bioscall.h revision 1.9 1 /* $NetBSD: bioscall.h,v 1.9 2003/10/27 13:44:20 junyoung Exp $ */
2
3 /*-
4 * Copyright (c) 1997, 2000 The NetBSD Foundation, Inc.
5 * All rights reserved.
6 *
7 * This code is derived from software contributed to The NetBSD Foundation
8 * by John Kohl and Jason R. Thorpe.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. All advertising materials mentioning features or use of this software
19 * must display the following acknowledgement:
20 * This product includes software developed by the NetBSD
21 * Foundation, Inc. and its contributors.
22 * 4. Neither the name of The NetBSD Foundation nor the names of its
23 * contributors may be used to endorse or promote products derived
24 * from this software without specific prior written permission.
25 *
26 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
27 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
30 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 * POSSIBILITY OF SUCH DAMAGE.
37 */
38
39 #ifndef __I386_BIOSCALL_H__
40 #define __I386_BIOSCALL_H__
41
42 /*
43 * virtual & physical address of the trampoline
44 * that we use: page 1.
45 */
46 #define BIOSTRAMP_BASE PAGE_SIZE
47
48 #ifndef _LOCORE
49 #define BIOSREG_LO 0
50 #define BIOSREG_HI 1
51
52 typedef union {
53 u_char biosreg_quarter[4];
54 u_short biosreg_half[2];
55 u_int biosreg_long;
56 } bios_reg;
57
58 struct bioscallregs {
59 bios_reg r_ax;
60 bios_reg r_bx;
61 bios_reg r_cx;
62 bios_reg r_dx;
63 bios_reg r_si;
64 bios_reg r_di;
65 bios_reg r_flags;
66 bios_reg r_es;
67 };
68
69 #define AL r_ax.biosreg_quarter[BIOSREG_LO]
70 #define AH r_ax.biosreg_quarter[BIOSREG_HI]
71 #define AX r_ax.biosreg_half[BIOSREG_LO]
72 #define AX_HI r_ax.biosreg_half[BIOSREG_HI]
73 #define EAX r_ax.biosreg_long
74
75 #define BL r_bx.biosreg_quarter[BIOSREG_LO]
76 #define BH r_bx.biosreg_quarter[BIOSREG_HI]
77 #define BX r_bx.biosreg_half[BIOSREG_LO]
78 #define BX_HI r_bx.biosreg_half[BIOSREG_HI]
79 #define EBX r_bx.biosreg_long
80
81 #define CL r_cx.biosreg_quarter[BIOSREG_LO]
82 #define CH r_cx.biosreg_quarter[BIOSREG_HI]
83 #define CX r_cx.biosreg_half[BIOSREG_LO]
84 #define CX_HI r_cx.biosreg_half[BIOSREG_HI]
85 #define ECX r_cx.biosreg_long
86
87 #define DL r_dx.biosreg_quarter[BIOSREG_LO]
88 #define DH r_dx.biosreg_quarter[BIOSREG_HI]
89 #define DX r_dx.biosreg_half[BIOSREG_LO]
90 #define DX_HI r_dx.biosreg_half[BIOSREG_HI]
91 #define EDX r_dx.biosreg_long
92
93 #define SI r_si.biosreg_half[BIOSREG_LO]
94 #define SI_HI r_si.biosreg_half[BIOSREG_HI]
95 #define ESI r_si.biosreg_long
96
97 #define DI r_di.biosreg_half[BIOSREG_LO]
98 #define DI_HI r_di.biosreg_half[BIOSREG_HI]
99 #define EDI r_di.biosreg_long
100
101 #define FLAGS r_flags.biosreg_half[BIOSREG_LO]
102 #define FLAGS_HI r_flags.biosreg_half[BIOSREG_HI]
103 #define EFLAGS r_flags.biosreg_long
104
105 #define ES r_es.biosreg_half[BIOSREG_LO]
106
107 void bioscall(int /* function*/ , struct bioscallregs * /* regs */);
108 #endif
109 #endif /* __I386_BIOSCALL_H__ */
110