new: 简单的warn assert

This commit is contained in:
fslongjin
2022-07-17 17:23:56 +08:00
parent 9ed3eb2ae2
commit a1c843cd3a
3 changed files with 26 additions and 1 deletions

10
kernel/common/compiler.h Normal file
View 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