Changeset View
Changeset View
Standalone View
Standalone View
sys/compat/linuxkpi/common/include/linux/jiffies.h
Show All 39 Lines | |||||
#define jiffies ticks | #define jiffies ticks | ||||
#define jiffies_64 ticks | #define jiffies_64 ticks | ||||
#define jiffies_to_msecs(x) (((int64_t)(int)(x)) * 1000 / hz) | #define jiffies_to_msecs(x) (((int64_t)(int)(x)) * 1000 / hz) | ||||
#define MAX_JIFFY_OFFSET ((INT_MAX >> 1) - 1) | #define MAX_JIFFY_OFFSET ((INT_MAX >> 1) - 1) | ||||
#define time_after(a, b) ((int)((b) - (a)) < 0) | #define time_after(a, b) ((int)((b) - (a)) < 0) | ||||
#define time_after32(a, b) ((int32_t)((uint32_t)(b) - (uint32_t)(a)) < 0) | |||||
hselasky: Define time_after32() like time_after() . int is always 32-bit on our platforms. Else a lot of… | |||||
manuAuthorUnsubmitted Done Inline ActionsLinux cast the operand to uint32_t, I guess some code can rely on that. manu: Linux cast the operand to uint32_t, I guess some code can rely on that. | |||||
hselaskyUnsubmitted Done Inline ActionsI don't see how casting the arguments makes any difference in C- ? Can you investigate? Adding Konstantin here. hselasky: I don't see how casting the arguments makes any difference in C- ? Can you investigate? | |||||
#define time_before(a, b) time_after(b,a) | #define time_before(a, b) time_after(b,a) | ||||
#define time_after_eq(a, b) ((int)((a) - (b)) >= 0) | #define time_after_eq(a, b) ((int)((a) - (b)) >= 0) | ||||
#define time_before_eq(a, b) time_after_eq(b, a) | #define time_before_eq(a, b) time_after_eq(b, a) | ||||
#define time_in_range(a,b,c) \ | #define time_in_range(a,b,c) \ | ||||
(time_after_eq(a,b) && time_before_eq(a,c)) | (time_after_eq(a,b) && time_before_eq(a,c)) | ||||
#define time_is_after_eq_jiffies(a) time_after_eq(a, jiffies) | #define time_is_after_eq_jiffies(a) time_after_eq(a, jiffies) | ||||
#define HZ hz | #define HZ hz | ||||
▲ Show 20 Lines • Show All 109 Lines • Show Last 20 Lines |
Define time_after32() like time_after() . int is always 32-bit on our platforms. Else a lot of things will break.