forked from Imagelibrary/rtems
powerpc/shared/clock/clock.c: Remove clock major/minor and clean up
This commit is contained in:
@@ -42,10 +42,6 @@ extern uint32_t bsp_time_base_frequency;
|
||||
|
||||
volatile uint32_t Clock_driver_ticks = 0;
|
||||
|
||||
rtems_device_major_number rtems_clock_major = UINT32_MAX;
|
||||
|
||||
rtems_device_minor_number rtems_clock_minor = UINT32_MAX;
|
||||
|
||||
static uint32_t ppc_clock_decrementer_value = PPC_CLOCK_DECREMENTER_MAX;
|
||||
|
||||
static uint32_t ppc_clock_next_time_base;
|
||||
@@ -59,7 +55,10 @@ static void ppc_clock_no_tick(void)
|
||||
|
||||
static void (*ppc_clock_tick)(void) = ppc_clock_no_tick;
|
||||
|
||||
static int ppc_clock_exception_handler( BSP_Exception_frame *frame, unsigned number)
|
||||
static int ppc_clock_exception_handler(
|
||||
BSP_Exception_frame *frame,
|
||||
unsigned number
|
||||
)
|
||||
{
|
||||
uint32_t delta = ppc_clock_decrementer_value;
|
||||
uint32_t next = ppc_clock_next_time_base;
|
||||
@@ -99,7 +98,10 @@ static int ppc_clock_exception_handler( BSP_Exception_frame *frame, unsigned num
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ppc_clock_exception_handler_first( BSP_Exception_frame *frame, unsigned number)
|
||||
static int ppc_clock_exception_handler_first(
|
||||
BSP_Exception_frame *frame,
|
||||
unsigned number
|
||||
)
|
||||
{
|
||||
/* We have to clear the first pending decrementer exception this way */
|
||||
|
||||
@@ -112,7 +114,10 @@ static int ppc_clock_exception_handler_first( BSP_Exception_frame *frame, unsign
|
||||
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
|
||||
)
|
||||
{
|
||||
uint32_t msr;
|
||||
|
||||
@@ -187,16 +192,16 @@ void Clock_exit(void)
|
||||
ppc_clock_tick = ppc_clock_no_tick;
|
||||
}
|
||||
|
||||
rtems_device_driver Clock_initialize( rtems_device_major_number major, rtems_device_minor_number minor, void *arg)
|
||||
rtems_device_driver Clock_initialize(
|
||||
rtems_device_major_number major,
|
||||
rtems_device_minor_number minor,
|
||||
void *arg
|
||||
)
|
||||
{
|
||||
uint64_t frequency = bsp_time_base_frequency;
|
||||
uint64_t us_per_tick = rtems_configuration_get_microseconds_per_tick();
|
||||
uint32_t interval = (uint32_t) ((frequency * us_per_tick) / 1000000);
|
||||
|
||||
/* Make major/minor available to others such as shared memory driver */
|
||||
rtems_clock_major = major;
|
||||
rtems_clock_minor = minor;
|
||||
|
||||
/*
|
||||
* Set default ticker.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user