Ignore:
Timestamp:
09/11/95 19:35:39 (28 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/no_cpu/no_bsp/console/console.c

    r5072b07 r3a4ae6c  
    1515#define NO_BSP_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 {
    40   *status = RTEMS_SUCCESSFUL;
     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;
    4149}
    4250
     
    111119}
    112120
    113 /*
    114  * __read  -- read bytes from the serial port. Ignore fd, since
    115  *            we only have stdin.
    116  */
    117 
    118 int __read(
    119   int fd,
    120   char *buf,
    121   int nbytes
    122 )
    123 {
    124   int i = 0;
    125 
    126   for (i = 0; i < nbytes; i++) {
    127     *(buf + i) = inbyte();
    128     if ((*(buf + i) == '\n') || (*(buf + i) == '\r')) {
    129       (*(buf + i++)) = '\n';
    130       (*(buf + i)) = 0;
     121
     122/*
     123 *  Open entry point
     124 */
     125
     126rtems_device_driver console_open(
     127  rtems_device_major_number major,
     128  rtems_device_minor_number minor,
     129  void                    * arg
     130)
     131{
     132  return RTEMS_SUCCESSFUL;
     133}
     134 
     135/*
     136 *  Close entry point
     137 */
     138
     139rtems_device_driver console_close(
     140  rtems_device_major_number major,
     141  rtems_device_minor_number minor,
     142  void                    * arg
     143)
     144{
     145  return RTEMS_SUCCESSFUL;
     146}
     147
     148/*
     149 * read bytes from the serial port. We only have stdin.
     150 */
     151
     152rtems_device_driver console_read(
     153  rtems_device_major_number major,
     154  rtems_device_minor_number minor,
     155  void                    * arg
     156)
     157{
     158  rtems_libio_rw_args_t *rw_args;
     159  char *buffer;
     160  int maximum;
     161  int count = 0;
     162 
     163  rw_args = (rtems_libio_rw_args_t *) arg;
     164
     165  buffer = rw_args->buffer;
     166  maximum = rw_args->count;
     167
     168  for (count = 0; count < maximum; count++) {
     169    buffer[ count ] = inbyte();
     170    if (buffer[ count ] == '\n' || buffer[ count ] == '\r') {
     171      buffer[ count++ ]  = '\n';
     172      buffer[ count ]  = 0;
    131173      break;
    132174    }
    133175  }
    134   return (i);
    135 }
    136 
    137 /*
    138  * __write -- write bytes to the serial port. Ignore fd, since
    139  *            stdout and stderr are the same. Since we have no filesystem,
    140  *            open will only return an error.
    141  */
    142 
    143 int __write(
    144   int fd,
    145   char *buf,
    146   int nbytes
    147 )
    148 {
    149   int i;
    150 
    151   for (i = 0; i < nbytes; i++) {
    152     if (*(buf + i) == '\n') {
    153       outbyte ('\r');
     176
     177  rw_args->bytes_moved = count;
     178  return (count >= 0) ? RTEMS_SUCCESSFUL : RTEMS_UNSATISFIED;
     179}
     180
     181/*
     182 * write bytes to the serial port. Stdout and stderr are the same.
     183 */
     184
     185rtems_device_driver console_write(
     186  rtems_device_major_number major,
     187  rtems_device_minor_number minor,
     188  void                    * arg
     189)
     190{
     191  int count;
     192  int maximum;
     193  rtems_libio_rw_args_t *rw_args;
     194  char *buffer;
     195
     196  rw_args = (rtems_libio_rw_args_t *) arg;
     197
     198  buffer = rw_args->buffer;
     199  maximum = rw_args->count;
     200
     201  for (count = 0; count < maximum; count++) {
     202    if ( buffer[ count ] == '\n') {
     203      outbyte('\r');
    154204    }
    155     outbyte (*(buf + i));
     205    outbyte( buffer[ count ] );
    156206  }
    157   return (nbytes);
    158 }
     207  return maximum;
     208}
     209
     210/*
     211 *  IO Control entry point
     212 */
     213
     214rtems_device_driver console_control(
     215  rtems_device_major_number major,
     216  rtems_device_minor_number minor,
     217  void                    * arg
     218)
     219{
     220  return RTEMS_SUCCESSFUL;
     221}
Note: See TracChangeset for help on using the changeset viewer.