coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
decode.h
Go to the documentation of this file.
1 /****************************************************************************
2 *
3 * Realmode X86 Emulator Library
4 *
5 * Copyright (C) 1996-1999 SciTech Software, Inc.
6 * Copyright (C) David Mosberger-Tang
7 * Copyright (C) 1999 Egbert Eich
8 *
9 * ========================================================================
10 *
11 * Permission to use, copy, modify, distribute, and sell this software and
12 * its documentation for any purpose is hereby granted without fee,
13 * provided that the above copyright notice appear in all copies and that
14 * both that copyright notice and this permission notice appear in
15 * supporting documentation, and that the name of the authors not be used
16 * in advertising or publicity pertaining to distribution of the software
17 * without specific, written prior permission. The authors makes no
18 * representations about the suitability of this software for any purpose.
19 * It is provided "as is" without express or implied warranty.
20 *
21 * THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
22 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
23 * EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
24 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
25 * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
26 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
27 * PERFORMANCE OF THIS SOFTWARE.
28 *
29 * ========================================================================
30 *
31 * Language: ANSI C
32 * Environment: Any
33 * Developer: Kendall Bennett
34 *
35 * Description: Header file for instruction decoding logic.
36 *
37 ****************************************************************************/
38 
39 #ifndef __X86EMU_DECODE_H
40 #define __X86EMU_DECODE_H
41 
42 /*---------------------- Macros and type definitions ----------------------*/
43 
44 /* Instruction Decoding Stuff */
45 
46 #define FETCH_DECODE_MODRM(mod,rh,rl) fetch_decode_modrm(&mod,&rh,&rl)
47 #define DECODE_RM_BYTE_REGISTER(r) decode_rm_byte_register(r)
48 #define DECODE_RM_WORD_REGISTER(r) decode_rm_word_register(r)
49 #define DECODE_RM_LONG_REGISTER(r) decode_rm_long_register(r)
50 #define DECODE_CLEAR_SEGOVR() M.x86.mode &= ~SYSMODE_CLRMASK
51 
52 /*-------------------------- Function Prototypes --------------------------*/
53 
54 #ifdef __cplusplus
55 extern "C" { /* Use "C" linkage when in C++ mode */
56 #endif
57 
59 void fetch_decode_modrm (int *mod,int *regh,int *regl);
60 u8 fetch_byte_imm (void);
61 u16 fetch_word_imm (void);
62 u32 fetch_long_imm (void);
70 void store_data_byte_abs (uint segment, uint offset, u8 val);
72 void store_data_word_abs (uint segment, uint offset, u16 val);
74 void store_data_long_abs (uint segment, uint offset, u32 val);
75 u8* decode_rm_byte_register(int reg);
78 u16* decode_rm_seg_register(int reg);
79 unsigned int decode_rm00_address(int rm);
80 unsigned int decode_rm01_address(int rm);
81 unsigned int decode_rm10_address(int rm);
82 unsigned int decode_rmXX_address(int mod, int rm);
83 
84 #ifdef __cplusplus
85 } /* End of "C" linkage for C++ */
86 #endif
87 
88 #endif /* __X86EMU_DECODE_H */
unsigned int decode_rm01_address(int rm)
Definition: decode.c:957
unsigned int decode_rmXX_address(int mod, int rm)
Definition: decode.c:1138
u16 fetch_data_word_abs(uint segment, uint offset)
Definition: decode.c:384
u16 fetch_data_word(uint offset)
Definition: decode.c:324
u8 fetch_data_byte_abs(uint segment, uint offset)
Definition: decode.c:363
void store_data_byte(uint offset, u8 val)
Definition: decode.c:427
unsigned int decode_rm10_address(int rm)
Definition: decode.c:1046
void fetch_decode_modrm(int *mod, int *regh, int *regl)
Definition: decode.c:152
void store_data_word_abs(uint segment, uint offset, u16 val)
Definition: decode.c:516
u16 fetch_word_imm(void)
Definition: decode.c:199
u16 * decode_rm_seg_register(int reg)
Definition: decode.c:695
void store_data_byte_abs(uint segment, uint offset, u8 val)
Definition: decode.c:493
void store_data_long_abs(uint segment, uint offset, u32 val)
Definition: decode.c:539
u8 fetch_byte_imm(void)
Definition: decode.c:178
u16 * decode_rm_word_register(int reg)
Definition: decode.c:606
u8 fetch_data_byte(uint offset)
Definition: decode.c:305
unsigned int decode_rm00_address(int rm)
Definition: decode.c:877
u8 * decode_rm_byte_register(int reg)
Definition: decode.c:562
void store_data_long(uint offset, u32 val)
Definition: decode.c:471
u32 fetch_data_long_abs(uint segment, uint offset)
Definition: decode.c:405
u32 * decode_rm_long_register(int reg)
Definition: decode.c:650
void store_data_word(uint offset, u16 val)
Definition: decode.c:449
void x86emu_intr_raise(u8 type)
Definition: decode.c:77
u32 fetch_data_long(uint offset)
Definition: decode.c:343
u32 fetch_long_imm(void)
Definition: decode.c:221
unsigned int uint
Definition: types.h:44
static size_t offset
Definition: flashconsole.c:16
unsigned int type
Definition: edid.c:57
uint32_t u32
Definition: stdint.h:51
uint16_t u16
Definition: stdint.h:48
uint8_t u8
Definition: stdint.h:45
u8 val
Definition: sys.c:300