Ignore:
Timestamp:
Sep 11, 1995, 7:35:39 PM (25 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/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}
Note: See TracChangeset for help on using the changeset viewer.