comparison packages/kernel/current/tests/kthread1.c @ 2:443894e2e912 ecos-v1_2_1-release

Block commit of eCos version 1.2.1
author jlarmour
date Tue, 11 May 1999 12:24:34 +0000
parents 3111d98ba7b3
children c38311975d4f
comparison
equal deleted inserted replaced
1:72f549f0d891 2:443894e2e912
20 // 20 //
21 // The Original Code is eCos - Embedded Cygnus Operating System, released 21 // The Original Code is eCos - Embedded Cygnus Operating System, released
22 // September 30, 1998. 22 // September 30, 1998.
23 // 23 //
24 // The Initial Developer of the Original Code is Cygnus. Portions created 24 // The Initial Developer of the Original Code is Cygnus. Portions created
25 // by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. 25 // by Cygnus are Copyright (C) 1998,1999 Cygnus Solutions. All Rights Reserved.
26 // ------------------------------------------- 26 // -------------------------------------------
27 // 27 //
28 //####COPYRIGHTEND#### 28 //####COPYRIGHTEND####
29 //========================================================================== 29 //==========================================================================
30 //#####DESCRIPTIONBEGIN#### 30 //#####DESCRIPTIONBEGIN####
42 42
43 #ifdef CYGFUN_KERNEL_API_C 43 #ifdef CYGFUN_KERNEL_API_C
44 44
45 #include "testaux.h" 45 #include "testaux.h"
46 46
47 #include <cyg/hal/hal_arch.h> // for CYGNUM_HAL_STACK_SIZE_TYPICAL
48
49 #ifdef CYGNUM_HAL_STACK_SIZE_TYPICAL
50 #define STACKSIZE CYGNUM_HAL_STACK_SIZE_TYPICAL
51 #else
47 #define STACKSIZE 2000 52 #define STACKSIZE 2000
53 #endif
48 54
49 static char stack[2][STACKSIZE]; 55 static char stack[2][STACKSIZE];
50 56
51 static cyg_thread thread[2]; 57 static cyg_thread thread[2];
52 58
78 84
79 CHECK( self == pt1 ); 85 CHECK( self == pt1 );
80 86
81 cyg_thread_suspend(pt1); 87 cyg_thread_suspend(pt1);
82 88
83 cyg_thread_exit(); // no guarantee this will be called 89 cyg_thread_exit(); // no guarantee this will be called
84 } 90 }
85 91
86 void kthread1_main( void ) 92 void kthread1_main( void )
87 { 93 {
88 CYG_TEST_INIT(); 94 CYG_TEST_INIT();
89 95
90 cyg_thread_create(4, entry0, (cyg_addrword_t)222, "kthread1-0", 96 cyg_thread_create(4, entry0, (cyg_addrword_t)222, "kthread1-0",
91 (void *)stack[0], STACKSIZE, &pt0, &thread[0] ); 97 (void *)stack[0], STACKSIZE, &pt0, &thread[0] );
92 cyg_thread_create(4, entry1, (cyg_addrword_t)333, "kthread1-1", 98 cyg_thread_create(4, entry1, (cyg_addrword_t)333, "kthread1-1",
93 (void *)stack[1], STACKSIZE, &pt1, &thread[1] ); 99 (void *)stack[1], STACKSIZE, &pt1, &thread[1] );
94 100
95 cyg_thread_resume(pt0); 101 cyg_thread_resume(pt0);
96 cyg_thread_resume(pt1); 102 cyg_thread_resume(pt1);
97 103
98 cyg_scheduler_start(); 104 cyg_scheduler_start();
110 #else /* def CYGFUN_KERNEL_API_C */ 116 #else /* def CYGFUN_KERNEL_API_C */
111 externC void 117 externC void
112 cyg_start( void ) 118 cyg_start( void )
113 { 119 {
114 CYG_TEST_INIT(); 120 CYG_TEST_INIT();
115 CYG_TEST_PASS_FINISH("Kernel C API layer disabled"); 121 CYG_TEST_NA("Kernel C API layer disabled");
116 } 122 }
117 #endif /* def CYGFUN_KERNEL_API_C */ 123 #endif /* def CYGFUN_KERNEL_API_C */
118 124
119 /* EOF kthread1.c */ 125 /* EOF kthread1.c */