From: Antti Kantee Date: Wed, 17 Feb 2016 13:00:22 +0000 (+0000) Subject: p-p-p-p-panic: make bmk_isr_rumpkernel() type void X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=0174f2503eca9af69a0f4265e6003d30dd071667;p=osstest%2Frumprun.git p-p-p-p-panic: make bmk_isr_rumpkernel() type void In other words: just panic if something doesn't work out. It's ~100% likely that the resulting state would not be what the user wanted in case we'd return an error. --- diff --git a/platform/hw/include/hw/kernel.h b/platform/hw/include/hw/kernel.h index d403664..18f148c 100644 --- a/platform/hw/include/hw/kernel.h +++ b/platform/hw/include/hw/kernel.h @@ -21,7 +21,7 @@ bmk_time_t cpu_clock_epochoffset(void); void isr(int); int intr_init(void); -int bmk_isr_rumpkernel(int (*)(void *), void *, int, int); +void bmk_isr_rumpkernel(int (*)(void *), void *, int, int); #define BMK_MULTIBOOT_CMDLINE_SIZE 4096 extern char multiboot_cmdline[]; diff --git a/platform/hw/intr.c b/platform/hw/intr.c index 97a2bd8..1b1323c 100644 --- a/platform/hw/intr.c +++ b/platform/hw/intr.c @@ -131,25 +131,24 @@ doisr(void *arg) } } -int +void bmk_isr_rumpkernel(int (*func)(void *), void *arg, int intr, int flags) { struct intrhand *ih; int error; if (intr > sizeof(isr_todo)*8 || intr > BMK_MAXINTR) - return BMK_EGENERIC; + bmk_platform_halt("bmk_isr_rumpkernel: intr"); if (flags != 0) - bmk_platform_halt("bmk_isr_rumpkernel: invalid flags"); + bmk_platform_halt("bmk_isr_rumpkernel: flags"); ih = bmk_xmalloc_bmk(sizeof(*ih)); if (!ih) - return BMK_ENOMEM; + bmk_platform_halt("bmk_isr_rumpkernel: xmalloc"); if ((error = cpu_intr_init(intr)) != 0) { - bmk_memfree(ih, BMK_MEMWHO_WIREDBMK); - return error; + bmk_platform_halt("bmk_isr_rumpkernel: cpu_intr_init"); } ih->ih_fun = func; ih->ih_arg = arg; @@ -157,8 +156,6 @@ bmk_isr_rumpkernel(int (*func)(void *), void *arg, int intr, int flags) SLIST_INSERT_HEAD(&isr_ih[intr % BMK_INTRLEVS], ih, ih_entries); if ((unsigned)intr < isr_lowest) isr_lowest = intr; - - return 0; } void diff --git a/platform/hw/pci/rumppci.c b/platform/hw/pci/rumppci.c index 82a891b..c9b7ee7 100644 --- a/platform/hw/pci/rumppci.c +++ b/platform/hw/pci/rumppci.c @@ -97,10 +97,8 @@ void * rumpcomp_pci_irq_establish(unsigned cookie, int (*handler)(void *), void *data) { - if (bmk_isr_rumpkernel(handler, data, intrs[cookie], 0) == 0) - return &intrs[cookie]; - else - return NULL; + bmk_isr_rumpkernel(handler, data, intrs[cookie], 0); + return &intrs[cookie]; } /*