blob: 2c51bccb97bb27ee816e64644c41b4c00f967796 [file] [log] [blame]
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00001/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef LINUX_COMPILER_H
3#define LINUX_COMPILER_H
4
5#define WRITE_ONCE(var, val) \
6 (*((volatile typeof(val) *)(&(var))) = (val))
7
8#define READ_ONCE(var) (*((volatile typeof(var) *)(&(var))))
9
Olivier Deprez157378f2022-04-04 15:47:50 +020010#define __aligned(x) __attribute((__aligned__(x)))
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000011#endif