/*1* Copyright (c) 1998 Robert Nordier2* All rights reserved.3*4* Redistribution and use in source and binary forms are freely5* permitted provided that the above copyright notice and this6* paragraph and the following disclaimer are duplicated in all7* such forms.8*9* This software is provided "AS IS" and without any express or10* implied warranties, including, without limitation, the implied11* warranties of merchantability and fitness for a particular12* purpose.13*/1415/*16*/1718#ifndef _BTXV86_H_19#define _BTXV86_H_2021#include <sys/types.h>22#include <machine/psl.h>2324/*25* Memory buffer space for real mode IO.26* Just one page is not much, but the space is rather limited.27* See ../btx/btx.S for details.28*/29#define V86_IO_BUFFER 0x800030#define V86_IO_BUFFER_SIZE 0x10003132#define V86_ADDR 0x10000 /* Segment:offset address */33#define V86_CALLF 0x20000 /* Emulate far call */34#define V86_FLAGS 0x40000 /* Return flags */3536struct __v86 {37uint32_t ctl; /* Control flags */38uint32_t addr; /* Interrupt number or address */39uint32_t es; /* V86 ES register */40uint32_t ds; /* V86 DS register */41uint32_t fs; /* V86 FS register */42uint32_t gs; /* V86 GS register */43uint32_t eax; /* V86 EAX register */44uint32_t ecx; /* V86 ECX register */45uint32_t edx; /* V86 EDX register */46uint32_t ebx; /* V86 EBX register */47uint32_t efl; /* V86 eflags register */48uint32_t ebp; /* V86 EBP register */49uint32_t esi; /* V86 ESI register */50uint32_t edi; /* V86 EDI register */51};5253extern struct __v86 __v86; /* V86 interface structure */54void __v86int(void);5556#define v86 __v8657#define v86int __v86int5859extern uint32_t __base;60extern uint32_t __args;6162#define PTOV(pa) ((caddr_t)(pa) - __base)63#define VTOP(va) ((vm_offset_t)(va) + __base)64#define VTOPSEG(va) (uint16_t)(VTOP((caddr_t)va) >> 4)65#define VTOPOFF(va) (uint16_t)(VTOP((caddr_t)va) & 0xf)6667#define V86_CY(x) ((x) & PSL_C)68#define V86_ZR(x) ((x) & PSL_Z)6970void __exit(int) __attribute__((__noreturn__));71void __exec(caddr_t, ...);7273#endif /* !_BTXV86_H_ */747576