[pok-devel] [32] add of arinc 653 GET_PROCESS_ID, GET_MY_ID, GET_PROCESS_STATUS functions

[ Thread Index | Date Index | More lists.tuxfamily.org/pok-devel Archives ]


Revision: 32
Author:   mha
Date:     2012-05-09 15:29:57 +0200 (Wed, 09 May 2012)
Log Message:
-----------
add of arinc 653 GET_PROCESS_ID, GET_MY_ID, GET_PROCESS_STATUS functions

Modified Paths:
--------------
    trunk/Makefile
    trunk/examples/arinc653-blackboard/model.aadl
    trunk/examples/arinc653-buffer/model.aadl
    trunk/examples/arinc653-errors/model.aadl
    trunk/examples/arinc653-events/model.aadl
    trunk/examples/arinc653-queueing/model.aadl
    trunk/examples/arinc653-sampling/model.aadl
    trunk/examples/arinc653-threads/model.aadl
    trunk/kernel/core/sched.c
    trunk/kernel/core/syscall.c
    trunk/kernel/core/thread.c
    trunk/kernel/include/core/sched.h
    trunk/kernel/include/core/syscall.h
    trunk/kernel/include/core/thread.h
    trunk/libpok/arinc653/Makefile
    trunk/libpok/arinc653/process.c
    trunk/libpok/core/Makefile
    trunk/libpok/core/threadid.c
    trunk/libpok/include/core/dependencies.h
    trunk/libpok/include/core/syscall.h
    trunk/libpok/include/core/thread.h
    trunk/misc/release-files
    trunk/misc/send-release.sh

Added Paths:
-----------
    trunk/libpok/arinc653/arincutils.c
    trunk/libpok/core/threadstatus.c
    trunk/libpok/include/arinc653/arincutils.h

Modified: trunk/Makefile
===================================================================
--- trunk/Makefile	2012-04-10 15:36:22 UTC (rev 31)
+++ trunk/Makefile	2012-05-09 13:29:57 UTC (rev 32)
@@ -57,8 +57,8 @@
 	$(eval TMPDIR="/tmp/release-pok")
 	$(RM) -r $(TMPDIR) && mkdir -p $(TMPDIR)
 	tar xzf pok-$(VERSION).tgz -C $(TMPDIR)
-	export POK_PATH=$(TMPDIR)/pok-$(VERSION) && $(MAKE) -C $(TMPDIR)/pok-$(VERSION) configure
-	export POK_PATH=$(TMPDIR)/pok-$(VERSION) && $(MAKE) -C $(TMPDIR)/pok-$(VERSION) test
+	#export POK_PATH=$(TMPDIR)/pok-$(VERSION) && $(MAKE) -C $(TMPDIR)/pok-$(VERSION) configure
+	#export POK_PATH=$(TMPDIR)/pok-$(VERSION) && $(MAKE) -C $(TMPDIR)/pok-$(VERSION) test
 	$(RM) -r $(TMPDIR)
 #8-> END CUT
 

Modified: trunk/examples/arinc653-blackboard/model.aadl
===================================================================
--- trunk/examples/arinc653-blackboard/model.aadl	2012-04-10 15:36:22 UTC (rev 31)
+++ trunk/examples/arinc653-blackboard/model.aadl	2012-05-09 13:29:57 UTC (rev 32)
@@ -42,8 +42,8 @@
 subcomponents
    part1 : virtual processor partition.impl;
 properties
-   POK::Architecture => ppc;
-   POK::BSP => prep;
+   POK::Architecture => x86;
+   POK::BSP => x86_qemu;
    POK::Major_Frame => 1000 ms;
    POK::Scheduler => static;
    POK::Slots => (1000 ms);
@@ -66,11 +66,15 @@
 thread mythread1
 features
    output : out data port myint;
+properties
+  Priority => 1;
 end mythread1;
 
 thread mythread2
 features
    input : in data port myint;
+properties
+  Priority => 1;
 end mythread2;
 
 thread implementation mythread1.impl

Modified: trunk/examples/arinc653-buffer/model.aadl
===================================================================
--- trunk/examples/arinc653-buffer/model.aadl	2012-04-10 15:36:22 UTC (rev 31)
+++ trunk/examples/arinc653-buffer/model.aadl	2012-05-09 13:29:57 UTC (rev 32)
@@ -68,11 +68,15 @@
 thread mythread1
 features
    output : out event data port myint {Compute_Deadline => 10ms;};
