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

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

View File

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

View File

@@ -65,12 +65,6 @@ void Install_clock(
Reload_Clock_isrs = BSP_Configuration.microseconds_per_tick / 1000;
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 TMR_WRITE_CNTL 8
#define TMR_AUTO_RELOAD 4
@@ -78,9 +72,6 @@ void Install_clock(
#define TMR_TERM_CNT_STAT 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 */
@@ -102,13 +93,11 @@ void Clock_exit()
{
volatile unsigned int *tmr0 = (unsigned int *) TMR0_ADDR;
if ( BSP_Configuration.ticks_per_timeslice ) {
/* shut down the timer */
*tmr0 = *tmr0 & ~TMR_ENABLE;
i960_mask_intr( 12 );
/* do not restore old vector */
}
}
rtems_device_driver Clock_initialize(

View File

@@ -69,7 +69,6 @@ void Install_clock(
Clock_driver_ticks = 0;
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 );
Z8x36_WRITE( TIMER, MASTER_CFG, 0xd4 );
@@ -93,20 +92,15 @@ void Install_clock(
Z8x36_WRITE( TIMER, CT1_CMD_STATUS, 0xC6 );
atexit( Clock_exit );
}
}
void Clock_exit( void )
{
rtems_unsigned8 data;
if ( BSP_Configuration.ticks_per_timeslice ) {
Z8x36_READ ( TIMER, MASTER_INTR, data );
Z8x36_WRITE( TIMER, MASTER_INTR, (data & 0x01) );
/* do not restore old vector */
}
}
rtems_device_driver Clock_initialize(

View File

@@ -57,7 +57,6 @@ void Install_clock(
Clock_driver_ticks = 0;
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 );
/* enable 1mS interrupts */
@@ -66,22 +65,16 @@ void Install_clock(
( SAM(ISRL_PIT,8,PIRQL) | SAM(CLOCK_VECTOR,0,PIV) );
atexit( Clock_exit );
}
}
void Clock_exit( void )
{
if ( BSP_Configuration.ticks_per_timeslice ) {
/* shutdown the periodic interrupt */
*PICR = (unsigned short int)
( SAM(0,8,PIRQL) | SAM(CLOCK_VECTOR,0,PIV) );
/* ^^ zero disables interrupt */
/* do not restore old vector */
}
}
rtems_device_driver Clock_initialize(

View File

@@ -82,27 +82,20 @@ void Install_clock(
Clock_driver_ticks = 0;
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 );
*MSR = RS; /* enable 1mS interrupts */
*ICR0 |= OME;
atexit( Clock_exit );
}
}
void Clock_exit( void )
{
if ( BSP_Configuration.ticks_per_timeslice ) {
/* shutdown periodic interrupt */
*MSR = RS;
*ICR0 &= 0xc0;
/* do not restore old vector */
}
}
rtems_device_driver Clock_initialize(

View File

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

View File

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

View File

@@ -101,19 +101,21 @@ Clock_isr (rtems_vector_number vector)
void
Clock_exit (void)
{
if (BSP_Configuration.ticks_per_timeslice ) {
/*
* Turn off periodic interval timer
*/
m360.pitr &= ~0xFF;
}
}
static void
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;
if ( BSP_Configuration.ticks_per_timeslice ) {
/*
* Choose periodic interval timer register value
* 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
* 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;
divisor = rtems_nsec_per_tick / nsec_per_pit_tick;
if (divisor >= 256) {
divisor = 255;
}
else if (divisor == 0) {
} else if (divisor == 0) {
divisor = 1;
}
pit_nsec_per_tick = nsec_per_pit_tick * divisor;
@@ -148,7 +145,6 @@ Install_clock (rtems_isr_entry clock_isr)
set_vector (clock_isr, CLOCK_VECTOR, 1);
m360.pitr |= divisor;
atexit (Clock_exit);
}
}
rtems_device_driver

View File

@@ -96,7 +96,6 @@ rtems_isr_entry clock_isr;
Clock_driver_ticks = 0;
Clock_isrs = (int)(Configuration.microseconds_per_tick / 1000);
if ( Configuration.ticks_per_timeslice ) {
/* led_putnum('c'); * for debugging purposes */
Old_ticker = (rtems_isr_entry) set_vector( clock_isr, CLOCK_VECTOR, 1 );
@@ -126,7 +125,6 @@ rtems_isr_entry clock_isr;
* Schedule the clock cleanup routine to execute if the application exits.
*/
atexit( Clock_exit );
}
}
/* The following was added for debugging purposes */
@@ -134,8 +132,6 @@ void Clock_exit( void )
{
rtems_unsigned8 data;
if ( Configuration.ticks_per_timeslice ) {
/* disable timer
data = TCR;
TCR = (data & 0xFE); */
@@ -143,7 +139,6 @@ void Clock_exit( void )
MC68230_WRITE (TCR, (data & 0xFE));
/* do not restore old vector */
}
}
rtems_device_driver Clock_initialize(

View File

@@ -81,7 +81,6 @@ void Install_clock(
Clock_driver_ticks = 0;
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 );
timer = (struct z8036_map *) 0xfffb0000;
timer->MASTER_INTR = MICRVAL;
@@ -103,22 +102,18 @@ void Install_clock(
(*(rtems_unsigned8 *)0xfffb0038) &= 0xfd;
atexit( Clock_exit );
}
}
void Clock_exit( void )
{
volatile struct z8036_map *timer;
if ( BSP_Configuration.ticks_per_timeslice ) {
timer = (struct z8036_map *) 0xfffb0000;
timer->MASTER_INTR = 0x62;
timer->CT1_MODE_SPEC = 0x00;
timer->MASTER_CFG = 0xf4;
timer->CT1_CMD_STATUS = 0x00;
/* do not restore old vector */
}
}
rtems_device_driver Clock_initialize(

View File

@@ -67,9 +67,7 @@ void Install_clock(rtems_isr_entry clock_isr )
Clock_driver_ticks = 0;
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_preload = MS_COUNT;
@@ -79,14 +77,11 @@ void Install_clock(rtems_isr_entry clock_isr )
/* Enable Timer 2 and set its int. level */
atexit( Clock_exit );
}
}
void Clock_exit( void )
{
if ( BSP_Configuration.ticks_per_timeslice ) {
pcc->timer2_int_control = 0x00; /* Disable T2 Interr. */
}
}
rtems_device_driver Clock_initialize(

View File

@@ -71,9 +71,7 @@ void Install_clock(rtems_isr_entry clock_isr )
Clock_driver_ticks = 0;
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->to_ctl = 0xE7; /* prescaler to 1 MHz (see Appendix A1) */
lcsr->timer_cmp_2 = MS_COUNT;
@@ -85,7 +83,6 @@ void Install_clock(rtems_isr_entry clock_isr )
lcsr->intr_ena |= 0x02000000; /* enable tick timer 2 interrupt */
atexit( Clock_exit );
}
}
void Clock_exit( void )

