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
Added debug to Threads_GetNext
[tpg/acess2.git]
/
Kernel
/
arch
/
x86
/
proc.c
diff --git
a/Kernel/arch/x86/proc.c
b/Kernel/arch/x86/proc.c
index
bb93bfc
..
fd91643
100644
(file)
--- a/
Kernel/arch/x86/proc.c
+++ b/
Kernel/arch/x86/proc.c
@@
-10,6
+10,9
@@
# include <mp.h>
#endif
# include <mp.h>
#endif
+// === FLAGS ===
+#define DEBUG_TRACE_SWITCH 0
+
// === CONSTANTS ===
#define SWITCH_MAGIC 0xFFFACE55 // There is no code in this area
#define TIMER_DIVISOR 11931 //~100Hz
// === CONSTANTS ===
#define SWITCH_MAGIC 0xFFFACE55 // There is no code in this area
#define TIMER_DIVISOR 11931 //~100Hz
@@
-29,6
+32,7
@@
extern tThread *gActiveThreads;
extern tThread *gSleepingThreads;
extern tThread *gDeleteThreads;
extern tThread *Threads_GetNextToRun(int CPU);
extern tThread *gSleepingThreads;
extern tThread *gDeleteThreads;
extern tThread *Threads_GetNextToRun(int CPU);
+extern void Threads_Dump();
// === PROTOTYPES ===
void ArchThreads_Init();
// === PROTOTYPES ===
void ArchThreads_Init();
@@
-312,6
+316,8
@@
int Proc_Clone(Uint *Err, Uint Flags)
giTotalTickets += newThread->NumTickets;
RELEASE( &giThreadListLock );
giTotalTickets += newThread->NumTickets;
RELEASE( &giThreadListLock );
+ Threads_Dump();
+
return newThread->TID;
}
return newThread->TID;
}
@@
-464,7
+470,7
@@
void Proc_Scheduler(int CPU)
// Check if there is any tasks running
if(giNumActiveThreads == 0) {
// Check if there is any tasks running
if(giNumActiveThreads == 0) {
- Log("No Active threads, sleeping
\n
");
+ Log("No Active threads, sleeping");
__asm__ __volatile__ ("hlt");
return;
}
__asm__ __volatile__ ("hlt");
return;
}
@@
-494,6
+500,14
@@
void Proc_Scheduler(int CPU)
return;
}
return;
}
+ #if DEBUG_TRACE_SWITCH
+ Log("Switching to task %i, CR3 = 0x%x, EIP = %p",
+ thread->TID,
+ thread->MemState.CR3,
+ thread->SavedState.EIP
+ );
+ #endif
+
// Set current thread
gCurrentThread = thread;
// Set current thread
gCurrentThread = thread;
UCC
git Repository :: git.ucc.asn.au