From b9362985e0ba81d7f89e0892f70193c6f9a9c0b7 Mon Sep 17 00:00:00 2001 From: Amit Mahajan Date: Mon, 30 Nov 2009 16:07:36 +0530 Subject: [PATCH 1/3] Typos' in Bahadir's repo corrected, we are in good shape now and in sync with bahadir's latest devel branch --- conts/baremetal/baremetal4/main.c | 4 +++- conts/baremetal/baremetal5/main.c | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/conts/baremetal/baremetal4/main.c b/conts/baremetal/baremetal4/main.c index fd3e810..c424bf5 100644 --- a/conts/baremetal/baremetal4/main.c +++ b/conts/baremetal/baremetal4/main.c @@ -149,8 +149,10 @@ int cap_read_all() "complete CAP_CONTROL_READ_CAPS request.\n"); BUG(); } - +#if 0 cap_array_print(&caparray); +#endif + return 0; } diff --git a/conts/baremetal/baremetal5/main.c b/conts/baremetal/baremetal5/main.c index a22b289..7b8d6a3 100644 --- a/conts/baremetal/baremetal5/main.c +++ b/conts/baremetal/baremetal5/main.c @@ -75,6 +75,11 @@ void cap_print(struct capability *cap) printf("Capability type:\t\t%s\n", "Mutex"); break; case CAP_TYPE_IRQCTRL: + printf("Capability resource type:\t%s\n", "IRQ"); + break; + } +} + void cap_array_print() { printf("Capabilities\n" From 438fd780f8c36e2bca9db44688164dec24de48c1 Mon Sep 17 00:00:00 2001 From: Amit Mahajan Date: Mon, 30 Nov 2009 18:26:05 +0530 Subject: [PATCH 2/3] MR register handling added in UART service --- conts/baremetal/baremetal4/main.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/conts/baremetal/baremetal4/main.c b/conts/baremetal/baremetal4/main.c index c424bf5..6152910 100644 --- a/conts/baremetal/baremetal4/main.c +++ b/conts/baremetal/baremetal4/main.c @@ -274,6 +274,7 @@ char uart_generic_rx(int devno) void handle_requests(void) { + u32 mr[MR_UNUSED_TOTAL]; l4id_t senderid; u32 tag; int ret; @@ -289,6 +290,10 @@ void handle_requests(void) 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: * @@ -300,12 +305,18 @@ void handle_requests(void) * the request should (currently) come from a task * inside the current container */ + + /* + * FIXME: Right now we are talking to UART1 by default, we need to define protocol + * for sommunication with UART service + */ switch (tag) { case L4_IPC_TAG_UART_SENDCHAR: - uart_generic_tx(0, 1); /*FIXME: Fill in */ + printf("got L4_IPC_TAG_UART_SENDCHAR with char %d\n ", mr[0]); + uart_generic_tx((char)mr[0], 0); break; case L4_IPC_TAG_UART_RECVCHAR: - uart_generic_rx(1); /* FIXME: Fill in */ + mr[0] = (int)uart_generic_rx(0); break; default: printf("%s: Error received ipc from 0x%x residing " From 9eb55156419f95380578d7d30ce732a472697151 Mon Sep 17 00:00:00 2001 From: Amit Mahajan Date: Mon, 30 Nov 2009 18:36:29 +0530 Subject: [PATCH 3/3] 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__ */