xref: /openbmc/qemu/target/i386/hvf/x86_emu.h (revision a9e445df)
169e0a03cSPaolo Bonzini /*
269e0a03cSPaolo Bonzini  * Copyright (C) 2016 Veertu Inc,
369e0a03cSPaolo Bonzini  * Copyright (C) 2017 Google Inc,
469e0a03cSPaolo Bonzini  *
569e0a03cSPaolo Bonzini  * This program is free software; you can redistribute it and/or
669e0a03cSPaolo Bonzini  * modify it under the terms of the GNU Lesser General Public
769e0a03cSPaolo Bonzini  * License as published by the Free Software Foundation; either
88af82b8eSChetan Pant  * version 2.1 of the License, or (at your option) any later version.
969e0a03cSPaolo Bonzini  *
1069e0a03cSPaolo Bonzini  * This program is distributed in the hope that it will be useful,
1169e0a03cSPaolo Bonzini  * but WITHOUT ANY WARRANTY; without even the implied warranty of
1269e0a03cSPaolo Bonzini  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
1369e0a03cSPaolo Bonzini  * Lesser General Public License for more details.
1469e0a03cSPaolo Bonzini  *
1569e0a03cSPaolo Bonzini  * You should have received a copy of the GNU Lesser General Public
1669e0a03cSPaolo Bonzini  * License along with this program; if not, see <http://www.gnu.org/licenses/>.
1769e0a03cSPaolo Bonzini  */
18a8b991b5SMarkus Armbruster 
19a8b991b5SMarkus Armbruster #ifndef X86_EMU_H
20a8b991b5SMarkus Armbruster #define X86_EMU_H
2169e0a03cSPaolo Bonzini 
2269e0a03cSPaolo Bonzini #include "x86.h"
2369e0a03cSPaolo Bonzini #include "x86_decode.h"
2469e0a03cSPaolo Bonzini #include "cpu.h"
2569e0a03cSPaolo Bonzini 
2669e0a03cSPaolo Bonzini void init_emu(void);
2736861198SPhilippe Mathieu-Daudé bool exec_instruction(CPUX86State *env, struct x86_decode *ins);
2869e0a03cSPaolo Bonzini 
2969e0a03cSPaolo Bonzini void load_regs(struct CPUState *cpu);
3069e0a03cSPaolo Bonzini void store_regs(struct CPUState *cpu);
3169e0a03cSPaolo Bonzini 
32*a9e445dfSPhilippe Mathieu-Daudé void simulate_rdmsr(CPUX86State *env);
33*a9e445dfSPhilippe Mathieu-Daudé void simulate_wrmsr(CPUX86State *env);
3469e0a03cSPaolo Bonzini 
35ff2de166SPaolo Bonzini target_ulong read_reg(CPUX86State *env, int reg, int size);
36ff2de166SPaolo Bonzini void write_reg(CPUX86State *env, int reg, target_ulong val, int size);
37ff2de166SPaolo Bonzini target_ulong read_val_from_reg(target_ulong reg_ptr, int size);
38ff2de166SPaolo Bonzini void write_val_to_reg(target_ulong reg_ptr, target_ulong val, int size);
3936861198SPhilippe Mathieu-Daudé void write_val_ext(CPUX86State *env, target_ulong ptr, target_ulong val, int size);
4036861198SPhilippe Mathieu-Daudé uint8_t *read_mmio(CPUX86State *env, target_ulong ptr, int bytes);
4136861198SPhilippe Mathieu-Daudé target_ulong read_val_ext(CPUX86State *env, target_ulong ptr, int size);
4269e0a03cSPaolo Bonzini 
4336861198SPhilippe Mathieu-Daudé void exec_movzx(CPUX86State *env, struct x86_decode *decode);
4436861198SPhilippe Mathieu-Daudé void exec_shl(CPUX86State *env, struct x86_decode *decode);
4536861198SPhilippe Mathieu-Daudé void exec_movsx(CPUX86State *env, struct x86_decode *decode);
4636861198SPhilippe Mathieu-Daudé void exec_ror(CPUX86State *env, struct x86_decode *decode);
4736861198SPhilippe Mathieu-Daudé void exec_rol(CPUX86State *env, struct x86_decode *decode);
4836861198SPhilippe Mathieu-Daudé void exec_rcl(CPUX86State *env, struct x86_decode *decode);
4936861198SPhilippe Mathieu-Daudé void exec_rcr(CPUX86State *env, struct x86_decode *decode);
5069e0a03cSPaolo Bonzini #endif
51