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/i960/cvme961/console/console.c

    r5072b07 r3a4ae6c  
    11/*
    2  *  This file contains the MVME136 console IO package.
     2 *  This file contains the CVME961 console IO package.
    33 *
    44 *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
     
    1515#define C961_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
     
    101109
    102110/*
    103  * __read  -- read bytes from the serial port. Ignore fd, since
    104  *            we only have stdin.
    105  */
    106 
    107 int __read(
    108   int fd,
    109   char *buf,
    110   int nbytes
    111 )
    112 {
    113   int i = 0;
    114 
    115   for (i = 0; i < nbytes; i++) {
    116     *(buf + i) = inbyte();
    117     if ((*(buf + i) == '\n') || (*(buf + i) == '\r')) {
    118       (*(buf + i++)) = '\n';
    119       (*(buf + i)) = 0;
     111 *  Open entry point
     112 */
     113 
     114rtems_device_driver console_open(
     115  rtems_device_major_number major,
     116  rtems_device_minor_number minor,
     117  void                    * arg
     118)
     119{
     120  return RTEMS_SUCCESSFUL;
     121}
     122 
     123/*
     124 *  Close entry point
     125 */
     126 
     127rtems_device_driver console_close(
     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 * read bytes from the serial port. We only have stdin.
     138 */
     139 
     140rtems_device_driver console_read(
     141  rtems_device_major_number major,
     142  rtems_device_minor_number minor,
     143  void                    * arg
     144)
     145{
     146  rtems_libio_rw_args_t *rw_args;
     147  char *buffer;
     148  int maximum;
     149  int count = 0;
     150 
     151  rw_args = (rtems_libio_rw_args_t *) arg;
     152 
     153  buffer = rw_args->buffer;
     154  maximum = rw_args->count;
     155 
     156  for (count = 0; count < maximum; count++) {
     157    buffer[ count ] = inbyte();
     158    if (buffer[ count ] == '\n' || buffer[ count ] == '\r') {
     159      buffer[ count++ ]  = '\n';
     160      buffer[ count ]  = 0;
    120161      break;
    121162    }
    122163  }
    123   return (i);
    124 }
    125 
    126 /*
    127  * __write -- write bytes to the serial port. Ignore fd, since
    128  *            stdout and stderr are the same. Since we have no filesystem,
    129  *            open will only return an error.
    130  */
    131 
    132 int __write(
    133   int fd,
    134   char *buf,
    135   int nbytes
    136 )
    137 {
    138   int i;
    139 
    140   for (i = 0; i < nbytes; i++) {
    141     if (*(buf + i) == '\n') {
    142       outbyte ('\r');
     164 
     165  rw_args->bytes_moved = count;
     166  return (count >= 0) ? RTEMS_SUCCESSFUL : RTEMS_UNSATISFIED;
     167}
     168 
     169/*
     170 * write bytes to the serial port. Stdout and stderr are the same.
     171 */
     172 
     173rtems_device_driver console_write(
     174  rtems_device_major_number major,
     175  rtems_device_minor_number minor,
     176  void                    * arg
     177)
     178{
     179  int count;
     180  int maximum;
     181  rtems_libio_rw_args_t *rw_args;
     182  char *buffer;
     183 
     184  rw_args = (rtems_libio_rw_args_t *) arg;
     185 
     186  buffer = rw_args->buffer;
     187  maximum = rw_args->count;
     188 
     189  for (count = 0; count < maximum; count++) {
     190    if ( buffer[ count ] == '\n') {
     191      outbyte('\r');
    143192    }
    144     outbyte (*(buf + i));
     193    outbyte( buffer[ count ] );
    145194  }
    146   return (nbytes);
    147 }
     195  return maximum;
     196}
     197 
     198/*
     199 *  IO Control entry point
     200 */
     201 
     202rtems_device_driver console_control(
     203  rtems_device_major_number major,
     204  rtems_device_minor_number minor,
     205  void                    * arg
     206)
     207{
     208  return RTEMS_SUCCESSFUL;
     209}
     210
Note: See TracChangeset for help on using the changeset viewer.