1 | /* |
---|
2 | * Scheduler Simple Handler / Initialize |
---|
3 | * Scheduler Simple Handler / Allocate (Empty Routine) |
---|
4 | * Scheduler Simple Handler / Update (Empty Routine) |
---|
5 | * Scheduler Simple Handler / Free (Empty Routine) |
---|
6 | * |
---|
7 | * COPYRIGHT (c) 2011. |
---|
8 | * On-Line Applications Research Corporation (OAR). |
---|
9 | * |
---|
10 | * The license and distribution terms for this file may be |
---|
11 | * found in the file LICENSE in this distribution or at |
---|
12 | * http://www.rtems.com/license/LICENSE. |
---|
13 | */ |
---|
14 | |
---|
15 | #if HAVE_CONFIG_H |
---|
16 | #include "config.h" |
---|
17 | #endif |
---|
18 | |
---|
19 | #include <rtems/system.h> |
---|
20 | #include <rtems/config.h> |
---|
21 | #include <rtems/score/chain.h> |
---|
22 | #include <rtems/score/scheduler.h> |
---|
23 | #include <rtems/score/schedulersimple.h> |
---|
24 | #include <rtems/score/thread.h> |
---|
25 | #include <rtems/score/wkspace.h> |
---|
26 | |
---|
27 | /** |
---|
28 | * This routine does nothing, and is used as a stub for Schedule allocate |
---|
29 | * |
---|
30 | * Note: returns a non-zero value, or else thread initialize thinks the |
---|
31 | * allocation failed. |
---|
32 | * |
---|
33 | * The overhead of a function call will still be imposed. |
---|
34 | */ |
---|
35 | void * _Scheduler_simple_Allocate( |
---|
36 | Thread_Control *the_thread |
---|
37 | ) |
---|
38 | { |
---|
39 | return (void*)-1; /* maybe pick an appropriate poison value */ |
---|
40 | } |
---|
41 | |
---|
42 | |
---|
43 | /** |
---|
44 | * This routine does nothing, and is used as a stub for Schedule update |
---|
45 | * |
---|
46 | * The overhead of a function call will still be imposed. |
---|
47 | */ |
---|
48 | void _Scheduler_simple_Update( |
---|
49 | Thread_Control *the_thread |
---|
50 | ) |
---|
51 | { |
---|
52 | } |
---|
53 | |
---|
54 | /** |
---|
55 | * This routine does nothing, and is used as a stub for Schedule free |
---|
56 | * |
---|
57 | * The overhead of a function call will still be imposed. |
---|
58 | */ |
---|
59 | void _Scheduler_simple_Free( |
---|
60 | Thread_Control *the_thread |
---|
61 | ) |
---|
62 | { |
---|
63 | } |
---|
64 | |
---|
65 | /** |
---|
66 | * This routine initializes the simple scheduler. |
---|
67 | */ |
---|
68 | void _Scheduler_simple_Initialize ( void ) |
---|
69 | { |
---|
70 | void *f; |
---|
71 | |
---|
72 | /* |
---|
73 | * Initialize Ready Queue |
---|
74 | */ |
---|
75 | |
---|
76 | /* allocate ready queue structures */ |
---|
77 | f = _Workspace_Allocate_or_fatal_error( sizeof(Chain_Control) ); |
---|
78 | _Scheduler.information = f; |
---|
79 | |
---|
80 | /* initialize ready queue structure */ |
---|
81 | _Chain_Initialize_empty( (Chain_Control *)f ); |
---|
82 | } |
---|