Changeset 136 in vbox for trunk/src/VBox/Runtime/r0drv/linux/the-linux-kernel.h
- Timestamp:
- Jan 18, 2007 2:42:26 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r0drv/linux/the-linux-kernel.h
r1 r136 108 108 # endif 109 109 110 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 29) || LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0) 111 110 112 DECLINLINE(unsigned int) jiffies_to_msecs(unsigned long cJiffies) 111 113 { 112 # if HZ <= 1000 && !(1000 % HZ)114 # if HZ <= 1000 && !(1000 % HZ) 113 115 return (1000 / HZ) * cJiffies; 114 # elif HZ > 1000 && !(HZ % 1000)116 # elif HZ > 1000 && !(HZ % 1000) 115 117 return (cJiffies + (HZ / 1000) - 1) / (HZ / 1000); 116 # else118 # else 117 119 return (j * 1000) / HZ; 118 # endif120 # endif 119 121 } 120 122 121 123 DECLINLINE(unsigned long) msecs_to_jiffies(unsigned int cMillies) 122 124 { 123 # if HZ > 1000125 # if HZ > 1000 124 126 if (cMillies > jiffies_to_msecs(MAX_JIFFY_OFFSET)) 125 127 return MAX_JIFFY_OFFSET; 126 # endif127 # if HZ <= 1000 && !(1000 % HZ)128 # endif 129 # if HZ <= 1000 && !(1000 % HZ) 128 130 return (cMillies + (1000 / HZ) - 1) / (1000 / HZ); 129 # elif HZ > 1000 && !(HZ % 1000)131 # elif HZ > 1000 && !(HZ % 1000) 130 132 return cMillies * (HZ / 1000); 131 # else133 # else 132 134 return (cMillies * HZ + 999) / 1000; 133 # endif135 # endif 134 136 } 137 138 # endif /* < 2.4.29 || >= 2.6.0 */ 135 139 136 140 # define prepare_to_wait(q, wait, state) \
Note:
See TracChangeset
for help on using the changeset viewer.