opuntiaOS - an operating system targeting x86 and ARMv7
at master 628 B view raw
1/* 2 * Copyright (C) 2020-2022 The opuntiaOS Project Authors. 3 * + Contributed by Nikita Melekhin <nimelehin@gmail.com> 4 * 5 * Use of this source code is governed by a BSD-style license that can be 6 * found in the LICENSE file. 7 */ 8 9#ifndef _KERNEL_LIBKERN_ATOMIC_H 10#define _KERNEL_LIBKERN_ATOMIC_H 11 12#include <libkern/c_attrs.h> 13#include <libkern/kassert.h> 14#include <libkern/types.h> 15 16#define atomic_add(x, val) (__atomic_add_fetch(x, val, __ATOMIC_SEQ_CST)) 17#define atomic_store(x, val) (__atomic_store_n(x, val, __ATOMIC_SEQ_CST)) 18#define atomic_load(x) (__atomic_load_n(x, __ATOMIC_SEQ_CST)) 19 20#endif // _KERNEL_LIBKERN_LOCK_H