Changeset 6418 in vbox for trunk/src/VBox/HostDrivers/Support
- Timestamp:
- Jan 21, 2008 4:51:44 PM (17 years ago)
- Location:
- trunk/src/VBox/HostDrivers/Support
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/SUPDRV.h
r6340 r6418 25 25 */ 26 26 27 #ifndef __ SUPDRV_h__28 #define __ SUPDRV_h__27 #ifndef ___SUPDRV_h 28 #define ___SUPDRV_h 29 29 30 30 … … 271 271 typedef struct timer_list VBOXKTIMER; 272 272 # endif 273 typedef VBOXKTIMER *PVBOXKTIMER; 273 274 #endif 274 275 -
trunk/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c
r6342 r6418 42 42 #include <linux/module.h> 43 43 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0) 44 # include <linux/moduleparam.h>44 # include <linux/moduleparam.h> 45 45 #endif 46 46 #include <linux/kernel.h> … … 284 284 #endif /* !CONFIG_VBOXDRV_AS_MISC */ 285 285 286 /** Module parameter */ 286 /** Module parameter. 287 * Not prefixed because the name is used by macros and the end of this file. */ 287 288 static int force_async_tsc = 0; 288 289 … … 310 311 *******************************************************************************/ 311 312 #ifdef VBOX_HRTIMER 312 typedef enum hrtimer_restart (* VBOXTIMERFN)(struct hrtimer *);313 #else 314 typedef void (* VBOXTIMERFN)(unsigned long);313 typedef enum hrtimer_restart (*PFNVBOXKTIMER)(struct hrtimer *); 314 #else 315 typedef void (*PFNVBOXKTIMER)(unsigned long); 315 316 #endif 316 317 … … 328 329 static int VBoxDrvLinuxTermGip(PSUPDRVDEVEXT pDevExt); 329 330 #ifdef VBOX_HRTIMER 330 static enum hrtimer_restart VBoxDrvLinuxGipTimer(struct hrtimer * timer);331 static enum hrtimer_restart VBoxDrvLinuxGipTimer(struct hrtimer *pTimer); 331 332 #else 332 333 static void VBoxDrvLinuxGipTimer(unsigned long ulUser); … … 334 335 #ifdef CONFIG_SMP 335 336 # ifdef VBOX_HRTIMER 336 static enum hrtimer_restart VBoxDrvLinuxGipTimerPerCpu(struct hrtimer * timer);337 static enum hrtimer_restart VBoxDrvLinuxGipTimerPerCpu(struct hrtimer *pTimer); 337 338 # else 338 339 static void VBoxDrvLinuxGipTimerPerCpu(unsigned long ulUser); … … 370 371 #endif 371 372 372 static inline void vbox_ktimer_init( VBOXKTIMER *timer, VBOXTIMERFN function, unsigned long data)373 static inline void vbox_ktimer_init(PVBOXKTIMER pTimer, PFNVBOXKTIMER pfnFunction, unsigned long ulData) 373 374 { 374 375 #ifdef VBOX_HRTIMER 375 hrtimer_init(timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS);376 timer->function = function;377 #else 378 init_timer( timer);379 timer->data = data;380 timer->function = function;381 timer->expires = jiffies;382 #endif 383 } 384 385 static inline void vbox_ktimer_start( VBOXKTIMER *timer)376 hrtimer_init(pTimer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS); 377 pTimer->function = pfnFunction; 378 #else 379 init_timer(pTimer); 380 pTimer->data = ulData; 381 pTimer->function = pfnFunction; 382 pTimer->expires = jiffies; 383 #endif 384 } 385 386 static inline void vbox_ktimer_start(PVBOXKTIMER pTimer) 386 387 { 387 388 #ifdef VBOX_HRTIMER 388 hrtimer_start( timer, ktime_add_ns(ktime_get(), 1000000), HRTIMER_MODE_ABS);389 #else 390 mod_timer( timer, jiffies);391 #endif 392 } 393 394 static inline void vbox_ktimer_stop( VBOXKTIMER *timer)389 hrtimer_start(pTimer, ktime_add_ns(ktime_get(), 1000000), HRTIMER_MODE_ABS); 390 #else 391 mod_timer(pTimer, jiffies); 392 #endif 393 } 394 395 static inline void vbox_ktimer_stop(PVBOXKTIMER pTimer) 395 396 { 396 397 #ifdef VBOX_HRTIMER 397 hrtimer_cancel( timer);398 #else 399 if (timer_pending( timer))400 del_timer_sync( timer);398 hrtimer_cancel(pTimer); 399 #else 400 if (timer_pending(pTimer)) 401 del_timer_sync(pTimer); 401 402 #endif 402 403 } … … 701 702 printk(KERN_INFO DEVICE_NAME ": TSC mode is %s, kernel timer mode is " 702 703 #ifdef VBOX_HRTIMER 703 704 #else 705 706 #endif 707 708 704 "'high-res'" 705 #else 706 "'normal'" 707 #endif 708 ".\n", 709 g_DevExt.pGip->u32Mode == SUPGIPMODE_SYNC_TSC ? "'synchronous'" : "'asynchronous'"); 709 710 dprintf(("VBoxDrv::ModuleInit returning %#x\n", rc)); 710 711 printk(KERN_DEBUG DEVICE_NAME ": Successfully loaded version " … … 1107 1108 */ 1108 1109 #ifdef VBOX_HRTIMER 1109 static enum hrtimer_restart VBoxDrvLinuxGipTimer(struct hrtimer * timer)1110 static enum hrtimer_restart VBoxDrvLinuxGipTimer(struct hrtimer *pTimer) 1110 1111 #else 1111 1112 static void VBoxDrvLinuxGipTimer(unsigned long ulUser) … … 1119 1120 unsigned long SavedFlags; 1120 1121 #ifdef VBOX_HRTIMER 1121 ktime_t kNow;1122 ktime_t KtNow; 1122 1123 #endif 1123 1124 … … 1126 1127 ulNow = jiffies; 1127 1128 #ifdef VBOX_HRTIMER 1128 kNow= ktime_get();1129 KtNow = ktime_get(); 1129 1130 pDevExt = &g_DevExt; 1130 1131 #else … … 1155 1156 { 1156 1157 #ifdef VBOX_HRTIMER 1157 hrtimer_forward(&g_GipTimer, kNow, ktime_set(0, 1000000));1158 hrtimer_forward(&g_GipTimer, KtNow, ktime_set(0, 1000000)); 1158 1159 #else 1159 1160 mod_timer(&g_GipTimer, ulNow + ONE_MSEC_IN_JIFFIES); … … 1176 1177 */ 1177 1178 #ifdef VBOX_HRTIMER 1178 static enum hrtimer_restart VBoxDrvLinuxGipTimerPerCpu(struct hrtimer * timer)1179 static enum hrtimer_restart VBoxDrvLinuxGipTimerPerCpu(struct hrtimer *pTimer) 1179 1180 #else 1180 1181 static void VBoxDrvLinuxGipTimerPerCpu(unsigned long iTimerCPU) … … 1189 1190 # ifdef VBOX_HRTIMER 1190 1191 unsigned long iTimerCPU; 1191 ktime_t kNow;1192 ktime_t KtNow; 1192 1193 # endif 1193 1194 … … 1200 1201 # ifdef VBOX_HRTIMER 1201 1202 iTimerCPU = iCPU; /* XXX hrtimer does not support a 'data' field */ 1202 kNow= ktime_get();1203 KtNow = ktime_get(); 1203 1204 # endif 1204 1205 … … 1216 1217 { 1217 1218 # ifdef VBOX_HRTIMER 1218 hrtimer_forward(&pDevExt->aCPUs[iCPU].Timer, kNow, ktime_set(0, 1000000));1219 hrtimer_forward(&pDevExt->aCPUs[iCPU].Timer, KtNow, ktime_set(0, 1000000)); 1219 1220 # else 1220 1221 mod_timer(&pDevExt->aCPUs[iCPU].Timer, ulNow + ONE_MSEC_IN_JIFFIES);
Note:
See TracChangeset
for help on using the changeset viewer.