vaseboot/include/VasEBoot/i386/pc/int.h

68 lines
2.1 KiB
C

/*
* VasEBoot -- GRand Unified Bootloader
* Copyright (C) 2009 Free Software Foundation, Inc.
*
* VasEBoot is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* VasEBoot is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with VasEBoot. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef VasEBoot_INTERRUPT_MACHINE_HEADER
#define VasEBoot_INTERRUPT_MACHINE_HEADER 1
#include <VasEBoot/symbol.h>
#include <VasEBoot/types.h>
struct VasEBoot_bios_int_registers
{
VasEBoot_uint32_t eax;
VasEBoot_uint16_t es;
VasEBoot_uint16_t ds;
VasEBoot_uint16_t flags;
VasEBoot_uint16_t dummy;
VasEBoot_uint32_t ebx;
VasEBoot_uint32_t ecx;
VasEBoot_uint32_t edi;
VasEBoot_uint32_t esi;
VasEBoot_uint32_t edx;
};
#define VasEBoot_CPU_INT_FLAGS_CARRY 0x1
#define VasEBoot_CPU_INT_FLAGS_PARITY 0x4
#define VasEBoot_CPU_INT_FLAGS_ADJUST 0x10
#define VasEBoot_CPU_INT_FLAGS_ZERO 0x40
#define VasEBoot_CPU_INT_FLAGS_SIGN 0x80
#define VasEBoot_CPU_INT_FLAGS_TRAP 0x100
#define VasEBoot_CPU_INT_FLAGS_INTERRUPT 0x200
#define VasEBoot_CPU_INT_FLAGS_DIRECTION 0x400
#define VasEBoot_CPU_INT_FLAGS_OVERFLOW 0x800
#ifdef VasEBoot_MACHINE_PCBIOS
#define VasEBoot_CPU_INT_FLAGS_DEFAULT VasEBoot_CPU_INT_FLAGS_INTERRUPT
#else
#define VasEBoot_CPU_INT_FLAGS_DEFAULT 0
#endif
void EXPORT_FUNC (VasEBoot_bios_interrupt) (VasEBoot_uint8_t intno,
struct VasEBoot_bios_int_registers *regs)
__attribute__ ((regparm(3)));
struct VasEBoot_i386_idt
{
VasEBoot_uint16_t limit;
VasEBoot_uint32_t base;
} VasEBoot_PACKED;
#ifdef VasEBoot_MACHINE_PCBIOS
extern struct VasEBoot_i386_idt *EXPORT_VAR(VasEBoot_realidt);
#endif
#endif