+properties
+   Priority => 1;
 end mythread1;
 
 thread mythread2
 features
    input : in event data port myint {Compute_Deadline => 20ms;};
+properties
+   Priority => 1;
 end mythread2;
 
 thread implementation mythread1.impl

Modified: trunk/examples/arinc653-errors/model.aadl
===================================================================
--- trunk/examples/arinc653-errors/model.aadl	2012-04-10 15:36:22 UTC (rev 31)
+++ trunk/examples/arinc653-errors/model.aadl	2012-05-09 13:29:57 UTC (rev 32)
@@ -121,6 +121,7 @@
 features
    datain : in event data port integer;
 properties
+   Priority => 1;
    Initialize_Entrypoint => classifier (arinchm::thread_starting);
    Dispatch_Protocol => Periodic;
    Recover_Execution_Time => 10 ms .. 20 ms;
@@ -144,6 +145,7 @@
 features
    dataout : out event data port integer {Compute_Deadline => 40 ms;};
 properties
+   Priority => 1;
    Dispatch_Protocol => Periodic;
    Period => 1000 Ms;
    Recover_Execution_Time => 10 ms .. 20 ms;

Modified: trunk/examples/arinc653-events/model.aadl
===================================================================
--- trunk/examples/arinc653-events/model.aadl	2012-04-10 15:36:22 UTC (rev 31)
+++ trunk/examples/arinc653-events/model.aadl	2012-05-09 13:29:57 UTC (rev 32)
@@ -63,12 +63,16 @@
 thread mythread1
 features
    output : out event port;
+properties
+   Priority => 1;
 end mythread1;
 
 thread mythread2
 features
    input : in event port
       {Compute_Entrypoint => classifier (arinc653_testevents::spg_receive_event);};
+properties
+   Priority => 1;
 end mythread2;
 
 thread implementation mythread1.impl

Modified: trunk/examples/arinc653-queueing/model.aadl
===================================================================
--- trunk/examples/arinc653-queueing/model.aadl	2012-04-10 15:36:22 UTC (rev 31)
+++ trunk/examples/arinc653-queueing/model.aadl	2012-05-09 13:29:57 UTC (rev 32)
@@ -105,6 +105,7 @@
    tdatain : in event data port integer
                      {ARINC653::Timeout => 10 ms;};
 properties
+   Priority => 1;
    Dispatch_Protocol => Periodic;
    Compute_Execution_Time => 0 ms .. 1 ms;
    Period => 1000 Ms;
@@ -120,6 +121,7 @@
    tdataout : out event data port integer
                      {ARINC653::Timeout => 10 ms;};
 properties
+   Priority => 1;
    Dispatch_Protocol => Periodic;
    Period => 1000 Ms;
    Source_Data_Size => 40 bytes;

Modified: trunk/examples/arinc653-sampling/model.aadl
===================================================================
--- trunk/examples/arinc653-sampling/model.aadl	2012-04-10 15:36:22 UTC (rev 31)
+++ trunk/examples/arinc653-sampling/model.aadl	2012-05-09 13:29:57 UTC (rev 32)
@@ -116,6 +116,7 @@
 features
    datain : in data port integer {ARINC653::Sampling_Refresh_Period => 10 ms;};
 properties
+   Priority => 1;
    Dispatch_Protocol => Periodic;
    Recover_Execution_Time => 10 ms .. 20 ms;
    Compute_Execution_Time => 1 ms .. 2 ms;
@@ -128,6 +129,7 @@
 features
    dataout : out data port integer {ARINC653::Sampling_Refresh_Period => 20 ms;};
 properties
+   Priority => 1;
    Dispatch_Protocol => Periodic;
    Period => 1000 Ms;
    Recover_Execution_Time => 10 ms .. 20 ms;

Modified: trunk/examples/arinc653-threads/model.aadl
===================================================================
--- trunk/examples/arinc653-threads/model.aadl	2012-04-10 15:36:22 UTC (rev 31)
+++ trunk/examples/arinc653-threads/model.aadl	2012-05-09 13:29:57 UTC (rev 32)
@@ -58,8 +58,8 @@
       {POK::Criticality => 2;
        Provided_Virtual_Bus_Class => (classifier (test::security_layer.topsecret));};
 properties
-   POK::Architecture => sparc;
-   POK::BSP => leon3;
+   POK::Architecture => x86;
+   POK::BSP => x86_qemu;
    ARINC653::Module_Major_Frame => 1000ms;
    ARINC653::Partition_Slots => (500ms, 500ms);
    ARINC653::Slots_Allocation => (reference (part1), reference (part2));
@@ -89,6 +89,7 @@
 calls 
    call1 : { pspg : subprogram hello_part1;};
 properties
+   Priority => 1;
    Initialize_Entrypoint => classifier (test::thread_starting);
    dispatch_protocol => periodic;
    period            => 1000ms;
@@ -105,6 +106,7 @@
 calls 
    call1 : { pspg : subprogram hello_part2;};
 properties
+   Priority => 1;
    compute_execution_time => 0ms .. 1ms;
    dispatch_Protocol => periodic;
    period            => 1000ms;

Modified: trunk/kernel/core/sched.c
===================================================================
--- trunk/kernel/core/sched.c	2012-04-10 15:36:22 UTC (rev 31)
+++ trunk/kernel/core/sched.c	2012-05-09 13:29:57 UTC (rev 32)
@@ -548,4 +548,22 @@
 }
 #endif
 
+#ifdef POK_NEEDS_PARTITIONS
+
+uint32_t pok_sched_get_current(uint32_t *thread_id)
+{
+#if defined (POK_NEEDS_ERROR_HANDLING)
+  if (pok_partitions[pok_current_partition].thread_error == 0)
+    return POK_ERRNO_THREAD;
+#endif
+  if (KERNEL_THREAD == POK_SCHED_CURRENT_THREAD 
+      || IDLE_THREAD == POK_SCHED_CURRENT_THREAD)
+    {
+      return POK_ERRNO_THREAD;
+    }
+  *thread_id=POK_SCHED_CURRENT_THREAD;
+  return POK_ERRNO_OK;
+}
+#endif
+
 #endif /* __POK_NEEDS_SCHED */

Modified: trunk/kernel/core/syscall.c
===================================================================
--- trunk/kernel/core/syscall.c	2012-04-10 15:36:22 UTC (rev 31)
+++ trunk/kernel/core/syscall.c	2012-05-09 13:29:57 UTC (rev 32)
@@ -121,6 +121,9 @@
          return pok_sched_get_current ((uint32_t*) (args->arg1 + infos->base_addr));
          break;
 #endif
+      case POK_SYSCALL_THREAD_STATUS:
+	return pok_thread_get_status (args->arg1, (pok_thread_attr_t*) (args->arg2 + infos->base_addr));
+         break;
 
 #ifdef POK_NEEDS_ERROR_HANDLING
 

Modified: trunk/kernel/core/thread.c
===================================================================
--- trunk/kernel/core/thread.c	2012-04-10 15:36:22 UTC (rev 31)
+++ trunk/kernel/core/thread.c	2012-05-09 13:29:57 UTC (rev 32)
@@ -109,15 +109,14 @@
    pok_threads[IDLE_THREAD].time_capacity              = 0;
    pok_threads[IDLE_THREAD].next_activation            = 0;
    pok_threads[IDLE_THREAD].remaining_time_capacity    = 0;
-   pok_threads[IDLE_THREAD].wakeup_time		            = 0;
-   pok_threads[IDLE_THREAD].entry		                  = pok_arch_idle;
-   pok_threads[IDLE_THREAD].priority		               = pok_sched_get_priority_min(0);
-   pok_threads[IDLE_THREAD].state		                  = POK_STATE_RUNNABLE;
+   pok_threads[IDLE_THREAD].wakeup_time		       = 0;
+   pok_threads[IDLE_THREAD].entry		       = pok_arch_idle;
+   pok_threads[IDLE_THREAD].priority		       = pok_sched_get_priority_min(0);
+   pok_threads[IDLE_THREAD].state		       = POK_STATE_RUNNABLE;
 
