Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:23:51

0001 /*
0002  *  This file contains the hardware specific portions of the TTY driver
0003  *  for the Moxie GDB simulator.
0004  */
0005 
0006 /*
0007  *  COPYRIGHT (c) 2011.
0008  *  Anthony Green.
0009  *
0010  *  COPYRIGHT (c) 1989-2008.
0011  *  On-Line Applications Research Corporation (OAR).
0012  *
0013  *  The license and distribution terms for this file may be
0014  *  found in the file LICENSE in this distribution or at
0015  *  http://www.rtems.org/license/LICENSE.
0016  *
0017  */
0018 
0019 #include <bsp.h>
0020 #include <bsp/console-polled.h>
0021 #include <rtems/libio.h>
0022 #include <stdlib.h>
0023 #include <assert.h>
0024 
0025 /*
0026  *  console_initialize_hardware
0027  *
0028  *  This routine initializes the console hardware.
0029  *
0030  */
0031 
0032 void console_initialize_hardware(void)
0033 {
0034   return;
0035 }
0036 
0037 /*
0038  *  console_outbyte_polled
0039  *
0040  *  This routine transmits a character using polling.
0041  */
0042 ssize_t _sys_write(int fd, const void *buf, size_t count);
0043 void console_outbyte_polled(
0044   int  port,
0045   char ch
0046 )
0047 {
0048   _sys_write( 1, &ch, 1 );
0049 }
0050 
0051 /*
0052  *  console_inbyte_nonblocking
0053  *
0054  *  This routine polls for a character.
0055  */
0056 
0057 int console_inbyte_nonblocking(
0058   int port
0059 )
0060 {
0061   return -1;
0062 }
0063 
0064 #include <rtems/bspIo.h>
0065 
0066 static void moxiesim_output_char(char c) { console_outbyte_polled( 0, c ); }
0067 
0068 BSP_output_char_function_type           BSP_output_char = moxiesim_output_char;
0069 BSP_polling_getchar_function_type       BSP_poll_char = NULL;