View File

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

View File

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

View File

@@ -98,19 +98,12 @@ void Install_clock(
Clock_driver_ticks = 0;
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 );
/*
* Hardware specific initialize goes here
*/
/* XXX */
}
/*
* Schedule the clock cleanup routine to execute if the application exits.
@@ -125,12 +118,9 @@ void Install_clock(
void Clock_exit( void )
{
if ( BSP_Configuration.ticks_per_timeslice ) {
/* XXX: turn off the timer interrupts */
/* XXX: If necessary, restore the old vector */
}
}
/*

View File

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

View File

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

View File

@@ -122,14 +122,11 @@ void Install_clock(
{
Clock_driver_ticks = 0;
if ( BSP_Configuration.ticks_per_timeslice ) {
Old_ticker = (rtems_isr_entry) set_vector( clock_isr, CLOCK_VECTOR, 1 );
PPC_Set_decrementer( CPU_PPC_CLICKS_PER_TICK );
atexit( Clock_exit );
}
}
/*
@@ -148,12 +145,9 @@ void Install_clock(
void Clock_exit( void )
{
if ( BSP_Configuration.ticks_per_timeslice ) {
/* nothing to do */;
/* do not restore old vector */
}
}
/*

View File

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

View File

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

View File

@@ -101,7 +101,6 @@ void Install_clock(rtems_isr_entry clock_isr)
Clock_isrs = rtems_configuration_get_milliseconds_per_tick();
if ( rtems_configuration_get_ticks_per_timeslice() ) {
/*
* initialize the interval here
* 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);
(void) set_vector(clock_isr, HPPA_INTERRUPT_EXTERNAL_INTERVAL_TIMER, 1);
}
atexit(Clock_exit);
}
@@ -186,9 +184,7 @@ Clock_isr(rtems_vector_number vector)
void
Clock_exit(void)
{
if ( rtems_configuration_get_ticks_per_timeslice() ) {
(void) set_vector(0, HPPA_INTERRUPT_EXTERNAL_INTERVAL_TIMER, 1);
}
}
/*

View File

@@ -160,21 +160,15 @@ void Install_clock(
Clock_driver_ticks = 0;
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 );
/*
* 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 );
enable_int(CLOCK_VECTOR_MASK);
}
/*
* Schedule the clock cleanup routine to execute if the application exits.
@@ -189,10 +183,8 @@ void Install_clock(
void Clock_exit( void )
{
if ( rtems_configuration_get_ticks_per_timeslice() ) {
/* mips: turn off the timer interrupts */
disable_int(~CLOCK_VECTOR_MASK);
}
}
/*

View File

@@ -160,21 +160,15 @@ void Install_clock(
Clock_driver_ticks = 0;
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 );
/*
* 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 );
enable_int(CLOCK_VECTOR_MASK);
}
/*
* Schedule the clock cleanup routine to execute if the application exits.
@@ -189,10 +183,8 @@ void Install_clock(
void Clock_exit( void )
{
if ( rtems_configuration_get_ticks_per_timeslice() ) {
/* mips: turn off the timer interrupts */
disable_int(~CLOCK_VECTOR_MASK);
}
}
/*

View File

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

View File

@@ -81,7 +81,6 @@ void Install_clock(rtems_isr_entry clock_isr)
if (pit_value > 0xffff) { /* pit is only 16 bits long */
rtems_fatal_error_occurred(-1);
}
if ( rtems_configuration_get_ticks_per_timeslice() ) {
/*
* 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.simask |= M821_SIMASK_LVM0;
}
atexit(Clock_exit);
}
@@ -127,12 +125,10 @@ ReInstall_clock(rtems_isr_entry new_clock_isr)
void
Clock_exit(void)
{
if ( rtems_configuration_get_ticks_per_timeslice() ) {
/* disable PIT and PIT interrupts */
m821.piscr &= ~(M821_PISCR_PTE | M821_PISCR_PIE);
(void) set_vector(0, PPC_IRQ_LVL0, 1);
}
}
rtems_device_driver Clock_initialize(

View File

@@ -82,7 +82,6 @@ void Install_clock(rtems_isr_entry clock_isr)
if (pit_value > 0xffff) { /* pit is only 16 bits long */
rtems_fatal_error_occurred(-1);
}
if ( rtems_configuration_get_ticks_per_timeslice() ) {
/*
* 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.simask |= M860_SIMASK_LVM0;
}
atexit(Clock_exit);
}
@@ -128,12 +126,10 @@ ReInstall_clock(rtems_isr_entry new_clock_isr)
void
Clock_exit(void)
{
if ( rtems_configuration_get_ticks_per_timeslice() ) {
/* disable PIT and PIT interrupts */
m860.piscr &= ~(M860_PISCR_PTE | M860_PISCR_PIE);
(void) set_vector(0, PPC_IRQ_LVL0, 1);
}
}
rtems_device_driver Clock_initialize(

View File

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

View File

@@ -223,12 +223,6 @@ void Install_clock(
Clock_limit = cclicks_per_tick / 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 );
/*
* Hardware specific initialize goes here
@@ -274,8 +268,6 @@ void Install_clock(
temp8 = read8( ITU_TSTR) |~ITU0_STARTMASK;
write8( temp8, ITU_TSTR);
}
/*
* Schedule the clock cleanup routine to execute if the application exits.
*/
@@ -290,7 +282,6 @@ void Install_clock(
void Clock_exit( void )
{
unsigned8 temp8 = 0;
if ( rtems_configuration_get_ticks_per_timeslice() ) {
/* turn off the timer interrupts */
/* set interrupt priority to 0 */
@@ -307,7 +298,6 @@ void Clock_exit( void )
write8( temp8, ITU_TSTR);
/* old vector shall not be installed */
}
}
/*

View File

@@ -161,13 +161,8 @@ void Install_clock(
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 );
/*
* Hardware specific initialize goes here
*/
@@ -207,16 +202,12 @@ void Install_clock(
/* set counter limits */
write16( _MTU_COUNTER0_MICROSECOND *
rtems_configuration_get_microseconds_per_tick(),
MTU_GR0A);
rtems_configuration_get_microseconds_per_tick(), MTU_GR0A);
/* start counter */
temp8 = read8( MTU_TSTR) |~MTU0_STARTMASK;
write8( temp8, MTU_TSTR);
}
/*
* Schedule the clock cleanup routine to execute if the application exits.
*/
@@ -231,7 +222,6 @@ void Install_clock(
void Clock_exit( void )
{
unsigned8 temp8 = 0;
if ( rtems_configuration_get_ticks_per_timeslice() ) {
/* turn off the timer interrupts */
/* set interrupt priority to 0 */
@@ -248,7 +238,6 @@ void Clock_exit( void )
write8( temp8, MTU_TSTR);
/* old vector shall not be installed */
}
}
/*