]> git.saurik.com Git - apple/xnu.git/blob - pexpert/pexpert/i386/protos.h
xnu-344.21.73.tar.gz
[apple/xnu.git] / pexpert / pexpert / i386 / protos.h
1 /*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
7 *
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * file.
14 *
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
22 *
23 * @APPLE_LICENSE_HEADER_END@
24 */
25 #ifndef _PEXPERT_I386_PROTOS_H
26 #define _PEXPERT_I386_PROTOS_H
27
28 //------------------------------------------------------------------------
29 // x86 IN/OUT I/O inline functions.
30 //
31 // IN : inb, inw, inl
32 // IN(port)
33 //
34 // OUT: outb, outw, outl
35 // OUT(port, data)
36
37 typedef unsigned short i386_ioport_t;
38
39 #define __IN(s, u) \
40 static __inline__ unsigned u \
41 in##s(i386_ioport_t port) \
42 { \
43 unsigned u data; \
44 asm volatile ( \
45 "in" #s " %1,%0" \
46 : "=a" (data) \
47 : "d" (port)); \
48 return (data); \
49 }
50
51 #define __OUT(s, u) \
52 static __inline__ void \
53 out##s(i386_ioport_t port, unsigned u data) \
54 { \
55 asm volatile ( \
56 "out" #s " %1,%0" \
57 : \
58 : "d" (port), "a" (data)); \
59 }
60
61 __IN(b, char)
62 __IN(w, short)
63 __IN(l, long)
64
65 __OUT(b, char)
66 __OUT(w, short)
67 __OUT(l, long)
68
69 extern void cninit(void);
70 extern void bcopy(void * from, void * to, int size);
71 extern int sprintf(char * str, const char * format, ...);
72
73 //------------------------------------------------------------------------
74 // from osfmk/i386/AT386/video_console.c
75
76 extern boolean_t vc_progress_initialize( void * desc,
77 const unsigned char * data,
78 const unsigned char * clut );
79
80 extern void vc_display_icon( void * desc, const unsigned char * data );
81
82 #endif /* _PEXPERT_I386_PROTOS_H */