X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/003db17f7a36a8098827f40df8fedc087b5a26f6..a7384053efe345d199440720b437a28e91058ff3:/lunaix-os/includes/lunaix/spike.h diff --git a/lunaix-os/includes/lunaix/spike.h b/lunaix-os/includes/lunaix/spike.h index 4e17993..274bcf6 100644 --- a/lunaix-os/includes/lunaix/spike.h +++ b/lunaix-os/includes/lunaix/spike.h @@ -3,12 +3,12 @@ // Some helper functions. As helpful as Spike the Dragon! :) -// 除法向上取整 +// 除法 v/(2^k) 向上取整 #define CEIL(v, k) (((v) + (1 << (k)) - 1) >> (k)) #define ICEIL(x, y) ((x) / (y) + ((x) % (y) != 0)) -// 除法向下取整 +// 除法 v/(2^k) 向下取整 #define FLOOR(v, k) ((v) >> (k)) // 获取v最近的最大k倍数 @@ -92,6 +92,9 @@ __assert_fail(const char* expr, const char* file, unsigned int line) void panick(const char* msg); +void +panickf(const char* fmt, ...); + #define wait_until(cond) \ while (!(cond)) \ ;