git.ucc.asn.au
/
tpg
/
acess2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Kernel - Working on allowing \0 out debug
[tpg/acess2.git]
/
KernelLand
/
Kernel
/
time.c
diff --git
a/KernelLand/Kernel/time.c
b/KernelLand/Kernel/time.c
index
05b749d
..
b0ea5e4
100644
(file)
--- a/
KernelLand/Kernel/time.c
+++ b/
KernelLand/Kernel/time.c
@@
-77,17
+77,14
@@
void Timer_CallTimers()
SHORTLOCK(&gTimers_ListLock);
while( gTimers && gTimers->FiresAfter < now() )
{
SHORTLOCK(&gTimers_ListLock);
while( gTimers && gTimers->FiresAfter < now() )
{
+ ASSERT( gTimers != gTimers->Next );
// Get timer from list
tTimer *timer = gTimers;
// Get timer from list
tTimer *timer = gTimers;
-
- ASSERT( gTimers != gTimers->Next );
gTimers = gTimers->Next;
// Perform event
if( timer->Callback ) {
LOG("Callback schedule %p", timer);
gTimers = gTimers->Next;
// Perform event
if( timer->Callback ) {
LOG("Callback schedule %p", timer);
- // PROBLEM! Possibly causes rescheudle during interrupt
-// Mutex_Acquire( &timer->Lock ); // Released once the callback fires
Workqueue_AddWork(&gTimers_CallbackQueue, timer);
}
else {
Workqueue_AddWork(&gTimers_CallbackQueue, timer);
}
else {
@@
-137,7
+134,7
@@
void Time_ScheduleTimer(tTimer *Timer, int Delta)
// Mutex_Release( &Timer->Lock ); // Prevent deadlocks
for( prev_next = &gTimers, t = gTimers; t; prev_next = &t->Next, t = t->Next )
{
// Mutex_Release( &Timer->Lock ); // Prevent deadlocks
for( prev_next = &gTimers, t = gTimers; t; prev_next = &t->Next, t = t->Next )
{
- ASSERT
C( *prev_next, !=,
t );
+ ASSERT
( prev_next != &t->Nex
t );
ASSERT( CheckMem(t, sizeof(tTimer)) );
if( t == Timer )
{
ASSERT( CheckMem(t, sizeof(tTimer)) );
if( t == Timer )
{
@@
-151,7
+148,7
@@
void Time_ScheduleTimer(tTimer *Timer, int Delta)
Timer->Next = t;
*prev_next = Timer;
Timer->bActive = 1;
Timer->Next = t;
*prev_next = Timer;
Timer->bActive = 1;
- LOG("
%p %p
%p", prev_next, Timer, t);
+ LOG("
prev_next=%p Timer=%p next=
%p", prev_next, Timer, t);
SHORTREL(&gTimers_ListLock);
}
SHORTREL(&gTimers_ListLock);
}
@@
-168,7
+165,8
@@
void Time_RemoveTimer(tTimer *Timer)
SHORTLOCK(&gTimers_ListLock);
for( prev_next = &gTimers, t = gTimers; t; prev_next = &t->Next, t = t->Next )
{
SHORTLOCK(&gTimers_ListLock);
for( prev_next = &gTimers, t = gTimers; t; prev_next = &t->Next, t = t->Next )
{
- ASSERT( *prev_next != t ); ASSERT( CheckMem(t, sizeof(tTimer)) );
+ ASSERT( prev_next != &t->Next );
+ ASSERT( CheckMem(t, sizeof(tTimer)) );
if( t == Timer )
{
*prev_next = t->Next;
if( t == Timer )
{
*prev_next = t->Next;
@@
-209,6
+207,7
@@
void Time_InitTimer(tTimer *Timer, tTimerCallback *Callback, void *Argument)
Timer->Argument = Argument;
// memset( &Timer->Lock, 0, sizeof(Timer->Lock) );
Timer->bActive = 0;
Timer->Argument = Argument;
// memset( &Timer->Lock, 0, sizeof(Timer->Lock) );
Timer->bActive = 0;
+ LOG("Initialised timer %p (cb=%p,arg=%p)", Timer, Callback, Argument);
}
/**
}
/**
@@
-235,6
+234,7
@@
void Time_FreeTimer(tTimer *Timer)
*/
void Time_Delay(int Delay)
{
*/
void Time_Delay(int Delay)
{
+ LOG("(%i)", Delay);
tTimer *t = &Proc_GetCurThread()->ThreadTimer;
Time_InitTimer(t, NULL, NULL);
Time_ScheduleTimer(t, Delay);
tTimer *t = &Proc_GetCurThread()->ThreadTimer;
Time_InitTimer(t, NULL, NULL);
Time_ScheduleTimer(t, Delay);
UCC
git Repository :: git.ucc.asn.au