summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/shared/clockdrv_shell.h
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2009-08-28 18:24:10 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2009-08-28 18:24:10 +0000
commitf1e8903dc074a64e4299632dbed23c14b6f1704f (patch)
tree249bcef6358860984b125d216da0c127c5ee7198 /c/src/lib/libbsp/shared/clockdrv_shell.h
parent2009-08-28 Joel Sherrill <joel.sherrill@OARcorp.com> (diff)
downloadrtems-f1e8903dc074a64e4299632dbed23c14b6f1704f.tar.bz2
2009-08-28 Joel Sherrill <joel.sherrill@OARcorp.com>
* bootcard.c, bsplibc.c, clockdrv_shell.h, console-polled.c: Fix formatting.
Diffstat (limited to 'c/src/lib/libbsp/shared/clockdrv_shell.h')
-rw-r--r--c/src/lib/libbsp/shared/clockdrv_shell.h104
1 files changed, 38 insertions, 66 deletions
diff --git a/c/src/lib/libbsp/shared/clockdrv_shell.h b/c/src/lib/libbsp/shared/clockdrv_shell.h
index 645d07b29d..9912d56f16 100644
--- a/c/src/lib/libbsp/shared/clockdrv_shell.h
+++ b/c/src/lib/libbsp/shared/clockdrv_shell.h
@@ -19,44 +19,33 @@
#error "clockdrv_shell.c: fast idle and N ISRs per tick is not supported"
#endif
-
/*
* This method is rarely used so default it.
*/
#ifndef Clock_driver_support_find_timer
-#define Clock_driver_support_find_timer()
+ #define Clock_driver_support_find_timer()
#endif
/*
* ISRs until next clock tick
*/
-
#ifdef CLOCK_DRIVER_ISRS_PER_TICK
-volatile uint32_t Clock_driver_isrs;
+ volatile uint32_t Clock_driver_isrs;
#endif
/*
* Clock ticks since initialization
*/
-
volatile uint32_t Clock_driver_ticks;
/*
* ISR formerly installed.
*/
-
rtems_isr_entry Old_ticker;
void Clock_exit( void );
/*
- * Major and minor number.
- */
-
-rtems_device_major_number rtems_clock_major = UINT32_MAX;
-rtems_device_minor_number rtems_clock_minor;
-
-/*
* Clock_isr
*
* This is the clock tick interrupt handler.
@@ -67,9 +56,7 @@ rtems_device_minor_number rtems_clock_minor;
* Output parameters: NONE
*
* Return values: NONE
- *
*/
-
rtems_isr Clock_isr(
rtems_vector_number vector
)
@@ -77,48 +64,41 @@ rtems_isr Clock_isr(
/*
* Accurate count of ISRs
*/
-
Clock_driver_ticks += 1;
-#ifdef CLOCK_DRIVER_USE_FAST_IDLE
- do {
- rtems_clock_tick();
- } while ( _Thread_Executing == _Thread_Idle &&
- _Thread_Heir == _Thread_Executing);
-
- Clock_driver_support_at_tick();
- return;
-
-#else
-
- /*
- * Do the hardware specific per-tick action.
- *
- * The counter/timer may or may not be set to automatically reload.
- */
-
- Clock_driver_support_at_tick();
-
-#ifdef CLOCK_DRIVER_ISRS_PER_TICK
- /*
- * The driver is multiple ISRs per clock tick.
- */
-
- if ( !Clock_driver_isrs ) {
-
- rtems_clock_tick();
-
- Clock_driver_isrs = CLOCK_DRIVER_ISRS_PER_TICK;
- }
- Clock_driver_isrs--;
-#else
-
- /*
- * The driver is one ISR per clock tick.
- */
- rtems_clock_tick();
-#endif
-#endif
+ #ifdef CLOCK_DRIVER_USE_FAST_IDLE
+ do {
+ rtems_clock_tick();
+ } while ( _Thread_Executing == _Thread_Idle &&
+ _Thread_Heir == _Thread_Executing);
+
+ Clock_driver_support_at_tick();
+ return;
+ #else
+ /*
+ * Do the hardware specific per-tick action.
+ *
+ * The counter/timer may or may not be set to automatically reload.
+ */
+ Clock_driver_support_at_tick();
+
+ #ifdef CLOCK_DRIVER_ISRS_PER_TICK
+ /*
+ * The driver is multiple ISRs per clock tick.
+ */
+ if ( !Clock_driver_isrs ) {
+ rtems_clock_tick();
+
+ Clock_driver_isrs = CLOCK_DRIVER_ISRS_PER_TICK;
+ }
+ Clock_driver_isrs--;
+ #else
+ /*
+ * The driver is one ISR per clock tick.
+ */
+ rtems_clock_tick();
+ #endif
+ #endif
}
/*
@@ -211,19 +191,11 @@ rtems_device_driver Clock_initialize(
Install_clock( Clock_isr );
/*
- * make major/minor avail to others such as shared memory driver
- */
-
- rtems_clock_major = major;
- rtems_clock_minor = minor;
-
- /*
* If we are counting ISRs per tick, then initialize the counter.
*/
-
-#ifdef CLOCK_DRIVER_ISRS_PER_TICK
- Clock_driver_isrs = CLOCK_DRIVER_ISRS_PER_TICK;
-#endif
+ #ifdef CLOCK_DRIVER_ISRS_PER_TICK
+ Clock_driver_isrs = CLOCK_DRIVER_ISRS_PER_TICK;
+ #endif
return RTEMS_SUCCESSFUL;
}