// 除法向上取整
#define CEIL(v, k) (((v) + (1 << (k)) - 1) >> (k))
+#define ICEIL(x, y) ((x) / (y) + ((x) % (y) != 0))
+
// 除法向下取整
#define FLOOR(v, k) ((v) >> (k))
// 获取v最近的最小k倍数
#define ROUNDDOWN(v, k) ((v) & ~((k)-1))
-#define __USER__ __attribute__((section("usrtext")))
+#define __USER__ __attribute__((section(".usrtext")))
inline static void
spin()
while (!(cond)) \
;
+#define wait_until_expire(cond, max) \
+ ({ \
+ unsigned int __wcounter__ = (max); \
+ while (!(cond) && __wcounter__-- > 0) \
+ ; \
+ __wcounter__; \
+ })
+
#endif /* __LUNAIX_SPIKE_H */