Removed old hack of using Configuration Table entry ticks_per_timeslice

being set to 0 to indicate that there should be no Clock Tick.  This
was used by the Timing Tests to avoid clock tick overhead perturbing
execution times.  Now the Timing Tests simply leave the Clock Tick
Driver out of the Device Driver Table.
This commit is contained in:
Joel Sherrill
2000-01-11 17:34:20 +00:00
parent bdb289988a
commit 0dd1d44582
30 changed files with 447 additions and 617 deletions

View File

@@ -102,14 +102,11 @@ static void clockIsr()
| Returns: Nothing. | Returns: Nothing.
+--------------------------------------------------------------------------*/ +--------------------------------------------------------------------------*/
void clockOff(const rtems_irq_connect_data* unused) void clockOff(const rtems_irq_connect_data* unused)
{
if (BSP_Configuration.ticks_per_timeslice)
{ {
/* reset timer mode to standard (BIOS) value */ /* reset timer mode to standard (BIOS) value */
outport_byte(TIMER_MODE, TIMER_SEL0 | TIMER_16BIT | TIMER_RATEGEN); outport_byte(TIMER_MODE, TIMER_SEL0 | TIMER_16BIT | TIMER_RATEGEN);
outport_byte(TIMER_CNTR0, 0); outport_byte(TIMER_CNTR0, 0);
outport_byte(TIMER_CNTR0, 0); outport_byte(TIMER_CNTR0, 0);
}
} /* Clock_exit */ } /* Clock_exit */
@@ -158,7 +155,6 @@ static void clockOn(const rtems_irq_connect_data* unused)
Clock_isrs = Clock_isrs_per_tick; /* Initialize Clock_isrs */ Clock_isrs = Clock_isrs_per_tick; /* Initialize Clock_isrs */
if (BSP_Configuration.ticks_per_timeslice)
{ {
/* 105/88 approximates TIMER_TICK * 1e-6 */ /* 105/88 approximates TIMER_TICK * 1e-6 */
rtems_unsigned32 count = US_TO_TICK(microseconds_per_isr); rtems_unsigned32 count = US_TO_TICK(microseconds_per_isr);

View File

@@ -51,25 +51,21 @@ void Install_clock(
Clock_driver_ticks = 0; Clock_driver_ticks = 0;
Clock_isrs = BSP_Configuration.microseconds_per_tick / 1000; Clock_isrs = BSP_Configuration.microseconds_per_tick / 1000;
if ( BSP_Configuration.ticks_per_timeslice ) {
Old_ticker = set_vector( clock_isr, CLOCK_VECTOR, 1 ); Old_ticker = set_vector( clock_isr, CLOCK_VECTOR, 1 );
victimer = (volatile unsigned char *) 0xa00000c3; victimer = (volatile unsigned char *) 0xa00000c3;
*victimer = 0x12; *victimer = 0x12;
*victimer = 0x92; /* 1000 HZ */ *victimer = 0x92; /* 1000 HZ */
} }
}
void Clock_exit() void Clock_exit()
{ {
unsigned char *victimer; unsigned char *victimer;
if ( BSP_Configuration.ticks_per_timeslice ) {
victimer = (unsigned char *) 0xa00000c3; victimer = (unsigned char *) 0xa00000c3;
*victimer = 0x12; *victimer = 0x12;
i960_mask_intr( 5 ); i960_mask_intr( 5 );
/* do not restore old vector */ /* do not restore old vector */
} }
}
rtems_device_driver Clock_initialize( rtems_device_driver Clock_initialize(
rtems_device_major_number major, rtems_device_major_number major,

View File

@@ -65,12 +65,6 @@ void Install_clock(
Reload_Clock_isrs = BSP_Configuration.microseconds_per_tick / 1000; Reload_Clock_isrs = BSP_Configuration.microseconds_per_tick / 1000;
Clock_isrs = Reload_Clock_isrs; Clock_isrs = Reload_Clock_isrs;
/* Not for our case
if ( BSP_Configuration.ticks_per_timeslice ) {
*icon = 0x6000;
Old_ticker = set_vector( (((unsigned int) clock_isr) | 0x2), CLOCK_VECTOR, 1 );
*/
#define BUS_CLOCK_1 0 #define BUS_CLOCK_1 0
#define TMR_WRITE_CNTL 8 #define TMR_WRITE_CNTL 8
#define TMR_AUTO_RELOAD 4 #define TMR_AUTO_RELOAD 4
@@ -78,9 +72,6 @@ void Install_clock(
#define TMR_TERM_CNT_STAT 1 #define TMR_TERM_CNT_STAT 1
Old_ticker = set_vector( (((unsigned int) clock_isr) | 0x2), CLOCK_VECTOR, 1 ); Old_ticker = set_vector( (((unsigned int) clock_isr) | 0x2), CLOCK_VECTOR, 1 );
/*
*(unsigned int *)(CLOCK_VECTOR >>2) = (unsigned int )clockHandler;
*/
/* initialize the i960RP timer 0 here */ /* initialize the i960RP timer 0 here */
@@ -102,14 +93,12 @@ void Clock_exit()
{ {
volatile unsigned int *tmr0 = (unsigned int *) TMR0_ADDR; volatile unsigned int *tmr0 = (unsigned int *) TMR0_ADDR;
if ( BSP_Configuration.ticks_per_timeslice ) {
/* shut down the timer */ /* shut down the timer */
*tmr0 = *tmr0 & ~TMR_ENABLE; *tmr0 = *tmr0 & ~TMR_ENABLE;
i960_mask_intr( 12 ); i960_mask_intr( 12 );
/* do not restore old vector */ /* do not restore old vector */
} }
}
rtems_device_driver Clock_initialize( rtems_device_driver Clock_initialize(
rtems_device_major_number major, rtems_device_major_number major,

View File

@@ -69,7 +69,6 @@ void Install_clock(
Clock_driver_ticks = 0; Clock_driver_ticks = 0;
Clock_isrs = BSP_Configuration.microseconds_per_tick / 1000; Clock_isrs = BSP_Configuration.microseconds_per_tick / 1000;
if ( BSP_Configuration.ticks_per_timeslice ) {
Old_ticker = (rtems_isr_entry) set_vector( clock_isr, CLOCK_VECTOR, 1 ); Old_ticker = (rtems_isr_entry) set_vector( clock_isr, CLOCK_VECTOR, 1 );
Z8x36_WRITE( TIMER, MASTER_CFG, 0xd4 ); Z8x36_WRITE( TIMER, MASTER_CFG, 0xd4 );
@@ -94,19 +93,14 @@ void Install_clock(
atexit( Clock_exit ); atexit( Clock_exit );
} }
}
void Clock_exit( void ) void Clock_exit( void )
{ {
rtems_unsigned8 data; rtems_unsigned8 data;
if ( BSP_Configuration.ticks_per_timeslice ) {
Z8x36_READ ( TIMER, MASTER_INTR, data ); Z8x36_READ ( TIMER, MASTER_INTR, data );
Z8x36_WRITE( TIMER, MASTER_INTR, (data & 0x01) ); Z8x36_WRITE( TIMER, MASTER_INTR, (data & 0x01) );
/* do not restore old vector */ /* do not restore old vector */
}
} }
rtems_device_driver Clock_initialize( rtems_device_driver Clock_initialize(

View File

@@ -57,7 +57,6 @@ void Install_clock(
Clock_driver_ticks = 0; Clock_driver_ticks = 0;
Clock_isrs = BSP_Configuration.microseconds_per_tick / 1000; Clock_isrs = BSP_Configuration.microseconds_per_tick / 1000;
if ( BSP_Configuration.ticks_per_timeslice ) {
Old_ticker = (rtems_isr_entry) set_vector( clock_isr, CLOCK_VECTOR, 1 ); Old_ticker = (rtems_isr_entry) set_vector( clock_isr, CLOCK_VECTOR, 1 );
/* enable 1mS interrupts */ /* enable 1mS interrupts */
@@ -67,21 +66,15 @@ void Install_clock(
atexit( Clock_exit ); atexit( Clock_exit );
} }
}
void Clock_exit( void ) void Clock_exit( void )
{ {
if ( BSP_Configuration.ticks_per_timeslice ) {
/* shutdown the periodic interrupt */ /* shutdown the periodic interrupt */
*PICR = (unsigned short int) *PICR = (unsigned short int)
( SAM(0,8,PIRQL) | SAM(CLOCK_VECTOR,0,PIV) ); ( SAM(0,8,PIRQL) | SAM(CLOCK_VECTOR,0,PIV) );
/* ^^ zero disables interrupt */ /* ^^ zero disables interrupt */
/* do not restore old vector */ /* do not restore old vector */
}
} }
rtems_device_driver Clock_initialize( rtems_device_driver Clock_initialize(

View File

@@ -82,7 +82,6 @@ void Install_clock(
Clock_driver_ticks = 0; Clock_driver_ticks = 0;
Clock_isrs = BSP_Configuration.microseconds_per_tick / 1000; Clock_isrs = BSP_Configuration.microseconds_per_tick / 1000;
if ( BSP_Configuration.ticks_per_timeslice ) {
Old_ticker = (rtems_isr_entry) set_vector( clock_isr, CLOCK_VECTOR, 1 ); Old_ticker = (rtems_isr_entry) set_vector( clock_isr, CLOCK_VECTOR, 1 );
*MSR = RS; /* enable 1mS interrupts */ *MSR = RS; /* enable 1mS interrupts */
@@ -90,19 +89,13 @@ void Install_clock(
atexit( Clock_exit ); atexit( Clock_exit );
} }
}
void Clock_exit( void ) void Clock_exit( void )
{ {
if ( BSP_Configuration.ticks_per_timeslice ) {
/* shutdown periodic interrupt */ /* shutdown periodic interrupt */
*MSR = RS; *MSR = RS;
*ICR0 &= 0xc0; *ICR0 &= 0xc0;
/* do not restore old vector */ /* do not restore old vector */
}
} }
rtems_device_driver Clock_initialize( rtems_device_driver Clock_initialize(

View File

@@ -83,11 +83,9 @@ void Install_clock(
rtems_isr_entry clock_isr rtems_isr_entry clock_isr
) )
{ {
Clock_driver_ticks = 0; Clock_driver_ticks = 0;
Clock_isrs = BSP_Configuration.microseconds_per_tick / 1000; Clock_isrs = BSP_Configuration.microseconds_per_tick / 1000;
if ( BSP_Configuration.ticks_per_timeslice ) {
set_vector( clock_isr, CLOCK_VECTOR, 1 ); set_vector( clock_isr, CLOCK_VECTOR, 1 );
m302.reg.trr1 = TRR1_VAL; /* set timer reference register */ m302.reg.trr1 = TRR1_VAL; /* set timer reference register */
@@ -99,15 +97,12 @@ void Install_clock(
atexit( Clock_exit ); atexit( Clock_exit );
} }
}
void Clock_exit( void ) void Clock_exit( void )
{ {
if ( BSP_Configuration.ticks_per_timeslice ) {
/* TODO: figure out what to do here */ /* TODO: figure out what to do here */
/* do not restore old vector */ /* do not restore old vector */
} }
}
rtems_device_driver Clock_initialize( rtems_device_driver Clock_initialize(
rtems_device_major_number major, rtems_device_major_number major,

View File

@@ -77,13 +77,11 @@ Clock_isr (rtems_vector_number vector)
void void
Clock_exit (void) Clock_exit (void)
{ {
if (BSP_Configuration.ticks_per_timeslice ) {
/* /*
* Turn off periodic interval timer * Turn off periodic interval timer
*/ */
SIMPITR = 0; SIMPITR = 0;
} }
}
/****************************************************** /******************************************************
Name: Install_clock Name: Install_clock
@@ -96,9 +94,9 @@ static void
Install_clock (rtems_isr_entry clock_isr) Install_clock (rtems_isr_entry clock_isr)
{ {
unsigned32 pitr_tmp; unsigned32 pitr_tmp;
unsigned32 usecs_per_tick;
Clock_driver_ticks = 0; Clock_driver_ticks = 0;
if ( BSP_Configuration.ticks_per_timeslice ) {
set_vector (clock_isr, CLOCK_VECTOR, 1); set_vector (clock_isr, CLOCK_VECTOR, 1);
@@ -110,12 +108,12 @@ Install_clock (rtems_isr_entry clock_isr)
/* sets the PITR count value */ /* sets the PITR count value */
/* this assumes a 32.765 kHz crystal */ /* this assumes a 32.765 kHz crystal */
usecs_per_tick = BSP_Configuration.microseconds_per_tick;
/* find out whether prescaler should be enabled or not */ /* find out whether prescaler should be enabled or not */
if ( BSP_Configuration.microseconds_per_tick <= 31128 ) { if ( usecs_per_tick <= 31128 ) {
pitr_tmp = ( BSP_Configuration.microseconds_per_tick * 8192 ) / 1000000 ; pitr_tmp = ( usecs_per_tick * 8192 ) / 1000000 ;
} } else {
else { pitr_tmp = ( usecs_per_tick / 1000000 ) * 16;
pitr_tmp = ( BSP_Configuration.microseconds_per_tick / 1000000 ) * 16;
/* enable it */ /* enable it */
pitr_tmp |= 0x100; pitr_tmp |= 0x100;
} }
@@ -124,7 +122,6 @@ Install_clock (rtems_isr_entry clock_isr)
atexit (Clock_exit); atexit (Clock_exit);
} }
}
/****************************************************** /******************************************************
Name: Clock_initialize Name: Clock_initialize

View File

@@ -101,19 +101,21 @@ Clock_isr (rtems_vector_number vector)
void void
Clock_exit (void) Clock_exit (void)
{ {
if (BSP_Configuration.ticks_per_timeslice ) {
/* /*
* Turn off periodic interval timer * Turn off periodic interval timer
*/ */
m360.pitr &= ~0xFF; m360.pitr &= ~0xFF;
} }
}
static void static void
Install_clock (rtems_isr_entry clock_isr) Install_clock (rtems_isr_entry clock_isr)
{ {
int divisor;
extern int m360_clock_rate; /* This should be somewhere in a config file */
unsigned long nsec_per_chip_tick = 1000000000 / m360_clock_rate;
unsigned long nsec_per_pit_tick = 512 * nsec_per_chip_tick;
Clock_driver_ticks = 0; Clock_driver_ticks = 0;
if ( BSP_Configuration.ticks_per_timeslice ) {
/* /*
* Choose periodic interval timer register value * Choose periodic interval timer register value
* The rate at which the periodic interval timer * The rate at which the periodic interval timer
@@ -129,17 +131,12 @@ Install_clock (rtems_isr_entry clock_isr)
* For a 25 MHz external clock the basic clock rate is * For a 25 MHz external clock the basic clock rate is
* 40 nsec * 128 * 4 = 20.48 usec/tick * 40 nsec * 128 * 4 = 20.48 usec/tick
*/ */
int divisor;
extern int m360_clock_rate; /* This should be somewhere in a config file */
unsigned long nsec_per_chip_tick = 1000000000 / m360_clock_rate;
unsigned long nsec_per_pit_tick = 512 * nsec_per_chip_tick;
rtems_nsec_per_tick = BSP_Configuration.microseconds_per_tick * 1000; rtems_nsec_per_tick = BSP_Configuration.microseconds_per_tick * 1000;
divisor = rtems_nsec_per_tick / nsec_per_pit_tick; divisor = rtems_nsec_per_tick / nsec_per_pit_tick;
if (divisor >= 256) { if (divisor >= 256) {
divisor = 255; divisor = 255;
} } else if (divisor == 0) {
else if (divisor == 0) {
divisor = 1; divisor = 1;
} }
pit_nsec_per_tick = nsec_per_pit_tick * divisor; pit_nsec_per_tick = nsec_per_pit_tick * divisor;
@@ -149,7 +146,6 @@ Install_clock (rtems_isr_entry clock_isr)
m360.pitr |= divisor; m360.pitr |= divisor;
atexit (Clock_exit); atexit (Clock_exit);
} }
}
rtems_device_driver rtems_device_driver
Clock_initialize( Clock_initialize(

View File

@@ -96,7 +96,6 @@ rtems_isr_entry clock_isr;
Clock_driver_ticks = 0; Clock_driver_ticks = 0;
Clock_isrs = (int)(Configuration.microseconds_per_tick / 1000); Clock_isrs = (int)(Configuration.microseconds_per_tick / 1000);
if ( Configuration.ticks_per_timeslice ) {
/* led_putnum('c'); * for debugging purposes */ /* led_putnum('c'); * for debugging purposes */
Old_ticker = (rtems_isr_entry) set_vector( clock_isr, CLOCK_VECTOR, 1 ); Old_ticker = (rtems_isr_entry) set_vector( clock_isr, CLOCK_VECTOR, 1 );
@@ -127,15 +126,12 @@ rtems_isr_entry clock_isr;
*/ */
atexit( Clock_exit ); atexit( Clock_exit );
} }
}
/* The following was added for debugging purposes */ /* The following was added for debugging purposes */
void Clock_exit( void ) void Clock_exit( void )
{ {
rtems_unsigned8 data; rtems_unsigned8 data;
if ( Configuration.ticks_per_timeslice ) {
/* disable timer /* disable timer
data = TCR; data = TCR;
TCR = (data & 0xFE); */ TCR = (data & 0xFE); */
@@ -144,7 +140,6 @@ void Clock_exit( void )
/* do not restore old vector */ /* do not restore old vector */
} }
}
rtems_device_driver Clock_initialize( rtems_device_driver Clock_initialize(
rtems_device_major_number major, rtems_device_major_number major,

View File

@@ -81,7 +81,6 @@ void Install_clock(
Clock_driver_ticks = 0; Clock_driver_ticks = 0;
Clock_isrs = BSP_Configuration.microseconds_per_tick / 1000; Clock_isrs = BSP_Configuration.microseconds_per_tick / 1000;
if ( BSP_Configuration.ticks_per_timeslice ) {
Old_ticker = (rtems_isr_entry) set_vector( clock_isr, CLOCK_VECTOR, 1 ); Old_ticker = (rtems_isr_entry) set_vector( clock_isr, CLOCK_VECTOR, 1 );
timer = (struct z8036_map *) 0xfffb0000; timer = (struct z8036_map *) 0xfffb0000;
timer->MASTER_INTR = MICRVAL; timer->MASTER_INTR = MICRVAL;
@@ -105,13 +104,10 @@ void Install_clock(
atexit( Clock_exit ); atexit( Clock_exit );
} }
}
void Clock_exit( void ) void Clock_exit( void )
{ {
volatile struct z8036_map *timer; volatile struct z8036_map *timer;
if ( BSP_Configuration.ticks_per_timeslice ) {
timer = (struct z8036_map *) 0xfffb0000; timer = (struct z8036_map *) 0xfffb0000;
timer->MASTER_INTR = 0x62; timer->MASTER_INTR = 0x62;
timer->CT1_MODE_SPEC = 0x00; timer->CT1_MODE_SPEC = 0x00;
@@ -119,7 +115,6 @@ void Clock_exit( void )
timer->CT1_CMD_STATUS = 0x00; timer->CT1_CMD_STATUS = 0x00;
/* do not restore old vector */ /* do not restore old vector */
} }
}
rtems_device_driver Clock_initialize( rtems_device_driver Clock_initialize(
rtems_device_major_number major, rtems_device_major_number major,

View File

@@ -67,9 +67,7 @@ void Install_clock(rtems_isr_entry clock_isr )
Clock_driver_ticks = 0; Clock_driver_ticks = 0;
Clock_isrs = BSP_Configuration.microseconds_per_tick / 1000; Clock_isrs = BSP_Configuration.microseconds_per_tick / 1000;
if ( BSP_Configuration.ticks_per_timeslice ) { Old_ticker = (rtems_isr_entry) set_vector( clock_isr, TIMER_2_VECTOR, 1 );
Old_ticker =
(rtems_isr_entry) set_vector( clock_isr, TIMER_2_VECTOR, 1 );
pcc->timer2_int_control = 0x00; /* Disable T2 Interr. */ pcc->timer2_int_control = 0x00; /* Disable T2 Interr. */
pcc->timer2_preload = MS_COUNT; pcc->timer2_preload = MS_COUNT;
@@ -80,14 +78,11 @@ void Install_clock(rtems_isr_entry clock_isr )
atexit( Clock_exit ); atexit( Clock_exit );
} }
}
void Clock_exit( void ) void Clock_exit( void )
{ {
if ( BSP_Configuration.ticks_per_timeslice ) {
pcc->timer2_int_control = 0x00; /* Disable T2 Interr. */ pcc->timer2_int_control = 0x00; /* Disable T2 Interr. */
} }
}
rtems_device_driver Clock_initialize( rtems_device_driver Clock_initialize(
rtems_device_major_number major, rtems_device_major_number major,

View File

@@ -71,9 +71,7 @@ void Install_clock(rtems_isr_entry clock_isr )
Clock_driver_ticks = 0; Clock_driver_ticks = 0;
Clock_isrs = BSP_Configuration.microseconds_per_tick / 1000; Clock_isrs = BSP_Configuration.microseconds_per_tick / 1000;
if ( BSP_Configuration.ticks_per_timeslice ) { Old_ticker = (rtems_isr_entry) set_vector( clock_isr, CLOCK_VECTOR, 1 );
Old_ticker =
(rtems_isr_entry) set_vector( clock_isr, CLOCK_VECTOR, 1 );
lcsr->vector_base |= MASK_INT; /* unmask VMEchip2 interrupts */ lcsr->vector_base |= MASK_INT; /* unmask VMEchip2 interrupts */
lcsr->to_ctl = 0xE7; /* prescaler to 1 MHz (see Appendix A1) */ lcsr->to_ctl = 0xE7; /* prescaler to 1 MHz (see Appendix A1) */
lcsr->timer_cmp_2 = MS_COUNT; lcsr->timer_cmp_2 = MS_COUNT;
@@ -86,7 +84,6 @@ void Install_clock(rtems_isr_entry clock_isr )
atexit( Clock_exit ); atexit( Clock_exit );
} }
}
void Clock_exit( void ) void Clock_exit( void )
{ {

View File

@@ -156,7 +156,6 @@ void VMEchip2_T2_initialize( void )
Clock_driver_ticks = 0; Clock_driver_ticks = 0;
Clock_isrs = BSP_Configuration.microseconds_per_tick / 1000; Clock_isrs = BSP_Configuration.microseconds_per_tick / 1000;
if ( BSP_Configuration.ticks_per_timeslice ) {
lcsr->intr_ena &= 0xFDFFFFFF; /* Disable tick timer 2 interrupt */ lcsr->intr_ena &= 0xFDFFFFFF; /* Disable tick timer 2 interrupt */
lcsr->intr_clear = 0x02000000; /* Clear tick timer 2 interrupt */ lcsr->intr_clear = 0x02000000; /* Clear tick timer 2 interrupt */
lcsr->intr_level[0] = /* Set tick timer 2 interrupt level */ lcsr->intr_level[0] = /* Set tick timer 2 interrupt level */
@@ -171,7 +170,6 @@ void VMEchip2_T2_initialize( void )
lcsr->vector_base |= 0x00800000;/* Unmask VMEchip2 interrupts */ lcsr->vector_base |= 0x00800000;/* Unmask VMEchip2 interrupts */
atexit( clock_exit ); /* Turn off T2 interrupts when we exit */ atexit( clock_exit ); /* Turn off T2 interrupts when we exit */
} }
}
/* /*
@@ -189,14 +187,12 @@ void VMEchip2_T2_initialize( void )
*/ */
void clock_exit( void ) void clock_exit( void )
{ {
if ( BSP_Configuration.ticks_per_timeslice ) {
lcsr->board_ctl &= 0xFFFFFEFF; /* Stop tick timer 2 */ lcsr->board_ctl &= 0xFFFFFEFF; /* Stop tick timer 2 */
lcsr->intr_ena &= 0xFDFFFFFF; /* Disable tick timer 2 interrupt */ lcsr->intr_ena &= 0xFDFFFFFF; /* Disable tick timer 2 interrupt */
lcsr->intr_clear = 0x02000000; /* Clear tick timer 2 interrupt */ lcsr->intr_clear = 0x02000000; /* Clear tick timer 2 interrupt */
set_vector( Old_ticker, CLOCK_VECTOR, 1 ); set_vector( Old_ticker, CLOCK_VECTOR, 1 );
} }
}
/* /*

View File

@@ -87,7 +87,6 @@ void Install_clock(
Clock_driver_ticks = 0; Clock_driver_ticks = 0;
Clock_isrs = BSP_Configuration.microseconds_per_tick / 1000; Clock_isrs = BSP_Configuration.microseconds_per_tick / 1000;
if ( BSP_Configuration.ticks_per_timeslice ) {
set_vector( clock_isr, CLOCK_VECTOR, 1 ); set_vector( clock_isr, CLOCK_VECTOR, 1 );
m302.reg.trr1 = TRR1_VAL; /* set timer reference register */ m302.reg.trr1 = TRR1_VAL; /* set timer reference register */
@@ -99,15 +98,12 @@ void Install_clock(
atexit( Clock_exit ); atexit( Clock_exit );
} }
}
void Clock_exit( void ) void Clock_exit( void )
{ {
if ( BSP_Configuration.ticks_per_timeslice ) {
/* TODO: figure out what to do here */ /* TODO: figure out what to do here */
/* do not restore old vector */ /* do not restore old vector */
} }
}
rtems_device_driver Clock_initialize( rtems_device_driver Clock_initialize(
rtems_device_major_number major, rtems_device_major_number major,

View File

@@ -98,19 +98,12 @@ void Install_clock(
Clock_driver_ticks = 0; Clock_driver_ticks = 0;
Clock_isrs = BSP_Configuration.microseconds_per_tick / 1000; Clock_isrs = BSP_Configuration.microseconds_per_tick / 1000;
/*
* If ticks_per_timeslice is configured as non-zero, then the user
* wants a clock tick.
*/
if ( BSP_Configuration.ticks_per_timeslice ) {
Old_ticker = (rtems_isr_entry) set_vector( clock_isr, CLOCK_VECTOR, 1 ); Old_ticker = (rtems_isr_entry) set_vector( clock_isr, CLOCK_VECTOR, 1 );
/* /*
* Hardware specific initialize goes here * Hardware specific initialize goes here
*/ */
/* XXX */ /* XXX */
}
/* /*
* Schedule the clock cleanup routine to execute if the application exits. * Schedule the clock cleanup routine to execute if the application exits.
@@ -125,13 +118,10 @@ void Install_clock(
void Clock_exit( void ) void Clock_exit( void )
{ {
if ( BSP_Configuration.ticks_per_timeslice ) {
/* XXX: turn off the timer interrupts */ /* XXX: turn off the timer interrupts */
/* XXX: If necessary, restore the old vector */ /* XXX: If necessary, restore the old vector */
} }
}
/* /*
* Clock_initialize * Clock_initialize

View File

@@ -119,14 +119,12 @@ void Install_clock(
{ {
Clock_driver_ticks = 0; Clock_driver_ticks = 0;
if ( BSP_Configuration.ticks_per_timeslice ) {
Old_ticker = (rtems_isr_entry) set_vector( clock_isr, CLOCK_VECTOR, 1 ); Old_ticker = (rtems_isr_entry) set_vector( clock_isr, CLOCK_VECTOR, 1 );
PPC_Set_decrementer( Clock_Decrementer_value ); PPC_Set_decrementer( Clock_Decrementer_value );
atexit( Clock_exit ); atexit( Clock_exit );
} }
}
/*PAGE /*PAGE
* *
@@ -145,13 +143,10 @@ void Install_clock(
void Clock_exit( void ) void Clock_exit( void )
{ {
if ( BSP_Configuration.ticks_per_timeslice ) {
/* nothing to do */; /* nothing to do */;
/* do not restore old vector */ /* do not restore old vector */
} }
}
/*PAGE /*PAGE
* *

View File

@@ -117,14 +117,12 @@ void Install_clock(
{ {
Clock_driver_ticks = 0; Clock_driver_ticks = 0;
if ( BSP_Configuration.ticks_per_timeslice ) {
Old_ticker = (rtems_isr_entry) set_vector( clock_isr, CLOCK_VECTOR, 1 ); Old_ticker = (rtems_isr_entry) set_vector( clock_isr, CLOCK_VECTOR, 1 );
PPC_Set_decrementer( Clock_Decrementer_value ); PPC_Set_decrementer( Clock_Decrementer_value );
atexit( Clock_exit ); atexit( Clock_exit );
} }
}
/* /*
* Clock_exit * Clock_exit
@@ -142,13 +140,10 @@ void Install_clock(
void Clock_exit( void ) void Clock_exit( void )
{ {
if ( BSP_Configuration.ticks_per_timeslice ) {
/* nothing to do */; /* nothing to do */;
/* do not restore old vector */ /* do not restore old vector */
} }
}
/* /*
* Clock_initialize * Clock_initialize

View File

@@ -122,7 +122,6 @@ void Install_clock(
{ {
Clock_driver_ticks = 0; Clock_driver_ticks = 0;
if ( BSP_Configuration.ticks_per_timeslice ) {
Old_ticker = (rtems_isr_entry) set_vector( clock_isr, CLOCK_VECTOR, 1 ); Old_ticker = (rtems_isr_entry) set_vector( clock_isr, CLOCK_VECTOR, 1 );
PPC_Set_decrementer( CPU_PPC_CLICKS_PER_TICK ); PPC_Set_decrementer( CPU_PPC_CLICKS_PER_TICK );
@@ -130,8 +129,6 @@ void Install_clock(
atexit( Clock_exit ); atexit( Clock_exit );
} }
}
/* /*
* Clock_exit * Clock_exit
* *
@@ -148,13 +145,10 @@ void Install_clock(
void Clock_exit( void ) void Clock_exit( void )
{ {
if ( BSP_Configuration.ticks_per_timeslice ) {
/* nothing to do */; /* nothing to do */;
/* do not restore old vector */ /* do not restore old vector */
} }
}
/* /*
* Clock_initialize * Clock_initialize

View File

@@ -117,14 +117,12 @@ void Install_clock(
{ {
Clock_driver_ticks = 0; Clock_driver_ticks = 0;
if ( BSP_Configuration.ticks_per_timeslice ) {
Old_ticker = (rtems_isr_entry) set_vector( clock_isr, CLOCK_VECTOR, 1 ); Old_ticker = (rtems_isr_entry) set_vector( clock_isr, CLOCK_VECTOR, 1 );
PPC_Set_decrementer( Clock_Decrementer_value ); PPC_Set_decrementer( Clock_Decrementer_value );
atexit( Clock_exit ); atexit( Clock_exit );
} }
}
/* /*
* Clock_exit * Clock_exit
@@ -142,13 +140,10 @@ void Install_clock(
void Clock_exit( void ) void Clock_exit( void )
{ {
if ( BSP_Configuration.ticks_per_timeslice ) {
/* nothing to do */; /* nothing to do */;
/* do not restore old vector */ /* do not restore old vector */
} }
}
/* /*
* Clock_initialize * Clock_initialize

View File

@@ -128,7 +128,6 @@ void Install_clock(
{ {
Clock_driver_ticks = 0; Clock_driver_ticks = 0;
if ( BSP_Configuration.ticks_per_timeslice ) {
Old_ticker = (rtems_isr_entry) set_vector( clock_isr, CLOCK_VECTOR, 1 ); Old_ticker = (rtems_isr_entry) set_vector( clock_isr, CLOCK_VECTOR, 1 );
/* approximately 1 us per countdown */ /* approximately 1 us per countdown */
@@ -149,8 +148,6 @@ void Install_clock(
atexit( Clock_exit ); atexit( Clock_exit );
} }
}
/* /*
* Clock_exit * Clock_exit
* *
@@ -167,7 +164,6 @@ void Install_clock(
void Clock_exit( void ) void Clock_exit( void )
{ {
if ( BSP_Configuration.ticks_per_timeslice ) {
ERC32_Mask_interrupt( ERC32_INTERRUPT_REAL_TIME_CLOCK ); ERC32_Mask_interrupt( ERC32_INTERRUPT_REAL_TIME_CLOCK );
ERC32_MEC_Set_Real_Time_Clock_Timer_Control( ERC32_MEC_Set_Real_Time_Clock_Timer_Control(
@@ -176,7 +172,6 @@ void Clock_exit( void )
/* do not restore old vector */ /* do not restore old vector */
} }
}
/* /*
* Clock_initialize * Clock_initialize

View File

@@ -101,7 +101,6 @@ void Install_clock(rtems_isr_entry clock_isr)
Clock_isrs = rtems_configuration_get_milliseconds_per_tick(); Clock_isrs = rtems_configuration_get_milliseconds_per_tick();
if ( rtems_configuration_get_ticks_per_timeslice() ) {
/* /*
* initialize the interval here * initialize the interval here
* First tick is set to right amount of time in the future * First tick is set to right amount of time in the future
@@ -114,7 +113,6 @@ void Install_clock(rtems_isr_entry clock_isr)
set_itimer((rtems_unsigned32) Clock_clicks_interrupt); set_itimer((rtems_unsigned32) Clock_clicks_interrupt);
(void) set_vector(clock_isr, HPPA_INTERRUPT_EXTERNAL_INTERVAL_TIMER, 1); (void) set_vector(clock_isr, HPPA_INTERRUPT_EXTERNAL_INTERVAL_TIMER, 1);
}
atexit(Clock_exit); atexit(Clock_exit);
} }
@@ -186,10 +184,8 @@ Clock_isr(rtems_vector_number vector)
void void
Clock_exit(void) Clock_exit(void)
{ {
if ( rtems_configuration_get_ticks_per_timeslice() ) {
(void) set_vector(0, HPPA_INTERRUPT_EXTERNAL_INTERVAL_TIMER, 1); (void) set_vector(0, HPPA_INTERRUPT_EXTERNAL_INTERVAL_TIMER, 1);
} }
}
/* /*
* spin delay for specified number of microseconds * spin delay for specified number of microseconds

View File

@@ -160,21 +160,15 @@ void Install_clock(
Clock_driver_ticks = 0; Clock_driver_ticks = 0;
Clock_isrs = rtems_configuration_get_milliseconds_per_tick(); Clock_isrs = rtems_configuration_get_milliseconds_per_tick();
/*
* If ticks_per_timeslice is configured as non-zero, then the user
* wants a clock tick.
*/
if ( rtems_configuration_get_ticks_per_timeslice() ) {
Old_ticker = (rtems_isr_entry) set_vector( clock_isr, CLOCK_VECTOR, 1 ); Old_ticker = (rtems_isr_entry) set_vector( clock_isr, CLOCK_VECTOR, 1 );
/* /*
* Hardware specific initialize goes here * Hardware specific initialize goes here
*/ */
mips_timer_rate = rtems_configuration_get_microseconds_per_tick() * CLOCKS_PER_MICROSECOND; mips_timer_rate =
rtems_configuration_get_microseconds_per_tick() * CLOCKS_PER_MICROSECOND;
mips_set_timer( mips_timer_rate ); mips_set_timer( mips_timer_rate );
enable_int(CLOCK_VECTOR_MASK); enable_int(CLOCK_VECTOR_MASK);
}
/* /*
* Schedule the clock cleanup routine to execute if the application exits. * Schedule the clock cleanup routine to execute if the application exits.
@@ -189,11 +183,9 @@ void Install_clock(
void Clock_exit( void ) void Clock_exit( void )
{ {
if ( rtems_configuration_get_ticks_per_timeslice() ) {
/* mips: turn off the timer interrupts */ /* mips: turn off the timer interrupts */
disable_int(~CLOCK_VECTOR_MASK); disable_int(~CLOCK_VECTOR_MASK);
} }
}
/* /*
* Clock_initialize * Clock_initialize

View File

@@ -160,21 +160,15 @@ void Install_clock(
Clock_driver_ticks = 0; Clock_driver_ticks = 0;
Clock_isrs = rtems_configuration_get_milliseconds_per_tick(); Clock_isrs = rtems_configuration_get_milliseconds_per_tick();
/*
* If ticks_per_timeslice is configured as non-zero, then the user
* wants a clock tick.
*/
if ( rtems_configuration_get_ticks_per_timeslice() ) {
Old_ticker = (rtems_isr_entry) set_vector( clock_isr, CLOCK_VECTOR, 1 ); Old_ticker = (rtems_isr_entry) set_vector( clock_isr, CLOCK_VECTOR, 1 );
/* /*
* Hardware specific initialize goes here * Hardware specific initialize goes here
*/ */
mips_timer_rate = rtems_configuration_get_microseconds_per_tick() * CLOCKS_PER_MICROSECOND; mips_timer_rate =
rtems_configuration_get_microseconds_per_tick() * CLOCKS_PER_MICROSECOND;
mips_set_timer( mips_timer_rate ); mips_set_timer( mips_timer_rate );
enable_int(CLOCK_VECTOR_MASK); enable_int(CLOCK_VECTOR_MASK);
}
/* /*
* Schedule the clock cleanup routine to execute if the application exits. * Schedule the clock cleanup routine to execute if the application exits.
@@ -189,11 +183,9 @@ void Install_clock(
void Clock_exit( void ) void Clock_exit( void )
{ {
if ( rtems_configuration_get_ticks_per_timeslice() ) {
/* mips: turn off the timer interrupts */ /* mips: turn off the timer interrupts */
disable_int(~CLOCK_VECTOR_MASK); disable_int(~CLOCK_VECTOR_MASK);
} }
}
/* /*
* Clock_initialize * Clock_initialize

View File

@@ -48,13 +48,11 @@ rtems_device_minor_number rtems_clock_minor;
void clockOff(void* unused) void clockOff(void* unused)
{ {
if (BSP_Configuration.ticks_per_timeslice) {
/* /*
* Nothing to do as we cannot disable all interrupts and * Nothing to do as we cannot disable all interrupts and
* the decrementer interrupt enable is MSR_EE * the decrementer interrupt enable is MSR_EE
*/ */
} }
}
void clockOn(void* unused) void clockOn(void* unused)
{ {
PPC_Set_decrementer( Clock_Decrementer_value ); PPC_Set_decrementer( Clock_Decrementer_value );
@@ -116,10 +114,8 @@ int clockIsOn(void* unused)
void Clock_exit( void ) void Clock_exit( void )
{ {
if ( BSP_Configuration.ticks_per_timeslice ) {
(void) BSP_disconnect_clock_handler (); (void) BSP_disconnect_clock_handler ();
} }
}
/* /*
* Clock_initialize * Clock_initialize

View File

@@ -81,7 +81,6 @@ void Install_clock(rtems_isr_entry clock_isr)
if (pit_value > 0xffff) { /* pit is only 16 bits long */ if (pit_value > 0xffff) { /* pit is only 16 bits long */
rtems_fatal_error_occurred(-1); rtems_fatal_error_occurred(-1);
} }
if ( rtems_configuration_get_ticks_per_timeslice() ) {
/* /*
* initialize the interval here * initialize the interval here
@@ -102,7 +101,6 @@ void Install_clock(rtems_isr_entry clock_isr)
M821_PISCR_PTE | M821_PISCR_PS | M821_PISCR_PIE; M821_PISCR_PTE | M821_PISCR_PS | M821_PISCR_PIE;
m821.simask |= M821_SIMASK_LVM0; m821.simask |= M821_SIMASK_LVM0;
}
atexit(Clock_exit); atexit(Clock_exit);
} }
@@ -127,13 +125,11 @@ ReInstall_clock(rtems_isr_entry new_clock_isr)
void void
Clock_exit(void) Clock_exit(void)
{ {
if ( rtems_configuration_get_ticks_per_timeslice() ) {
/* disable PIT and PIT interrupts */ /* disable PIT and PIT interrupts */
m821.piscr &= ~(M821_PISCR_PTE | M821_PISCR_PIE); m821.piscr &= ~(M821_PISCR_PTE | M821_PISCR_PIE);
(void) set_vector(0, PPC_IRQ_LVL0, 1); (void) set_vector(0, PPC_IRQ_LVL0, 1);
} }
}
rtems_device_driver Clock_initialize( rtems_device_driver Clock_initialize(
rtems_device_major_number major, rtems_device_major_number major,

View File

@@ -82,7 +82,6 @@ void Install_clock(rtems_isr_entry clock_isr)
if (pit_value > 0xffff) { /* pit is only 16 bits long */ if (pit_value > 0xffff) { /* pit is only 16 bits long */
rtems_fatal_error_occurred(-1); rtems_fatal_error_occurred(-1);
} }
if ( rtems_configuration_get_ticks_per_timeslice() ) {
/* /*
* initialize the interval here * initialize the interval here
@@ -103,7 +102,6 @@ void Install_clock(rtems_isr_entry clock_isr)
M860_PISCR_PTE | M860_PISCR_PS | M860_PISCR_PIE; M860_PISCR_PTE | M860_PISCR_PS | M860_PISCR_PIE;
m860.simask |= M860_SIMASK_LVM0; m860.simask |= M860_SIMASK_LVM0;
}
atexit(Clock_exit); atexit(Clock_exit);
} }
@@ -128,13 +126,11 @@ ReInstall_clock(rtems_isr_entry new_clock_isr)
void void
Clock_exit(void) Clock_exit(void)
{ {
if ( rtems_configuration_get_ticks_per_timeslice() ) {
/* disable PIT and PIT interrupts */ /* disable PIT and PIT interrupts */
m860.piscr &= ~(M860_PISCR_PTE | M860_PISCR_PIE); m860.piscr &= ~(M860_PISCR_PTE | M860_PISCR_PIE);
(void) set_vector(0, PPC_IRQ_LVL0, 1); (void) set_vector(0, PPC_IRQ_LVL0, 1);
} }
}
rtems_device_driver Clock_initialize( rtems_device_driver Clock_initialize(
rtems_device_major_number major, rtems_device_major_number major,

View File

@@ -132,6 +132,7 @@ void Install_clock(rtems_isr_entry clock_isr)
{ {
rtems_isr_entry previous_isr; rtems_isr_entry previous_isr;
rtems_unsigned32 pvr, iocr; rtems_unsigned32 pvr, iocr;
register rtems_unsigned32 tcr;
Clock_driver_ticks = 0; Clock_driver_ticks = 0;
@@ -164,8 +165,6 @@ void Install_clock(rtems_isr_entry clock_isr)
pit_value = rtems_configuration_get_microseconds_per_tick() * pit_value = rtems_configuration_get_microseconds_per_tick() *
rtems_cpu_configuration_get_clicks_per_usec(); rtems_cpu_configuration_get_clicks_per_usec();
if ( rtems_configuration_get_ticks_per_timeslice() ) {
register rtems_unsigned32 tcr;
/* /*
* initialize the interval here * initialize the interval here
@@ -188,7 +187,7 @@ void Install_clock(rtems_isr_entry clock_isr)
tick_time = get_itimer() + pit_value; tick_time = get_itimer() + pit_value;
asm volatile ("mtspr 0x3da, %0" : "=r" ((tcr)) : "0" ((tcr))); /* TCR */ asm volatile ("mtspr 0x3da, %0" : "=r" ((tcr)) : "0" ((tcr))); /* TCR */
}
atexit(Clock_exit); atexit(Clock_exit);
} }
@@ -214,7 +213,6 @@ ReInstall_clock(rtems_isr_entry new_clock_isr)
void void
Clock_exit(void) Clock_exit(void)
{ {
if ( rtems_configuration_get_ticks_per_timeslice() ) {
register rtems_unsigned32 tcr; register rtems_unsigned32 tcr;
asm volatile ("mfspr %0, 0x3da" : "=r" ((tcr))); /* TCR */ asm volatile ("mfspr %0, 0x3da" : "=r" ((tcr))); /* TCR */
@@ -226,8 +224,6 @@ Clock_exit(void)
(void) set_vector(0, PPC_IRQ_PIT, 1); (void) set_vector(0, PPC_IRQ_PIT, 1);
} }
}
rtems_device_driver Clock_initialize( rtems_device_driver Clock_initialize(
rtems_device_major_number major, rtems_device_major_number major,
rtems_device_minor_number minor, rtems_device_minor_number minor,

View File

@@ -223,12 +223,6 @@ void Install_clock(
Clock_limit = cclicks_per_tick / Clock_isrs_const ; Clock_limit = cclicks_per_tick / Clock_isrs_const ;
Clock_isrs = Clock_isrs_const; Clock_isrs = Clock_isrs_const;
/*
* If ticks_per_timeslice is configured as non-zero, then the user
* wants a clock tick.
*/
if ( rtems_configuration_get_ticks_per_timeslice() ) {
rtems_interrupt_catch( Clock_isr, CLOCK_VECTOR, &Old_ticker ); rtems_interrupt_catch( Clock_isr, CLOCK_VECTOR, &Old_ticker );
/* /*
* Hardware specific initialize goes here * Hardware specific initialize goes here
@@ -274,8 +268,6 @@ void Install_clock(
temp8 = read8( ITU_TSTR) |~ITU0_STARTMASK; temp8 = read8( ITU_TSTR) |~ITU0_STARTMASK;
write8( temp8, ITU_TSTR); write8( temp8, ITU_TSTR);
}
/* /*
* Schedule the clock cleanup routine to execute if the application exits. * Schedule the clock cleanup routine to execute if the application exits.
*/ */
@@ -290,7 +282,6 @@ void Install_clock(
void Clock_exit( void ) void Clock_exit( void )
{ {
unsigned8 temp8 = 0; unsigned8 temp8 = 0;
if ( rtems_configuration_get_ticks_per_timeslice() ) {
/* turn off the timer interrupts */ /* turn off the timer interrupts */
/* set interrupt priority to 0 */ /* set interrupt priority to 0 */
@@ -308,7 +299,6 @@ void Clock_exit( void )
/* old vector shall not be installed */ /* old vector shall not be installed */
} }
}
/* /*
* Clock_initialize * Clock_initialize

View File

@@ -161,13 +161,8 @@ void Install_clock(
Clock_MHZ = rtems_cpu_configuration_get_clicks_per_second() / 1000000 ; Clock_MHZ = rtems_cpu_configuration_get_clicks_per_second() / 1000000 ;
/*
* If ticks_per_timeslice is configured as non-zero, then the user
* wants a clock tick.
*/
if ( rtems_configuration_get_ticks_per_timeslice() ) {
rtems_interrupt_catch( Clock_isr, CLOCK_VECTOR, &Old_ticker ); rtems_interrupt_catch( Clock_isr, CLOCK_VECTOR, &Old_ticker );
/* /*
* Hardware specific initialize goes here * Hardware specific initialize goes here
*/ */
@@ -207,16 +202,12 @@ void Install_clock(
/* set counter limits */ /* set counter limits */
write16( _MTU_COUNTER0_MICROSECOND * write16( _MTU_COUNTER0_MICROSECOND *
rtems_configuration_get_microseconds_per_tick(), rtems_configuration_get_microseconds_per_tick(), MTU_GR0A);
MTU_GR0A);
/* start counter */ /* start counter */
temp8 = read8( MTU_TSTR) |~MTU0_STARTMASK; temp8 = read8( MTU_TSTR) |~MTU0_STARTMASK;
write8( temp8, MTU_TSTR); write8( temp8, MTU_TSTR);
}
/* /*
* Schedule the clock cleanup routine to execute if the application exits. * Schedule the clock cleanup routine to execute if the application exits.
*/ */
@@ -231,7 +222,6 @@ void Install_clock(
void Clock_exit( void ) void Clock_exit( void )
{ {
unsigned8 temp8 = 0; unsigned8 temp8 = 0;
if ( rtems_configuration_get_ticks_per_timeslice() ) {
/* turn off the timer interrupts */ /* turn off the timer interrupts */
/* set interrupt priority to 0 */ /* set interrupt priority to 0 */
@@ -249,7 +239,6 @@ void Clock_exit( void )
/* old vector shall not be installed */ /* old vector shall not be installed */
} }
}
/* /*
* Clock_initialize * Clock_initialize