mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
Fix a few critical typos/mistakes (like interruptvector/interruptlevel), stdcall for thread's func, etc. Also added some "hacks" into hub's thread, but at least it leads to first steps to device enumeration.
Driver (OHCI) bugchecks on my_pci_pool_allocation now (when trying to send URB). svn path=/trunk/; revision=15795
This commit is contained in:
parent
2fb48b3787
commit
607f793fc0
4 changed files with 25 additions and 9 deletions
|
@ -1019,6 +1019,7 @@ static void hub_events(void)
|
|||
* safe since we delete the hub from the event list.
|
||||
* Not the most efficient, but avoids deadlocks.
|
||||
*/
|
||||
DPRINT1("hub_events() called\n");
|
||||
|
||||
while (m<5) {
|
||||
m++;
|
||||
|
@ -1138,7 +1139,8 @@ static void hub_events(void)
|
|||
spin_unlock_irqrestore(&hub_event_lock, flags);
|
||||
}
|
||||
|
||||
static int hub_thread(void *__hub)
|
||||
// ReactOS: STDCALL is needed here
|
||||
static int STDCALL hub_thread(void *__hub)
|
||||
{
|
||||
/*
|
||||
* This thread doesn't need any user-level access,
|
||||
|
@ -1149,14 +1151,25 @@ static int hub_thread(void *__hub)
|
|||
allow_signal(SIGKILL);
|
||||
/* Send me a signal to get me die (for debugging) */
|
||||
do {
|
||||
|
||||
|
||||
/* The following is just for debug */
|
||||
inc_jiffies(1);
|
||||
do_all_timers();
|
||||
handle_irqs(-1);
|
||||
/* End of debug hack*/
|
||||
|
||||
hub_events();
|
||||
|
||||
/* The following is just for debug */
|
||||
handle_irqs(-1);
|
||||
/* End of debug hack*/
|
||||
|
||||
|
||||
//FIXME: Correct this
|
||||
//wait_event_interruptible(khubd_wait, !list_empty(&hub_event_list)); // interruptable_sleep_on analog - below
|
||||
while (!list_empty(&hub_event_list)) {
|
||||
interruptible_sleep_on(&khubd_wait);
|
||||
}
|
||||
//while (!list_empty(&hub_event_list)) {
|
||||
// interruptible_sleep_on(&khubd_wait);
|
||||
//}
|
||||
|
||||
if (current->flags & PF_FREEZE)
|
||||
refrigerator(PF_IOTHREAD);
|
||||
|
|
|
@ -125,7 +125,8 @@ VOID STDCALL DriverUnload(PDRIVER_OBJECT DriverObject)
|
|||
ohci_hcd_pci_cleanup();
|
||||
}
|
||||
|
||||
NTSTATUS InitLinuxWrapper(PDEVICE_OBJECT DeviceObject)
|
||||
NTSTATUS
|
||||
InitLinuxWrapper(PDEVICE_OBJECT DeviceObject)
|
||||
{
|
||||
NTSTATUS Status;
|
||||
POHCI_DEVICE_EXTENSION DeviceExtension = (POHCI_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
|
||||
|
@ -134,7 +135,7 @@ NTSTATUS InitLinuxWrapper(PDEVICE_OBJECT DeviceObject)
|
|||
dev = ExAllocatePoolWithTag(PagedPool, sizeof(struct pci_dev), USB_OHCI_TAG);
|
||||
|
||||
init_wrapper(dev);
|
||||
dev->irq = DeviceExtension->InterruptLevel;
|
||||
dev->irq = DeviceExtension->InterruptVector;
|
||||
dev->dev_ext = (PVOID)DeviceExtension;
|
||||
dev->slot_name = ExAllocatePoolWithTag(NonPagedPool, 128, USB_OHCI_TAG); // 128 max len for slot name
|
||||
|
||||
|
@ -151,7 +152,7 @@ NTSTATUS InitLinuxWrapper(PDEVICE_OBJECT DeviceObject)
|
|||
// Probe device with real id now
|
||||
ohci_pci_driver.probe(dev, pci_ids);
|
||||
|
||||
DPRINT("InitLinuxWrapper() done\n");
|
||||
DPRINT1("InitLinuxWrapper() done\n");
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
|
|
@ -517,7 +517,7 @@ void my_interruptible_sleep_on(PKEVENT evnt);
|
|||
|
||||
#define flush_scheduled_work() do {} while(0)
|
||||
#define refrigerator(x) do {} while(0)
|
||||
#define signal_pending(x) 1 // fall through threads
|
||||
#define signal_pending(x) 0 // Don't fall through threads! ReactOS implements this correctly
|
||||
#define complete_and_exit(a,b) return 0
|
||||
|
||||
//#define kill_proc(a,b,c) 0
|
||||
|
|
|
@ -126,6 +126,8 @@ int my_kernel_thread(int STDCALL (*handler)(void*), void* parm, int flags)
|
|||
(PKSTART_ROUTINE)handler,
|
||||
parm);
|
||||
|
||||
DPRINT1("usbcore: Created system thread %d\n", (int)hThread);
|
||||
|
||||
return (int)hThread; // FIXME: Correct?
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue