Commit beb82243 authored by Bruno Gomes's avatar Bruno Gomes

Merge branch 'master' of https://spass-git-ext.gmv.com/AIR/AIR

parents acd899b0 05ab54d3
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<!-- Partition 0 --> <!-- Partition 0 -->
<Partition PartitionIdentifier="1" PartitionName="part0" <Partition PartitionIdentifier="1" PartitionName="part0"
Criticality="LEVEL_A" EntryPoint="entry_point" SystemPartition="false"> Criticality="LEVEL_A" EntryPoint="entry_point" SystemPartition="false">
<PartitionConfiguration Personality="RTEMS48i" Cores="1" Mode="source"> <PartitionConfiguration Personality="RTEMS5" Cores="1" Mode="source">
<Libs>LIBAIR; LIBPRINTF</Libs> <Libs>LIBAIR; LIBPRINTF</Libs>
<Devices></Devices> <Devices></Devices>
<Cache>CODE; DATA</Cache> <Cache>CODE; DATA</Cache>
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<!-- partition 0--> <!-- partition 0-->
<Partition PartitionIdentifier="1" PartitionName="p0" Criticality="LEVEL_A" SystemPartition="true" EntryPoint="producer"> <Partition PartitionIdentifier="1" PartitionName="p0" Criticality="LEVEL_A" SystemPartition="true" EntryPoint="producer">
<PartitionConfiguration Personality="RTEMS48I" Cores="1"> <PartitionConfiguration Personality="RTEMS5" Cores="1">
<Libs>LIBAIR;IMASPEX;LIBPRINTF</Libs> <Libs>LIBAIR;IMASPEX;LIBPRINTF</Libs>
<Cache>CODE; DATA</Cache> <Cache>CODE; DATA</Cache>
<Memory Size="0x500000" /> <Memory Size="0x500000" />
......
...@@ -67,7 +67,6 @@ void test2(uintptr_t self_id) { ...@@ -67,7 +67,6 @@ void test2(uintptr_t self_id) {
}*/ }*/
} }
int producer() { int producer() {
RETURN_CODE_TYPE rc; RETURN_CODE_TYPE rc;
...@@ -93,5 +92,3 @@ int producer() { ...@@ -93,5 +92,3 @@ int producer() {
return RTEMS_SUCCESSFUL; return RTEMS_SUCCESSFUL;
} }
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
Direction="SOURCE" MaxMessageSize="1024" RefreshRateSeconds="1.5"/> Direction="SOURCE" MaxMessageSize="1024" RefreshRateSeconds="1.5"/>
<Queuing_Port Name="QSAMPLE" <Queuing_Port Name="QSAMPLE"
Direction="SOURCE" MaxMessageSize="1024" MaxNbMessages="32" /> Direction="SOURCE" MaxMessageSize="1024" MaxNbMessages="32" />
<PartitionConfiguration Personality="RTEMS48I" Cores="1"> <PartitionConfiguration Personality="RTEMS5" Cores="1">
<Libs>LIBAIR; IMASPEX; LIBPRINTF</Libs> <Libs>LIBAIR; IMASPEX; LIBPRINTF</Libs>
<Devices></Devices> <Devices></Devices>
<Cache>CODE; DATA</Cache> <Cache>CODE; DATA</Cache>
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
Criticality="LEVEL_A" EntryPoint="entry_func" SystemPartition="false"> Criticality="LEVEL_A" EntryPoint="entry_func" SystemPartition="false">
<Sampling_Port Name="RECV_SAMP" <Sampling_Port Name="RECV_SAMP"
Direction="DESTINATION" MaxMessageSize="1024" RefreshRateSeconds="1.5"/> Direction="DESTINATION" MaxMessageSize="1024" RefreshRateSeconds="1.5"/>
<PartitionConfiguration Personality="RTEMS48I" Cores="1"> <PartitionConfiguration Personality="RTEMS5" Cores="1">
<Libs>LIBAIR; IMASPEX; LIBPRINTF</Libs> <Libs>LIBAIR; IMASPEX; LIBPRINTF</Libs>
<Devices></Devices> <Devices></Devices>
<Cache>CODE; DATA</Cache> <Cache>CODE; DATA</Cache>
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
Direction="DESTINATION" MaxMessageSize="1024" RefreshRateSeconds="1.5"/> Direction="DESTINATION" MaxMessageSize="1024" RefreshRateSeconds="1.5"/>
<Queuing_Port Name="QSAMPLE" <Queuing_Port Name="QSAMPLE"
Direction="DESTINATION" MaxMessageSize="1024" MaxNbMessages="32" /> Direction="DESTINATION" MaxMessageSize="1024" MaxNbMessages="32" />
<PartitionConfiguration Personality="RTEMS48I" Cores="1"> <PartitionConfiguration Personality="RTEMS5" Cores="1">
<Libs>LIBAIR; IMASPEX; LIBPRINTF</Libs> <Libs>LIBAIR; IMASPEX; LIBPRINTF</Libs>
<Devices></Devices> <Devices></Devices>
<Cache>CODE; DATA</Cache> <Cache>CODE; DATA</Cache>
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#include <imaspex.h> #include <imaspex.h>
#ifdef RTEMS48I #ifdef RTEMS48I
#include <pprintf.h> #include <printf.h>
#endif #endif
...@@ -46,24 +46,24 @@ void test(PARTITION_ID_TYPE self_id) { ...@@ -46,24 +46,24 @@ void test(PARTITION_ID_TYPE self_id) {
while(1) { while(1) {
pprintf ("Partition %d receiving message..\n", self_id); printf ("Partition %d receiving message..\n", self_id);
/*if (TIME_STAMP > REF_TIME_STAMP), receive from sampling port*/ /*if (TIME_STAMP > REF_TIME_STAMP), receive from sampling port*/
READ_SAMPLING_MESSAGE_CONDITIONAL(RECV_PORT, REF_TIME_STAMP, (MESSAGE_ADDR_TYPE)message, &SIZE, &TIME_STAMP, &rc); READ_SAMPLING_MESSAGE_CONDITIONAL(RECV_PORT, REF_TIME_STAMP, (MESSAGE_ADDR_TYPE)message, &SIZE, &TIME_STAMP, &rc);
if(INVALID_PARAM == rc) { if(INVALID_PARAM == rc) {
pprintf("READ_SAMPLING_MESSAGE_CONDITIONAL error %d\n", rc); printf("READ_SAMPLING_MESSAGE_CONDITIONAL error %d\n", rc);
} }
else if((NO_ACTION == rc) && (0 == TIME_STAMP) && (0 == SIZE)) { else if((NO_ACTION == rc) && (0 == TIME_STAMP) && (0 == SIZE)) {
pprintf("Empty Sampling Port\n"); printf("Empty Sampling Port\n");
} }
else if((TIME_STAMP <= REF_TIME_STAMP) && (NO_ACTION == rc) && (0 == SIZE)) { else if((TIME_STAMP <= REF_TIME_STAMP) && (NO_ACTION == rc) && (0 == SIZE)) {
pprintf("Timestamp not yet reached\n"); printf("Timestamp not yet reached\n");
} }
else if(TIME_STAMP > REF_TIME_STAMP) { else if(TIME_STAMP > REF_TIME_STAMP) {
pprintf("Message: %s, timestamp=%ldms\n", message, (long int)(TIME_STAMP/1000000) ); printf("Message: %s, timestamp=%ldms\n", message, (long int)(TIME_STAMP/1000000) );
} }
else { else {
pprintf("Unexpected READ_SAMPLING_MESSAGE_CONDITIONAL behavior\n"); printf("Unexpected READ_SAMPLING_MESSAGE_CONDITIONAL behavior\n");
} }
...@@ -90,10 +90,10 @@ int entry_func() { ...@@ -90,10 +90,10 @@ int entry_func() {
/*Getting my own ID*/ /*Getting my own ID*/
GET_PARTITION_ID(&self_id, &rc); GET_PARTITION_ID(&self_id, &rc);
if(NO_ERROR != rc) { if(NO_ERROR != rc) {
pprintf("GET_PARTITION_ID error %d\n", rc); printf("GET_PARTITION_ID error %d\n", rc);
} }
pprintf("Initializing partition %d...\n", self_id); printf("Initializing partition %d...\n", self_id);
/*creating Destination sampling Port*/ /*creating Destination sampling Port*/
SAMPLING_PORT_NAME_TYPE NAME = "RECV_SAMP"; SAMPLING_PORT_NAME_TYPE NAME = "RECV_SAMP";
...@@ -103,7 +103,7 @@ int entry_func() { ...@@ -103,7 +103,7 @@ int entry_func() {
CREATE_SAMPLING_PORT (NAME, SIZE, DESTINATION, PERIOD, &RECV_PORT, &rc); CREATE_SAMPLING_PORT (NAME, SIZE, DESTINATION, PERIOD, &RECV_PORT, &rc);
if (NO_ERROR != rc) { if (NO_ERROR != rc) {
pprintf("CREATE_SAMPLING_PORT error %d\n", rc); printf("CREATE_SAMPLING_PORT error %d\n", rc);
} }
...@@ -114,7 +114,7 @@ int entry_func() { ...@@ -114,7 +114,7 @@ int entry_func() {
SET_PARTITION_MODE(NORMAL, &rc); SET_PARTITION_MODE(NORMAL, &rc);
if (NO_ERROR != rc) { if (NO_ERROR != rc) {
pprintf("SET_PARTITION_MODE error %d\n", rc); printf("SET_PARTITION_MODE error %d\n", rc);
} }
return RTEMS_SUCCESSFUL; return RTEMS_SUCCESSFUL;
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#include <imaspex.h> #include <imaspex.h>
#ifdef RTEMS48I #ifdef RTEMS48I
#include <pprintf.h> #include <printf.h>
#endif #endif
...@@ -59,12 +59,12 @@ void test(uintptr_t self_id) { ...@@ -59,12 +59,12 @@ void test(uintptr_t self_id) {
while(1) { while(1) {
pprintf ("Partition %d receiving message..\n", self_id); printf ("Partition %d receiving message..\n", self_id);
GET_SAMPLING_PORT_CURRENT_STATUS(RECV_PORT2, &STATUS, &rc); GET_SAMPLING_PORT_CURRENT_STATUS(RECV_PORT2, &STATUS, &rc);
if(NO_ERROR != rc) { if(NO_ERROR != rc) {
pprintf("GET_SAMPLING_PORT_CURRENT_STATUS error %d\n", rc); printf("GET_SAMPLING_PORT_CURRENT_STATUS error %d\n", rc);
} }
switch (STATUS.UPDATED) { switch (STATUS.UPDATED) {
...@@ -72,45 +72,45 @@ void test(uintptr_t self_id) { ...@@ -72,45 +72,45 @@ void test(uintptr_t self_id) {
case NEW_MESSAGE: case NEW_MESSAGE:
READ_UPDATED_SAMPLING_MESSAGE(RECV_PORT2, (MESSAGE_ADDR_TYPE)message, &SIZE, &UPDATED, &rc); READ_UPDATED_SAMPLING_MESSAGE(RECV_PORT2, (MESSAGE_ADDR_TYPE)message, &SIZE, &UPDATED, &rc);
if(NO_ERROR != rc) { if(NO_ERROR != rc) {
pprintf("READ_UPDATED_SAMPLING_MESSAGE error %d\n", rc); printf("READ_UPDATED_SAMPLING_MESSAGE error %d\n", rc);
} }
pprintf("NEW_MSG: %s\n", message); printf("NEW_MSG: %s\n", message);
break; break;
case CONSUMED_MESSAGE: case CONSUMED_MESSAGE:
READ_SAMPLING_MESSAGE(RECV_PORT2, (MESSAGE_ADDR_TYPE)message, &SIZE, &VALIDITY, &rc); READ_SAMPLING_MESSAGE(RECV_PORT2, (MESSAGE_ADDR_TYPE)message, &SIZE, &VALIDITY, &rc);
if(NO_ERROR != rc) { if(NO_ERROR != rc) {
pprintf("READ_SAMPLING_MESSAGE error %d\n", rc); printf("READ_SAMPLING_MESSAGE error %d\n", rc);
} }
switch (VALIDITY) { switch (VALIDITY) {
case INVALID: case INVALID:
pprintf("INVALID: %s\n", message); printf("INVALID: %s\n", message);
break; break;
case VALID: case VALID:
pprintf("VALID: %s\n", message); printf("VALID: %s\n", message);
break; break;
} }
break; break;
case EMPTY_PORT: case EMPTY_PORT:
message[0]='\0'; message[0]='\0';
pprintf("Empty sampling port\n"); printf("Empty sampling port\n");
break; break;
default: default:
pprintf("Error in STATUS.UPDATED value\n"); printf("Error in STATUS.UPDATED value\n");
break; break;
} }
RECEIVE_QUEUING_MESSAGE(qpid, INFINITE_TIME_VALUE, message, &len, &rc ); RECEIVE_QUEUING_MESSAGE(qpid, INFINITE_TIME_VALUE, message, &len, &rc );
if (rc == NO_ERROR) { if (rc == NO_ERROR) {
pprintf ("Received Partition Queue message %d: %s\n", self_id, message); printf ("Received Partition Queue message %d: %s\n", self_id, message);
} }
else else
{ {
pprintf("Error in Receiving Queue Message - %d\n", rc); printf("Error in Receiving Queue Message - %d\n", rc);
} }
rtems_task_wake_after(0.6*TPS); rtems_task_wake_after(0.6*TPS);
} }
...@@ -131,10 +131,10 @@ int entry_func() { ...@@ -131,10 +131,10 @@ int entry_func() {
GET_PARTITION_ID(&self_id, &rc); GET_PARTITION_ID(&self_id, &rc);
if (NO_ERROR != rc) { if (NO_ERROR != rc) {
pprintf("GET_PARTITION_ID error %d\n", rc); printf("GET_PARTITION_ID error %d\n", rc);
} }
pprintf("Initializing partition %d...\n", self_id); printf("Initializing partition %d...\n", self_id);
/*creating Destination sampling Port*/ /*creating Destination sampling Port*/
SAMPLING_PORT_NAME_TYPE NAME = "RECV_SAMP2"; SAMPLING_PORT_NAME_TYPE NAME = "RECV_SAMP2";
...@@ -144,12 +144,12 @@ int entry_func() { ...@@ -144,12 +144,12 @@ int entry_func() {
CREATE_SAMPLING_PORT (NAME, SIZE, DESTINATION, PERIOD, &RECV_PORT2, &rc); CREATE_SAMPLING_PORT (NAME, SIZE, DESTINATION, PERIOD, &RECV_PORT2, &rc);
if (NO_ERROR != rc) { if (NO_ERROR != rc) {
pprintf("CREATE_SAMPLING_PORT error %d\n", rc); printf("CREATE_SAMPLING_PORT error %d\n", rc);
} }
CREATE_QUEUING_PORT("QSAMPLE", 1024, 32, DESTINATION, FIFO, &qpid, &rc ); CREATE_QUEUING_PORT("QSAMPLE", 1024, 32, DESTINATION, FIFO, &qpid, &rc );
if(NO_ERROR != rc){ if(NO_ERROR != rc){
pprintf("CREATE_QUEUING_PORT error %d\n", rc); printf("CREATE_QUEUING_PORT error %d\n", rc);
} }
if (RTEMS_SUCCESSFUL == rtems_task_create (name, 15, 4096, mode, mode_mask, &id)) { if (RTEMS_SUCCESSFUL == rtems_task_create (name, 15, 4096, mode, mode_mask, &id)) {
...@@ -158,7 +158,7 @@ int entry_func() { ...@@ -158,7 +158,7 @@ int entry_func() {
SET_PARTITION_MODE(NORMAL, &rc); SET_PARTITION_MODE(NORMAL, &rc);
if (NO_ERROR != rc) { if (NO_ERROR != rc) {
pprintf("SET_PARTITION_MODE error %d\n", rc); printf("SET_PARTITION_MODE error %d\n", rc);
} }
return RTEMS_SUCCESSFUL; return RTEMS_SUCCESSFUL;
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#include <imaspex.h> #include <imaspex.h>
#ifdef RTEMS48I #ifdef RTEMS48I
#include <pprintf.h> #include <printf.h>
#endif #endif
...@@ -40,10 +40,10 @@ void test(uintptr_t self_id) { ...@@ -40,10 +40,10 @@ void test(uintptr_t self_id) {
RETURN_CODE_TYPE rc; RETURN_CODE_TYPE rc;
while(1) { while(1) {
pprintf ("Partition %d sending: %s..\n", self_id, message); printf ("Partition %d sending: %s..\n", self_id, message);
WRITE_SAMPLING_MESSAGE (SEND_PORT, (MESSAGE_ADDR_TYPE )message, 16, &rc ); WRITE_SAMPLING_MESSAGE (SEND_PORT, (MESSAGE_ADDR_TYPE )message, 16, &rc );
if (NO_ERROR != rc) { if (NO_ERROR != rc) {
pprintf("WRITE_SAMPLING_MESSAGE error %d\n", rc); printf("WRITE_SAMPLING_MESSAGE error %d\n", rc);
} }
/*identify the string with an integer index*/ /*identify the string with an integer index*/
...@@ -53,10 +53,10 @@ void test(uintptr_t self_id) { ...@@ -53,10 +53,10 @@ void test(uintptr_t self_id) {
} }
message[15] = 0x30 + i; message[15] = 0x30 + i;
pprintf ("Partition %d sending queuing: %s..\n", self_id, message); printf ("Partition %d sending queuing: %s..\n", self_id, message);
SEND_QUEUING_MESSAGE(qpid, (MESSAGE_ADDR_TYPE )message, 16, INFINITE_TIME_VALUE, &rc ); SEND_QUEUING_MESSAGE(qpid, (MESSAGE_ADDR_TYPE )message, 16, INFINITE_TIME_VALUE, &rc );
if (rc != NO_ERROR) { if (rc != NO_ERROR) {
pprintf ("SEND_QUEUING_MESSAGE error %d\n", rc); printf ("SEND_QUEUING_MESSAGE error %d\n", rc);
} }
/*identify the string with an integer index*/ /*identify the string with an integer index*/
...@@ -88,10 +88,10 @@ int entry_func() { ...@@ -88,10 +88,10 @@ int entry_func() {
/*Getting my own partition id*/ /*Getting my own partition id*/
GET_PARTITION_ID(&self_id, &rc); GET_PARTITION_ID(&self_id, &rc);
if(NO_ERROR != rc) { if(NO_ERROR != rc) {
pprintf("GET_PARTITION_ID error %d\n", rc); printf("GET_PARTITION_ID error %d\n", rc);
} }
pprintf("Initializing partition %d...\n", self_id); printf("Initializing partition %d...\n", self_id);
/*Creating Source sampling Port*/ /*Creating Source sampling Port*/
...@@ -101,13 +101,13 @@ int entry_func() { ...@@ -101,13 +101,13 @@ int entry_func() {
CREATE_SAMPLING_PORT (NAME, SIZE, SOURCE, PERIOD, &SEND_PORT, &rc); CREATE_SAMPLING_PORT (NAME, SIZE, SOURCE, PERIOD, &SEND_PORT, &rc);
if (NO_ERROR != rc) { if (NO_ERROR != rc) {
pprintf("CREATE_SAMPLING_PORT error %d\n", rc); printf("CREATE_SAMPLING_PORT error %d\n", rc);
} }
/* Creating Queueing port */ /* Creating Queueing port */
CREATE_QUEUING_PORT("QSAMPLE", 1024, 32, SOURCE, FIFO, &qpid, &rc ); CREATE_QUEUING_PORT("QSAMPLE", 1024, 32, SOURCE, FIFO, &qpid, &rc );
if(NO_ERROR != rc){ if(NO_ERROR != rc){
pprintf("CREATE_QUEUING_PORT error %d\n", rc); printf("CREATE_QUEUING_PORT error %d\n", rc);
} }
...@@ -117,7 +117,7 @@ int entry_func() { ...@@ -117,7 +117,7 @@ int entry_func() {
SET_PARTITION_MODE(NORMAL, &rc); SET_PARTITION_MODE(NORMAL, &rc);
if (NO_ERROR != rc) { if (NO_ERROR != rc) {
pprintf("SET_PARTITION_MODE error %d\n", rc); printf("SET_PARTITION_MODE error %d\n", rc);
} }
return RTEMS_SUCCESSFUL; return RTEMS_SUCCESSFUL;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment