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.

File:
1 edited

Legend:

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