[pok-devel] [42] add the START arinc call. |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/pok-devel Archives
]
Revision: 42
Author: jrosen
Date: 2012-10-04 14:35:12 +0200 (Thu, 04 Oct 2012)
Log Message:
-----------
add the START arinc call.
this is not required yet since processes are created in a runnable state
Modified Paths:
--------------
trunk/libpok/arinc653/process.c
Modified: trunk/libpok/arinc653/process.c
===================================================================
--- trunk/libpok/arinc653/process.c 2012-09-28 16:04:57 UTC (rev 41)
+++ trunk/libpok/arinc653/process.c 2012-10-04 12:35:12 UTC (rev 42)
@@ -214,15 +214,29 @@
*return_code = core_ret;
}
-#ifndef POK_CONFIG_OPTIMIZE_FOR_GENERATED_CODE
-void STOP (PROCESS_ID_TYPE process_id,
+void START (PROCESS_ID_TYPE process_id,
RETURN_CODE_TYPE *return_code )
{
- (void) process_id;
- *return_code = NOT_AVAILABLE;
+ pok_thread_attr_t attr;
+ pok_ret_t core_ret;
+
+ core_ret = pok_thread_status (process_id, &attr);
+ if (core_ret != 0)
+ {
+ *return_code = INVALID_PARAM;
+ return ;
+ }
+ if (attr.state != DORMANT)
+ {
+ *return_code = NO_ACTION;
+ return ;
+ }
+ core_ret = pok_thread_restart(process_id);
+ *return_code = core_ret;
}
-void START (PROCESS_ID_TYPE process_id,
+#ifndef POK_CONFIG_OPTIMIZE_FOR_GENERATED_CODE
+void STOP (PROCESS_ID_TYPE process_id,
RETURN_CODE_TYPE *return_code )
{
(void) process_id;