diff -u -p -r hptmv/entry.c hptmv-freebsd/entry.c --- hptmv/entry.c 2008-02-28 18:37:56.000000000 -0800 +++ hptmv-freebsd/entry.c 2009-04-04 21:46:12.784948813 -0700 @@ -2543,8 +2543,12 @@ static void hpt_worker_thread(void) #if (__FreeBSD_version < 500000) YIELD_THREAD; #else +#if (__FreeBSD_version > 700033) + pause("sched", 1); +#else tsleep((caddr_t)hpt_worker_thread, PPAUSE, "sched", 1); #endif +#endif if (SIGISMEMBER(curproc->p_siglist, SIGSTOP)) { /* abort rebuilding process. */ IAL_ADAPTER_T *pAdapter; @@ -2577,15 +2581,25 @@ static void hpt_worker_thread(void) /* #ifdef DEBUG if (SIGISMEMBER(curproc->p_siglist, SIGSTOP)) +#if (__FreeBSD_version > 700033) + pause("hptrdy", 2*hz); +#else tsleep((caddr_t)hpt_worker_thread, PPAUSE, "hptrdy", 2*hz); #endif +#endif */ - #if (__FreeBSD_version >= 500043) + #if (__FreeBSD_version >= 800002) + kproc_suspend_check(curproc); + #elif (__FreeBSD_version >= 500043) kthread_suspend_check(curproc); #else kproc_suspend_loop(curproc); #endif +#if (__FreeBSD_version > 700033) + pause("hptrdy", 2*hz); /* wait for something to do */ +#else tsleep((caddr_t)hpt_worker_thread, PPAUSE, "hptrdy", 2*hz); /* wait for something to do */ +#endif } } diff -u -p -r hptmv/gui_lib.c hptmv-freebsd/gui_lib.c --- hptmv/gui_lib.c 2008-02-28 18:37:56.000000000 -0800 +++ hptmv-freebsd/gui_lib.c 2009-04-04 21:46:12.789951451 -0700 @@ -1312,7 +1312,7 @@ int hpt_default_ioctl(_VBUS_ARG while(pAdapter != 0) { pVBus = &pAdapter->VBus; - for(i = 0; i < MAX_ARRAY_PER_VBUS; i++) + for(i = 0; i < MAX_VDEVICE_PER_VBUS; i++) { if(!(pTop = pVBus->pVDevice[i])) continue; if (pTop->pVBus!=_vbus_p) return -1; diff -u -p -r hptmv/ioctl.c hptmv-freebsd/ioctl.c --- hptmv/ioctl.c 2008-02-28 18:37:56.000000000 -0800 +++ hptmv-freebsd/ioctl.c 2009-04-04 21:46:12.792948858 -0700 @@ -75,13 +75,16 @@ get_disk_location(PDevice pDev, int *con IAL_ADAPTER_T *pAdapTemp; int i, j; - for (i=1, pAdapTemp = gIal_Adapter; pAdapTemp; pAdapTemp = pAdapTemp->next, i++) { - for (j=0; jVDevices[j].u.disk) { - *controller = i; - *channel = j; - return; - } + *controller = *channel = 0; + + for (i=1, pAdapTemp = gIal_Adapter; pAdapTemp; pAdapTemp = pAdapTemp->next, i++) { + for (j=0; jVDevices[j].u.disk) { + *controller = i; + *channel = j; + return; + } + } } } @@ -204,8 +207,12 @@ lock_driver_idle(IAL_ADAPTER_T *pAdapter #if (__FreeBSD_version < 500000) YIELD_THREAD; #else +#if (__FreeBSD_version > 700033) + pause("switch", 1); +#else tsleep(lock_driver_idle, PPAUSE, "switch", 1); #endif +#endif oldspl = lock_driver(); } CheckIdleCall(_VBUS_P0); @@ -440,7 +447,11 @@ int Kernel_DeviceIoControl(_VBUS_ARG unlock_driver(oldspl); while (!pArray->u.array.rf_rebuilding) { +#if (__FreeBSD_version > 700033) + pause("pause", 1); +#else tsleep((caddr_t)Kernel_DeviceIoControl, PPAUSE, "pause", 1); +#endif if ( timeout >= hz*3) break; timeout ++; @@ -505,7 +516,11 @@ hpt_set_array_state(DEVICEID idArray, DW while (!pVDevice->u.array.rf_rebuilding) { +#if (__FreeBSD_version > 700033) + pause("pause", 1); +#else tsleep((caddr_t)hpt_set_array_state, PPAUSE, "pause", 1); +#endif if ( timeout >= hz*20) break; timeout ++; @@ -530,7 +545,11 @@ hpt_set_array_state(DEVICEID idArray, DW while (pVDevice->u.array.rf_abort_rebuild) { +#if (__FreeBSD_version > 700033) + pause("pause", 1); +#else tsleep((caddr_t)hpt_set_array_state, PPAUSE, "pause", 1); +#endif if ( timeout >= hz*20) break; timeout ++; @@ -554,7 +573,11 @@ hpt_set_array_state(DEVICEID idArray, DW while (!pVDevice->u.array.rf_verifying) { +#if (__FreeBSD_version > 700033) + pause("pause", 1); +#else tsleep((caddr_t)hpt_set_array_state, PPAUSE, "pause", 1); +#endif if ( timeout >= hz*20) break; timeout ++; @@ -573,7 +596,11 @@ hpt_set_array_state(DEVICEID idArray, DW while (pVDevice->u.array.rf_abort_rebuild) { +#if (__FreeBSD_version > 700033) + pause("pause", 1); +#else tsleep((caddr_t)hpt_set_array_state, PPAUSE, "pause", 1); +#endif if ( timeout >= hz*80) break; timeout ++; @@ -594,7 +621,11 @@ hpt_set_array_state(DEVICEID idArray, DW while (!pVDevice->u.array.rf_initializing) { +#if (__FreeBSD_version > 700033) + pause("pause", 1); +#else tsleep((caddr_t)hpt_set_array_state, PPAUSE, "pause", 1); +#endif if ( timeout >= hz*80) break; timeout ++; @@ -613,7 +644,11 @@ hpt_set_array_state(DEVICEID idArray, DW while (pVDevice->u.array.rf_abort_rebuild) { +#if (__FreeBSD_version > 700033) + pause("pause", 1); +#else tsleep((caddr_t)hpt_set_array_state, PPAUSE, "pause", 1); +#endif if ( timeout >= hz*80) break; timeout ++; @@ -968,8 +1003,12 @@ fail: #if (__FreeBSD_version < 500000) YIELD_THREAD; #else +#if (__FreeBSD_version > 700033) + pause("switch", 1); +#else tsleep(hpt_rebuild_data_block, PPAUSE, "switch", 1); #endif +#endif oldspl = lock_driver(); } diff -u -p -r hptmv/osbsd.h hptmv-freebsd/osbsd.h --- hptmv/osbsd.h 2008-02-28 18:37:56.000000000 -0800 +++ hptmv-freebsd/osbsd.h 2009-04-04 21:46:12.794948922 -0700 @@ -55,7 +55,6 @@ #include #include #include -#include #include #include