Changeset 3a4ae6c in rtems for c/src/lib/libbsp/m68k


Ignore:
Timestamp:
Sep 11, 1995, 7:35:39 PM (26 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.

Location:
c/src/lib/libbsp/m68k
Files:
22 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
  • c/src/lib/libbsp/m68k/dmv152/console/console.c

    r5072b07 r3a4ae6c  
    1515#define D152_INIT
    1616
    17 #include <rtems.h>
    18 #include "console.h"
    19 #include "bsp.h"
    20 
     17#include <bsp.h>
     18#include <rtems/libio.h>
     19 
    2120/*  console_initialize
    2221 *
     
    2928 *  Return values:
    3029 */
    31 
     30 
    3231rtems_device_driver console_initialize(
    3332  rtems_device_major_number  major,
    3433  rtems_device_minor_number  minor,
    35   void                      *arg,
    36   rtems_id                   self,
    37   rtems_unsigned32          *status
    38 )
    39 {
    40   *status = RTEMS_SUCCESSFUL;
    41 }
    42 
     34  void                      *arg
     35)
     36{
     37  rtems_status_code status;
     38 
     39  status = rtems_io_register_name(
     40    "/dev/console",
     41    major,
     42    (rtems_device_minor_number) 0
     43  );
     44 
     45  if (status != RTEMS_SUCCESSFUL)
     46    rtems_fatal_error_occurred(status);
     47 
     48  return RTEMS_SUCCESSFUL;
     49}
    4350
    4451/*  is_character_ready
     
    140147
    141148/*
    142  * __read  -- read bytes from the serial port. Ignore fd, since
    143  *            we only have stdin.
    144  */
    145 
    146 int __read(
    147   int fd,
    148   char *buf,
    149   int nbytes
    150 )
    151 {
    152   int i = 0;
    153 
    154   for (i = 0; i < nbytes; i++) {
    155     *(buf + i) = inbyte();
    156     if ((*(buf + i) == '\n') || (*(buf + i) == '\r')) {
    157       (*(buf + i++)) = '\n';
    158       (*(buf + i)) = 0;
     149 *  Open entry point
     150 */
     151
     152rtems_device_driver console_open(
     153  rtems_device_major_number major,
     154  rtems_device_minor_number minor,
     155  void                    * arg
     156)
     157{
     158  return RTEMS_SUCCESSFUL;
     159}
     160 
     161/*
     162 *  Close entry point
     163 */
     164
     165rtems_device_driver console_close(
     166  rtems_device_major_number major,
     167  rtems_device_minor_number minor,
     168  void                    * arg
     169)
     170{
     171  return RTEMS_SUCCESSFUL;
     172}
     173
     174/*
     175 * read bytes from the serial port. We only have stdin.
     176 */
     177
     178rtems_device_driver console_read(
     179  rtems_device_major_number major,
     180  rtems_device_minor_number minor,
     181  void                    * arg
     182)
     183{
     184  rtems_libio_rw_args_t *rw_args;
     185  char *buffer;
     186  int maximum;
     187  int count = 0;
     188 
     189  rw_args = (rtems_libio_rw_args_t *) arg;
     190
     191  buffer = rw_args->buffer;
     192  maximum = rw_args->count;
     193
     194  for (count = 0; count < maximum; count++) {
     195    buffer[ count ] = inbyte();
     196    if (buffer[ count ] == '\n' || buffer[ count ] == '\r') {
     197      buffer[ count++ ]  = '\n';
     198      buffer[ count ]  = 0;
    159199      break;
    160200    }
    161201  }
    162   return (i);
    163 }
    164 
    165 /*
    166  * __write -- write bytes to the serial port. Ignore fd, since
    167  *            stdout and stderr are the same. Since we have no filesystem,
    168  *            open will only return an error.
    169  */
    170 
    171 int __write(
    172   int fd,
    173   char *buf,
    174   int nbytes
    175 )
    176 {
    177   int i;
    178 
    179   for (i = 0; i < nbytes; i++) {
    180     if (*(buf + i) == '\n') {
    181       outbyte ('\r');
     202
     203  rw_args->bytes_moved = count;
     204  return (count >= 0) ? RTEMS_SUCCESSFUL : RTEMS_UNSATISFIED;
     205}
     206
     207/*
     208 * write bytes to the serial port. Stdout and stderr are the same.
     209 */
     210
     211rtems_device_driver console_write(
     212  rtems_device_major_number major,
     213  rtems_device_minor_number minor,
     214  void                    * arg
     215)
     216{
     217  int count;
     218  int maximum;
     219  rtems_libio_rw_args_t *rw_args;
     220  char *buffer;
     221
     222  rw_args = (rtems_libio_rw_args_t *) arg;
     223
     224  buffer = rw_args->buffer;
     225  maximum = rw_args->count;
     226
     227  for (count = 0; count < maximum; count++) {
     228    if ( buffer[ count ] == '\n') {
     229      outbyte('\r');
    182230    }
    183     outbyte (*(buf + i));
    184   }
    185   return (nbytes);
    186 }
     231    outbyte( buffer[ count ] );
     232  }
     233  return maximum;
     234}
     235
     236/*
     237 *  IO Control entry point
     238 */
     239
     240rtems_device_driver console_control(
     241  rtems_device_major_number major,
     242  rtems_device_minor_number minor,
     243  void                    * arg
     244)
     245{
     246  return RTEMS_SUCCESSFUL;
     247}
  • c/src/lib/libbsp/m68k/dmv152/include/bsp.h

    r5072b07 r3a4ae6c  
    2222
    2323#include <rtems.h>
     24#include <console.h>
     25#include <clockdrv.h>
    2426#include <iosupp.h>
     27#include <vmeintr.h>
    2528#include <z8530.h>
    2629#include <z8536.h>
     
    152155extern m68k_isr_entry M68Kvec[];   /* vector table address */
    153156
     157/*
     158 *  Device Driver Table Entries
     159 */
     160
     161/*
     162 * NOTE: Use the standard Console driver entry
     163 */
     164 
     165/*
     166 * NOTE: Use the standard Clock driver entry
     167 */
     168
     169/*
     170 * How many libio files we want
     171 */
     172
     173#define BSP_LIBIO_MAX_FDS       20
     174
    154175/* functions */
    155176
  • c/src/lib/libbsp/m68k/dmv152/startup/bspstart.c

    r5072b07 r3a4ae6c  
    2222 */
    2323
    24 #include <rtems.h>
    2524#include <bsp.h>
     25#include <rtems/libio.h>
     26 
    2627#include <libcsupport.h>
    27 #include <vmeintr.h>
    28 
     28 
     29#include <string.h>
     30#include <fcntl.h>
     31 
     32#ifdef STACK_CHECKER_ON
     33#include <stackchk.h>
     34#endif
    2935/*
    3036 *  The original table from the application and our copy of it with
     
    3642
    3743rtems_cpu_table Cpu_table;
     44
     45char *rtems_progname;
    3846
    3947/*      Initialize whatever libc we are using
     
    5361
    5462    /*
     63     *  Init the RTEMS libio facility to provide UNIX-like system
     64     *  calls for use by newlib (ie: provide __open, __close, etc)
     65     *  Uses malloc() to get area for the iops, so must be after malloc init
     66     */
     67
     68    rtems_libio_init();
     69
     70    /*
    5571     * Set up for the libc handling.
    5672     */
     
    7086}
    7187
    72 int bsp_start(
     88/*
     89 * After drivers are setup, register some "filenames"
     90 * and open stdin, stdout, stderr files
     91 *
     92 * Newlib will automatically associate the files with these
     93 * (it hardcodes the numbers)
     94 */
     95 
     96void
     97bsp_postdriver_hook(void)
     98{
     99  int stdin_fd, stdout_fd, stderr_fd;
     100 
     101  if ((stdin_fd = __open("/dev/console", O_RDONLY, 0)) == -1)
     102    rtems_fatal_error_occurred('STD0');
     103 
     104  if ((stdout_fd = __open("/dev/console", O_WRONLY, 0)) == -1)
     105    rtems_fatal_error_occurred('STD1');
     106 
     107  if ((stderr_fd = __open("/dev/console", O_WRONLY, 0)) == -1)
     108    rtems_fatal_error_occurred('STD2');
     109 
     110  if ((stdin_fd != 0) || (stdout_fd != 1) || (stderr_fd != 2))
     111    rtems_fatal_error_occurred('STIO');
     112}
     113
     114int main(
    73115  int argc,
    74116  char **argv,
     
    80122  void           *vbr;
    81123
     124  if ((argc > 0) && argv && argv[0])
     125    rtems_progname = argv[0];
     126  else
     127    rtems_progname = "RTEMS";
     128
    82129  monitors_vector_table = (m68k_isr_entry *)0;   /* Monitor Vectors are at 0 */
    83130  m68k_set_vbr( monitors_vector_table );
     
    116163  Cpu_table.predriver_hook = bsp_libc_init;  /* RTEMS resources available */
    117164
    118   Cpu_table.postdriver_hook = NULL;   /* Call our main() for constructors */
     165  Cpu_table.postdriver_hook = bsp_postdriver_hook;
    119166
    120167  Cpu_table.idle_task = NULL;  /* do not override system IDLE task */
     
    159206    BSP_Configuration.maximum_extensions++;
    160207#endif
     208
     209  /*
     210   * Tell libio how many fd's we want and allow it to tweak config
     211   */
     212
     213  rtems_libio_config(&BSP_Configuration, BSP_LIBIO_MAX_FDS);
    161214
    162215  rtems_initialize_executive( &BSP_Configuration, &Cpu_table );
  • c/src/lib/libbsp/m68k/gen68302/clock/ckinit.c

    r5072b07 r3a4ae6c  
    2121#include <stdlib.h>                     /* for atexit() */
    2222
    23 #include <rtems.h>
    2423#include <bsp.h>
    25 #include <clockdrv.h>
     24#include <rtems/libio.h>
     25
    2626#include "m68302.h"
    2727
     28#define CLOCK_VECTOR 137
    2829
    2930#define TMR1_VAL (  RBIT_TMR_RST        /* software reset the timer */\
     
    5051rtems_unsigned32 Clock_isrs;
    5152
     53void Clock_exit( void );
     54 
     55/*
     56 * These are set by clock driver during its init
     57 */
     58 
     59rtems_device_major_number rtems_clock_major = ~0;
     60rtems_device_minor_number rtems_clock_minor;
    5261
    53 rtems_device_driver Clock_initialize(
    54   rtems_device_major_number major,
    55   rtems_device_minor_number minor,
    56   void *pargp,
    57   rtems_id tid,
    58   rtems_unsigned32 *rval
     62/*
     63 *  ISR Handler
     64 */
     65
     66rtems_isr Clock_isr(
     67  rtems_vector_number vector
    5968)
    6069{
    61   Install_clock( Clock_isr );
     70  Clock_driver_ticks += 1;
     71
     72  m302.reg.isr  = RBIT_ISR_TIMER1;      /* clear in-service bit */
     73  m302.reg.ter1 = (RBIT_TER_REF | RBIT_TER_CAP); /* clear timer intr request */
     74
     75  if ( Clock_isrs == 1 ) {
     76    rtems_clock_tick();
     77    Clock_isrs = BSP_Configuration.microseconds_per_tick / 1000;
     78  }
     79  else
     80    Clock_isrs -= 1;
    6281}
    63 
    6482
    6583void Install_clock(
     
    7290
    7391  if ( BSP_Configuration.ticks_per_timeslice ) {
    74 /*  set_vector( clock_isr, 137, 1 );*/
     92/*  set_vector( clock_isr, CLOCK_VECTOR, 1 );*/
    7593
    7694    m302.reg.trr1 = TRR1_VAL;           /* set timer reference register */
     
    85103}
    86104
     105void ReInstall_clock(
     106  rtems_isr_entry clock_isr
     107)
     108{
     109  rtems_unsigned32 isrlevel;
     110 
     111  rtems_interrupt_disable( isrlevel );
     112   /* (void) set_vector( clock_isr, CLOCK_VECTOR, 1 ); */
     113  rtems_interrupt_enable( isrlevel );
     114}
    87115
    88116void Clock_exit( void )
     
    93121  }
    94122}
     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
  • c/src/lib/libbsp/m68k/gen68302/console/console.c

    r5072b07 r3a4ae6c  
    1515#define GEN68302_INIT
    1616
    17 #include <rtems.h>
    18 #include "console.h"
    1917#include <bsp.h>
     18#include <rtems/libio.h>
    2019
    2120#include "m68302.h"
     
    3534  rtems_device_major_number  major,
    3635  rtems_device_minor_number  minor,
    37   void                      *arg,
    38   rtems_id                   self,
    39   rtems_unsigned32          *status
    40 )
    41 {
     36  void                      *arg
     37)
     38{
     39  rtems_status_code status;
    4240  volatile m302_dualPortRAM_t *p = &m302;
    4341
     
    8280  p->reg.scc[1].scm  = 0x01BD;
    8381
    84   *status = RTEMS_SUCCESSFUL;
    85 }
    86 
     82  status = rtems_io_register_name(
     83    "/dev/console",
     84    major,
     85    (rtems_device_minor_number) 0
     86  );
     87 
     88  if (status != RTEMS_SUCCESSFUL)
     89    rtems_fatal_error_occurred(status);
     90 
     91  return RTEMS_SUCCESSFUL;
     92
     93}
    8794
    8895/*  is_character_ready
     
    195202
    196203/*
    197  * __read  -- read bytes from the serial port. Ignore fd, since
    198  *            we only have stdin.
    199  */
    200 
    201 int __read(
    202   int fd,
    203   char *buf,
    204   int nbytes
    205 )
    206 {
    207   int i = 0;
    208 
    209   for (i = 0; i < nbytes; i++) {
    210     *(buf + i) = inbyte();
    211     if ((*(buf + i) == '\n') || (*(buf + i) == '\r')) {
    212       (*(buf + i++)) = '\n';
    213       (*(buf + i)) = 0;
     204 *  Open entry point
     205 */
     206
     207rtems_device_driver console_open(
     208  rtems_device_major_number major,
     209  rtems_device_minor_number minor,
     210  void                    * arg
     211)
     212{
     213  return RTEMS_SUCCESSFUL;
     214}
     215 
     216/*
     217 *  Close entry point
     218 */
     219
     220rtems_device_driver console_close(
     221  rtems_device_major_number major,
     222  rtems_device_minor_number minor,
     223  void                    * arg
     224)
     225{
     226  return RTEMS_SUCCESSFUL;
     227}
     228
     229/*
     230 * read bytes from the serial port. We only have stdin.
     231 */
     232
     233rtems_device_driver console_read(
     234  rtems_device_major_number major,
     235  rtems_device_minor_number minor,
     236  void                    * arg
     237)
     238{
     239  rtems_libio_rw_args_t *rw_args;
     240  char *buffer;
     241  int maximum;
     242  int count = 0;
     243 
     244  rw_args = (rtems_libio_rw_args_t *) arg;
     245
     246  buffer = rw_args->buffer;
     247  maximum = rw_args->count;
     248
     249  for (count = 0; count < maximum; count++) {
     250    buffer[ count ] = inbyte();
     251    if (buffer[ count ] == '\n' || buffer[ count ] == '\r') {
     252      buffer[ count++ ]  = '\n';
     253      buffer[ count ]  = 0;
    214254      break;
    215255    }
    216256  }
    217   return (i);
    218 }
    219 
    220 /*
    221  * __write -- write bytes to the serial port. Ignore fd, since
    222  *            stdout and stderr are the same. Since we have no filesystem,
    223  *            open will only return an error.
    224  */
    225 
    226 int __write(
    227   int fd,
    228   char *buf,
    229   int nbytes
    230 )
    231 {
    232   int i;
    233 
    234   for (i = 0; i < nbytes; i++) {
    235     if (*(buf + i) == '\n') {
    236       outbyte ('\r');
     257
     258  rw_args->bytes_moved = count;
     259  return (count >= 0) ? RTEMS_SUCCESSFUL : RTEMS_UNSATISFIED;
     260}
     261
     262/*
     263 * write bytes to the serial port. Stdout and stderr are the same.
     264 */
     265
     266rtems_device_driver console_write(
     267  rtems_device_major_number major,
     268  rtems_device_minor_number minor,
     269  void                    * arg
     270)
     271{
     272  int count;
     273  int maximum;
     274  rtems_libio_rw_args_t *rw_args;
     275  char *buffer;
     276
     277  rw_args = (rtems_libio_rw_args_t *) arg;
     278
     279  buffer = rw_args->buffer;
     280  maximum = rw_args->count;
     281
     282  for (count = 0; count < maximum; count++) {
     283    if ( buffer[ count ] == '\n') {
     284      outbyte('\r');
    237285    }
    238     outbyte (*(buf + i));
     286    outbyte( buffer[ count ] );
    239287  }
    240   return (nbytes);
    241 }
     288  return maximum;
     289}
     290
     291/*
     292 *  IO Control entry point
     293 */
     294
     295rtems_device_driver console_control(
     296  rtems_device_major_number major,
     297  rtems_device_minor_number minor,
     298  void                    * arg
     299)
     300{
     301  return RTEMS_SUCCESSFUL;
     302}
  • c/src/lib/libbsp/m68k/gen68302/include/bsp.h

    r5072b07 r3a4ae6c  
    2424
    2525#include <rtems.h>
     26#include <console.h>
    2627#include <iosupp.h>
     28#include <clockdrv.h>
    2729
    2830/*
     
    8284#endif
    8385
     86/*
     87 *  Device Driver Table Entries
     88 */
     89
     90/*
     91 * NOTE: Use the standard Console driver entry
     92 */
     93 
     94/*
     95 * NOTE: Use the standard Clock driver entry
     96 */
     97
     98/*
     99 * How many libio files we want
     100 */
     101
     102#define BSP_LIBIO_MAX_FDS       20
     103
    84104/* miscellaneous stuff assumed to exist */
    85105
  • c/src/lib/libbsp/m68k/gen68302/start/start302.s

    r5072b07 r3a4ae6c  
    228228#endif
    229229
    230         jsr     SYM (bsp_start)
     230        move.l  #0,a7@-               | environp
     231        move.l  #0,a7@-               | argv
     232        move.l  #0,a7@-               | argc
     233        jsr     SYM (main)
    231234
    232235        nop
  • c/src/lib/libbsp/m68k/gen68302/start302/start302.s

    r5072b07 r3a4ae6c  
    228228#endif
    229229
    230         jsr     SYM (bsp_start)
     230        move.l  #0,a7@-               | environp
     231        move.l  #0,a7@-               | argv
     232        move.l  #0,a7@-               | argc
     233        jsr     SYM (main)
    231234
    232235        nop
  • c/src/lib/libbsp/m68k/gen68302/startup/bspstart.c

    r5072b07 r3a4ae6c  
    2121 */
    2222
    23 #include <rtems.h>
    2423#include <bsp.h>
     24#include <rtems/libio.h>
     25 
    2526#include <libcsupport.h>
    26 
     27 
     28#include <string.h>
     29#include <fcntl.h>
     30 
     31#ifdef STACK_CHECKER_ON
     32#include <stackchk.h>
     33#endif
    2734
    2835/*
     
    3542
    3643rtems_cpu_table Cpu_table;
     44
     45char *rtems_progname;
    3746
    3847/*      Initialize whatever libc we are using
     
    5968
    6069    /*
     70     *  Init the RTEMS libio facility to provide UNIX-like system
     71     *  calls for use by newlib (ie: provide __open, __close, etc)
     72     *  Uses malloc() to get area for the iops, so must be after malloc init
     73     */
     74
     75    rtems_libio_init();
     76
     77    /*
    6178     * Set up for the libc handling.
    6279     */
     
    7693}
    7794
    78 
    79 int bsp_start(
     95/*
     96 * After drivers are setup, register some "filenames"
     97 * and open stdin, stdout, stderr files
     98 *
     99 * Newlib will automatically associate the files with these
     100 * (it hardcodes the numbers)
     101 */
     102 
     103void
     104bsp_postdriver_hook(void)
     105{
     106  int stdin_fd, stdout_fd, stderr_fd;
     107 
     108  if ((stdin_fd = __open("/dev/console", O_RDONLY, 0)) == -1)
     109    rtems_fatal_error_occurred('STD0');
     110 
     111  if ((stdout_fd = __open("/dev/console", O_WRONLY, 0)) == -1)
     112    rtems_fatal_error_occurred('STD1');
     113 
     114  if ((stderr_fd = __open("/dev/console", O_WRONLY, 0)) == -1)
     115    rtems_fatal_error_occurred('STD2');
     116 
     117  if ((stdin_fd != 0) || (stdout_fd != 1) || (stderr_fd != 2))
     118    rtems_fatal_error_occurred('STIO');
     119}
     120
     121int main(
    80122  int argc,
    81123  char **argv,
     
    83125)
    84126{
     127  if ((argc > 0) && argv && argv[0])
     128    rtems_progname = argv[0];
     129  else
     130    rtems_progname = "RTEMS";
     131
    85132  /*
    86133   *  Allocate the memory for the RTEMS Work Space.  This can come from
     
    91138   */
    92139#if 0
    93 a  Cpu_table.interrupt_vector_table = (mc68000_isr *) 0/*&M68Kvec*/;
     140  Cpu_table.interrupt_vector_table = (mc68000_isr *) 0/*&M68Kvec*/;
    94141#endif
    95142
     
    122169    BSP_Configuration.maximum_extensions++;
    123170#endif
     171
     172  /*
     173   * Tell libio how many fd's we want and allow it to tweak config
     174   */
     175
     176  rtems_libio_config(&BSP_Configuration, BSP_LIBIO_MAX_FDS);
    124177
    125178  /*
     
    144197  Cpu_table.predriver_hook = bsp_libc_init;    /* RTEMS resources available */
    145198
    146   Cpu_table.postdriver_hook = NULL;
     199  Cpu_table.postdriver_hook = bsp_postdriver_hook;
    147200
    148201  Cpu_table.idle_task = NULL;  /* do not override system IDLE task */
  • c/src/lib/libbsp/m68k/idp/clock/ckinit.c

    r5072b07 r3a4ae6c  
    2727#include <stdlib.h>
    2828
    29 #include <rtems.h>
    30 #include <clockdrv.h>
    3129#include <bsp.h>
     30#include <rtems/libio.h>
    3231
    3332rtems_unsigned32 Clock_isrs;        /* ISRs until next tick */
     
    4039void Disable_clock();
    4140
    42 #define TIMER_VECTOR 0x4D
    43 
    44 rtems_device_driver Clock_initialize(
    45   rtems_device_major_number major,
    46   rtems_device_minor_number minor,
    47   void *pargp,
    48   rtems_id tid,
    49   rtems_unsigned32 *rval
     41#define CLOCK_VECTOR 0x4D
     42
     43void Clock_exit( void );
     44 
     45/*
     46 * These are set by clock driver during its init
     47 */
     48 
     49rtems_device_major_number rtems_clock_major = ~0;
     50rtems_device_minor_number rtems_clock_minor;
     51 
     52
     53/*
     54 *  ISR Handler
     55 *
     56 *
     57 * ((1ms * 6.5 MHz) / 2^5) = 203.125) where 6.5 MHz is the clock rate of the
     58 * MC68230, 2^5 is the prescaler factor, and 1ms is the common interrupt
     59 * interval for the Clock_isr routine.
     60 * Therefore, 203 (decimal) is the number to program into the CPRH-L registers
     61 * of the MC68230 for countdown.  However, I have found that 193 instead of
     62 * 203 provides greater accuracy -- why?  The crystal should be more accurate
     63 * than that
     64 */
     65
     66rtems_isr Clock_isr(
     67  rtems_vector_number vector
    5068)
    5169{
    52   Install_clock( Clock_isr );
    53 }
    54 
    55 void ReInstall_clock( clock_isr )
    56 rtems_isr_entry clock_isr;
    57 {
    58   rtems_unsigned32 isrlevel = 0 ;
    59 
    60   rtems_interrupt_disable( isrlevel );
    61    (void) set_vector( clock_isr, TIMER_VECTOR, 1 );
    62   rtems_interrupt_enable( isrlevel );
    63 }
    64 
    65 /* The following was added for debugging purposes */
     70  Clock_driver_ticks += 1;
     71  /* acknowledge interrupt
     72        TSR = 1; */
     73  MC68230_WRITE (TSR, 1);
     74
     75  if ( Clock_isrs == 1 ) {
     76    rtems_clock_tick();
     77        /* Cast to an integer so that 68EC040 IDP which doesn't have an FPU doesn't
     78           have a heart attack -- if you use newlib1.6 or greater and get
     79           libgcc.a for gcc with software floating point support, this is not
     80           a problem */
     81    Clock_isrs =
     82      (int)(BSP_Configuration.microseconds_per_tick / 1000);
     83  }
     84  else
     85    Clock_isrs -= 1;
     86}
     87
    6688void Disable_clock()
    6789{
     
    78100  if ( Configuration.ticks_per_timeslice ) {
    79101/*    led_putnum('c'); * for debugging purposes */
    80     Old_ticker = (rtems_isr_entry) set_vector( clock_isr, TIMER_VECTOR, 1 );
     102    Old_ticker = (rtems_isr_entry) set_vector( clock_isr, CLOCK_VECTOR, 1 );
    81103
    82104        /* Disable timer for initialization */
     
    86108           file in this directory to understand why I use the values that I do */
    87109        /* Set up the interrupt vector on the MC68230 chip:
    88                 TIVR = TIMER_VECTOR; */
    89         MC68230_WRITE (TIVR, TIMER_VECTOR);
     110                TIVR = CLOCK_VECTOR; */
     111        MC68230_WRITE (TIVR, CLOCK_VECTOR);
    90112
    91113        /* Set CPRH through CPRL to 193 (not 203) decimal for countdown--see ckisr.c
     
    109131}
    110132
     133void ReInstall_clock( clock_isr )
     134rtems_isr_entry clock_isr;
     135{
     136  rtems_unsigned32 isrlevel = 0 ;
     137
     138  rtems_interrupt_disable( isrlevel );
     139   (void) set_vector( clock_isr, CLOCK_VECTOR, 1 );
     140  rtems_interrupt_enable( isrlevel );
     141}
     142
     143/* The following was added for debugging purposes */
    111144void Clock_exit( void )
    112145{
     
    124157  }
    125158}
     159
     160rtems_device_driver Clock_initialize(
     161  rtems_device_major_number major,
     162  rtems_device_minor_number minor,
     163  void *pargp
     164)
     165{
     166  Install_clock( Clock_isr );
     167 
     168  /*
     169   * make major/minor avail to others such as shared memory driver
     170   */
     171 
     172  rtems_clock_major = major;
     173  rtems_clock_minor = minor;
     174 
     175  return RTEMS_SUCCESSFUL;
     176}
     177 
     178rtems_device_driver Clock_control(
     179  rtems_device_major_number major,
     180  rtems_device_minor_number minor,
     181  void *pargp
     182)
     183{
     184    rtems_libio_ioctl_args_t *args = pargp;
     185 
     186    if (args == 0)
     187        goto done;
     188 
     189    /*
     190     * This is hokey, but until we get a defined interface
     191     * to do this, it will just be this simple...
     192     */
     193 
     194    if (args->command == rtems_build_name('I', 'S', 'R', ' '))
     195    {
     196        Clock_isr(CLOCK_VECTOR);
     197    }
     198    else if (args->command == rtems_build_name('N', 'E', 'W', ' '))
     199    {
     200        ReInstall_clock(args->buffer);
     201    }
     202 
     203done:
     204    return RTEMS_SUCCESSFUL;
     205}
     206
  • c/src/lib/libbsp/m68k/idp/console/console.c

    r5072b07 r3a4ae6c  
    1212#define MIDP_INIT
    1313
    14 #include "rtems.h"
    15 #include "console.h"
    16 #include "bsp.h"
    17 
    18 #include "ringbuf.h"
     14#include <bsp.h>
     15#include <rtems/libio.h>
     16
     17#include <ringbuf.h>
    1918
    2019Ring_buffer_t  Buffer[ 2 ];
    2120
    2221rtems_isr C_Receive_ISR(rtems_vector_number vector);
    23 
    2422
    2523/*  console_initialize
     
    3735  rtems_device_major_number  major,
    3836  rtems_device_minor_number  minor,
    39   void                      *arg,
    40   rtems_id                   self,
    41   rtems_unsigned32          *status
    42 )
    43 {
     37  void                      *arg
     38)
     39{
     40  rtems_status_code status;
    4441
    4542  Ring_buffer_Initialize( &Buffer[ 0 ] );
     
    4845  init_pit();
    4946
    50   *status = RTEMS_SUCCESSFUL;
     47  status = rtems_io_register_name(
     48    "/dev/console",
     49    major,
     50    (rtems_device_minor_number) 0
     51  );
     52 
     53  if (status != RTEMS_SUCCESSFUL)
     54    rtems_fatal_error_occurred(status);
     55 
     56  status = rtems_io_register_name(
     57    "/dev/tty00",
     58    major,
     59    (rtems_device_minor_number) 0
     60  );
     61 
     62  if (status != RTEMS_SUCCESSFUL)
     63    rtems_fatal_error_occurred(status);
     64 
     65  status = rtems_io_register_name(
     66    "/dev/tty01",
     67    major,
     68    (rtems_device_minor_number) 1
     69  );
     70 
     71  if (status != RTEMS_SUCCESSFUL)
     72    rtems_fatal_error_occurred(status);
     73 
     74  return RTEMS_SUCCESSFUL;
    5175}
    5276
     
    152176
    153177/*
    154  * __read  -- read bytes from the serial port. Ignore fd, since
    155  *            we only have stdin.
    156  */
    157 
    158 int __read(
    159   int fd,
    160   char *buf,
    161   int nbytes
    162 )
    163 {
    164   int i = 0;
    165   int port;
    166 
    167   /*
    168    *  Map port A to stdin, stdout, and stderr.
    169    *  Map everything else to port B.
    170    */
    171 
    172   if ( fd <= 2 ) port = 0;
    173   else           port = 1;
    174 
    175   for (i = 0; i < nbytes; i++) {
    176     *(buf + i) = inbyte( port );
    177     if ((*(buf + i) == '\n') || (*(buf + i) == '\r')) {
    178       (*(buf + i++)) = '\n';
    179       (*(buf + i)) = 0;
     178 *  Open entry point
     179 */
     180
     181rtems_device_driver console_open(
     182  rtems_device_major_number major,
     183  rtems_device_minor_number minor,
     184  void                    * arg
     185)
     186{
     187  return RTEMS_SUCCESSFUL;
     188}
     189 
     190/*
     191 *  Close entry point
     192 */
     193
     194rtems_device_driver console_close(
     195  rtems_device_major_number major,
     196  rtems_device_minor_number minor,
     197  void                    * arg
     198)
     199{
     200  return RTEMS_SUCCESSFUL;
     201}
     202
     203/*
     204 * read bytes from the serial port. We only have stdin.
     205 */
     206
     207rtems_device_driver console_read(
     208  rtems_device_major_number major,
     209  rtems_device_minor_number minor,
     210  void                    * arg
     211)
     212{
     213  rtems_libio_rw_args_t *rw_args;
     214  char *buffer;
     215  int maximum;
     216  int count = 0;
     217 
     218  rw_args = (rtems_libio_rw_args_t *) arg;
     219
     220  buffer = rw_args->buffer;
     221  maximum = rw_args->count;
     222
     223  if ( minor > 1 )
     224    return RTEMS_INVALID_NUMBER;
     225
     226  for (count = 0; count < maximum; count++) {
     227    buffer[ count ] = inbyte( minor );
     228    if (buffer[ count ] == '\n' || buffer[ count ] == '\r') {
     229      buffer[ count++ ]  = '\n';
     230      buffer[ count ]  = 0;
    180231      break;
    181232    }
    182233  }
    183   return (i);
    184 }
    185 
    186 /*
    187  * __write -- write bytes to the serial port. Ignore fd, since
    188  *            stdout and stderr are the same. Since we have no filesystem,
    189  *            open will only return an error.
    190  */
    191 
    192 int __write(
    193   int fd,
    194   char *buf,
    195   int nbytes
    196 )
    197 {
    198   int i;
    199   int port;
    200  
    201   /*
    202    *  Map port A to stdin, stdout, and stderr.
    203    *  Map everything else to port B.
    204    */
    205  
    206   if ( fd <= 2 ) port = 0;
    207   else           port = 1;
    208  
    209   for (i = 0; i < nbytes; i++) {
    210     if (*(buf + i) == '\n') {
    211       outbyte ('\r', port );
     234
     235  rw_args->bytes_moved = count;
     236  return (count >= 0) ? RTEMS_SUCCESSFUL : RTEMS_UNSATISFIED;
     237}
     238
     239/*
     240 * write bytes to the serial port. Stdout and stderr are the same.
     241 */
     242
     243rtems_device_driver console_write(
     244  rtems_device_major_number major,
     245  rtems_device_minor_number minor,
     246  void                    * arg
     247)
     248{
     249  int count;
     250  int maximum;
     251  rtems_libio_rw_args_t *rw_args;
     252  char *buffer;
     253
     254  rw_args = (rtems_libio_rw_args_t *) arg;
     255
     256  buffer = rw_args->buffer;
     257  maximum = rw_args->count;
     258
     259  if ( minor > 1 )
     260    return RTEMS_INVALID_NUMBER;
     261
     262  for (count = 0; count < maximum; count++) {
     263    if ( buffer[ count ] == '\n') {
     264      outbyte('\r', minor );
    212265    }
    213     outbyte (*(buf + i), port );
     266    outbyte( buffer[ count ], minor );
    214267  }
    215   return (nbytes);
    216 }
     268  return maximum;
     269}
     270
     271/*
     272 *  IO Control entry point
     273 */
     274
     275rtems_device_driver console_control(
     276  rtems_device_major_number major,
     277  rtems_device_minor_number minor,
     278  void                    * arg
     279)
     280{
     281  return RTEMS_SUCCESSFUL;
     282}
  • c/src/lib/libbsp/m68k/idp/include/bsp.h

    r5072b07 r3a4ae6c  
    1111#include <rtems.h>
    1212#include <console.h>
     13#include <clockdrv.h>
    1314#include <mc68230.h>
    1415#include <mc68681.h>
     
    5354#endif
    5455
     56/*
     57 *  Device Driver Table Entries
     58 */
     59
     60/*
     61 * NOTE: Use the standard Console driver entry
     62 */
     63 
     64/*
     65 * NOTE: Use the standard Clock driver entry
     66 */
     67
     68/*
     69 * How many libio files we want
     70 */
     71
     72#define BSP_LIBIO_MAX_FDS       20
     73
    5574/* miscellaneous stuff assumed to exist */
    5675
  • c/src/lib/libbsp/m68k/idp/startup/bspstart.c

    r5072b07 r3a4ae6c  
    2121 */
    2222
    23 #include <rtems.h>
    2423#include <bsp.h>
     24#include <rtems/libio.h>
     25 
    2526#include <libcsupport.h>
     27 
     28#include <string.h>
     29#include <fcntl.h>
     30 
     31#ifdef STACK_CHECKER_ON
     32#include <stackchk.h>
     33#endif
    2634
    2735unsigned char *duart_base;
     
    4250rtems_cpu_table Cpu_table;
    4351 
     52char *rtems_progname;
     53
    4454/*      Initialize whatever libc we are using
    4555 *      called from postdriver hook
     
    5767        /* Create 64 KByte memory region for RTEMS executive */
    5868    RTEMS_Malloc_Initialize((void *) heap_start, 64 * 1024, 0);
     69
     70    /*
     71     *  Init the RTEMS libio facility to provide UNIX-like system
     72     *  calls for use by newlib (ie: provide __open, __close, etc)
     73     *  Uses malloc() to get area for the iops, so must be after malloc init
     74     */
     75
     76    rtems_libio_init();
    5977 
    6078    /*
     
    7795 
    7896
    79 int bsp_start(
     97/*
     98 * After drivers are setup, register some "filenames"
     99 * and open stdin, stdout, stderr files
     100 *
     101 * Newlib will automatically associate the files with these
     102 * (it hardcodes the numbers)
     103 */
     104 
     105void
     106bsp_postdriver_hook(void)
     107{
     108  int stdin_fd, stdout_fd, stderr_fd;
     109 
     110  if ((stdin_fd = __open("/dev/console", O_RDONLY, 0)) == -1)
     111    rtems_fatal_error_occurred('STD0');
     112 
     113  if ((stdout_fd = __open("/dev/console", O_WRONLY, 0)) == -1)
     114    rtems_fatal_error_occurred('STD1');
     115 
     116  if ((stderr_fd = __open("/dev/console", O_WRONLY, 0)) == -1)
     117    rtems_fatal_error_occurred('STD2');
     118 
     119  if ((stdin_fd != 0) || (stdout_fd != 1) || (stderr_fd != 2))
     120    rtems_fatal_error_occurred('STIO');
     121}
     122
     123int main(
    80124  int argc,
    81125  char **argv,
     
    86130  int             index;
    87131
     132  if ((argc > 0) && argv && argv[0])
     133    rtems_progname = argv[0];
     134  else
     135    rtems_progname = "RTEMS";
     136
    88137  duart_base = (unsigned char *)DUART_ADDR;
    89138
     
    122171  Cpu_table.predriver_hook = bsp_libc_init;  /* RTEMS resources available */
    123172 
    124   Cpu_table.postdriver_hook = NULL;
     173  Cpu_table.postdriver_hook = bsp_postdriver_hook;
    125174 
    126175  Cpu_table.idle_task = NULL;  /* do not override system IDLE task */
     
    165214#endif
    166215 
     216  /*
     217   * Tell libio how many fd's we want and allow it to tweak config
     218   */
     219
     220  rtems_libio_config(&BSP_Configuration, BSP_LIBIO_MAX_FDS);
     221
    167222/*  led_putnum('e'); * for debugging purposes only */
    168223  rtems_initialize_executive( &BSP_Configuration, &Cpu_table );/* does not return */
  • c/src/lib/libbsp/m68k/mvme136/clock/ckinit.c

    r5072b07 r3a4ae6c  
    2121#include <stdlib.h>
    2222
    23 #include <rtems.h>
    2423#include <bsp.h>
    25 #include <clockdrv.h>
     24#include <rtems/libio.h>
    2625#include <z8036.h>
    2726
     
    3635                                    /*   and trigger countdown */
    3736
     37#define TIMER        0xfffb0000
     38#define RELOAD       0x24            /* clr IP & IUS,allow countdown */
     39 
     40#define CLOCK_VECTOR 66
     41
    3842rtems_unsigned32 Clock_isrs;        /* ISRs until next tick */
    39 volatile rtems_unsigned32 Clock_driver_ticks;
    40                                     /* ticks since initialization */
     43
     44volatile rtems_unsigned32 Clock_driver_ticks; /* ticks since initialization */
     45
    4146rtems_isr_entry  Old_ticker;
    4247
    43 rtems_device_driver Clock_initialize(
    44   rtems_device_major_number major,
    45   rtems_device_minor_number minor,
    46   void *pargp,
    47   rtems_id tid,
    48   rtems_unsigned32 *rval
     48void Clock_exit( void );
     49
     50/*
     51 * These are set by clock driver during its init
     52 */
     53 
     54rtems_device_major_number rtems_clock_major = ~0;
     55rtems_device_minor_number rtems_clock_minor;
     56 
     57/*
     58 *  ISR Handler
     59 */
     60 
     61rtems_isr Clock_isr(
     62  rtems_vector_number vector
    4963)
    5064{
    51   Install_clock( Clock_isr );
    52 }
     65  Clock_driver_ticks += 1;
     66  ((volatile struct z8036_map *) TIMER)->CT1_CMD_STATUS = RELOAD;
    5367
    54 void ReInstall_clock(
    55   rtems_isr_entry clock_isr
    56 )
    57 {
    58   rtems_unsigned32 isrlevel;
    59 
    60   rtems_interrupt_disable( isrlevel );
    61    (void) set_vector( clock_isr, 66, 1 );
    62   rtems_interrupt_enable( isrlevel );
     68  if ( Clock_isrs == 1 ) {
     69    rtems_clock_tick();
     70    Clock_isrs = BSP_Configuration.microseconds_per_tick / 1000;
     71  }
     72  else
     73    Clock_isrs -= 1;
    6374}
    6475
     
    7384
    7485  if ( BSP_Configuration.ticks_per_timeslice ) {
    75     Old_ticker = (rtems_isr_entry) set_vector( clock_isr, 66, 1 );
     86    Old_ticker = (rtems_isr_entry) set_vector( clock_isr, CLOCK_VECTOR, 1 );
    7687    timer = (struct z8036_map *) 0xfffb0000;
    7788    timer->MASTER_INTR        = MICRVAL;
    7889    timer->CT1_MODE_SPEC      = T1MSRVAL;
    7990
    80   *((rtems_unsigned16 *)0xfffb0016) = MS_COUNT;  /* write countdown value */
    81 /*
    82     timer->CT1_TIME_CONST_MSB = (MS_COUNT >> 8);
    83     timer->CT1_TIME_CONST_LSB = (MS_COUNT &  0xff);
    84 */
     91    *((rtems_unsigned16 *)0xfffb0016) = MS_COUNT;  /* write countdown value */
     92
     93    /*
     94     *  timer->CT1_TIME_CONST_MSB = (MS_COUNT >> 8);
     95     *  timer->CT1_TIME_CONST_LSB = (MS_COUNT &  0xff);
     96     */
     97
    8598    timer->MASTER_CFG         = MCCRVAL;
    8699    timer->CT1_CMD_STATUS     = T1CSRVAL;
    87100
    88 /*
    89  * Enable interrupt via VME interrupt mask register
    90  */
     101    /*
     102     * Enable interrupt via VME interrupt mask register
     103     */
    91104    (*(rtems_unsigned8 *)0xfffb0038) &= 0xfd;
    92 
    93105
    94106    atexit( Clock_exit );
    95107  }
    96108
     109}
     110
     111void ReInstall_clock(
     112  rtems_isr_entry clock_isr
     113)
     114{
     115  rtems_unsigned32 isrlevel;
     116
     117  rtems_interrupt_disable( isrlevel );
     118   (void) set_vector( clock_isr, CLOCK_VECTOR, 1 );
     119  rtems_interrupt_enable( isrlevel );
    97120}
    98121
     
    110133  }
    111134}
     135
     136rtems_device_driver Clock_initialize(
     137  rtems_device_major_number major,
     138  rtems_device_minor_number minor,
     139  void *pargp
     140)
     141{
     142  Install_clock( Clock_isr );
     143
     144  /*
     145   * make major/minor avail to others such as shared memory driver
     146   */
     147
     148  rtems_clock_major = major;
     149  rtems_clock_minor = minor;
     150 
     151  return RTEMS_SUCCESSFUL;
     152}
     153
     154rtems_device_driver Clock_control(
     155  rtems_device_major_number major,
     156  rtems_device_minor_number minor,
     157  void *pargp
     158)
     159{
     160    rtems_libio_ioctl_args_t *args = pargp;
     161 
     162    if (args == 0)
     163        goto done;
     164 
     165    /*
     166     * This is hokey, but until we get a defined interface
     167     * to do this, it will just be this simple...
     168     */
     169 
     170    if (args->command == rtems_build_name('I', 'S', 'R', ' '))
     171    {
     172        Clock_isr(CLOCK_VECTOR);
     173    }
     174    else if (args->command == rtems_build_name('N', 'E', 'W', ' '))
     175    {
     176        ReInstall_clock(args->buffer);
     177    }
     178 
     179done:
     180    return RTEMS_SUCCESSFUL;
     181}
     182
  • c/src/lib/libbsp/m68k/mvme136/console/console.c

    r5072b07 r3a4ae6c  
    1515#define M136_INIT
    1616
    17 #include <rtems.h>
    18 #include "console.h"
    19 #include "bsp.h"
     17#include <bsp.h>
     18#include <rtems/libio.h>
    2019
    2120/*  console_initialize
     
    3332  rtems_device_major_number  major,
    3433  rtems_device_minor_number  minor,
    35   void                      *arg,
    36   rtems_id                   self,
    37   rtems_unsigned32          *status
    38 )
    39 {
     34  void                      *arg
     35)
     36{
     37  rtems_status_code status;
     38
    4039  _Write_m681 = ( struct w_m681_info * ) M681ADDR;
    4140  _Read_m681 = ( struct r_m681_info * ) M681ADDR;
    42   *status = RTEMS_SUCCESSFUL;
     41
     42  status = rtems_io_register_name(
     43    "/dev/console",
     44    major,
     45    (rtems_device_minor_number) 0
     46  );
     47
     48  if (status != RTEMS_SUCCESSFUL)
     49    rtems_fatal_error_occurred(status);
     50 
     51  return RTEMS_SUCCESSFUL;
    4352}
    4453
     
    113122
    114123/*
    115  * __read  -- read bytes from the serial port. Ignore fd, since
    116  *            we only have stdin.
    117  */
    118 
    119 int __read(
    120   int fd,
    121   char *buf,
    122   int nbytes
    123 )
    124 {
    125   int i = 0;
    126 
    127   for (i = 0; i < nbytes; i++) {
    128     *(buf + i) = inbyte();
    129     if ((*(buf + i) == '\n') || (*(buf + i) == '\r')) {
    130       (*(buf + i++)) = '\n';
    131       (*(buf + i)) = 0;
     124 *  Open entry point
     125 */
     126
     127rtems_device_driver console_open(
     128  rtems_device_major_number major,
     129  rtems_device_minor_number minor,
     130  void                    * arg
     131)
     132{
     133  return RTEMS_SUCCESSFUL;
     134}
     135 
     136/*
     137 *  Close entry point
     138 */
     139
     140rtems_device_driver console_close(
     141  rtems_device_major_number major,
     142  rtems_device_minor_number minor,
     143  void                    * arg
     144)
     145{
     146  return RTEMS_SUCCESSFUL;
     147}
     148
     149/*
     150 * read bytes from the serial port. We only have stdin.
     151 */
     152
     153rtems_device_driver console_read(
     154  rtems_device_major_number major,
     155  rtems_device_minor_number minor,
     156  void                    * arg
     157)
     158{
     159  rtems_libio_rw_args_t *rw_args;
     160  char *buffer;
     161  int maximum;
     162  int count = 0;
     163 
     164  rw_args = (rtems_libio_rw_args_t *) arg;
     165
     166  buffer = rw_args->buffer;
     167  maximum = rw_args->count;
     168
     169  for (count = 0; count < maximum; count++) {
     170    buffer[ count ] = inbyte();
     171    if (buffer[ count ] == '\n' || buffer[ count ] == '\r') {
     172      buffer[ count++ ]  = '\n';
     173      buffer[ count ]  = 0;
    132174      break;
    133175    }
    134176  }
    135   return (i);
    136 }
    137 
    138 /*
    139  * __write -- write bytes to the serial port. Ignore fd, since
    140  *            stdout and stderr are the same. Since we have no filesystem,
    141  *            open will only return an error.
    142  */
    143 
    144 int __write(
    145   int fd,
    146   char *buf,
    147   int nbytes
    148 )
    149 {
    150   int i;
    151 
    152   for (i = 0; i < nbytes; i++) {
    153     if (*(buf + i) == '\n') {
    154       outbyte ('\r');
     177
     178  rw_args->bytes_moved = count;
     179  return (count >= 0) ? RTEMS_SUCCESSFUL : RTEMS_UNSATISFIED;
     180}
     181
     182/*
     183 * write bytes to the serial port. Stdout and stderr are the same.
     184 */
     185
     186rtems_device_driver console_write(
     187  rtems_device_major_number major,
     188  rtems_device_minor_number minor,
     189  void                    * arg
     190)
     191{
     192  int count;
     193  int maximum;
     194  rtems_libio_rw_args_t *rw_args;
     195  char *buffer;
     196
     197  rw_args = (rtems_libio_rw_args_t *) arg;
     198
     199  buffer = rw_args->buffer;
     200  maximum = rw_args->count;
     201
     202  for (count = 0; count < maximum; count++) {
     203    if ( buffer[ count ] == '\n') {
     204      outbyte('\r');
    155205    }
    156     outbyte (*(buf + i));
     206    outbyte( buffer[ count ] );
    157207  }
    158   return (nbytes);
    159 }
     208  return maximum;
     209}
     210
     211/*
     212 *  IO Control entry point
     213 */
     214
     215rtems_device_driver console_control(
     216  rtems_device_major_number major,
     217  rtems_device_minor_number minor,
     218  void                    * arg
     219)
     220{
     221  return RTEMS_SUCCESSFUL;
     222}
  • c/src/lib/libbsp/m68k/mvme136/include/bsp.h

    r5072b07 r3a4ae6c  
    2222
    2323#include <rtems.h>
     24#include <clockdrv.h>
     25#include <console.h>
    2426#include <iosupp.h>
    2527
     
    125127extern m68k_isr_entry M68Kvec[];   /* vector table address */
    126128
     129/*
     130 *  Device Driver Table Entries
     131 */
     132
     133/*
     134 * NOTE: Use the standard Console driver entry
     135 */
     136 
     137/*
     138 * NOTE: Use the standard Clock driver entry
     139 */
     140
     141/*
     142 * How many libio files we want
     143 */
     144
     145#define BSP_LIBIO_MAX_FDS       20
     146
    127147/* functions */
    128148
  • c/src/lib/libbsp/m68k/mvme136/startup/bspstart.c

    r5072b07 r3a4ae6c  
    2121 */
    2222
    23 #include <rtems.h>
    2423#include <bsp.h>
     24#include <rtems/libio.h>
     25
    2526#include <libcsupport.h>
    2627#include <z8036.h>
    2728
    28 #include "stackchk.h"
     29#include <string.h>
     30#include <fcntl.h>
     31
     32#ifdef STACK_CHECKER_ON
     33#include <stackchk.h>
     34#endif
    2935
    3036/*
     
    3743
    3844rtems_cpu_table Cpu_table;
     45
     46char *rtems_progname;
    3947
    4048/*      Initialize whatever libc we are using
     
    4755    rtems_unsigned32        heap_start;
    4856
     57#ifdef RTEMS_DEBUG
     58    rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
     59#endif
     60
    4961    heap_start = (rtems_unsigned32) &end;
    5062    if (heap_start & (CPU_ALIGNMENT-1))
     
    5264
    5365    RTEMS_Malloc_Initialize((void *) heap_start, 64 * 1024, 0);
     66
     67    /*
     68     *  Init the RTEMS libio facility to provide UNIX-like system
     69     *  calls for use by newlib (ie: provide __open, __close, etc)
     70     *  Uses malloc() to get area for the iops, so must be after malloc init
     71     */
     72
     73    rtems_libio_init();
    5474
    5575    /*
     
    7191}
    7292
    73 int bsp_start(
     93/*
     94 * After drivers are setup, register some "filenames"
     95 * and open stdin, stdout, stderr files
     96 *
     97 * Newlib will automatically associate the files with these
     98 * (it hardcodes the numbers)
     99 */
     100 
     101void
     102bsp_postdriver_hook(void)
     103{
     104  int stdin_fd, stdout_fd, stderr_fd;
     105
     106  if ((stdin_fd = __open("/dev/console", O_RDONLY, 0)) == -1)
     107    rtems_fatal_error_occurred('STD0');
     108 
     109  if ((stdout_fd = __open("/dev/console", O_WRONLY, 0)) == -1)
     110    rtems_fatal_error_occurred('STD1');
     111 
     112  if ((stderr_fd = __open("/dev/console", O_WRONLY, 0)) == -1)
     113    rtems_fatal_error_occurred('STD2');
     114 
     115  if ((stdin_fd != 0) || (stdout_fd != 1) || (stderr_fd != 2))
     116    rtems_fatal_error_occurred('STIO');
     117}
     118
     119
     120int main(
    74121  int argc,
    75122  char **argv,
     
    80127  int             index;
    81128
     129  if ((argc > 0) && argv && argv[0])
     130    rtems_progname = argv[0];
     131  else
     132    rtems_progname = "RTEMS";
     133
    82134  monitors_vector_table = (m68k_isr_entry *)0;   /* 135Bug Vectors are at 0 */
    83135  m68k_set_vbr( monitors_vector_table );
     
    105157  Cpu_table.predriver_hook = bsp_libc_init;  /* RTEMS resources available */
    106158
    107   Cpu_table.postdriver_hook = NULL;
     159  Cpu_table.postdriver_hook = bsp_postdriver_hook;
    108160
    109161  Cpu_table.idle_task = NULL;  /* do not override system IDLE task */
     
    148200#endif
    149201
     202  /*
     203   * Tell libio how many fd's we want and allow it to tweak config
     204   */
     205
     206  rtems_libio_config(&BSP_Configuration, BSP_LIBIO_MAX_FDS);
     207
    150208  rtems_initialize_executive( &BSP_Configuration, &Cpu_table );
    151209  /* does not return */
  • c/src/lib/libbsp/m68k/mvme162/clock/ckinit.c

    r5072b07 r3a4ae6c  
    2828#include <stdlib.h>
    2929
    30 #include <rtems.h>
    3130#include <bsp.h>
    32 #include <clockdrv.h>
     31#include <rtems/libio.h>
    3332
    3433#define MS_COUNT          1000            /* T2's countdown constant (1 ms) */
     
    3938rtems_isr_entry  Old_ticker;
    4039
    41 rtems_device_driver Clock_initialize(
    42   rtems_device_major_number major,
    43   rtems_device_minor_number minor,
    44   void *pargp,
    45   rtems_id tid,
    46   rtems_unsigned32 *rval
    47 )
     40void Clock_exit( void );
     41 
     42#define CLOCK_VECTOR (VBR0 * 0x10 + 0x9)
     43/*
     44 * These are set by clock driver during its init
     45 */
     46 
     47rtems_device_major_number rtems_clock_major = ~0;
     48rtems_device_minor_number rtems_clock_minor;
     49 
     50
     51/*
     52 *  ISR Handler
     53 */
     54
     55rtems_isr Clock_isr(rtems_vector_number vector)
    4856{
    49   Install_clock( Clock_isr );
    50 }
     57  Clock_driver_ticks += 1;
     58  lcsr->timer_cnt_2 = 0;            /* clear counter */
     59  lcsr->intr_clear |= 0x02000000;
    5160
    52 void ReInstall_clock(rtems_isr_entry clock_isr)
    53 {
    54   rtems_unsigned32 isrlevel;
    55 
    56   rtems_interrupt_disable( isrlevel );
    57   (void) set_vector( clock_isr, VBR0 * 0x10 + 0x9, 1 );
    58   rtems_interrupt_enable( isrlevel );
     61  if ( Clock_isrs == 1 ) {
     62    rtems_clock_tick();
     63    Clock_isrs = BSP_Configuration.microseconds_per_tick / 1000;
     64  }
     65  else
     66    Clock_isrs -= 1;
    5967}
    6068
     
    6775  if ( BSP_Configuration.ticks_per_timeslice ) {
    6876    Old_ticker =
    69       (rtems_isr_entry) set_vector( clock_isr, VBR0 * 0x10 + 0x9, 1 );
     77      (rtems_isr_entry) set_vector( clock_isr, CLOCK_VECTOR, 1 );
    7078    lcsr->vector_base |= MASK_INT;   /* unmask VMEchip2 interrupts */
    7179    lcsr->to_ctl = 0xE7;             /* prescaler to 1 MHz (see Appendix A1) */
     
    8088    atexit( Clock_exit );
    8189  }
     90}
    8291
     92void ReInstall_clock(rtems_isr_entry clock_isr)
     93{
     94  rtems_unsigned32 isrlevel;
     95
     96  rtems_interrupt_disable( isrlevel );
     97  (void) set_vector( clock_isr, CLOCK_VECTOR, 1 );
     98  rtems_interrupt_enable( isrlevel );
    8399}
    84100
     
    87103/* Dummy for now. See other m68k BSP's for code examples */
    88104}
     105
     106rtems_device_driver Clock_initialize(
     107  rtems_device_major_number major,
     108  rtems_device_minor_number minor,
     109  void *pargp
     110)
     111{
     112  Install_clock( Clock_isr );
     113 
     114  /*
     115   * make major/minor avail to others such as shared memory driver
     116   */
     117 
     118  rtems_clock_major = major;
     119  rtems_clock_minor = minor;
     120 
     121  return RTEMS_SUCCESSFUL;
     122}
     123 
     124rtems_device_driver Clock_control(
     125  rtems_device_major_number major,
     126  rtems_device_minor_number minor,
     127  void *pargp
     128)
     129{
     130    rtems_libio_ioctl_args_t *args = pargp;
     131 
     132    if (args == 0)
     133        goto done;
     134 
     135    /*
     136     * This is hokey, but until we get a defined interface
     137     * to do this, it will just be this simple...
     138     */
     139 
     140    if (args->command == rtems_build_name('I', 'S', 'R', ' '))
     141    {
     142        Clock_isr(CLOCK_VECTOR);
     143    }
     144    else if (args->command == rtems_build_name('N', 'E', 'W', ' '))
     145    {
     146        ReInstall_clock(args->buffer);
     147    }
     148 
     149done:
     150    return RTEMS_SUCCESSFUL;
     151}
     152
  • c/src/lib/libbsp/m68k/mvme162/console/console.c

    r5072b07 r3a4ae6c  
    2222#define M162_INIT
    2323
    24 #include <rtems.h>
    25 #include "console.h"
    26 #include "bsp.h"
    27 #include "ringbuf.h"
     24#include <bsp.h>
     25#include <rtems/libio.h>
     26#include <ringbuf.h>
    2827
    2928Ring_buffer_t  Buffer[2];
     
    5554  rtems_device_major_number  major,
    5655  rtems_device_minor_number  minor,
    57   void                      *arg,
    58   rtems_id                   self,
    59   rtems_unsigned32          *status
     56  void                      *arg
    6057)
    6158{
    6259  int     i;
     60  rtems_status_code status;
    6361 
    6462  /*
     
    8078  mcchip->SCC_int_ctl = 0x13;     /* SCC IEN, IPL3 */
    8179
    82   *status = RTEMS_SUCCESSFUL;
     80  status = rtems_io_register_name(
     81    "/dev/console",
     82    major,
     83    (rtems_device_minor_number) 0
     84  );
     85 
     86  if (status != RTEMS_SUCCESSFUL)
     87    rtems_fatal_error_occurred(status);
     88 
     89  status = rtems_io_register_name(
     90    "/dev/tty00",
     91    major,
     92    (rtems_device_minor_number) 0
     93  );
     94 
     95  if (status != RTEMS_SUCCESSFUL)
     96    rtems_fatal_error_occurred(status);
     97 
     98  status = rtems_io_register_name(
     99    "/dev/tty01",
     100    major,
     101    (rtems_device_minor_number) 0
     102  );
     103 
     104  if (status != RTEMS_SUCCESSFUL)
     105    rtems_fatal_error_occurred(status);
     106 
     107  return RTEMS_SUCCESSFUL;
    83108}
    84109
     
    101126 */
    102127
    103 char char_wait(int port)
     128char inbyte(int port)
    104129{
    105130  unsigned char tmp_char;
     
    114139 */
    115140
    116 void char_put(int port, char ch)
     141void outbyte(int port, char ch)
    117142{
    118143  while (1) {
     
    123148
    124149/*
    125  *    Map port A (1) to stdin, stdout, and stderr.
    126  *    Map everything else to port B (0).
    127  */
    128 
    129 int __read(int fd, char *buf, int nbytes)
    130 {
    131   int i, port;
    132 
    133   if ( fd <= 2 ) port = 1;
    134   else           port = 0;
    135 
    136   for (i = 0; i < nbytes; i++) {
    137     *(buf + i) = char_wait(port);
    138     if ((*(buf + i) == '\n') || (*(buf + i) == '\r')) {
    139       (*(buf + i++)) = '\n';
    140       (*(buf + i)) = 0;
     150 *  Open entry point
     151 */
     152
     153rtems_device_driver console_open(
     154  rtems_device_major_number major,
     155  rtems_device_minor_number minor,
     156  void                    * arg
     157)
     158{
     159  return RTEMS_SUCCESSFUL;
     160}
     161 
     162/*
     163 *  Close entry point
     164 */
     165
     166rtems_device_driver console_close(
     167  rtems_device_major_number major,
     168  rtems_device_minor_number minor,
     169  void                    * arg
     170)
     171{
     172  return RTEMS_SUCCESSFUL;
     173}
     174
     175/*
     176 * read bytes from the serial port. We only have stdin.
     177 */
     178
     179rtems_device_driver console_read(
     180  rtems_device_major_number major,
     181  rtems_device_minor_number minor,
     182  void                    * arg
     183)
     184{
     185  rtems_libio_rw_args_t *rw_args;
     186  char *buffer;
     187  int maximum;
     188  int count = 0;
     189 
     190  rw_args = (rtems_libio_rw_args_t *) arg;
     191
     192  buffer = rw_args->buffer;
     193  maximum = rw_args->count;
     194
     195  if ( minor > 1 )
     196    return RTEMS_INVALID_NUMBER;
     197
     198  for (count = 0; count < maximum; count++) {
     199    buffer[ count ] = inbyte( minor );
     200    if (buffer[ count ] == '\n' || buffer[ count ] == '\r') {
     201      buffer[ count++ ]  = '\n';
     202      buffer[ count ]  = 0;
    141203      break;
    142204    }
    143205  }
    144   return (i);
    145 }
    146 
    147 /*
    148  *  Map port A (1) to stdin, stdout, and stderr.
    149  *  Map everything else to port B (0).
    150  */
    151 
    152 int __write(int fd, char *buf, int nbytes)
    153 {
    154   int i, port;
    155  
    156   if ( fd <= 2 ) port = 1;
    157   else           port = 0;
    158  
    159   for (i = 0; i < nbytes; i++) {
    160     if (*(buf + i) == '\n') {
    161       char_put (port, '\r');
     206
     207  rw_args->bytes_moved = count;
     208  return (count >= 0) ? RTEMS_SUCCESSFUL : RTEMS_UNSATISFIED;
     209}
     210
     211/*
     212 * write bytes to the serial port. Stdout and stderr are the same.
     213 */
     214
     215rtems_device_driver console_write(
     216  rtems_device_major_number major,
     217  rtems_device_minor_number minor,
     218  void                    * arg
     219)
     220{
     221  int count;
     222  int maximum;
     223  rtems_libio_rw_args_t *rw_args;
     224  char *buffer;
     225
     226  rw_args = (rtems_libio_rw_args_t *) arg;
     227
     228  buffer = rw_args->buffer;
     229  maximum = rw_args->count;
     230
     231  if ( minor > 1 )
     232    return RTEMS_INVALID_NUMBER;
     233
     234  for (count = 0; count < maximum; count++) {
     235    if ( buffer[ count ] == '\n') {
     236      outbyte('\r', minor );
    162237    }
    163     char_put (port, *(buf + i));
    164   }
    165   return (nbytes);
    166 }
     238    outbyte( buffer[ count ], minor  );
     239  }
     240  return maximum;
     241}
     242
     243/*
     244 *  IO Control entry point
     245 */
     246
     247rtems_device_driver console_control(
     248  rtems_device_major_number major,
     249  rtems_device_minor_number minor,
     250  void                    * arg
     251)
     252{
     253  return RTEMS_SUCCESSFUL;
     254}
  • c/src/lib/libbsp/m68k/mvme162/include/bsp.h

    r5072b07 r3a4ae6c  
    2929
    3030#include <rtems.h>
     31#include <clockdrv.h>
     32#include <console.h>
    3133#include <iosupp.h>
    3234
     
    249251#endif
    250252
     253/*
     254 *  Device Driver Table Entries
     255 */
     256
     257/*
     258 * NOTE: Use the standard Console driver entry
     259 */
     260 
     261/*
     262 * NOTE: Use the standard Clock driver entry
     263 */
     264
     265/*
     266 * How many libio files we want
     267 */
     268
     269#define BSP_LIBIO_MAX_FDS       20
     270
    251271/* miscellaneous stuff assumed to exist */
    252272
  • c/src/lib/libbsp/m68k/mvme162/startup/bspstart.c

    r5072b07 r3a4ae6c  
    2828 */
    2929
    30 #include <rtems.h>
    3130#include <bsp.h>
     31#include <rtems/libio.h>
     32 
    3233#include <libcsupport.h>
    33 #include <z8036.h>
     34 
     35#include <string.h>
     36#include <fcntl.h>
     37 
     38#ifdef STACK_CHECKER_ON
     39#include <stackchk.h>
     40#endif
    3441
    3542/*
     
    4249
    4350rtems_cpu_table Cpu_table;
     51
     52char *rtems_progname;
    4453
    4554/*      Initialize whatever libc we are using
     
    5968
    6069    /*
     70     *  Init the RTEMS libio facility to provide UNIX-like system
     71     *  calls for use by newlib (ie: provide __open, __close, etc)
     72     *  Uses malloc() to get area for the iops, so must be after malloc init
     73     */
     74
     75    rtems_libio_init();
     76
     77    /*
    6178     * Set up for the libc handling.
    6279     */
     
    7693}
    7794
    78 int bsp_start(
     95/*
     96 * After drivers are setup, register some "filenames"
     97 * and open stdin, stdout, stderr files
     98 *
     99 * Newlib will automatically associate the files with these
     100 * (it hardcodes the numbers)
     101 */
     102 
     103void
     104bsp_postdriver_hook(void)
     105{
     106  int stdin_fd, stdout_fd, stderr_fd;
     107 
     108  if ((stdin_fd = __open("/dev/console", O_RDONLY, 0)) == -1)
     109    rtems_fatal_error_occurred('STD0');
     110 
     111  if ((stdout_fd = __open("/dev/console", O_WRONLY, 0)) == -1)
     112    rtems_fatal_error_occurred('STD1');
     113 
     114  if ((stderr_fd = __open("/dev/console", O_WRONLY, 0)) == -1)
     115    rtems_fatal_error_occurred('STD2');
     116 
     117  if ((stdin_fd != 0) || (stdout_fd != 1) || (stderr_fd != 2))
     118    rtems_fatal_error_occurred('STIO');
     119}
     120
     121int main(
    79122  int argc,
    80123  char **argv,
     
    85128  int             index;
    86129
     130  if ((argc > 0) && argv && argv[0])
     131    rtems_progname = argv[0];
     132  else
     133    rtems_progname = "RTEMS";
     134
    87135  /*
    88136   *  162Bug Vectors are at 0xFFE00000
     
    122170  Cpu_table.predriver_hook = bsp_libc_init;  /* RTEMS resources available */
    123171
    124   Cpu_table.postdriver_hook = NULL;   /* Call our main() for constructors */
     172  Cpu_table.postdriver_hook = bsp_postdriver_hook;
    125173
    126174  Cpu_table.idle_task = NULL;  /* do not override system IDLE task */
     
    162210#endif
    163211
     212  /*
     213   * Tell libio how many fd's we want and allow it to tweak config
     214   */
     215
     216  rtems_libio_config(&BSP_Configuration, BSP_LIBIO_MAX_FDS);
     217
    164218  BSP_Configuration.work_space_start = (void *)
    165219     (RAM_END - BSP_Configuration.work_space_size);
Note: See TracChangeset for help on using the changeset viewer.