Initial import from FreeBSD RELENG_4:
[dragonfly.git] / sys / boot / pc98 / btx / lib / btxv86.h
1 /*
2  * Copyright (c) 1998 Robert Nordier
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms are freely
6  * permitted provided that the above copyright notice and this
7  * paragraph and the following disclaimer are duplicated in all
8  * such forms.
9  *
10  * This software is provided "AS IS" and without any express or
11  * implied warranties, including, without limitation, the implied
12  * warranties of merchantability and fitness for a particular
13  * purpose.
14  */
15
16 /*
17  * $FreeBSD: src/sys/boot/pc98/btx/lib/btxv86.h,v 1.2 1999/08/28 00:40:32 peter Exp $
18  */
19
20 #ifndef _BTXV86_H_
21 #define _BTXV86_H_
22
23 #include <sys/types.h>
24
25 #define V86_ADDR   0x10000      /* Segment:offset address */
26 #define V86_CALLF  0x20000      /* Emulate far call */
27 #define V86_FLAGS  0x40000      /* Return flags */
28
29 struct __v86 {
30     uint32_t ctl;               /* Control flags */
31     uint32_t addr;              /* Interrupt number or address */
32     uint32_t es;                /* V86 ES register */
33     uint32_t ds;                /* V86 DS register */
34     uint32_t fs;                /* V86 FS register */
35     uint32_t gs;                /* V86 GS register */
36     uint32_t eax;               /* V86 EAX register */
37     uint32_t ecx;               /* V86 ECX register */
38     uint32_t edx;               /* V86 EDX register */
39     uint32_t ebx;               /* V86 EBX register */
40     uint32_t efl;               /* V86 eflags register */
41     uint32_t ebp;               /* V86 EBP register */
42     uint32_t esi;               /* V86 ESI register */
43     uint32_t edi;               /* V86 EDI register */
44 };
45
46 extern struct __v86 __v86;      /* V86 interface structure */
47 void __v86int(void);
48
49 #define v86     __v86
50 #define v86int  __v86int
51
52 extern u_int32_t        __base;
53 extern u_int32_t        __args;
54
55 #define PTOV(pa)        ((caddr_t)(pa) - __base)
56 #define VTOP(va)        ((vm_offset_t)(va) + __base)
57 #define VTOPSEG(va)     (u_int16_t)(VTOP((caddr_t)va) >> 4)
58 #define VTOPOFF(va)     (u_int16_t)(VTOP((caddr_t)va) & 0xf)
59
60 void __exit(int) __attribute__((__noreturn__));
61 void __exec(caddr_t, ...);
62
63 #endif /* !_BTXV86_H_ */