From 9eb55156419f95380578d7d30ce732a472697151 Mon Sep 17 00:00:00 2001 From: Amit Mahajan Date: Mon, 30 Nov 2009 18:36:29 +0530 Subject: [PATCH] Timer container sleep ipc definition added --- conts/baremetal/baremetal5/main.c | 18 +++++++++++++++++- conts/libl4/include/l4lib/ipcdefs.h | 2 +- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/conts/baremetal/baremetal5/main.c b/conts/baremetal/baremetal5/main.c index 7b8d6a3..c95c7f8 100644 --- a/conts/baremetal/baremetal5/main.c +++ b/conts/baremetal/baremetal5/main.c @@ -231,8 +231,16 @@ int timer_gettime(int devno) return sp804_read_value(timer[devno].base); } +void timer_sleep(int sec) +{ + /* + * TODO: We need to have a timer struct already present to be used + * as reference for us. to implement this call + */ +} void handle_requests(void) { + u32 mr[MR_UNUSED_TOTAL]; l4id_t senderid; u32 tag; int ret; @@ -247,7 +255,11 @@ void handle_requests(void) /* Syslib conventional ipc data which uses first few mrs. */ tag = l4_get_tag(); senderid = l4_get_sender(); - + + /* Read mrs not used by syslib */ + for (int i = 0; i < MR_UNUSED_TOTAL; i++) + mr[i] = read_mr(MR_UNUSED_START + i); + /* * TODO: * @@ -264,6 +276,10 @@ void handle_requests(void) timer_gettime(1); break; + case L4_IPC_TAG_TIMER_SLEEP: + timer_sleep(mr[0]); + break; + default: printf("%s: Error received ipc from 0x%x residing " "in container %x with an unrecognized tag: " diff --git a/conts/libl4/include/l4lib/ipcdefs.h b/conts/libl4/include/l4lib/ipcdefs.h index bd94f72..554d328 100644 --- a/conts/libl4/include/l4lib/ipcdefs.h +++ b/conts/libl4/include/l4lib/ipcdefs.h @@ -74,6 +74,6 @@ extern l4id_t pagerid; /* For ipc to timer service (TODO: Shared mapping buffers???) */ #define L4_IPC_TAG_TIMER_GETTIME 55 - +#define L4_IPC_TAG_TIMER_SLEEP 56 #endif /* __IPCDEFS_H__ */