|
|
1.1 root 1: /*
2: * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
3: *
4: * @APPLE_LICENSE_HEADER_START@
5: *
6: * Portions Copyright (c) 1999 Apple Computer, Inc. All Rights
7: * Reserved. This file contains Original Code and/or Modifications of
8: * Original Code as defined in and that are subject to the Apple Public
9: * Source License Version 1.1 (the "License"). You may not use this file
10: * except in compliance with the License. Please obtain a copy of the
11: * License at http://www.apple.com/publicsource and read it before using
12: * this file.
13: *
14: * The Original Code and all software distributed under the License are
15: * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
16: * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
17: * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
18: * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
19: * License for the specific language governing rights and limitations
20: * under the License.
21: *
22: * @APPLE_LICENSE_HEADER_END@
23: */
24:
25: /*
26: * Console is on the Printer Port (chip channel 0)
27: * Debugger is on the Modem Port (chip channel 1)
28: */
29:
30: #define CONSOLE_PORT 0
31: #define KGDB_PORT 1
32:
33: /*
34: * function declarations for performing serial i/o
35: * other functions below are declared in kern/misc_protos.h
36: * cnputc, cngetc, cnmaygetc
37: */
38:
39: #if MACH_KGDB
40: void kgdb_putc(char c), no_spl_scc_putc(int chan, char c);
41: int kgdb_getc(boolean_t timeout), no_spl_scc_getc(int chan, boolean_t timeout);
42:
43: /* kgdb_getc() special return values. */
44: #define KGDB_GETC_BAD_CHAR -1
45: #define KGDB_GETC_TIMEOUT -2
46: #endif
47:
48: void initialize_serial(void);
49:
50: #ifdef notdef_next
51: extern int scc_probe(
52: caddr_t xxx,
53: void *bus_device);
54:
55: extern io_return_t scc_open(
56: dev_t dev,
57: dev_mode_t flag,
58: io_req_t ior);
59:
60: extern void scc_close(
61: dev_t dev);
62:
63: extern io_return_t scc_read(
64: dev_t dev,
65: io_req_t ior);
66:
67: extern io_return_t scc_write(
68: dev_t dev,
69: io_req_t ior);
70:
71: extern io_return_t scc_get_status(
72: dev_t dev,
73: dev_flavor_t flavor,
74: dev_status_t data,
75: mach_msg_type_number_t *status_count);
76:
77: extern io_return_t scc_set_status(
78: dev_t dev,
79: dev_flavor_t flavor,
80: dev_status_t data,
81: mach_msg_type_number_t status_count);
82:
83: extern boolean_t scc_portdeath(
84: dev_t dev,
85: ipc_port_t port);
86:
87: extern int scc_putc(
88: int unit,
89: int line,
90: int c);
91:
92: extern int scc_getc(
93: int unit,
94: int line,
95: boolean_t wait,
96: boolean_t raw);
97:
98: /* Functions in serial_console.c for switching between serial and video
99: consoles. */
100: extern int switch_to_serial_console(
101: void);
102:
103: extern int switch_to_video_console(
104: void);
105:
106: extern void switch_to_old_console(
107: int old_console);
108:
109: #if MACH_KGDB
110: extern void no_spl_putc(char c);
111: extern int no_spl_getc(void);
112: #endif
113: #endif /* notdef_next */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.