From 069ed6c5b49999866b5b30a732ba2e09301240c0 Mon Sep 17 00:00:00 2001 From: Chris Johns Date: Fri, 16 Oct 2009 22:14:01 +0000 Subject: 2009-10-17 Chris Johns * shared/irq/idt.c: Check is the irq handlers are present before calling. * shared/comm/i386-stub-glue.c: Revert the change of 2009-05-06 as the handlers need to be present. Fixed the warnings. --- c/src/lib/libbsp/i386/ChangeLog | 7 +++++++ c/src/lib/libbsp/i386/shared/comm/i386-stub-glue.c | 20 ++++++++++++++++---- c/src/lib/libbsp/i386/shared/irq/idt.c | 6 ++++-- 3 files changed, 27 insertions(+), 6 deletions(-) (limited to 'c') diff --git a/c/src/lib/libbsp/i386/ChangeLog b/c/src/lib/libbsp/i386/ChangeLog index 1d08a4535e..c726a767d8 100644 --- a/c/src/lib/libbsp/i386/ChangeLog +++ b/c/src/lib/libbsp/i386/ChangeLog @@ -1,3 +1,10 @@ +2009-10-17 Chris Johns + + * shared/irq/idt.c: Check is the irq handlers are present before + calling. + * shared/comm/i386-stub-glue.c: Revert the change of 2009-05-06 as + the handlers need to be present. Fixed the warnings. + 2009-10-01 Ralf Corsépius PR 1445/BSPs diff --git a/c/src/lib/libbsp/i386/shared/comm/i386-stub-glue.c b/c/src/lib/libbsp/i386/shared/comm/i386-stub-glue.c index ff85206f00..2f52e379d2 100644 --- a/c/src/lib/libbsp/i386/shared/comm/i386-stub-glue.c +++ b/c/src/lib/libbsp/i386/shared/comm/i386-stub-glue.c @@ -20,6 +20,17 @@ int getDebugChar(void); /* read and return a single char */ /* assign an exception handler */ void exceptionHandler(int, void (*handler)(void)); +static void +nop(const rtems_raw_irq_connect_data* notused) +{ +} + +static int +isOn(const rtems_raw_irq_connect_data* notused) +{ + return 1; +} + void BSP_loop(int uart); /* Current uart used by gdb stub */ @@ -36,7 +47,8 @@ i386_stub_glue_init(int uart) uart_current = uart; - BSP_uart_init(uart, 38400, CHR_8_BITS, 0, 0, 0); + /* BSP_uart_init(uart, 38400, CHR_8_BITS, 0, 0, 0);*/ + BSP_uart_init(uart, 115200, CHR_8_BITS, 0, 0, 0); } void BSP_uart_on(const rtems_raw_irq_connect_data* used) @@ -152,9 +164,9 @@ void exceptionHandler(int vector, void (*handler)(void)) rtems_fatal_error_occurred(1); } - excep_raw_irq_data.on = NULL; - excep_raw_irq_data.off = NULL; - excep_raw_irq_data.isOn = NULL; + excep_raw_irq_data.on = nop; + excep_raw_irq_data.off = nop; + excep_raw_irq_data.isOn = isOn; excep_raw_irq_data.hdl = handler; if (!i386_set_idt_entry (&excep_raw_irq_data)) { diff --git a/c/src/lib/libbsp/i386/shared/irq/idt.c b/c/src/lib/libbsp/i386/shared/irq/idt.c index 07c748bf44..ca3b949443 100644 --- a/c/src/lib/libbsp/i386/shared/irq/idt.c +++ b/c/src/lib/libbsp/i386/shared/irq/idt.c @@ -87,7 +87,8 @@ int i386_set_idt_entry (const rtems_raw_irq_connect_data* irq) raw_irq_table [irq->idtIndex] = *irq; create_interrupt_gate_descriptor (&idt_entry_tbl[irq->idtIndex], irq->hdl); - irq->on(irq); + if (irq->on) + irq->on(irq); rtems_interrupt_enable(level); return 1; @@ -168,7 +169,8 @@ int i386_delete_idt_entry (const rtems_raw_irq_connect_data* irq) idt_entry_tbl[irq->idtIndex] = default_idt_entry; - irq->off(irq); + if (irq->off) + irq->off(irq); raw_irq_table[irq->idtIndex] = default_raw_irq_entry; raw_irq_table[irq->idtIndex].idtIndex = irq->idtIndex; -- cgit v1.2.3