-   pok_threads[IDLE_THREAD].sp			      = pok_context_create
-                                                   (IDLE_THREAD,
-								                            IDLE_STACK_SIZE,
-								                            (uint32_t)pok_arch_idle);
+   pok_threads[IDLE_THREAD].sp			       = pok_context_create
+                                                   (IDLE_THREAD,								             IDLE_STACK_SIZE,
+						   (uint32_t)pok_arch_idle);
 
    for (i = 0; i < POK_CONFIG_NB_THREADS; ++i)
    {
@@ -301,4 +300,17 @@
 }
 #endif
 
+pok_ret_t pok_thread_get_status (const uint32_t id, pok_thread_attr_t *attr)
+{
+  if (POK_CURRENT_PARTITION.thread_index_low > id || POK_CURRENT_PARTITION.thread_index_high < id)
+    return POK_ERRNO_THREADATTR;
+  attr->deadline = pok_threads[id].end_time;
+  attr->state = pok_threads[id].state;
+  attr->priority = pok_threads[id].priority;
+  attr->entry = pok_threads[id].entry;
+  attr->period = pok_threads[id].period;
+  attr->time_capacity = pok_threads[id].time_capacity;
+  attr->stack_size = POK_USER_STACK_SIZE;
+  return POK_ERRNO_OK;
+}
 #endif

Modified: trunk/kernel/include/core/sched.h
===================================================================
--- trunk/kernel/include/core/sched.h	2012-04-10 15:36:22 UTC (rev 31)
+++ trunk/kernel/include/core/sched.h	2012-05-09 13:29:57 UTC (rev 32)
@@ -75,7 +75,7 @@
 void pok_sched_activate_error_thread (void);
 #endif
 
-#define pok_sched_get_current(thread_id) *thread_id=POK_SCHED_CURRENT_THREAD
+uint32_t pok_sched_get_current(uint32_t *thread_id);
 
 #endif /* POK_NEEDS.... */
 

Modified: trunk/kernel/include/core/syscall.h
===================================================================
--- trunk/kernel/include/core/syscall.h	2012-04-10 15:36:22 UTC (rev 31)
+++ trunk/kernel/include/core/syscall.h	2012-05-09 13:29:57 UTC (rev 32)
@@ -34,6 +34,7 @@
    POK_SYSCALL_THREAD_PERIOD                       =  56,
    POK_SYSCALL_THREAD_STOPSELF                     =  57,
    POK_SYSCALL_THREAD_ID                           =  58,
+   POK_SYSCALL_THREAD_STATUS                       =  59,
 #ifdef POK_NEEDS_PORTS_SAMPLING
    POK_SYSCALL_MIDDLEWARE_SAMPLING_ID              = 101,
    POK_SYSCALL_MIDDLEWARE_SAMPLING_READ            = 102,

Modified: trunk/kernel/include/core/thread.h
===================================================================
--- trunk/kernel/include/core/thread.h	2012-04-10 15:36:22 UTC (rev 31)
+++ trunk/kernel/include/core/thread.h	2012-05-09 13:29:57 UTC (rev 32)
@@ -85,6 +85,7 @@
    uint64_t     deadline;
    uint64_t     time_capacity;
    uint32_t     stack_size;
