Ignore:
Timestamp:
09/27/95 20:53:58 (28 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
07058e7
Parents:
c701f197
Message:

Modified UNIX simulator port so all references to native unix
stuff is in the executive source proper in the file cpu.c. This
should help avoid conflicts between RTEMS POSIX files and UNIX files.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/unix/posix/clock/clock.c

    rc701f197 r37f4c2d  
    1515 */
    1616
    17 #include <rtems.h>
     17#include <bsp.h>
    1818#include <rtems/libio.h>
    19 #include <bsp.h>
    20 
    21 /*
    22  *  In order to get the types and prototypes used in this file under
    23  *  Solaris 2.3, it is necessary to pull the following magic.
    24  */
    25  
    26 #if defined(solaris)
    27 #warning "Ignore the undefining __STDC__ warning"
    28 #undef __STDC__
    29 #define __STDC__ 0
    30 #undef  _POSIX_C_SOURCE
    31 #endif
    32  
    3319#include <stdlib.h>
    34 #include <stdio.h>
    35 #include <signal.h>
    36 #include <time.h>
    37 
    38 extern rtems_configuration_table Configuration;
    3920
    4021void Clock_exit(void);
    4122
    4223volatile rtems_unsigned32 Clock_driver_ticks;
     24
     25rtems_unsigned32 Clock_driver_vector;
    4326
    4427/*
     
    5235Install_clock(rtems_isr_entry clock_isr)
    5336{
    54     struct itimerval  new;
    55 
    5637    Clock_driver_ticks = 0;
    5738
    58     new.it_value.tv_sec = 0;
    59     new.it_value.tv_usec = Configuration.microseconds_per_tick;
    60     new.it_interval.tv_sec = 0;
    61     new.it_interval.tv_usec = Configuration.microseconds_per_tick;
     39    (void)set_vector(clock_isr, Clock_driver_vector, 1);
    6240
    63     (void)set_vector(clock_isr, SIGALRM, 1);
    64 
    65     setitimer(ITIMER_REAL, &new, 0);
     41    _CPU_Start_clock( BSP_Configuration.microseconds_per_tick );
    6642
    6743    atexit(Clock_exit);
     
    7450
    7551    rtems_interrupt_disable(isrlevel);
    76     (void)set_vector(new_clock_isr, SIGALRM, 1);
     52    (void)set_vector(new_clock_isr, Clock_driver_vector, 1);
    7753    rtems_interrupt_enable(isrlevel);
    7854}
     
    9369Clock_exit(void)
    9470{
    95     struct itimerval  new;
    96      struct sigaction  act;
     71  _CPU_Stop_clock();
    9772
    98      /*
    99       * Set the SIGALRM signal to ignore any last
    100       * signals that might come in while we are
    101       * disarming the timer and removing the interrupt
    102       * vector.
    103       */
    104 
    105      act.sa_handler = SIG_IGN;
    106 
    107      sigaction(SIGALRM, &act, 0);
    108 
    109     new.it_value.tv_sec = 0;
    110     new.it_value.tv_usec = 0;
    111 
    112     setitimer(ITIMER_REAL, &new, 0);
    113 
    114     (void)set_vector(0, SIGALRM, 1);
     73  (void)set_vector(0, Clock_driver_vector, 1);
    11574}
    11675
     
    12281)
    12382{
     83    Clock_driver_vector = _CPU_Get_clock_vector();
     84
    12485    Install_clock((rtems_isr_entry) Clock_isr);
    12586
     
    151112    if (args->command == rtems_build_name('I', 'S', 'R', ' '))
    152113    {
    153         Clock_isr(SIGALRM);
     114        Clock_isr(Clock_driver_vector);
    154115    }
    155116    else if (args->command == rtems_build_name('N', 'E', 'W', ' '))
Note: See TracChangeset for help on using the changeset viewer.