mirror of
https://github.com/drasko/codezero.git
synced 2026-01-20 23:03:16 +01:00
Added means to add correct irq values to capabilities
This commit is contained in:
@@ -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},
|
||||
'''
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ cinfo_file_start = \
|
||||
#include <l4/generic/capability.h>
|
||||
#include <l4/generic/cap-types.h>
|
||||
#include INC_PLAT(platform.h)
|
||||
#include INC_PLAT(irq.h)
|
||||
|
||||
%s
|
||||
|
||||
|
||||
@@ -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) &&
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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,
|
||||
},
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user