implemented hook_interrupt() in PCI code
enabled PCI interrupts ohci seems to damage something in PCI config -> PCI device enumeration does not top with latest device networking in EmuTOS lost (probably a result of PCI interrupt implementation)
This commit is contained in:
25
util/wait.c
25
util/wait.c
@@ -31,7 +31,7 @@
|
||||
|
||||
uint32_t get_timer(void)
|
||||
{
|
||||
return MCF_SLT_SCNT(0);
|
||||
return MCF_SLT_SCNT(0);
|
||||
}
|
||||
/*
|
||||
* wait for the specified number of us on slice timer 0. Replaces the original routines that had
|
||||
@@ -39,17 +39,18 @@ uint32_t get_timer(void)
|
||||
*/
|
||||
void wait(uint32_t us)
|
||||
{
|
||||
int32_t target = MCF_SLT_SCNT(0) - (us * (SYSCLK / 1000));
|
||||
int32_t target = MCF_SLT_SCNT(0) - (us * (SYSCLK / 1000));
|
||||
|
||||
while (MCF_SLT_SCNT(0) - target > 0);
|
||||
while (MCF_SLT_SCNT(0) - target > 0);
|
||||
}
|
||||
void wait_us() __attribute__ ((weak, alias("wait")));
|
||||
|
||||
/*
|
||||
* same as above, but with milliseconds wait time
|
||||
*/
|
||||
void wait_ms(uint32_t ms)
|
||||
{
|
||||
wait(ms * 1000);
|
||||
wait(ms * 1000);
|
||||
}
|
||||
/*
|
||||
* the same as above, with a checker function which gets called while
|
||||
@@ -57,13 +58,13 @@ void wait_ms(uint32_t ms)
|
||||
*/
|
||||
bool waitfor(uint32_t us, checker_func condition)
|
||||
{
|
||||
int32_t target = MCF_SLT_SCNT(0) - (us * (SYSCLK / 1000));
|
||||
bool res;
|
||||
int32_t target = MCF_SLT_SCNT(0) - (us * (SYSCLK / 1000));
|
||||
bool res;
|
||||
|
||||
do
|
||||
{
|
||||
if ((res = (*condition)()))
|
||||
return res;
|
||||
} while (MCF_SLT_SCNT(0) - target > 0);
|
||||
return false;
|
||||
do
|
||||
{
|
||||
if ((res = (*condition)()))
|
||||
return res;
|
||||
} while (MCF_SLT_SCNT(0) - target > 0);
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user