source: trunk/libs/newlib/src/libgloss/mips/dvemon.c @ 559

Last change on this file since 559 was 444, checked in by satin@…, 6 years ago

add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc

File size: 2.0 KB
Line 
1/* dve.c -- I/O code for the Densan DVE-R3900 board.
2 *
3 * Copyright (c) 1998, 1999 Cygnus Support
4 *
5 * The authors hereby grant permission to use, copy, modify, distribute,
6 * and license this software and its documentation for any purpose, provided
7 * that existing copyright notices are retained in all copies and that this
8 * notice is included verbatim in any distributions. No written agreement,
9 * license, or royalty fee is required for any of the authorized uses.
10 * Modifications to this software may be copyrighted by their authors
11 * and need not follow the licensing terms described here, provided that
12 * the new terms are clearly indicated on the first page of each file where
13 * they apply.
14 */
15
16/* Flag indicating that we are being debugged by GDB.  If set,
17   preceded each character output to the console with a ^O,
18   so that GDB will print it instead of discarding it.  */
19
20int output_debug = 1;
21
22/* Monitor "ci" function (console input) */
23
24typedef int (*cifunc)(int waitflag);
25#ifdef __mips64
26static cifunc ci = (cifunc) 0xffffffffbfc00010L;
27#else
28static cifunc ci = (cifunc) 0xbfc00010;
29#endif
30
31#define WAIT    1
32#define NOWAIT  0
33#define NOCHAR  (-1)
34
35/* Monitor "co" function (console output) */
36
37typedef void (*cofunc)(int c);
38#ifdef __mips64
39static cofunc co = (cofunc) 0xffffffffbfc00018L;
40#else
41static cofunc co = (cofunc) 0xbfc00018;
42#endif
43
44/*  outbyte -- shove a byte out the serial port; used by write.c.  */
45
46int
47outbyte(byte)
48     unsigned char byte;
49{
50  /* Output a ^O prefix so that GDB won't discard the output.  */
51  if (output_debug)
52    co (0x0f);
53
54  co (byte);
55  return byte;
56}
57
58/* inbyte -- get a byte from the serial port; used by read.c.  */
59
60unsigned char
61inbyte()
62{
63  return (unsigned char) ci (WAIT);
64}
65
66
67/* Structure filled in by get_mem_info.  Only the size field is
68   actually used (by sbrk), so the others aren't even filled in.  */
69
70struct s_mem
71{
72  unsigned int size;
73  unsigned int icsize;
74  unsigned int dcsize;
75};
76
77
78void
79get_mem_info (mem)
80     struct s_mem *mem;
81{
82  mem->size = 0x1000000;        /* DVE-R3900 board has 16 MB of RAM */
83}
Note: See TracBrowser for help on using the repository browser.