diff --git a/config/caps.py b/config/caps.py index 3e12e43..25a0a1e 100644 --- a/config/caps.py +++ b/config/caps.py @@ -144,14 +144,15 @@ cap_strings = { 'ipc' : \ \t\t\t[${idx}] = { \t\t\t\t/* For device selection */ \t\t\t\t.target = ${cid}, -\t\t\t\t.attr = (CAP_DEVTYPE_${devtype} & CAP_DEVTYPE_MASK) -\t\t\t\t\t| ((${devnum} << CAP_DEVNUM_SHIFT) & CAP_DEVNUM_MASK), \t\t\t\t.type = CAP_TYPE_MAP_PHYSMEM | CAP_RTYPE_CONTAINER, \t\t\t\t.access = CAP_MAP_READ | CAP_MAP_WRITE | CAP_MAP_EXEC | \t\t\t\t\tCAP_MAP_CACHED | CAP_MAP_UNCACHED | CAP_MAP_UNMAP, \t\t\t\t.start = __pfn(PLATFORM_${devname}_BASE), \t\t\t\t.end = __pfn(PLATFORM_${devname}_BASE + PLATFORM_${devname}_SIZE), \t\t\t\t.size = 1, +\t\t\t\t.attr = (CAP_DEVTYPE_${devtype} & CAP_DEVTYPE_MASK) +\t\t\t\t\t| ((${devnum} << CAP_DEVNUM_SHIFT) & CAP_DEVNUM_MASK), +\t\t\t\t.irq = IRQ_${devname}, \t\t\t}, ''' } diff --git a/include/l4/platform/pb926/irq.h b/include/l4/platform/pb926/irq.h index 1aef880..b336fec 100644 --- a/include/l4/platform/pb926/irq.h +++ b/include/l4/platform/pb926/irq.h @@ -34,9 +34,9 @@ #define SIC_IRQ_SWI 0 #define SIC_IRQ_UART3 6 -/* Global irq numbers */ -#define IRQ_TIMER01 (VIC_IRQ_TIMER01 + VIC_CHIP_OFFSET) -#define IRQ_TIMER23 (VIC_IRQ_TIMER23 + VIC_CHIP_OFFSET) +/* Global irq numbers, note these should reflect global device names */ +#define IRQ_TIMER0 (VIC_IRQ_TIMER01 + VIC_CHIP_OFFSET) +#define IRQ_TIMER1 (VIC_IRQ_TIMER23 + VIC_CHIP_OFFSET) #define IRQ_RTC (VIC_IRQ_RTC + VIC_CHIP_OFFSET) #define IRQ_UART0 (VIC_IRQ_UART0 + VIC_CHIP_OFFSET) #define IRQ_UART1 (VIC_IRQ_UART1 + VIC_CHIP_OFFSET) diff --git a/include/l4/platform/pb926/platform.h b/include/l4/platform/pb926/platform.h index 035f26a..c4e5868 100644 --- a/include/l4/platform/pb926/platform.h +++ b/include/l4/platform/pb926/platform.h @@ -18,6 +18,7 @@ /* SP804 timer has TIMER1 at TIMER0 + 0x20 address */ #define PLATFORM_TIMER0_BASE PB926_TIMER01_BASE + /* Total number of timers present in this platform */ #define TOTAL_TIMERS 4 diff --git a/scripts/kernel/generate_kernel_cinfo.py b/scripts/kernel/generate_kernel_cinfo.py index 4e07b98..180b55b 100755 --- a/scripts/kernel/generate_kernel_cinfo.py +++ b/scripts/kernel/generate_kernel_cinfo.py @@ -30,6 +30,7 @@ cinfo_file_start = \ #include #include #include INC_PLAT(platform.h) +#include INC_PLAT(irq.h) %s diff --git a/src/api/ipc.c b/src/api/ipc.c index 6e91366..4a32056 100644 --- a/src/api/ipc.c +++ b/src/api/ipc.c @@ -348,7 +348,7 @@ int ipc_sendrecv(l4id_t to, l4id_t from, unsigned int flags) if ((ret = ipc_send(to, flags)) < 0) return ret; /* - * Get origy. A client would block its server + * Get reply. A client would block its server * only very briefly between these calls. */ if ((ret = ipc_recv(from, flags)) < 0) @@ -537,7 +537,6 @@ int sys_ipc(l4id_t to, l4id_t from, unsigned int flags) { unsigned int ipc_dir = 0; int ret = 0; - struct ktcb *t = current; if (!t); /* Check arguments */ if (tid_special_value(from) && diff --git a/src/generic/resource.c b/src/generic/resource.c index 74c5c50..2060032 100644 --- a/src/generic/resource.c +++ b/src/generic/resource.c @@ -509,6 +509,7 @@ int copy_pager_info(struct pager *pager, struct pager_info *pinfo) cap->end = cap_info->end; cap->size = cap_info->size; cap->attr = cap_info->attr; + cap->irq = cap_info->irq; cap_list_insert(cap, &pager->cap_list); } @@ -576,6 +577,9 @@ void copy_boot_capabilities(struct cap_list *caplist) realcap->access = bootcap->access; realcap->start = bootcap->start; realcap->end = bootcap->end; + realcap->size = bootcap->size; + realcap->attr = bootcap->attr; + realcap->irq = bootcap->irq; /* Unlink boot one */ list_remove(&bootcap->list); diff --git a/src/platform/pb926/irq.c b/src/platform/pb926/irq.c index 46814b7..e2e0c53 100644 --- a/src/platform/pb926/irq.c +++ b/src/platform/pb926/irq.c @@ -56,8 +56,8 @@ static int platform_timer_handler(struct irq_desc *desc) * Else register with register_irq() */ struct irq_desc irq_desc_array[IRQS_MAX] = { - [IRQ_TIMER01] = { - .name = "Timer01", + [IRQ_TIMER0] = { + .name = "Timer0", .chip = &irq_chip_array[0], .handler = platform_timer_handler, }, diff --git a/src/platform/pb926/timer.c b/src/platform/pb926/timer.c index 22d91da..8936001 100644 --- a/src/platform/pb926/timer.c +++ b/src/platform/pb926/timer.c @@ -25,8 +25,8 @@ void timer_init(void) /* Microkernel is using TIMER0, so we will initialize only this one */ void timer_start(void) { - /* Enable irq line for TIMER0*/ - irq_enable(IRQ_TIMER01); + /* Enable irq line for TIMER0 */ + irq_enable(IRQ_TIMER0); /* Enable timer */ sp804_enable(PLATFORM_TIMER0_VIRTUAL, 1);