freemyipod r542 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r541‎ | r542 | r543 >
Date:21:35, 6 February 2011
Author:theseven
Status:new
Tags:
Comment:
emCORE: The idle thread is of course a core thread...
Modified paths:
  • /emcore/trunk/init.c (modified) (history)
  • /emcore/trunk/thread.c (modified) (history)

Diff [purge]

Index: emcore/trunk/init.c
@@ -272,6 +272,6 @@
273273 reownalloc(bootalloc, &(ib->initthread));
274274 ib->bootalloc = bootalloc;
275275 thread_create(&(ib->initthread), initthreadname, initthread, ib->initstack,
276 - sizeof(ib->initstack), USER_THREAD, 127, true);
 276+ sizeof(ib->initstack), OS_THREAD, 127, true);
277277 interrupt_init();
278278 }
Index: emcore/trunk/thread.c
@@ -233,6 +233,7 @@
234234 memset(&idle_thread, 0, sizeof(idle_thread));
235235 idle_thread.state = THREAD_RUNNING;
236236 idle_thread.startusec = last_tick;
 237+ idle_thread.type = CORE_THREAD;
237238 idle_thread.name = "idle thread";
238239 idle_thread.stack = (uint32_t*)-1;
239240 setup_tick();
@@ -502,11 +503,13 @@
503504 for (t = head_thread; t; t = t->thread_next)
504505 if (t->type <= type && (killself || current_thread != t))
505506 {
 507+ panicf(PANIC_FATAL, "Killing thread %08X: %s (%d)", t, t->name, t->type);
506508 thread_terminate_internal(t, mode);
507509 found = true;
508510 count++;
509511 break;
510512 }
 513+ panicf(PANIC_FATAL, "Reached end of list");
511514 if (found) continue;
512515 leave_critical_section(mode);
513516 break;