source: rtems/c/src/lib/libbsp/powerpc/psim/clock/clock.c @ f599af0

4.104.114.84.95
Last change on this file since f599af0 was f599af0, checked in by Joel Sherrill <joel.sherrill@…>, on Aug 16, 2001 at 7:38:05 PM

2001-08-16 Joel Sherrill <joel@…>

  • clock/clock.c: Ensure that clock ticks are long enough to make forward progress. This was modified to improve results on the RTEMS tests and the ACATS.
  • startup/linkcmds: Modified to work better with gcc 2.8.1 and gnat 3.13p.
  • Property mode set to 100644
File size: 1.5 KB
Line 
1/*
2 *  Instantiate the clock driver shell for psim based
3 *  on the decrementer register.
4 *
5 *  $Id$
6 */
7
8#include <rtems.h>
9
10/*
11 *  If defined, speed up the clock ticks while the idle task is running so
12 *  time spent in the idle task is minimized.  This significantly reduces
13 *  the wall time required to execute the RTEMS test suites.
14 */
15
16#define CLOCK_DRIVER_USE_FAST_IDLE
17
18#define CLOCK_VECTOR PPC_IRQ_DECREMENTER
19
20/*  On psim, each click of the decrementer register corresponds
21 *  to 1 instruction.  By setting this to 100, we are indicating
22 *  that we are assuming it can execute 100 instructions per
23 *  microsecond.  This corresponds to sustaining 1 instruction
24 *  per cycle at 100 Mhz.  Whether this is a good guess or not
25 *  is anyone's guess.
26 */
27
28extern int PSIM_INSTRUCTIONS_PER_MICROSECOND;
29
30unsigned int PPC_DECREMENTER_CLICKS;
31
32#define Clock_driver_support_install_isr( _new, _old ) \
33  do { \
34    _old = (rtems_isr_entry) set_vector( _new, CLOCK_VECTOR, 1 ); \
35    PPC_DECREMENTER_CLICKS = (unsigned int)&PSIM_INSTRUCTIONS_PER_MICROSECOND; \
36    PPC_DECREMENTER_CLICKS *= rtems_configuration_get_microseconds_per_tick(); \
37    /* PPC_DECREMENTER_CLICKS = 5000; */ \
38  } while(0)
39
40#define Clock_driver_support_initialize_hardware() \
41  do { \
42    unsigned int _clicks = PPC_DECREMENTER_CLICKS; \
43    PPC_Set_decrementer( _clicks ); \
44  } while (0)
45
46#define Clock_driver_support_at_tick() \
47  Clock_driver_support_initialize_hardware()
48
49#define Clock_driver_support_shutdown_hardware()
50
51#include "../../../shared/clockdrv_shell.c"
Note: See TracBrowser for help on using the repository browser.