aboutsummaryrefslogtreecommitdiffstats
path: root/src/util.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2009-10-24 19:56:11 -0400
committerKevin O'Connor <kevin@koconnor.net>2009-10-24 19:56:11 -0400
commitc604f2f6be0ad729c8e25958c946a8535ca391ee (patch)
tree561c46af38c11dbc55685f525202b7a9d0c12e09 /src/util.c
parenta5826b5ad482f44d293387dc7513e5e98802a54e (diff)
downloadseabios-c604f2f6be0ad729c8e25958c946a8535ca391ee.tar.gz
Improve debugging output from threads.
Show the "thread id" on each debug message sent from a thread. Also, cleanup translation dprintf() so it looks nicer withe thread output.
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/util.c b/src/util.c
index 21c7a62c..36f32e43 100644
--- a/src/util.c
+++ b/src/util.c
@@ -134,9 +134,9 @@ struct thread_info {
void *stackpos;
};
-static struct thread_info MainThread = {&MainThread, NULL};
+struct thread_info MainThread = {&MainThread, NULL};
-static struct thread_info *
+struct thread_info *
getCurThread()
{
u32 esp = getesp();
@@ -187,7 +187,7 @@ __end_thread(struct thread_info *old)
pos = pos->next;
pos->next = old->next;
free(old);
- dprintf(2, "=========== end thread %p\n", old);
+ dprintf(DEBUG_thread, "\\%08x/ End thread\n", (u32)old);
}
void
@@ -206,7 +206,7 @@ run_thread(void (*func)(void*), void *data)
thread->next = cur->next;
cur->next = thread;
- dprintf(2, "=========== start thread %p\n", thread);
+ dprintf(DEBUG_thread, "/%08x\\ Start thread\n", (u32)thread);
asm volatile(
// Start thread
" pushl $1f\n" // store return pc