URL
https://opencores.org/ocsvn/or1k/or1k/trunk
Go to most recent revision |
Show entire file |
Details |
Blame |
View Log
Rev 222 |
Rev 997 |
Line 14... |
Line 14... |
struct _msg {
|
struct _msg {
|
char id;
|
char id;
|
unsigned long count;
|
unsigned long count;
|
} msg;
|
} msg;
|
|
|
printf("Task %d started\n", id);
|
PRINTF("Task %d started\n", id);
|
|
|
if(id == 1) {
|
if(id == 1) {
|
msg.id = 1;
|
msg.id = 1;
|
msg.count = 0;
|
msg.count = 0;
|
uos_msgsnd(2, (char *)&msg, sizeof(msg));
|
uos_msgsnd(2, (char *)&msg, sizeof(msg));
|
Line 26... |
Line 26... |
|
|
for(;;) {
|
for(;;) {
|
rc = uos_msgrcv(0, (char *)&msg, sizeof(msg));
|
rc = uos_msgrcv(0, (char *)&msg, sizeof(msg));
|
|
|
if(rc != 0) {
|
if(rc != 0) {
|
printf("Task %d: Waiting for massage\n", id);
|
PRINTF("Task %d: Waiting for massage\n", id);
|
} else {
|
} else {
|
printf("Task %d: Got massage from task %d: 0x%.8x. Sending message to task %d: 0x%.8x \n", id, msg.id, (int)msg.count, (id == 3 ? 1 : (id + 1)), (int)(msg.count + 1));
|
PRINTF("Task %d: Got massage from task %d: 0x%.8x. Sending message to task %d: 0x%.8x \n", id, msg.id, (int)msg.count, (id == 3 ? 1 : (id + 1)), (int)(msg.count + 1));
|
msg.id = id;
|
msg.id = id;
|
|
|
if((id == 1) && (msg.count > 15)) {
|
if((id == 1) && (msg.count > 15)) {
|
report(msg.count + 0xdeadde9c);
|
report(msg.count + 0xdeadde9c);
|
exit(0);
|
exit(0);
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.