diff --git a/include/l4/api/ipc.h b/include/l4/api/ipc.h index 9b75fa3..aa659f2 100644 --- a/include/l4/api/ipc.h +++ b/include/l4/api/ipc.h @@ -7,24 +7,15 @@ #define L4_IPC_TAG_MR_OFFSET 0 - -/* To synchronise two threads */ -#define L4_IPC_TAG_WAIT 0 - /* Pagefault */ -#define L4_IPC_TAG_PFAULT 2 +#define L4_IPC_TAG_PFAULT 0 -#if defined (__KERNEL__) /* These are kernel internal calls */ -/* A helper call for sys_ipc() or internally created ipc paths. */ +#if defined (__KERNEL__) + +/* These are for internally created ipc paths. */ int ipc_send(l4id_t to); int ipc_sendrecv(l4id_t to, l4id_t from); -/* - * This version sends an extra wait ipc to its receiver so that - * the receiver can explicitly make it runnable later by accepting - * this wait ipc. - */ -int ipc_sendwait(l4id_t tid); #endif #endif /* __IPC_H__ */ diff --git a/include/l4/generic/space.h b/include/l4/generic/space.h index 085a19a..cca33bb 100644 --- a/include/l4/generic/space.h +++ b/include/l4/generic/space.h @@ -18,6 +18,8 @@ #define MAP_SVC_DEFAULT_FLAGS MAP_SVC_RW_FLAGS #define MAP_IO_DEFAULT_FLAGS MAP_SVC_IO_FLAGS +#if defined (__KERNEL__) int check_access(unsigned long vaddr, unsigned long size, unsigned int flags); +#endif #endif /* __SPACE_H__ */ diff --git a/src/api/ipc.c b/src/api/ipc.c index 79e45a1..ab211b5 100644 --- a/src/api/ipc.c +++ b/src/api/ipc.c @@ -139,20 +139,6 @@ int ipc_recv(l4id_t senderid) return 0; } -/* FIXME: REMOVE: remove this completely and replace by ipc_sendrecv() */ -int ipc_sendwait(l4id_t to) -{ - unsigned int *mregs = KTCB_REF_MR0(current); - - /* Send actual message */ - ipc_send(to); - - /* Send wait message */ - mregs[L4_IPC_TAG_MR_OFFSET] = L4_IPC_TAG_WAIT; - ipc_send(to); - return 0; -} - /* * Both sends and receives mregs in the same call. This is mainly by user * tasks for client server communication with system servers. diff --git a/src/arch/arm/exception.c b/src/arch/arm/exception.c index a7b469f..9bd4f73 100644 --- a/src/arch/arm/exception.c +++ b/src/arch/arm/exception.c @@ -22,7 +22,7 @@ * for all ipc parties. */ #define MR_TAG 0 -#define MR_SENDERID 1 +#define MR_SENDER 1 #define MR_UNUSED_START 2 /* Send data fault ipc to the faulty task's pager */ @@ -30,7 +30,7 @@ void fault_ipc_to_pager(u32 faulty_pc, u32 fsr, u32 far) { /* mr[0] has the fault tag. The rest is the fault structure */ u32 mr[MR_TOTAL] = { [MR_TAG] = L4_IPC_TAG_PFAULT, - [MR_SENDERID] = current->tid }; + [MR_SENDER] = current->tid }; fault_kdata_t *fault = (fault_kdata_t *)&mr[MR_UNUSED_START]; /* Fill in fault information to pass over during ipc */ diff --git a/tasks/fs0/main.c b/tasks/fs0/main.c index 4887467..02e90da 100644 --- a/tasks/fs0/main.c +++ b/tasks/fs0/main.c @@ -71,7 +71,8 @@ void handle_fs_requests(void) void main(void) { - // printf("\n%s: Started.\n", __FUNCTION__); + printf("\n\n%s: Started.\n", __TASKNAME__); + initialise(); wait_pager(PAGER_TID); diff --git a/tasks/libl4/include/l4lib/ipcdefs.h b/tasks/libl4/include/l4lib/ipcdefs.h index 356d003..43b80ae 100644 --- a/tasks/libl4/include/l4lib/ipcdefs.h +++ b/tasks/libl4/include/l4lib/ipcdefs.h @@ -18,7 +18,7 @@ /*** IPC Tags used between server tasks ***/ /* For ping ponging */ -#define L4_IPC_TAG_PINGPONG 3 +#define L4_IPC_TAG_WAIT 3 /* To negotiate a shared memory mapping */ #define L4_IPC_TAG_SHM 4 diff --git a/tasks/mm0/main.c b/tasks/mm0/main.c index c6fa51d..9f6d225 100644 --- a/tasks/mm0/main.c +++ b/tasks/mm0/main.c @@ -104,8 +104,8 @@ void handle_requests(void) break; } default: - printf("%s: Unrecognised ipc tag (%d)" - "received. Ignoring.\n", __TASKNAME__, mr[MR_TAG]); + printf("%s: Unrecognised ipc tag (%d) " + "received. Ignoring.\n", __TASKNAME__, tag); } } diff --git a/tasks/test0/main.c b/tasks/test0/main.c index ac854c2..576110b 100644 --- a/tasks/test0/main.c +++ b/tasks/test0/main.c @@ -9,28 +9,31 @@ #include #include #include -#include +#include #include #define __TASKNAME__ "test0" void wait_pager(l4id_t partner) { - u32 tag = L4_IPC_TAG_WAIT; printf("%s: Syncing with pager.\n", __TASKNAME__); - l4_send(partner, tag); + l4_send(partner, L4_IPC_TAG_WAIT); printf("Pager synced with us.\n"); } void main(void) { + printf("\n%s: Started.\n", __TASKNAME__); /* Sync with pager */ - wait_pager(0); + while (1) + wait_pager(0); +#if 0 /* Check mmap/munmap */ mmaptest(); /* Check shmget/shmat/shmdt */ shmtest(); +#endif }