X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=kern%2Fproc.c;h=23a2c3effcfa05e247484f808a598662b248581c;hb=2fc060cf9ba421a053dfe8e41584b59bc7a3da20;hp=f8c7fb8df3330138729574a189c1401350c10be8;hpb=bcf38f772b397e7a8ba781a69aacb9380e54b32a;p=bertos.git diff --git a/kern/proc.c b/kern/proc.c old mode 100755 new mode 100644 index f8c7fb8d..23a2c3ef --- a/kern/proc.c +++ b/kern/proc.c @@ -1,9 +1,34 @@ /** * \file * * * \brief Simple realtime multitasking scheduler. @@ -17,6 +42,9 @@ /*#* *#* $Log$ + *#* Revision 1.32 2006/09/20 14:19:23 marco + *#* Restored test. + *#* *#* Revision 1.31 2006/07/19 12:56:27 bernie *#* Convert to new Doxygen style. *#* @@ -114,7 +142,7 @@ #include "proc.h" //#include "hw.h" #include -#include +#include #include #include /* ARCH_EMUL */ #include /* ABS() */ @@ -477,62 +505,3 @@ void proc_permit(void) } #endif /* CONFIG_KERN_PREEMPTIVE */ - - -#if 0 /* Simple testcase for the scheduler */ - -#include - -/** - * Proc scheduling test subthread 1 - */ -static void NORETURN proc_test_thread1(void) -{ - for (;;) - { - kputs(">task 1\n"); - timer_delay(50); - proc_switch(); - } -} - -/** - * Proc scheduling test subthread 2 - */ -static void NORETURN proc_test_thread2(void) -{ - for (;;) - { - kputs(">task 2\n"); - timer_delay(75); - proc_switch(); - } -} - -static cpustack_t proc_test_stack1[CONFIG_KERN_DEFSTACKSIZE/sizeof(cpustack_t)]; -static cpustack_t proc_test_stack2[CONFIG_KERN_DEFSTACKSIZE/sizeof(cpustack_t)]; - -/** - * Proc scheduling test - */ -void NORETURN proc_test(void) -{ - proc_new(proc_test_thread1, NULL, sizeof(proc_test_stack1), proc_test_stack1); - proc_new(proc_test_thread2, NULL, sizeof(proc_test_stack2), proc_test_stack2); - kputs("Created tasks\n"); - - kputs("stack1:\n"); - kdump(proc_test_stack1+sizeof(proc_test_stack1)-64, 64); - kputs("stack2:\n"); - kdump(proc_test_stack2+sizeof(proc_test_stack1)-64, 64); - - for (;;) - { - kputs(">main task\n"); - timer_delay(93); - proc_switch(); - } - - ASSERT(false); -} -#endif