This example shows how to send IPC using the UTCB to store payload.
#include <l4/sys/ipc.h>
#include <l4/sys/thread.h>
#include <l4/sys/utcb.h>
#include <stdio.h>
static unsigned char stack2[8 << 10];
static void thread1(void)
{
int i, j;
printf(
"Thread1 up (%p)\n",
l4_utcb());
for (i = 0; i < 10; i++)
{
mr->
mr[j] =
'A' + (i + j) % (
'~' -
'A' + 1);
tag =
l4_msgtag(0, L4_UTCB_GENERIC_DATA_SIZE, 0, 0);
printf("IPC-send error\n");
}
}
L4UTIL_THREAD_STATIC_FUNC(thread2)
{
unsigned i;
printf(
"Thread2 up (%p)\n",
l4_utcb());
while (1)
{
printf("IPC receive error\n");
printf(
"%c", (
char)mr.
mr[i]);
printf("\n");
}
__builtin_trap();
}
int main(void)
{
return 1;
return 1;
L4RE_THIS_TASK_CAP);
return 2;
return 3;
return 4;
thread1();
return 0;
}