]> git.saurik.com Git - apple/xnu.git/blob - pexpert/pexpert/i386/protos.h
b97cad5a9a57b81d74112df3f254b5488298ec13
[apple/xnu.git] / pexpert / pexpert / i386 / protos.h
1 /*
2 * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28 #ifndef _PEXPERT_I386_PROTOS_H
29 #define _PEXPERT_I386_PROTOS_H
30
31 //------------------------------------------------------------------------
32 // x86 IN/OUT I/O inline functions.
33 //
34 // IN : inb, inw, inl
35 // IN(port)
36 //
37 // OUT: outb, outw, outl
38 // OUT(port, data)
39
40 typedef unsigned short i386_ioport_t;
41
42 #define __IN(s, u) \
43 static __inline__ unsigned u \
44 in##s(i386_ioport_t port) \
45 { \
46 unsigned u data; \
47 asm volatile ( \
48 "in" #s " %1,%0" \
49 : "=a" (data) \
50 : "d" (port)); \
51 return (data); \
52 }
53
54 #define __OUT(s, u) \
55 static __inline__ void \
56 out##s(i386_ioport_t port, unsigned u data) \
57 { \
58 asm volatile ( \
59 "out" #s " %1,%0" \
60 : \
61 : "d" (port), "a" (data)); \
62 }
63
64 __IN(b, char)
65 __IN(w, short)
66 __IN(l, long)
67
68 __OUT(b, char)
69 __OUT(w, short)
70 __OUT(l, long)
71
72 extern void cninit(void);
73 extern int sprintf(char * str, const char * format, ...);
74
75 //------------------------------------------------------------------------
76 // from osfmk/console/panic_dialog.c
77 extern void panic_ui_initialize(const unsigned char * clut);
78
79 //------------------------------------------------------------------------
80 // from osfmk/i386/AT386/video_console.c
81
82 extern void vc_progress_initialize( void * desc,
83 const unsigned char * data,
84 const unsigned char * clut );
85
86 extern void vc_display_icon( void * desc, const unsigned char * data );
87
88 /* ------------------------------------------------------------------------
89 * from osfmk/i386/serial_io.h
90 */
91 int switch_to_serial_console(void);
92 void switch_to_old_console(int);
93 boolean_t console_is_serial(void);
94 int serial_init(void);
95 void serial_putc(char);
96 int serial_getc(void);
97
98 /* ------------------------------------------------------------------------
99 * from osfmk/kern/misc_protos.h
100 */
101 void cnputc(char);
102 int cngetc(void);
103
104 #endif /* _PEXPERT_I386_PROTOS_H */