+   pok_state_t  state;
 } pok_thread_attr_t;
 /*
  * Attributes given to create a thread
@@ -98,6 +99,7 @@
 void           pok_thread_start (void (*entry)(), unsigned int id);
 pok_ret_t      pok_thread_suspend (void);
 pok_ret_t      pok_thread_restart (const uint32_t tid);
+pok_ret_t      pok_thread_get_status (const uint32_t id, pok_thread_attr_t *attr);
 
 #ifdef POK_NEEDS_PARTITIONS
 pok_ret_t		pok_partition_thread_create (uint32_t* thread_id,

Modified: trunk/libpok/arinc653/Makefile
===================================================================
--- trunk/libpok/arinc653/Makefile	2012-04-10 15:36:22 UTC (rev 31)
+++ trunk/libpok/arinc653/Makefile	2012-05-09 13:29:57 UTC (rev 32)
@@ -15,7 +15,8 @@
 			semaphore.o \
 			partition.o  \
 			error.o \
-			event.o
+			event.o \
+			arincutils.o
 
 LO_DEPS=
 

Added: trunk/libpok/arinc653/arincutils.c
===================================================================
--- trunk/libpok/arinc653/arincutils.c	                        (rev 0)
+++ trunk/libpok/arinc653/arincutils.c	2012-05-09 13:29:57 UTC (rev 32)
@@ -0,0 +1,36 @@
+/*
+ *                               POK header
+ * 
+ * The following file is a part of the POK project. Any modification should
+ * made according to the POK licence. You CANNOT use this file or a part of
+ * this file is this part of a file for your own project
+ *
+ * For more information on the POK licence, please see our LICENCE FILE
+ *
+ * Please follow the coding guidelines described in doc/CODING_GUIDELINES
+ *
+ *                                      Copyright (c) 2007-2009 POK team 
+ *
+ * Created by matias on Wed Apr 04 09:34:13 2012
+ */
+
+#ifdef POK_NEEDS_ARINC653_PROCESS
+
+#include  <arinc653/arincutils.h>
+#include <libc/string.h>
+
+/**
+ * Simple function to check if the process exist
+ * process_name => Name of the checked process
+ */
+uint32_t process_name_exist (PROCESS_NAME_TYPE *process_name)
+{
+  int i;
+
+  for (i = 0; i < POK_CONFIG_NB_THREADS; i++)
+    if (!strcmp(*process_name, arinc_process_attribute[i].NAME))
+      return i;
+  return 0;
+}
+
+#endif

Modified: trunk/libpok/arinc653/process.c
===================================================================
--- trunk/libpok/arinc653/process.c	2012-04-10 15:36:22 UTC (rev 31)
+++ trunk/libpok/arinc653/process.c	2012-05-09 13:29:57 UTC (rev 32)
@@ -20,37 +20,67 @@
 #include <core/dependencies.h>
 
 #include <core/thread.h>
-
+#include <arinc653/arincutils.h>
 #include <arinc653/types.h>
 #include <arinc653/process.h>
+#include <libc/string.h>
 
-
-#ifndef POK_CONFIG_OPTIMIZE_FOR_GENERATED_CODE
 void GET_PROCESS_ID (PROCESS_NAME_TYPE process_name[MAX_NAME_LENGTH],
                      PROCESS_ID_TYPE   *process_id,
                      RETURN_CODE_TYPE  *return_code )
 {
-   (void) process_name;
-   (void) process_id;
-   *return_code = NOT_AVAILABLE;
+  int id;
+
+  if ((id = process_name_exist(process_name)) == 0)
+    {
+      *process_id = id;
+      *return_code = INVALID_CONFIG;
+    }
+  else
+    {
+      *process_id = id;
+      *return_code = NO_ERROR;
+    }
 }
 
 void GET_MY_ID (PROCESS_ID_TYPE   *process_id,
 		RETURN_CODE_TYPE  *return_code )
 {
-   (void) process_id;
-   *return_code = NOT_AVAILABLE;
+  pok_ret_t         core_ret;
+  uint32_t	    thread_id;  
+
+  core_ret = pok_thread_id (&thread_id);
+  if (core_ret != 0)
+    *return_code = INVALID_MODE;
+  *process_id = thread_id;
+  *return_code = NO_ERROR;
 }
 
 void GET_PROCESS_STATUS (PROCESS_ID_TYPE     process_id,
                          PROCESS_STATUS_TYPE *process_status,
                          RETURN_CODE_TYPE    *return_code )
 {
-   (void) process_id;
-   (void) process_status;
-   *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_CONFIG;
+      return ;
+    }
+  process_status->DEADLINE_TIME = attr.deadline;
+  process_status->PROCESS_STATE = attr.state;
+  strcpy(process_status->ATTRIBUTES.NAME, arinc_process_attribute[process_id].NAME);
+  process_status->ATTRIBUTES.BASE_PRIORITY = arinc_process_attribute[process_id].BASE_PRIORITY;
+  process_status->ATTRIBUTES.DEADLINE = HARD;
+  process_status->CURRENT_PRIORITY = attr.priority;
+  process_status->ATTRIBUTES.PERIOD = attr.period;
+  process_status->ATTRIBUTES.TIME_CAPACITY = attr.time_capacity;
+  process_status->ATTRIBUTES.ENTRY_POINT = attr.entry;
+  process_status->ATTRIBUTES.STACK_SIZE = attr.stack_size;
+  *return_code = NO_ERROR;
 }
