filename | src/xlat/xlatdasm.h |
changeset | 1263:b3de98d19faf |
prev | 1094:d2324eb67223 |
author | nkeynes |
date | Fri Aug 24 08:53:50 2012 +1000 (11 years ago) |
permissions | -rw-r--r-- |
last change | Move the generated prologue/epilogue code out into a common entry stub (reduces space requirements) and pre-save all saved registers. Change FASTCALL to use 3 regs instead of 2 since we can now keep everything in regs. |
file | annotate | diff | log | raw |
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +00001.2 +++ b/src/xlat/xlatdasm.h Fri Aug 24 08:53:50 2012 +10001.3 @@ -0,0 +1,55 @@1.4 +/**1.5 + * $Id$1.6 + *1.7 + * Wrapper around i386-dis to supply the same behaviour as the other1.8 + * disassembly functions.1.9 + *1.10 + * Copyright (c) 2005 Nathan Keynes.1.11 + *1.12 + * This program is free software; you can redistribute it and/or modify1.13 + * it under the terms of the GNU General Public License as published by1.14 + * the Free Software Foundation; either version 2 of the License, or1.15 + * (at your option) any later version.1.16 + *1.17 + * This program is distributed in the hope that it will be useful,1.18 + * but WITHOUT ANY WARRANTY; without even the implied warranty of1.19 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the1.20 + * GNU General Public License for more details.1.21 + */1.22 +1.23 +#include <stdio.h>1.24 +#include "cpu.h"1.25 +#include "mem.h"1.26 +extern const struct cpu_desc_struct xlat_cpu_desc;1.27 +1.28 +typedef struct xlat_symbol {1.29 + const char *name;1.30 + void *ptr;1.31 +} xlat_symbol;1.32 +1.33 +1.34 +1.35 +/**1.36 + * Dump the disassembly of the specified code block to a stream1.37 + * (primarily for debugging purposes)1.38 + * @param out The stream to write the output to1.39 + * @param code a translated block1.40 + */1.41 +void xlat_disasm_block( FILE *out, void *code );1.42 +1.43 +/**1.44 + * Disassemble one host instruction1.45 + * @param pc Instruction to disassemble1.46 + * @param buf buffer to hold the disassembled instruction1.47 + * @param len sizeof buf1.48 + * @param opcode buffer to hold the raw opcodes for the instruction (must be at least1.49 + * 3 * maximum number of instruction bytes)1.50 + * @return next pc after the current instruction1.51 + */1.52 +uintptr_t xlat_disasm_instruction( uintptr_t pc, char *buf, int len, char *opcode );1.53 +1.54 +void xlat_disasm_region( FILE *out, void *block, uint32_t len );1.55 +void xlat_disasm_init( xlat_symbol *symtab, int num_symbols );1.56 +uintptr_t xlat_disasm_instruction( uintptr_t pc, char *buf, int len, char *opcode );1.57 +1.58 +void xlat_print_symbolic_operand( char *buf, int hex, uintptr_t disp );
.