git://scm.lunaixsky.com
/
lunaix-os.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
feat: Ability to send command to ATA device.
[lunaix-os.git]
/
lunaix-os
/
includes
/
lunaix
/
spike.h
diff --git
a/lunaix-os/includes/lunaix/spike.h
b/lunaix-os/includes/lunaix/spike.h
index 1ce7481aabfb752242dff6ab7e018c3618fba07b..cbdadfb80d8bd45c3d4d5ed284d05b1fa49a29a6 100644
(file)
--- a/
lunaix-os/includes/lunaix/spike.h
+++ b/
lunaix-os/includes/lunaix/spike.h
@@
-15,7
+15,7
@@
// 获取v最近的最小k倍数
#define ROUNDDOWN(v, k) ((v) & ~((k)-1))
// 获取v最近的最小k倍数
#define ROUNDDOWN(v, k) ((v) & ~((k)-1))
-#define __USER__ __attribute__((section("usrtext")))
+#define __USER__ __attribute__((section("
.
usrtext")))
inline static void
spin()
inline static void
spin()
@@
-52,4
+52,12
@@
panick(const char* msg);
while (!(cond)) \
;
while (!(cond)) \
;
+#define wait_until_expire(cond, max) \
+ ({ \
+ unsigned int __wcounter__ = (max); \
+ while (!(cond) && __wcounter__-- > 0) \
+ ; \
+ __wcounter__; \
+ })
+
#endif /* __LUNAIX_SPIKE_H */
#endif /* __LUNAIX_SPIKE_H */