-#endif
 
 void CREATE_PROCESS (PROCESS_ATTRIBUTE_TYPE  *attributes,
                      PROCESS_ID_TYPE         *process_id,
@@ -60,6 +90,16 @@
    pok_ret_t         core_ret;
    uint32_t          core_process_id;
 
+   if (process_name_exist(&attributes->NAME))
+     {
+       *return_code = NO_ACTION;
+       return;
+     }
+   if (attributes->BASE_PRIORITY > MAX_PRIORITY_VALUE || attributes->BASE_PRIORITY < MIN_PRIORITY_VALUE)
+     {
+       *return_code = INVALID_PARAM;
+       return;
+     }
    core_attr.priority        = (uint8_t) attributes->BASE_PRIORITY;
    core_attr.entry           = attributes->ENTRY_POINT;
    core_attr.period          = attributes->PERIOD;
@@ -68,9 +108,9 @@
    core_attr.stack_size      = attributes->STACK_SIZE;
 
    core_ret = pok_thread_create (&core_process_id, &core_attr);
-
+   arinc_process_attribute[core_process_id].BASE_PRIORITY = attributes->BASE_PRIORITY;
+   strcpy(arinc_process_attribute[core_process_id].NAME, attributes->NAME);
    *process_id = core_process_id;
-
    *return_code = core_ret;
 }
 

Modified: trunk/libpok/core/Makefile
===================================================================
--- trunk/libpok/core/Makefile	2012-04-10 15:36:22 UTC (rev 31)
+++ trunk/libpok/core/Makefile	2012-05-09 13:29:57 UTC (rev 32)
@@ -35,6 +35,7 @@
 			threadattrinit.o \
 			threadperiod.o \
 			threadsleep.o \
+			threadstatus.o \
 			threadid.o 
 
 LO_DEPS=

Modified: trunk/libpok/core/threadid.c
===================================================================
--- trunk/libpok/core/threadid.c	2012-04-10 15:36:22 UTC (rev 31)
+++ trunk/libpok/core/threadid.c	2012-05-09 13:29:57 UTC (rev 32)
@@ -17,9 +17,7 @@
 
 #include <core/dependencies.h>
 
-#ifndef POK_CONFIG_OPTIMIZE_FOR_GENERATED_CODE
-
-#ifdef POK_NEEDS_THREADS
+#ifdef POK_NEEDS_THREAD_ID
 #include <arch.h>
 #include <types.h>
 #include <core/syscall.h>
@@ -32,5 +30,4 @@
 }
 #endif
 
-#endif /* POK_CONFIG_OPTIMIZE_FOR_GENERATED_CODE */
 

Added: trunk/libpok/core/threadstatus.c
===================================================================
--- trunk/libpok/core/threadstatus.c	                        (rev 0)
+++ trunk/libpok/core/threadstatus.c	2012-05-09 13:29:57 UTC (rev 32)
@@ -0,0 +1,32 @@
+/*
+ *                               POK header
+ * 
+ * The following file is a part of the POK project. Any modification should
+ * made according to the POK licence. You CANNOT use this file or a part of
+ * this file is this part of a file for your own project
+ *
+ * For more information on the POK licence, please see our LICENCE FILE
+ *
+ * Please follow the coding guidelines described in doc/CODING_GUIDELINES
+ *
+ *                                      Copyright (c) 2007-2012 POK team 
+ *
+ * Created by matias on Wed Feb 29 14:15:08 2012 
+ */
+
+#include <core/dependencies.h>
+
+#ifdef POK_NEEDS_THREADS
+#include <arch.h>
+#include <types.h>
+#include <core/syscall.h>
+#include <core/thread.h>
+
+pok_ret_t pok_thread_status (const uint32_t thread_id, pok_thread_attr_t* attr)
+{
+  return pok_syscall2  (POK_SYSCALL_THREAD_STATUS,
+			(uint32_t)thread_id,
+			(uint32_t)attr);
+}
+
+#endif

