18 #ifdef POK_NEEDS_ARINC653_PROCESS
20 #include <core/dependencies.h>
22 #include <core/thread.h>
23 #include <arinc653/arincutils.h>
24 #include <arinc653/types.h>
25 #include <arinc653/process.h>
26 #include <libc/string.h>
28 void GET_PROCESS_ID (PROCESS_NAME_TYPE process_name[MAX_NAME_LENGTH],
29 PROCESS_ID_TYPE *process_id,
30 RETURN_CODE_TYPE *return_code )
34 if ((
id = process_name_exist(process_name)) == 0)
37 *return_code = INVALID_CONFIG;
42 *return_code = NO_ERROR;
46 void GET_MY_ID (PROCESS_ID_TYPE *process_id,
47 RETURN_CODE_TYPE *return_code )
52 core_ret = pok_thread_id (&thread_id);
54 *return_code = INVALID_MODE;
55 *process_id = thread_id;
56 *return_code = NO_ERROR;
59 void GET_PROCESS_STATUS (PROCESS_ID_TYPE process_id,
61 RETURN_CODE_TYPE *return_code )
66 core_ret = pok_thread_status (process_id, &attr);
69 *return_code = INVALID_CONFIG;
72 process_status->DEADLINE_TIME = attr.deadline;
73 process_status->PROCESS_STATE = attr.state;
74 strcpy(process_status->ATTRIBUTES.NAME, arinc_process_attribute[process_id].NAME);
75 process_status->ATTRIBUTES.BASE_PRIORITY = arinc_process_attribute[process_id].BASE_PRIORITY;
76 process_status->ATTRIBUTES.DEADLINE = HARD;
77 process_status->CURRENT_PRIORITY = attr.priority;
78 process_status->ATTRIBUTES.PERIOD = attr.period;
79 process_status->ATTRIBUTES.TIME_CAPACITY = attr.time_capacity;
80 process_status->ATTRIBUTES.ENTRY_POINT = attr.entry;
81 process_status->ATTRIBUTES.STACK_SIZE = attr.stack_size;
82 *return_code = NO_ERROR;
86 PROCESS_ID_TYPE *process_id,
87 RETURN_CODE_TYPE *return_code )
91 uint32_t core_process_id;
93 if (process_name_exist(&attributes->NAME))
95 *return_code = NO_ACTION;
98 if (attributes->BASE_PRIORITY > MAX_PRIORITY_VALUE || attributes->BASE_PRIORITY < MIN_PRIORITY_VALUE)
100 *return_code = INVALID_PARAM;
103 core_attr.priority = (uint8_t) attributes->BASE_PRIORITY;
104 core_attr.entry = attributes->ENTRY_POINT;
105 core_attr.period = attributes->PERIOD;
106 core_attr.deadline = attributes->DEADLINE;
107 core_attr.time_capacity = attributes->TIME_CAPACITY;
108 core_attr.stack_size = attributes->STACK_SIZE;
110 core_ret = pok_thread_create (&core_process_id, &core_attr);
111 arinc_process_attribute[core_process_id].BASE_PRIORITY = attributes->BASE_PRIORITY;
112 strcpy(arinc_process_attribute[core_process_id].NAME, attributes->NAME);
113 *process_id = core_process_id;
114 *return_code = core_ret;
119 pok_thread_stop_self ();
124 #ifndef POK_CONFIG_OPTIMIZE_FOR_GENERATED_CODE
125 void SET_PRIORITY (PROCESS_ID_TYPE process_id,
126 PRIORITY_TYPE priority,
127 RETURN_CODE_TYPE *return_code )
131 *return_code = NOT_AVAILABLE;
134 void SUSPEND_SELF (SYSTEM_TIME_TYPE time_out,
135 RETURN_CODE_TYPE *return_code )
138 *return_code = NOT_AVAILABLE;
141 void SUSPEND (PROCESS_ID_TYPE process_id,
142 RETURN_CODE_TYPE *return_code )
145 *return_code = NOT_AVAILABLE;
148 void RESUME (PROCESS_ID_TYPE process_id,
149 RETURN_CODE_TYPE *return_code )
152 *return_code = NOT_AVAILABLE;
155 void STOP (PROCESS_ID_TYPE process_id,
156 RETURN_CODE_TYPE *return_code )
159 *return_code = NOT_AVAILABLE;
162 void START (PROCESS_ID_TYPE process_id,
163 RETURN_CODE_TYPE *return_code )
166 *return_code = NOT_AVAILABLE;
169 void DELAYED_START (PROCESS_ID_TYPE process_id,
170 SYSTEM_TIME_TYPE delay_time,
171 RETURN_CODE_TYPE *return_code )
175 *return_code = NOT_AVAILABLE;
178 void LOCK_PREEMPTION (LOCK_LEVEL_TYPE *lock_level,
179 RETURN_CODE_TYPE *return_code )
182 *return_code = NOT_AVAILABLE;
185 void UNLOCK_PREEMPTION (LOCK_LEVEL_TYPE *lock_level,
186 RETURN_CODE_TYPE *return_code )
190 *return_code = NOT_AVAILABLE;