source: rtems/c/src/lib/libbsp/sparc64/shared/console/conscfg.c @ 9b4422a2

4.115
Last change on this file since 9b4422a2 was 9b4422a2, checked in by Joel Sherrill <joel.sherrill@…>, on 05/03/12 at 15:09:24

Remove All CVS Id Strings Possible Using a Script

Script does what is expected and tries to do it as
smartly as possible.

+ remove occurrences of two blank comment lines

next to each other after Id string line removed.

+ remove entire comment blocks which only exited to

contain CVS Ids

+ If the processing left a blank line at the top of

a file, it was removed.

  • Property mode set to 100644
File size: 2.9 KB
Line 
1/*
2 *  COPYRIGHT (c) 2010 Eugen Leontie.
3 *
4 *  The license and distribution terms for this file may be
5 *  found in the file LICENSE in this distribution or at
6 *  http://www.rtems.com/license/LICENSE.
7 */
8
9#include <bsp.h>
10
11#include <libchip/serial.h>
12
13extern void ofw_write(const char *,const int );
14extern void ofw_read(void *,int );
15
16int sun4v_console_device_first_open(int major, int minor, void *arg)
17{
18  return 0;
19}
20
21static ssize_t sun4v_console_poll_write(int minor, const char *buf, size_t n)
22{
23  ofw_write(buf, n);
24  return 0;
25}
26
27void sun4v_console_deviceInitialize (int minor)
28{
29 
30}
31
32int sun4v_console_poll_read(int minor){
33  int a;
34  ofw_read(&a,1);
35  if(a!=0){
36    return a>>24;
37  }
38  return -1;
39}
40
41bool sun4v_console_deviceProbe (int minor){
42  return true;
43}
44
45/*
46 *  Polled mode functions
47 */
48console_fns pooled_functions={
49  sun4v_console_deviceProbe,       /* deviceProbe */
50  sun4v_console_device_first_open, /* deviceFirstOpen */
51  NULL,                            /* deviceLastClose */
52  sun4v_console_poll_read,         /* deviceRead */
53  sun4v_console_poll_write,        /* deviceWrite */
54  sun4v_console_deviceInitialize,  /* deviceInitialize */
55  NULL,                            /* deviceWritePolled */
56  NULL,                            /* deviceSetAttributes */
57  NULL                             /* deviceOutputUsesInterrupts */
58};
59
60console_flow sun4v_console_console_flow = {
61  NULL, /* deviceStopRemoteTx */
62  NULL  /* deviceStartRemoteTx */
63};
64
65console_tbl     Console_Configuration_Ports[] = {
66  {
67    "/dev/ttyS0",                 /* sDeviceName */
68    SERIAL_CUSTOM,                /* deviceType */
69    &pooled_functions,            /* pDeviceFns */
70    NULL,                         /* deviceProbe, assume it is there */
71    &sun4v_console_console_flow,  /* pDeviceFlow */
72    0,                            /* ulMargin */
73    0,                            /* ulHysteresis */
74    (void *) NULL,                /* pDeviceParams */
75    0,                            /* ulCtrlPort1 */
76    0,                            /* ulCtrlPort2 */
77    1,                            /* ulDataPort */
78    NULL,                         /* getRegister */
79    NULL,                         /* setRegister */
80    NULL, /* unused */            /* getData */
81    NULL, /* unused */            /* setData */
82    0,                            /* ulClock */
83    0                             /* ulIntVector -- base for port */
84  },
85};
86
87/*
88 *  Declare some information used by the console driver
89 */
90
91#define NUM_CONSOLE_PORTS 1
92
93unsigned long  Console_Configuration_Count = NUM_CONSOLE_PORTS;
94
95/* putchar/getchar for printk */
96
97static void bsp_out_char (char c)
98{
99  ofw_write(&c, 1);
100}
101
102BSP_output_char_function_type BSP_output_char = bsp_out_char;
103
104static int bsp_in_char( void ){
105  int tmp;
106  ofw_read( &tmp, 1 ); /* blocks */
107  if( tmp != 0 ) {
108    return tmp>>24;
109  }
110  return -1;
111}
112
113BSP_polling_getchar_function_type BSP_poll_char = bsp_in_char;
114
Note: See TracBrowser for help on using the repository browser.