# btxv86.h

    00001 /*
    00002  * Copyright (c) 1998 Robert Nordier
    00003  * All rights reserved.
    00004  *
    00005  * Redistribution and use in source and binary forms are freely
    00006  * permitted provided that the above copyright notice and this
    00007  * paragraph and the following disclaimer are duplicated in all
    00008  * such forms.
    00009  *
    00010  * This software is provided "AS IS" and without any express or
    00011  * implied warranties, including, without limitation, the implied
    00012  * warranties of merchantability and fitness for a particular
    00013  * purpose.
    00014  */
    00015
    00016 /*
    00017  * $FreeBSD: src/sys/boot/i386/btx/lib/btxv86.h,v 1.5 1999/08/28 00:40:08 peter Exp $
    00018  */
    00019
    00020 #ifndef _BTXV86_H_
    00021 #define _BTXV86_H_
    00022
    00023 #include <sys/types.h>
    00024
    00025 #define V86_ADDR   0x10000      /* Segment:offset address */
    00026 #define V86_CALLF  0x20000      /* Emulate far call */
    00027 #define V86_FLAGS  0x40000      /* Return flags */
    00028
    00029 struct __v86 {
    00030     uint32_t ctl;               /* Control flags */
    00031     uint32_t addr;              /* Interrupt number or address */
    00032     uint32_t es;                /* V86 ES register */
    00033     uint32_t ds;                /* V86 DS register */
    00034     uint32_t fs;                /* V86 FS register */
    00035     uint32_t gs;                /* V86 GS register */
    00036     uint32_t eax;               /* V86 EAX register */
    00037     uint32_t ecx;               /* V86 ECX register */
    00038     uint32_t edx;               /* V86 EDX register */
    00039     uint32_t ebx;               /* V86 EBX register */
    00040     uint32_t efl;               /* V86 eflags register */
    00041     uint32_t ebp;               /* V86 EBP register */
    00042     uint32_t esi;               /* V86 ESI register */
    00043     uint32_t edi;               /* V86 EDI register */
    00044 };
    00045
    00046 extern struct __v86 __v86;      /* V86 interface structure */
    00047 void __v86int(void);
    00048
    00049 #define v86     __v86
    00050 #define v86int  __v86int
    00051
    00052 extern u_int32_t        __base;
    00053 extern u_int32_t        __args;
    00054
    00055 #define PTOV(pa)        ((caddr_t)(pa) - __base)
    00056 #define VTOP(va)        ((vm_offset_t)(va) + __base)
    00057 #define VTOPSEG(va)     (u_int16_t)(VTOP((caddr_t)va) >> 4)
    00058 #define VTOPOFF(va)     (u_int16_t)(VTOP((caddr_t)va) & 0xf)
    00059
    00060 void __exit(int) __attribute__((__noreturn__));
    00061 void __exec(caddr_t, ...);
    00062
    00063 #endif /* !_BTXV86_H_ */