mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-18 20:36:31 +00:00
new: 简单的warn assert
This commit is contained in:
10
kernel/common/compiler.h
Normal file
10
kernel/common/compiler.h
Normal file
@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#define likely(x) __builtin_expect(!!(x), 1)
|
||||
#define unlikely(x) __builtin_expect(!!(x), 0)
|
||||
|
||||
#ifndef barrier
|
||||
// 内存屏障
|
||||
#define barrier() __asm__ __volatile__("" :: \
|
||||
: "memory");
|
||||
#endif
|
Reference in New Issue
Block a user