xref: /qemu/target/i386/emulate/x86_emu.h (revision 99e5aaf9afeed3e0437f6dbc7672e3028d2b2f4b)
1c97d6d2cSSergio Andres Gomez Del Real /*
2c97d6d2cSSergio Andres Gomez Del Real  * Copyright (C) 2016 Veertu Inc,
3c97d6d2cSSergio Andres Gomez Del Real  * Copyright (C) 2017 Google Inc,
4c97d6d2cSSergio Andres Gomez Del Real  *
5c97d6d2cSSergio Andres Gomez Del Real  * This program is free software; you can redistribute it and/or
6996feed4SSergio Andres Gomez Del Real  * modify it under the terms of the GNU Lesser General Public
7996feed4SSergio Andres Gomez Del Real  * License as published by the Free Software Foundation; either
88af82b8eSChetan Pant  * version 2.1 of the License, or (at your option) any later version.
9c97d6d2cSSergio Andres Gomez Del Real  *
10c97d6d2cSSergio Andres Gomez Del Real  * This program is distributed in the hope that it will be useful,
11c97d6d2cSSergio Andres Gomez Del Real  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12996feed4SSergio Andres Gomez Del Real  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13996feed4SSergio Andres Gomez Del Real  * Lesser General Public License for more details.
14c97d6d2cSSergio Andres Gomez Del Real  *
15996feed4SSergio Andres Gomez Del Real  * You should have received a copy of the GNU Lesser General Public
16996feed4SSergio Andres Gomez Del Real  * License along with this program; if not, see <http://www.gnu.org/licenses/>.
17c97d6d2cSSergio Andres Gomez Del Real  */
18a8b991b5SMarkus Armbruster 
19a8b991b5SMarkus Armbruster #ifndef X86_EMU_H
20a8b991b5SMarkus Armbruster #define X86_EMU_H
21c97d6d2cSSergio Andres Gomez Del Real 
22c97d6d2cSSergio Andres Gomez Del Real #include "x86.h"
23c97d6d2cSSergio Andres Gomez Del Real #include "x86_decode.h"
24c97d6d2cSSergio Andres Gomez Del Real #include "cpu.h"
25c97d6d2cSSergio Andres Gomez Del Real 
26c97d6d2cSSergio Andres Gomez Del Real void init_emu(void);
2736861198SPhilippe Mathieu-Daudé bool exec_instruction(CPUX86State *env, struct x86_decode *ins);
28*99e5aaf9SWei Liu void x86_emul_raise_exception(CPUX86State *env, int exception_index, int error_code);
29c97d6d2cSSergio Andres Gomez Del Real 
30ff2de166SPaolo Bonzini target_ulong read_reg(CPUX86State *env, int reg, int size);
31ff2de166SPaolo Bonzini void write_reg(CPUX86State *env, int reg, target_ulong val, int size);
32ff2de166SPaolo Bonzini target_ulong read_val_from_reg(target_ulong reg_ptr, int size);
33ff2de166SPaolo Bonzini void write_val_to_reg(target_ulong reg_ptr, target_ulong val, int size);
3436861198SPhilippe Mathieu-Daudé void write_val_ext(CPUX86State *env, target_ulong ptr, target_ulong val, int size);
3536861198SPhilippe Mathieu-Daudé uint8_t *read_mmio(CPUX86State *env, target_ulong ptr, int bytes);
3636861198SPhilippe Mathieu-Daudé target_ulong read_val_ext(CPUX86State *env, target_ulong ptr, int size);
37c97d6d2cSSergio Andres Gomez Del Real 
3836861198SPhilippe Mathieu-Daudé void exec_movzx(CPUX86State *env, struct x86_decode *decode);
3936861198SPhilippe Mathieu-Daudé void exec_shl(CPUX86State *env, struct x86_decode *decode);
4036861198SPhilippe Mathieu-Daudé void exec_movsx(CPUX86State *env, struct x86_decode *decode);
4136861198SPhilippe Mathieu-Daudé void exec_ror(CPUX86State *env, struct x86_decode *decode);
4236861198SPhilippe Mathieu-Daudé void exec_rol(CPUX86State *env, struct x86_decode *decode);
4336861198SPhilippe Mathieu-Daudé void exec_rcl(CPUX86State *env, struct x86_decode *decode);
4436861198SPhilippe Mathieu-Daudé void exec_rcr(CPUX86State *env, struct x86_decode *decode);
45c97d6d2cSSergio Andres Gomez Del Real #endif
46