Commit 59b7a913 authored by Laura Alexandra Sequeira Gouveia's avatar Laura Alexandra Sequeira Gouveia

Merge branch 'master' into TASTE

parents 58954e61 05ab54d3
......@@ -4,7 +4,7 @@
<!-- Partition 0 -->
<Partition PartitionIdentifier="1" PartitionName="part0"
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>
<Devices></Devices>
<Cache>CODE; DATA</Cache>
......
......@@ -6,7 +6,7 @@
<Partition PartitionIdentifier="1" PartitionName="p0" Criticality="LEVEL_A" SystemPartition="true" EntryPoint="producer">
<Sampling_Port Direction="SOURCE" MaxMessageSize="32" Name="SEND_SAMP1" RefreshRateSeconds="1.000"/>
<Sampling_Port Direction="DESTINATION" MaxMessageSize="32" Name="RECV_SAMP1" RefreshRateSeconds="1.000"/>
<PartitionConfiguration Personality="RTEMS48I" Cores="1" Mode="binary">
<PartitionConfiguration Personality="RTEMS5" Cores="1" Mode="binary">
<Libs>LIBAIR;IMASPEX;LIBPRINTF</Libs>
<Cache>CODE; DATA</Cache>
<Memory Size="0x500000" />
......@@ -20,7 +20,7 @@
<Partition PartitionIdentifier="2" PartitionName="p1" Criticality="LEVEL_A" SystemPartition="true" EntryPoint="receiver">
<Sampling_Port Direction="SOURCE" MaxMessageSize="32" Name="SEND_SAMP2" RefreshRateSeconds="1.000"/>
<Sampling_Port Direction="DESTINATION" MaxMessageSize="32" Name="RECV_SAMP2" RefreshRateSeconds="1.000"/>
<PartitionConfiguration Personality="RTEMS48I" Cores="1" Mode="binary">
<PartitionConfiguration Personality="RTEMS5" Cores="1" Mode="binary">
<Libs>LIBAIR; IMASPEX; LIBPRINTF</Libs>
<Cache>CODE; DATA</Cache>
<Memory Size="0x500000" />
......
......@@ -15,10 +15,6 @@
#include <rtems/cpuuse.h>
#include <a653.h>
#include <imaspex.h>
#include <pprintf.h>
SAMPLING_PORT_ID_TYPE SEND_PORT;
......@@ -39,7 +35,7 @@ void test2(PARTITION_ID_TYPE self_id) {
status= rtems_rate_monotonic_create( name_1, &period_1 );
status= rtems_rate_monotonic_create( name_2, &period_2 );
if( RTEMS_SUCCESSFUL != status ) {
pprintf("create failed with status: %d\n", status);
printf("create failed with status: %d\n", status);
}
......@@ -48,25 +44,25 @@ void test2(PARTITION_ID_TYPE self_id) {
status = rtems_rate_monotonic_period( period_1, 100 );
if( RTEMS_SUCCESSFUL != status ) {
pprintf("RM failed with status: %d\n", status);
printf("RM failed with status: %d\n", status);
}
status = rtems_rate_monotonic_period( period_2, 40 );
if( RTEMS_SUCCESSFUL != status ) {
pprintf("RM failed with status: %d\n", status);
printf("RM failed with status: %d\n", status);
}
pprintf(" * Perform first set of actions between clock * ticks 0 and 39 of every 100 ticks. \n");
printf(" * Perform first set of actions between clock * ticks 0 and 39 of every 100 ticks. \n");
status = rtems_rate_monotonic_period( period_2, 30 );
if( RTEMS_SUCCESSFUL != status ) {
pprintf("RM2 failed with status: %d\n", status);
printf("RM2 failed with status: %d\n", status);
}
pprintf(" Perform second set of actions between clock 40 and 69 iss the period_2 period. \n");
printf(" Perform second set of actions between clock 40 and 69 iss the period_2 period. \n");
(void) rtems_rate_monotonic_cancel( period_2 );
......@@ -95,14 +91,14 @@ int producer() {
/*Getting my own partition id*/
GET_PARTITION_ID(&self_id, &rc);
if(NO_ERROR != rc) {
//pprintf("GET_PARTITION_ID error %d\n", rc);
//printf("GET_PARTITION_ID error %d\n", rc);
}
//for (;;)
//{
pprintf("In partition PO loop t20\n");
printf("In partition PO loop t20\n");
rtems_task_wake_after(20);
pprintf("P0 : Waking up\n");
printf("P0 : Waking up\n");
//}
/*Creating Source sampling Port */
......@@ -112,7 +108,7 @@ int producer() {
CREATE_SAMPLING_PORT (NAME, SIZE, SOURCE, PERIOD, &SEND_PORT, &rc);
if (NO_ERROR != rc) {
pprintf("CREATE_SAMPLING_PORT error %d\n", rc);
printf("CREATE_SAMPLING_PORT error %d\n", rc);
}
......@@ -122,7 +118,7 @@ int producer() {
SET_PARTITION_MODE(NORMAL, &rc);
if (NO_ERROR != rc) {
pprintf("SET_PARTITION_MODE error %d\n", rc);
printf("SET_PARTITION_MODE error %d\n", rc);
}
return RTEMS_SUCCESSFUL;
......
......@@ -16,8 +16,6 @@
#include <a653.h>
#include <imaspex.h>
#include <pprintf.h>
......@@ -35,18 +33,18 @@ void test(PARTITION_ID_TYPE self_id) {
/* get the number of ticks per second */
int tps = 1000000 / xky_syscall_get_us_per_tick();
pprintf("P1: TPS %i\n", tps);
printf("P1: TPS %i\n", tps);
RETURN_CODE_TYPE rc = NO_ERROR;
//while(1) {
//pprintf ("P1:Partition %d with message: %s..\n", self_id, message);
//printf ("P1:Partition %d with message: %s..\n", self_id, message);
/*
WRITE_SAMPLING_MESSAGE (SEND_PORT, (MESSAGE_ADDR_TYPE )message, 17, &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*/
......@@ -77,14 +75,14 @@ int receiver() {
/*Getting my own partition id*/
GET_PARTITION_ID(&self_id, &rc);
if(NO_ERROR != rc) {
//pprintf("GET_PARTITION_ID error %d\n", rc);
//printf("GET_PARTITION_ID error %d\n", rc);
}
for (;;)
{
pprintf("In partition P1 loop t20\n");
printf("In partition P1 loop t20\n");
rtems_task_wake_after(20);
pprintf("P1 : Waking up\n");
printf("P1 : Waking up\n");
}
/*Creating Source sampling Port
......@@ -94,7 +92,7 @@ int receiver() {
CREATE_SAMPLING_PORT (NAME, SIZE, SOURCE, PERIOD, &SEND_PORT, &rc);
if (NO_ERROR != rc) {
pprintf("CREATE_SAMPLING_PORT error %d\n", rc);
printf("CREATE_SAMPLING_PORT error %d\n", rc);
}
......@@ -104,7 +102,7 @@ int receiver() {
SET_PARTITION_MODE(NORMAL, &rc);
if (NO_ERROR != rc) {
pprintf("SET_PARTITION_MODE error %d\n", rc);
printf("SET_PARTITION_MODE error %d\n", rc);
}
*/
return RTEMS_SUCCESSFUL;
......
......@@ -8,7 +8,7 @@
Direction="SOURCE" MaxMessageSize="1024" RefreshRateSeconds="1.5"/>
<Queuing_Port Name="QSAMPLE"
Direction="SOURCE" MaxMessageSize="1024" MaxNbMessages="32" />
<PartitionConfiguration Personality="RTEMS48I" Cores="1">
<PartitionConfiguration Personality="RTEMS5" Cores="1">
<Libs>LIBAIR; IMASPEX; LIBPRINTF</Libs>
<Devices></Devices>
<Cache>CODE; DATA</Cache>
......@@ -24,7 +24,7 @@
Criticality="LEVEL_A" EntryPoint="entry_func" SystemPartition="false">
<Sampling_Port Name="RECV_SAMP"
Direction="DESTINATION" MaxMessageSize="1024" RefreshRateSeconds="1.5"/>
<PartitionConfiguration Personality="RTEMS48I" Cores="1">
<PartitionConfiguration Personality="RTEMS5" Cores="1">
<Libs>LIBAIR; IMASPEX; LIBPRINTF</Libs>
<Devices></Devices>
<Cache>CODE; DATA</Cache>
......@@ -42,7 +42,7 @@
Direction="DESTINATION" MaxMessageSize="1024" RefreshRateSeconds="1.5"/>
<Queuing_Port Name="QSAMPLE"
Direction="DESTINATION" MaxMessageSize="1024" MaxNbMessages="32" />
<PartitionConfiguration Personality="RTEMS48I" Cores="1">
<PartitionConfiguration Personality="RTEMS5" Cores="1">
<Libs>LIBAIR; IMASPEX; LIBPRINTF</Libs>
<Devices></Devices>
<Cache>CODE; DATA</Cache>
......
......@@ -17,7 +17,7 @@
#include <air.h>
#ifdef RTEMS48I
#include <pprintf.h>
#include <printf.h>
#endif
......@@ -47,24 +47,24 @@ void test(PARTITION_ID_TYPE self_id) {
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*/
READ_SAMPLING_MESSAGE_CONDITIONAL(RECV_PORT, REF_TIME_STAMP, (MESSAGE_ADDR_TYPE)message, &SIZE, &TIME_STAMP, &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)) {
pprintf("Empty Sampling Port\n");
printf("Empty Sampling Port\n");
}
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) {
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 {
pprintf("Unexpected READ_SAMPLING_MESSAGE_CONDITIONAL behavior\n");
printf("Unexpected READ_SAMPLING_MESSAGE_CONDITIONAL behavior\n");
}
......@@ -91,10 +91,10 @@ int entry_func() {
/*Getting my own ID*/
GET_PARTITION_ID(&self_id, &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*/
SAMPLING_PORT_NAME_TYPE NAME = "RECV_SAMP";
......@@ -104,7 +104,7 @@ int entry_func() {
CREATE_SAMPLING_PORT (NAME, SIZE, DESTINATION, PERIOD, &RECV_PORT, &rc);
if (NO_ERROR != rc) {
pprintf("CREATE_SAMPLING_PORT error %d\n", rc);
printf("CREATE_SAMPLING_PORT error %d\n", rc);
}
......@@ -115,7 +115,7 @@ int entry_func() {
SET_PARTITION_MODE(NORMAL, &rc);
if (NO_ERROR != rc) {
pprintf("SET_PARTITION_MODE error %d\n", rc);
printf("SET_PARTITION_MODE error %d\n", rc);
}
return RTEMS_SUCCESSFUL;
......
......@@ -17,7 +17,7 @@
#include <air.h>
#ifdef RTEMS48I
#include <pprintf.h>
#include <printf.h>
#endif
......@@ -60,12 +60,12 @@ void test(PARTITION_ID_TYPE self_id) {
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);
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) {
......@@ -73,45 +73,45 @@ void test(PARTITION_ID_TYPE self_id) {
case NEW_MESSAGE:
READ_UPDATED_SAMPLING_MESSAGE(RECV_PORT2, (MESSAGE_ADDR_TYPE)message, &SIZE, &UPDATED, &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;
case CONSUMED_MESSAGE:
READ_SAMPLING_MESSAGE(RECV_PORT2, (MESSAGE_ADDR_TYPE)message, &SIZE, &VALIDITY, &rc);
if(NO_ERROR != rc) {
pprintf("READ_SAMPLING_MESSAGE error %d\n", rc);
printf("READ_SAMPLING_MESSAGE error %d\n", rc);
}
switch (VALIDITY) {
case INVALID:
pprintf("INVALID: %s\n", message);
printf("INVALID: %s\n", message);
break;
case VALID:
pprintf("VALID: %s\n", message);
printf("VALID: %s\n", message);
break;
}
break;
case EMPTY_PORT:
message[0]='\0';
pprintf("Empty sampling port\n");
printf("Empty sampling port\n");
break;
default:
pprintf("Error in STATUS.UPDATED value\n");
printf("Error in STATUS.UPDATED value\n");
break;
}
RECEIVE_QUEUING_MESSAGE(qpid, INFINITE_TIME_VALUE, message, &len, &rc );
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
{
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);
}
......@@ -132,10 +132,10 @@ int entry_func() {
GET_PARTITION_ID(&self_id, &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*/
SAMPLING_PORT_NAME_TYPE NAME = "RECV_SAMP2";
......@@ -145,12 +145,12 @@ int entry_func() {
CREATE_SAMPLING_PORT (NAME, SIZE, DESTINATION, PERIOD, &RECV_PORT2, &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 );
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)) {
......@@ -159,7 +159,7 @@ int entry_func() {
SET_PARTITION_MODE(NORMAL, &rc);
if (NO_ERROR != rc) {
pprintf("SET_PARTITION_MODE error %d\n", rc);
printf("SET_PARTITION_MODE error %d\n", rc);
}
return RTEMS_SUCCESSFUL;
......
......@@ -17,7 +17,7 @@
#include <air.h>
#ifdef RTEMS48I
#include <pprintf.h>
#include <printf.h>
#endif
......@@ -41,10 +41,10 @@ void test(PARTITION_ID_TYPE self_id) {
RETURN_CODE_TYPE rc;
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 );
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*/
......@@ -54,10 +54,10 @@ void test(PARTITION_ID_TYPE self_id) {
}
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 );
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*/
......@@ -89,10 +89,10 @@ int entry_func() {
/*Getting my own partition id*/
GET_PARTITION_ID(&self_id, &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*/
......@@ -102,13 +102,13 @@ int entry_func() {
CREATE_SAMPLING_PORT (NAME, SIZE, SOURCE, PERIOD, &SEND_PORT, &rc);
if (NO_ERROR != rc) {
pprintf("CREATE_SAMPLING_PORT error %d\n", rc);
printf("CREATE_SAMPLING_PORT error %d\n", rc);
}
/* Creating Queueing port */
CREATE_QUEUING_PORT("QSAMPLE", 1024, 32, SOURCE, FIFO, &qpid, &rc );
if(NO_ERROR != rc){
pprintf("CREATE_QUEUING_PORT error %d\n", rc);
printf("CREATE_QUEUING_PORT error %d\n", rc);
}
......@@ -118,7 +118,7 @@ int entry_func() {
SET_PARTITION_MODE(NORMAL, &rc);
if (NO_ERROR != rc) {
pprintf("SET_PARTITION_MODE error %d\n", rc);
printf("SET_PARTITION_MODE error %d\n", rc);
}
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