X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/88e668538d6c0d394e6ea34516052f010ca6e8d2..5fc669295655ec0eea7722aa4a48921dc6b700ec:/lunaix-os/includes/lunaix/spike.h diff --git a/lunaix-os/includes/lunaix/spike.h b/lunaix-os/includes/lunaix/spike.h index 6f91924..8297f0e 100644 --- a/lunaix-os/includes/lunaix/spike.h +++ b/lunaix-os/includes/lunaix/spike.h @@ -17,6 +17,9 @@ // 获取v最近的最小k倍数 #define ROUNDDOWN(v, k) ((v) & ~((k)-1)) +#define MIN(a, b) ((a) < (b) ? (a) : (b)) +#define MAX(a, b) ((a) > (b) ? (a) : (b)) + #define __USER__ __attribute__((section(".usrtext"))) inline static void @@ -57,7 +60,7 @@ panick(const char* msg); #define wait_until_expire(cond, max) \ ({ \ unsigned int __wcounter__ = (max); \ - while (!(cond) && __wcounter__-- > 0) \ + while (!(cond) && __wcounter__-- > 1) \ ; \ __wcounter__; \ })