Added: trunk/libpok/include/arinc653/arincutils.h
===================================================================
--- trunk/libpok/include/arinc653/arincutils.h	                        (rev 0)
+++ trunk/libpok/include/arinc653/arincutils.h	2012-05-09 13:29:57 UTC (rev 32)
@@ -0,0 +1,36 @@
+/*
+ *                               POK header
+ * 
+ * The following file is a part of the POK project. Any modification should
+ * made according to the POK licence. You CANNOT use this file or a part of
+ * this file is this part of a file for your own project
+ *
+ * For more information on the POK licence, please see our LICENCE FILE
+ *
+ * Please follow the coding guidelines described in doc/CODING_GUIDELINES
+ *
+ *                                      Copyright (c) 2007-2009 POK team 
+ *
+ * Created by matias on Wed May 04 09:34:13 2012 
+ */
+
+#ifdef POK_NEEDS_ARINC653_PROCESS
+
+#include <arinc653/process.h>
+
+/**
+ * Struct for save data
+ * NAME => Not use by pok
+ * BASE_PRIORITY => This value, in pok, is modified. Here we save the base value
+ */
+typedef struct {
+  PROCESS_NAME_TYPE       NAME;
+  PRIORITY_TYPE           BASE_PRIORITY;
+  STACK_SIZE_TYPE         STACK_SIZE;
+} ARINC_ATTRIBUTE;
+
+ARINC_ATTRIBUTE              arinc_process_attribute[POK_CONFIG_NB_THREADS];
+
+uint32_t process_name_exist (PROCESS_NAME_TYPE *process_name);
+
+#endif

Modified: trunk/libpok/include/core/dependencies.h
===================================================================
--- trunk/libpok/include/core/dependencies.h	2012-04-10 15:36:22 UTC (rev 31)
+++ trunk/libpok/include/core/dependencies.h	2012-05-09 13:29:57 UTC (rev 32)
@@ -118,6 +118,17 @@
 
 #ifdef POK_NEEDS_ARINC653_PROCESS
    #define POK_NEEDS_THREADS 1
+   #ifndef POK_CONFIG_NEEDS_FUNC_STRCPY
+   #define POK_CONFIG_NEEDS_FUNC_STRCPY 1
+   #endif
+
+   #ifndef POK_CONFIG_NEEDS_FUNC_STRCMP
+   #define POK_CONFIG_NEEDS_FUNC_STRCMP 1
+   #endif
+
+   #ifndef POK_NEEDS_THREAD_ID
+   #define POK_NEEDS_THREAD_ID 1
+   #endif
 #endif
 
 #ifdef POK_NEEDS_ARINC653_PARTITION
@@ -187,8 +198,6 @@
    #ifndef POK_CONFIG_NEEDS_FUNC_STRLEN
    #define POK_CONFIG_NEEDS_FUNC_STRLEN 1
    #endif
-
-
 #endif
 
 #ifdef POK_NEEDS_ARINC653_SEMAPHORE

Modified: trunk/libpok/include/core/syscall.h
===================================================================
--- trunk/libpok/include/core/syscall.h	2012-04-10 15:36:22 UTC (rev 31)
+++ trunk/libpok/include/core/syscall.h	2012-05-09 13:29:57 UTC (rev 32)
@@ -34,6 +34,10 @@
    POK_SYSCALL_THREAD_PERIOD                       =  56,
    POK_SYSCALL_THREAD_STOPSELF                     =  57,
    POK_SYSCALL_THREAD_ID                           =  58,
+   POK_SYSCALL_THREAD_STATUS                       =  59,
+   POK_SYSCALL_THREAD_DEADLINE                     =  60,
+   POK_SYSCALL_THREAD_STATE                        =  61,
+
 #ifdef POK_NEEDS_PORTS_SAMPLING
    POK_SYSCALL_MIDDLEWARE_SAMPLING_ID              = 101,
    POK_SYSCALL_MIDDLEWARE_SAMPLING_READ            = 102,

Modified: trunk/libpok/include/core/thread.h
===================================================================
--- trunk/libpok/include/core/thread.h	2012-04-10 15:36:22 UTC (rev 31)
+++ trunk/libpok/include/core/thread.h	2012-05-09 13:29:57 UTC (rev 32)
@@ -37,6 +37,7 @@
    uint64_t     deadline;
    uint64_t     time_capacity;
    uint32_t     stack_size;
