From 7ee59313932398aa2781503d25154c56301b9b73 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 1 Jun 2018 07:11:12 +0200 Subject: Remove Clock_driver_support_shutdown_hardware() The aim of this clock driver hook was to stop clock tick interrupts at some late point in the exit() procedure. The use of atexit() pulls in malloc() which pulls in errno. It is incompatible with the intention of the CONFIGURE_DISABLE_NEWLIB_REENTRANCY configuration option. The exit() function must be called from thread context, so accompanied clock tick interrupts should cause no harm. On the contrary, someone may assume a normal operating system operation, e.g. working timeouts. Remove the Clock_driver_support_shutdown_hardware() clock driver hook. Close #3436. --- bsps/i386/pc386/clock/ckinit.c | 24 ------------------------ 1 file changed, 24 deletions(-) (limited to 'bsps/i386') diff --git a/bsps/i386/pc386/clock/ckinit.c b/bsps/i386/pc386/clock/ckinit.c index fce267bda7..afd5d01f1e 100644 --- a/bsps/i386/pc386/clock/ckinit.c +++ b/bsps/i386/pc386/clock/ckinit.c @@ -38,7 +38,6 @@ uint32_t pc386_clock_click_count; /* forward declaration */ void Clock_isr(void *param); -static void clockOff(void); static void Clock_isr_handler(void *param); /* @@ -173,17 +172,6 @@ static void clockOn(void) calibrate_tsc(); } -static void clockOff(void) -{ - rtems_interrupt_lock_context lock_context; - rtems_interrupt_lock_acquire(&rtems_i386_i8254_access_lock, &lock_context); - /* reset timer mode to standard (BIOS) value */ - outport_byte(TIMER_MODE, TIMER_SEL0 | TIMER_16BIT | TIMER_RATEGEN); - outport_byte(TIMER_CNTR0, 0); - outport_byte(TIMER_CNTR0, 0); - rtems_interrupt_lock_release(&rtems_i386_i8254_access_lock, &lock_context); -} /* Clock_exit */ - bool Clock_isr_enabled = false; static void Clock_isr_handler(void *param) { @@ -247,16 +235,4 @@ void Clock_driver_support_initialize_hardware(void) Clock_isr_enabled = true; } -#define Clock_driver_support_shutdown_hardware() \ - do { \ - rtems_status_code status; \ - clockOff(); \ - status = rtems_interrupt_handler_remove( \ - BSP_PERIODIC_TIMER, \ - Clock_isr_handler, \ - NULL \ - ); \ - assert(status == RTEMS_SUCCESSFUL); \ - } while (0) - #include "../../../shared/dev/clock/clockimpl.h" -- cgit v1.2.3