* shared/clock/clock.c: Fix to clear the first pending decrementer
	exception.
This commit is contained in:
Sebastian Huber
2011-07-21 15:10:07 +00:00
parent fdd9de8001
commit e715727613
2 changed files with 25 additions and 7 deletions

View File

@@ -1,3 +1,8 @@
2011-07-21 Sebastian Huber <sebastian.huber@embedded-brains.de>
* shared/clock/clock.c: Fix to clear the first pending decrementer
exception.
2011-07-20 Till Straumann <strauman@slac.stanford.edu> 2011-07-20 Till Straumann <strauman@slac.stanford.edu>
PR 1837/bsps PR 1837/bsps

View File

@@ -7,12 +7,13 @@
*/ */
/* /*
* Copyright (c) 2008, 2009 * Copyright (c) 2008-2011 embedded brains GmbH. All rights reserved.
* Embedded Brains GmbH *
* Obere Lagerstr. 30 * embedded brains GmbH
* D-82178 Puchheim * Obere Lagerstr. 30
* Germany * 82178 Puchheim
* rtems@embedded-brains.de * Germany
* <rtems@embedded-brains.de>
* *
* The license and distribution terms for this file may be * The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at * found in the file LICENSE in this distribution or at
@@ -94,6 +95,18 @@ static int ppc_clock_exception_handler( BSP_Exception_frame *frame, unsigned num
return 0; return 0;
} }
static int ppc_clock_exception_handler_first( BSP_Exception_frame *frame, unsigned number)
{
/* We have to clear the first pending decrementer exception this way */
if (ppc_decrementer_register() >= 0x80000000) {
ppc_clock_exception_handler( frame, number);
}
ppc_exc_set_handler( ASM_DEC_VECTOR, ppc_clock_exception_handler);
return 0;
}
static int ppc_clock_exception_handler_booke( BSP_Exception_frame *frame, unsigned number) static int ppc_clock_exception_handler_booke( BSP_Exception_frame *frame, unsigned number)
{ {
@@ -208,7 +221,7 @@ rtems_device_driver Clock_initialize( rtems_device_major_number major, rtems_dev
ppc_clock_next_time_base = ppc_time_base() + ppc_clock_decrementer_value; ppc_clock_next_time_base = ppc_time_base() + ppc_clock_decrementer_value;
/* Install exception handler */ /* Install exception handler */
ppc_exc_set_handler( ASM_DEC_VECTOR, ppc_clock_exception_handler); ppc_exc_set_handler( ASM_DEC_VECTOR, ppc_clock_exception_handler_first);
} }
/* Set the decrementer value */ /* Set the decrementer value */