/*
 * vm86.h
 *
 * Copyright (C) 2016 Aleksandar Andrejevic <theflash@sdf.lonestar.org>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * This program 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 Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef _VM86_H_
#define _VM86_H_

#include <common.h>
#include <thread.h>
#include <interrupt.h>
#include <cpu.h>

typedef struct
{
    dword_t edi, esi, ebp, unused, ebx, edx, ecx, eax;
    dword_t eip, cs, eflags, esp, ss, es, ds, fs, gs;
} vm86_registers_t;

void vm86_handler(registers_ext_vm86_t *regs);
word_t vm86_alloc(word_t size);
void vm86_free(word_t paragraph);
dword_t vm86_interrupt(byte_t number, vm86_registers_t *regs);

#endif