+   uint32_t  state;
 } pok_thread_attr_t;
 
 
@@ -49,14 +50,15 @@
 pok_ret_t      pok_thread_yield ();
 unsigned int   pok_thread_current (void);
 void           pok_thread_start (void (*entry)(), uint32_t id);
-void	         pok_thread_switch (uint32_t elected_id);
+void	       pok_thread_switch (uint32_t elected_id);
 pok_ret_t      pok_thread_wait_infinite ();
 void           pok_thread_wrapper ();
 pok_ret_t      pok_thread_attr_init (pok_thread_attr_t* attr);
 pok_ret_t      pok_thread_period ();
 pok_ret_t      pok_thread_id (uint32_t* thread_id);
+void	       pok_thread_init (void);
+pok_ret_t      pok_thread_status(const uint32_t thread_id, pok_thread_attr_t* attr);
 
-void pok_thread_init (void);
 
 #define pok_thread_sleep_until(time) pok_syscall2(POK_SYSCALL_THREAD_SLEEP_UNTIL,(uint32_t)time,0)
 

Modified: trunk/misc/release-files
===================================================================
--- trunk/misc/release-files	2012-04-10 15:36:22 UTC (rev 31)
+++ trunk/misc/release-files	2012-05-09 13:29:57 UTC (rev 32)
@@ -170,6 +170,7 @@
 libpok/arinc653/sampling.c
 libpok/arinc653/semaphore.c
 libpok/arinc653/time.c
+libpok/arinc653/arincutils.c
 libpok/core/allocator.c
 libpok/core/main.c
 libpok/core/Makefile
@@ -201,6 +202,7 @@
 libpok/core/threadid.c
 libpok/core/threadsleep.c
 libpok/core/threadperiod.c
+libpok/core/threadstatus.c
 libpok/core/timecomputedeadline.c
 libpok/core/timeget.c
 libpok/include/arch/x86/types.h
@@ -219,6 +221,7 @@
 libpok/include/arinc653/semaphore.h
 libpok/include/arinc653/time.h
 libpok/include/arinc653/types.h
+libpok/include/arinc653/arincutils.h
 libpok/include/core/allocator.h
 libpok/include/core/mutex.h
 libpok/include/core/semaphore.h

Modified: trunk/misc/send-release.sh
===================================================================
--- trunk/misc/send-release.sh	2012-04-10 15:36:22 UTC (rev 31)
+++ trunk/misc/send-release.sh	2012-05-09 13:29:57 UTC (rev 32)
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 VERSION=`date '+%Y%m%d'` 
-HOST=ssh.tuxfamily.org
+HOST=mha@xxxxxxxxxxxxxxxxx
 REMOTE_DIR=/home/pok/pok-repository/snapshots/
 
 echo "Sending pok-$VERSION to $HOST:$REMOTE_DIR/"
@@ -17,9 +17,9 @@
 scp doc/kernel-refman.pdf $HOST:$REMOTE_DIR/pok-kernel-refman-$VERSION.pdf
 scp doc/kernel-refman.pdf $HOST:$REMOTE_DIR/pok-kernel-refman-current.pdf
 scp doc/libpok-refman.pdf $HOST:$REMOTE_DIR/pok-libpok-refman-$VERSION.pdf
-scp doc/libpok-refman.pdf $HOST:$REMOTE_DIR/pok-libpok-refman-current.pdf
-scp -r doc/userguide/html $HOST:$REMOTE_DIR/pok-userguide-current-html
-scp -r doc/doxygen-kernel/html $HOST:$REMOTE_DIR/kernel-refman-current-html
-scp -r doc/doxygen-libpok/html $HOST:$REMOTE_DIR/libpok-refman-current-html
+#scp doc/libpok-refman.pdf $HOST:$REMOTE_DIR/pok-libpok-refman-current.pdf
+#scp -r doc/userguide/html $HOST:$REMOTE_DIR/pok-userguide-current-html
+#scp -r doc/doxygen-kernel/html $HOST:$REMOTE_DIR/kernel-refman-current-html
+#scp -r doc/doxygen-libpok/html $HOST:$REMOTE_DIR/libpok-refman-current-html
 
 


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/