18 #ifdef POK_NEEDS_DEBUG
28 int debug_strlen (
const char* str)
40 void pok_debug_print_current_state ()
43 printf (
"\nCurrent state\n");
44 printf (
"-------------\n");
45 printf (
"Kernel thread : %d\n", KERNEL_THREAD);
46 printf (
"Idle thread : %d\n", IDLE_THREAD);
47 #ifdef POK_NEEDS_PARTITIONS
48 printf (
"Current partition : %d\n", POK_SCHED_CURRENT_PARTITION);
49 printf (
"Thread index : %d\n", POK_CURRENT_PARTITION.thread_index);
50 printf (
"Thread low : %d\n", POK_CURRENT_PARTITION.thread_index_low);
51 printf (
"Thread high : %d\n", POK_CURRENT_PARTITION.thread_index_high);
52 printf (
"Thread capacity : %d\n", POK_CURRENT_PARTITION.nthreads);
53 printf (
"Base addr : 0x%x\n", POK_CURRENT_PARTITION.base_addr);
54 printf (
"Base vaddr : 0x%x\n", POK_CURRENT_PARTITION.base_vaddr);
55 printf (
"Size : %d\n", POK_CURRENT_PARTITION.size);
56 printf (
"Current thread : %d\n", POK_CURRENT_PARTITION.current_thread);
57 printf (
"Prev current thread : %d\n", POK_CURRENT_PARTITION.prev_current_thread);
58 printf (
"Main thread : %d\n", POK_CURRENT_PARTITION.thread_main);
59 printf (
"Main thread entry : 0x%x\n", POK_CURRENT_PARTITION.thread_main_entry);
60 printf (
"Partition threads sp :");
61 for (i = POK_CURRENT_PARTITION.thread_index_low ; i < POK_CURRENT_PARTITION.thread_index_low + POK_CURRENT_PARTITION.thread_index ; i++)
63 printf (
" 0x%x", pok_threads[i].sp);
66 printf (
"-------------\n");
68 printf (
"Current thread : %d\n", POK_SCHED_CURRENT_THREAD);
69 printf (
"Period : %d\n", POK_CURRENT_THREAD.period);
70 printf (
"Deadline : %d\n", POK_CURRENT_THREAD.deadline);
71 printf (
"Partition : %d\n", POK_CURRENT_THREAD.partition);
72 printf (
"sp : 0x%x\n", POK_CURRENT_THREAD.sp);
73 printf (
"init_stack_addr : 0x%x\n", POK_CURRENT_THREAD.init_stack_addr);
74 printf (
"entry : 0x%x\n", POK_CURRENT_THREAD.entry);
77 void pok_fatal (
const char* message)
79 pok_write (
"FATAL ERROR: \n", 13);
80 pok_write (message , debug_strlen(message));