Ignore:
Timestamp:
09/11/95 19:35:39 (27 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
ced11f99
Parents:
5072b07
Message:

The word "RTEMS" almost completely removed from the core.

Configuration Table Template file added and all tests
modified to use this. All gvar.h and conftbl.h files
removed from test directories.

Configuration parameter maximum_devices added.

Core semaphore and mutex handlers added and RTEMS API Semaphore
Manager updated to reflect this.

Initialization sequence changed to invoke API specific initialization
routines. Initialization tasks table now owned by RTEMS Tasks Manager.

Added user extension for post-switch.

Utilized user extensions to implement API specific functionality
like signal dispatching.

Added extensions to the System Initialization Thread so that an
API can register a function to be invoked while the system
is being initialized. These are largely equivalent to the
pre-driver and post-driver hooks.

Added the Modules file oar-go32_p5, modified oar-go32, and modified
the file make/custom/go32.cfg to look at an environment varable which
determines what CPU model is being used.

All BSPs updated to reflect named devices and clock driver's IOCTL
used by the Shared Memory Driver. Also merged clock isr into
main file and removed ckisr.c where possible.

Updated spsize to reflect new and moved variables.

Makefiles for the executive source and include files updated to show
break down of files into Core, RTEMS API, and Neither.

Header and inline files installed into subdirectory based on whether
logically in the Core or a part of the RTEMS API.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/m68k/dmv152/clock/ckinit.c

    r5072b07 r3a4ae6c  
    2020
    2121#include <stdlib.h>
    22 
    23 #include <rtems.h>
     22 
    2423#include <bsp.h>
    25 #include <clockdrv.h>
     24#include <rtems/libio.h>
    2625
    2726rtems_unsigned32 Clock_isrs;        /* ISRs until next tick */
     
    3029rtems_isr_entry  Old_ticker;
    3130
    32 rtems_device_driver Clock_initialize(
    33   rtems_device_major_number major,
    34   rtems_device_minor_number minor,
    35   void *pargp,
    36   rtems_id tid,
    37   rtems_unsigned32 *rval
     31void Clock_exit( void );
     32
     33#define CLOCK_VECTOR  TIMER_VECTOR
     34 
     35/*
     36 * These are set by clock driver during its init
     37 */
     38 
     39rtems_device_major_number rtems_clock_major = ~0;
     40rtems_device_minor_number rtems_clock_minor;
     41
     42/*
     43 *  ISR Handler
     44 */
     45
     46rtems_isr Clock_isr(
     47  rtems_vector_number vector
    3848)
    3949{
    40   Install_clock( Clock_isr );
    41 }
     50  Clock_driver_ticks += 1;
    4251
    43 void ReInstall_clock(
    44   rtems_isr_entry clock_isr
    45 )
    46 {
    47   rtems_unsigned32 isrlevel = 0 ;
     52  Z8x36_WRITE( TIMER, CT1_CMD_STATUS, 0xE2 );
     53  Z8x36_WRITE( TIMER, CT1_CMD_STATUS, 0x22 );
     54  Z8x36_WRITE( TIMER, CT1_CMD_STATUS, 0xC6 );
    4855
    49   rtems_interrupt_disable( isrlevel );
    50    (void) set_vector( clock_isr, TIMER_VECTOR, 1 );
    51   rtems_interrupt_enable( isrlevel );
     56  if ( Clock_isrs == 1 ) {
     57    rtems_clock_tick();
     58    Clock_isrs = BSP_Configuration.microseconds_per_tick / 1000;
     59  }
     60  else
     61    Clock_isrs -= 1;
    5262}
    5363
     
    6272
    6373  if ( BSP_Configuration.ticks_per_timeslice ) {
    64     Old_ticker = (rtems_isr_entry) set_vector( clock_isr, TIMER_VECTOR, 1 );
     74    Old_ticker = (rtems_isr_entry) set_vector( clock_isr, CLOCK_VECTOR, 1 );
    6575
    6676    Z8x36_WRITE( TIMER, MASTER_CFG, 0xd4 );
     
    7080    Z8x36_WRITE( TIMER, CT1_TIME_CONST_LSB, 0xCE );
    7181    Z8x36_WRITE( TIMER, CT1_MODE_SPEC, 0x83 );
    72     Z8x36_WRITE( TIMER, CNT_TMR_VECTOR, TIMER_VECTOR );
     82    Z8x36_WRITE( TIMER, CNT_TMR_VECTOR, CLOCK_VECTOR );
    7383    Z8x36_WRITE( TIMER, CT1_CMD_STATUS, 0x20 );
    7484    Z8x36_READ ( TIMER, MASTER_INTR, data );
     
    8898}
    8999
     100void ReInstall_clock(
     101  rtems_isr_entry clock_isr
     102)
     103{
     104  rtems_unsigned32 isrlevel = 0 ;
     105
     106  rtems_interrupt_disable( isrlevel );
     107   (void) set_vector( clock_isr, CLOCK_VECTOR, 1 );
     108  rtems_interrupt_enable( isrlevel );
     109}
     110
    90111void Clock_exit( void )
    91112{
     
    100121  }
    101122}
     123
     124rtems_device_driver Clock_initialize(
     125  rtems_device_major_number major,
     126  rtems_device_minor_number minor,
     127  void *pargp
     128)
     129{
     130  Install_clock( Clock_isr );
     131 
     132  /*
     133   * make major/minor avail to others such as shared memory driver
     134   */
     135 
     136  rtems_clock_major = major;
     137  rtems_clock_minor = minor;
     138 
     139  return RTEMS_SUCCESSFUL;
     140}
     141 
     142rtems_device_driver Clock_control(
     143  rtems_device_major_number major,
     144  rtems_device_minor_number minor,
     145  void *pargp
     146)
     147{
     148    rtems_libio_ioctl_args_t *args = pargp;
     149 
     150    if (args == 0)
     151        goto done;
     152 
     153    /*
     154     * This is hokey, but until we get a defined interface
     155     * to do this, it will just be this simple...
     156     */
     157 
     158    if (args->command == rtems_build_name('I', 'S', 'R', ' '))
     159    {
     160        Clock_isr(CLOCK_VECTOR);
     161    }
     162    else if (args->command == rtems_build_name('N', 'E', 'W', ' '))
     163    {
     164        ReInstall_clock(args->buffer);
     165    }
     166 
     167done:
     168    return RTEMS_SUCCESSFUL;
     169}
     170
Note: See TracChangeset for help on using the changeset viewer.