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/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}
Note: See TracChangeset for help on using the changeset viewer.