Files
codezero/tasks/test0/main.c
Bahadir Balban f29c18ec09 Fixed various errors with ipc message passing.
Previously we had changed the method of setting the ipc tag from l4_ipc() call
argument to being passed as a message register.

- This change was not reflected in l4_ipc() signature as it still had a 3rd argument,
  even though ignored.

- l4_set_sender and _set_tag had their arguments wrong way around.
- Previously 5 mrs were passed onto utcb instead of 6, relying on the fact that
  l4_ipc tag argument was being passed in r3 directly, this wasnt true anymore
  with new convention, but wasn't catered for.

TODO:
- MM0 shouldn't really allocate tids itself, but use ones supplied by C0.
- Sender tid shouldn't really passed by the sender task, but rather by C0. Otherwise
  security can be easily breached by user tasks pretending to be other tasks. This
  would also save us a message register.
2008-02-06 12:26:31 +00:00

42 lines
753 B
C

/*
* Some tests for posix syscalls.
*
* Copyright (C) 2007 Bahadir Balban
*/
#include <stdio.h>
#include <string.h>
#include <l4lib/arch/message.h>
#include <l4lib/arch/syslib.h>
#include <l4lib/kip.h>
#include <l4lib/utcb.h>
#include <l4lib/ipcdefs.h>
#include <tests.h>
#define __TASKNAME__ "test0"
void wait_pager(l4id_t partner)
{
printf("%s: Syncing with pager.\n", __TASKNAME__);
for (int i = 0; i < 6; i++)
write_mr(i, i);
l4_send(partner, L4_IPC_TAG_WAIT);
printf("Pager synced with us.\n");
}
void main(void)
{
printf("\n%s: Started with tid %d.\n", __TASKNAME__, self_tid());
/* Sync with pager */
while (1)
wait_pager(0);
#if 0
/* Check mmap/munmap */
mmaptest();
/* Check shmget/shmat/shmdt */
shmtest();
#endif
}