bioscall.h revision 1.6 1 /* $NetBSD: bioscall.h,v 1.6 2000/07/12 22:58:12 thorpej 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 NBPG
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 };
67
68 #define AL r_ax.biosreg_quarter[BIOSREG_LO]
69 #define AH r_ax.biosreg_quarter[BIOSREG_HI]
70 #define AX r_ax.biosreg_half[BIOSREG_LO]
71 #define AX_HI r_ax.biosreg_half[BIOSREG_HI]
72 #define EAX r_ax.biosreg_long
73
74 #define BL r_bx.biosreg_quarter[BIOSREG_LO]
75 #define BH r_bx.biosreg_quarter[BIOSREG_HI]
76 #define BX r_bx.biosreg_half[BIOSREG_LO]
77 #define BX_HI r_bx.biosreg_half[BIOSREG_HI]
78 #define EBX r_bx.biosreg_long
79
80 #define CL r_cx.biosreg_quarter[BIOSREG_LO]
81 #define CH r_cx.biosreg_quarter[BIOSREG_HI]
82 #define CX r_cx.biosreg_half[BIOSREG_LO]
83 #define CX_HI r_cx.biosreg_half[BIOSREG_HI]
84 #define ECX r_cx.biosreg_long
85
86 #define DL r_dx.biosreg_quarter[BIOSREG_LO]
87 #define DH r_dx.biosreg_quarter[BIOSREG_HI]
88 #define DX r_dx.biosreg_half[BIOSREG_LO]
89 #define DX_HI r_dx.biosreg_half[BIOSREG_HI]
90 #define EDX r_dx.biosreg_long
91
92 #define SI r_si.biosreg_half[BIOSREG_LO]
93 #define SI_HI r_si.biosreg_half[BIOSREG_HI]
94 #define ESI r_si.biosreg_long
95
96 #define DI r_di.biosreg_half[BIOSREG_LO]
97 #define DI_HI r_di.biosreg_half[BIOSREG_HI]
98 #define EDI r_di.biosreg_long
99
100 #define FLAGS r_flags.biosreg_half[BIOSREG_LO]
101 #define FLAGS_HI r_flags.biosreg_half[BIOSREG_HI]
102 #define EFLAGS r_flags.biosreg_long
103
104 void bioscall __P((int /* function*/ , struct bioscallregs * /* regs */));
105 #endif
106 #endif /* __I386_BIOSCALL_H__ */
107