#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <unistd.h>
#include "arm_cpu_types.h"
#include "cpu.h"
#include "interrupt.h"
#include "machine.h"
#include "memory.h"
#include "misc.h"
#include "of.h"
#include "settings.h"
#include "symbol.h"
#include "tmp_arm_head.cc"
#include "quick_pc_to_pointers.h"
#include "tmp_arm_tail.cc"
Go to the source code of this file.
Macros | |
#define | DYNTRANS_32 |
Functions | |
void | arm_pc_to_pointers (struct cpu *cpu) |
void | arm_irq_interrupt_assert (struct interrupt *interrupt) |
void | arm_irq_interrupt_deassert (struct interrupt *interrupt) |
int | arm_cpu_new (struct cpu *cpu, struct memory *mem, struct machine *machine, int cpu_id, char *cpu_type_name) |
void | arm_setup_initial_translation_table (struct cpu *cpu, uint32_t ttb_addr) |
void | arm_translation_table_set_l1 (struct cpu *cpu, uint32_t vaddr, uint32_t paddr) |
void | arm_translation_table_set_l1_b (struct cpu *cpu, uint32_t vaddr, uint32_t paddr) |
void | arm_cpu_dumpinfo (struct cpu *cpu) |
void | arm_cpu_list_available_types (void) |
void | arm_cpu_register_dump (struct cpu *cpu, int gprs, int coprocs) |
void | arm_save_register_bank (struct cpu *cpu) |
void | arm_load_register_bank (struct cpu *cpu) |
void | arm_exception (struct cpu *cpu, int exception_nr) |
void | arm_cpu_tlbdump (struct machine *m, int x, int rawflag) |
int | arm_cpu_disassemble_instr_thumb (struct cpu *cpu, unsigned char *ib, int running, uint64_t dumpaddr) |
int | arm_cpu_interpret_thumb_SLOW (struct cpu *cpu) |
int | arm_cpu_disassemble_instr (struct cpu *cpu, unsigned char *ib, int running, uint64_t dumpaddr) |
void | arm_mcr_mrc (struct cpu *cpu, uint32_t iword) |
void | arm_cdp (struct cpu *cpu, uint32_t iword) |
Variables | |
uint8_t | condition_hi [16] |
uint8_t | condition_ge [16] |
uint8_t | condition_gt [16] |
#define DYNTRANS_32 |
Definition at line 56 of file cpu_arm.cc.
void arm_cdp | ( | struct cpu * | cpu, |
uint32_t | iword | ||
) |
Definition at line 2356 of file cpu_arm.cc.
References arm_exception(), ARM_EXCEPTION_UND, fatal(), and cpu::pc.
Referenced by Y().
int arm_cpu_disassemble_instr | ( | struct cpu * | cpu, |
unsigned char * | ib, | ||
int | running, | ||
uint64_t | dumpaddr | ||
) |
Definition at line 1715 of file cpu_arm.cc.
References arm_cpu_disassemble_instr_thumb(), cpu::byte_order, cpu::cpu_id, debug, EMUL_LITTLE_ENDIAN, get_symbol_name(), cpu::machine, machine::ncpus, cpu::pc, and machine::symbol_context.
int arm_cpu_disassemble_instr_thumb | ( | struct cpu * | cpu, |
unsigned char * | ib, | ||
int | running, | ||
uint64_t | dumpaddr | ||
) |
Definition at line 761 of file cpu_arm.cc.
References cpu::byte_order, debug, and EMUL_LITTLE_ENDIAN.
Referenced by arm_cpu_disassemble_instr(), and arm_cpu_interpret_thumb_SLOW().
void arm_cpu_dumpinfo | ( | struct cpu * | cpu | ) |
Definition at line 307 of file cpu_arm.cc.
References cpu::arm, cpu::cd, arm_cpu::cpu_type, arm_cpu_type_def::dcache_shift, debug, and arm_cpu_type_def::icache_shift.
int arm_cpu_interpret_thumb_SLOW | ( | struct cpu * | cpu | ) |
Definition at line 1092 of file cpu_arm.cc.
References addr, cpu::arm, arm_cpu_disassemble_instr_thumb(), arm_exception(), ARM_EXCEPTION_SWI, ARM_F_C, ARM_F_N, ARM_F_V, ARM_F_Z, ARM_FLAG_T, ARM_LR, ARM_PC, arm_pop(), arm_push(), ARM_SP, cpu::byte_order, CACHE_DATA, CACHE_INSTRUCTION, cpu::cd, condition_ge, condition_gt, condition_hi, arm_cpu::cpsr, cpu_functioncall_trace(), cpu_functioncall_trace_return(), cpu::cpu_id, debug, EMUL_LITTLE_ENDIAN, fatal(), arm_cpu::flags, get_symbol_name(), if(), machine::instruction_trace, cpu::machine, cpu::mem, MEM_READ, MEM_WRITE, cpu::memory_rw, machine::ncpus, cpu::ninstrs, cpu::pc, arm_cpu::r, cpu::running, machine::show_trace_tree, machine::symbol_context, t, and arm_cpu::tmp_branch.
void arm_cpu_list_available_types | ( | void | ) |
Definition at line 321 of file cpu_arm.cc.
References ARM_CPU_TYPE_DEFS, debug, arm_cpu_type_def::name, and strlen().
int arm_cpu_new | ( | struct cpu * | cpu, |
struct memory * | mem, | ||
struct machine * | machine, | ||
int | cpu_id, | ||
char * | cpu_type_name | ||
) |
Definition at line 91 of file cpu_arm.cc.
References cpu::arm, ARM_CACHETYPE_CLASS_SHIFT, ARM_CACHETYPE_DASSOC_SHIFT, ARM_CACHETYPE_DLINE_SHIFT, ARM_CACHETYPE_DSIZE_SHIFT, ARM_CACHETYPE_HARVARD_SHIFT, ARM_CACHETYPE_IASSOC_SHIFT, ARM_CACHETYPE_ILINE_SHIFT, ARM_CACHETYPE_ISIZE_SHIFT, ARM_CONTROL_ALIGN, ARM_CONTROL_CACHE, ARM_CONTROL_DATA32, ARM_CONTROL_ICACHE, ARM_CONTROL_PROG32, ARM_CONTROL_R, ARM_CONTROL_S, arm_coproc_15(), arm_coproc_xscale_14(), ARM_CPU_TYPE_DEFS, ARM_FLAG_F, ARM_FLAG_I, arm_invalidate_code_translation(), arm_invalidate_translation_caches(), arm_memory_rw(), ARM_MODE_SVC32, arm_run_instr(), arm_translate_v2p(), arm_update_translation_table(), ARM_XSCALE, cpu::byte_order, arm_cpu::cachetype, cpu::cd, arm_cpu::control, arm_cpu::coproc, arm_cpu::cpsr, CPU_SETTINGS_ADD_REGISTER32, CPU_SETTINGS_ADD_REGISTER64, arm_cpu::cpu_type, arm_cpu_type_def::dcache_shift, debug, EMUL_LITTLE_ENDIAN, arm_cpu_type_def::flags, arm_cpu::flags, arm_cpu_type_def::icache_shift, cpu::invalidate_code_translation, cpu::invalidate_translation_caches, cpu::is_32bit, cpu::machine, cpu::memory_rw, N_ARM_REGS, arm_cpu_type_def::name, cpu::name, arm_cpu::of_emul_addr, cpu::pc, machine::physical_ram_in_mb, machine::prom_emulation, cpu::run_instr, store_32bit_word(), cpu::translate_v2p, and cpu::update_translation_table.
void arm_cpu_register_dump | ( | struct cpu * | cpu, |
int | gprs, | ||
int | coprocs | ||
) |
Definition at line 346 of file cpu_arm.cc.
References cpu::arm, ARM_FLAG_A, ARM_FLAG_C, ARM_FLAG_E, ARM_FLAG_F, ARM_FLAG_I, ARM_FLAG_J, ARM_FLAG_MODE, ARM_FLAG_N, ARM_FLAG_Q, ARM_FLAG_T, ARM_FLAG_V, ARM_FLAG_Z, ARM_MODE_USR32, ARM_PC, cpu::cd, arm_cpu::cpsr, cpu::cpu_id, debug, arm_cpu::flags, get_symbol_name(), cpu::machine, N_ARM_REGS, cpu::pc, and machine::symbol_context.
void arm_cpu_tlbdump | ( | struct machine * | m, |
int | x, | ||
int | rawflag | ||
) |
Definition at line 733 of file cpu_arm.cc.
void arm_exception | ( | struct cpu * | cpu, |
int | exception_nr | ||
) |
Definition at line 603 of file cpu_arm.cc.
References cpu::arm, ARM_EXCEPTION_DATA_ABT, ARM_EXCEPTION_FIQ, ARM_EXCEPTION_IRQ, ARM_EXCEPTION_PREF_ABT, ARM_EXCEPTION_RESET, ARM_EXCEPTION_SWI, ARM_EXCEPTION_UND, ARM_FLAG_T, arm_save_register_bank(), cpu::cd, arm_cpu::cpsr, debug, arm_cpu::far, fatal(), arm_cpu::flags, arm_cpu::fsr, N_ARM_EXCEPTIONS, cpu::pc, quiet_mode, and cpu::running.
Referenced by arm_cdp(), arm_cpu_interpret_thumb_SLOW(), arm_mcr_mrc(), X(), and Y().
void arm_irq_interrupt_assert | ( | struct interrupt * | interrupt | ) |
Definition at line 742 of file cpu_arm.cc.
References cpu::arm, cpu::cd, interrupt::extra, and arm_cpu::irq_asserted.
void arm_irq_interrupt_deassert | ( | struct interrupt * | interrupt | ) |
Definition at line 747 of file cpu_arm.cc.
References cpu::arm, cpu::cd, interrupt::extra, and arm_cpu::irq_asserted.
void arm_load_register_bank | ( | struct cpu * | cpu | ) |
Definition at line 556 of file cpu_arm.cc.
References arm_cpu::abt_r13_r14, cpu::arm, ARM_FLAG_MODE, ARM_MODE_ABT32, ARM_MODE_FIQ32, ARM_MODE_IRQ32, ARM_MODE_SVC32, ARM_MODE_SYS32, ARM_MODE_UND32, ARM_MODE_USR32, cpu::cd, arm_cpu::cpsr, arm_cpu::default_r8_r14, fatal(), arm_cpu::fiq_r8_r14, arm_cpu::irq_r13_r14, arm_cpu::r, arm_cpu::svc_r13_r14, and arm_cpu::und_r13_r14.
void arm_mcr_mrc | ( | struct cpu * | cpu, |
uint32_t | iword | ||
) |
Definition at line 2326 of file cpu_arm.cc.
References cpu::arm, arm_exception(), ARM_EXCEPTION_UND, cpu::cd, arm_cpu::coproc, fatal(), and cpu::pc.
Referenced by Y().
void arm_pc_to_pointers | ( | struct cpu * | cpu | ) |
void arm_save_register_bank | ( | struct cpu * | cpu | ) |
Definition at line 509 of file cpu_arm.cc.
References arm_cpu::abt_r13_r14, cpu::arm, ARM_FLAG_MODE, ARM_MODE_ABT32, ARM_MODE_FIQ32, ARM_MODE_IRQ32, ARM_MODE_SVC32, ARM_MODE_SYS32, ARM_MODE_UND32, ARM_MODE_USR32, cpu::cd, arm_cpu::cpsr, arm_cpu::default_r8_r14, fatal(), arm_cpu::fiq_r8_r14, arm_cpu::irq_r13_r14, arm_cpu::r, arm_cpu::svc_r13_r14, and arm_cpu::und_r13_r14.
Referenced by A__NAME(), arm_exception(), arm_pop(), and Y().
void arm_setup_initial_translation_table | ( | struct cpu * | cpu, |
uint32_t | ttb_addr | ||
) |
Definition at line 215 of file cpu_arm.cc.
References addr, cpu::arm, ARM_CONTROL_MMU, arm_translate_v2p_mmu(), cpu::byte_order, cpu::cd, arm_cpu::control, arm_cpu::dacr, EMUL_LITTLE_ENDIAN, cpu::mem, MEM_WRITE, cpu::memory_rw, NO_EXCEPTIONS, PHYSICAL, cpu::translate_v2p, and arm_cpu::ttb.
Referenced by MACHINE_SETUP().
void arm_translation_table_set_l1 | ( | struct cpu * | cpu, |
uint32_t | vaddr, | ||
uint32_t | paddr | ||
) |
Definition at line 251 of file cpu_arm.cc.
References addr, cpu::arm, cpu::byte_order, cpu::cd, EMUL_LITTLE_ENDIAN, cpu::mem, MEM_WRITE, cpu::memory_rw, NO_EXCEPTIONS, PHYSICAL, and arm_cpu::ttb.
Referenced by MACHINE_SETUP().
void arm_translation_table_set_l1_b | ( | struct cpu * | cpu, |
uint32_t | vaddr, | ||
uint32_t | paddr | ||
) |
Definition at line 279 of file cpu_arm.cc.
References addr, cpu::arm, cpu::byte_order, cpu::cd, EMUL_LITTLE_ENDIAN, cpu::mem, MEM_WRITE, cpu::memory_rw, NO_EXCEPTIONS, PHYSICAL, and arm_cpu::ttb.
Referenced by MACHINE_SETUP().
uint8_t condition_ge[16] |
Definition at line 129 of file cpu_arm_instr.cc.
Referenced by arm_cpu_interpret_thumb_SLOW().
uint8_t condition_gt[16] |
Definition at line 130 of file cpu_arm_instr.cc.
Referenced by arm_cpu_interpret_thumb_SLOW().
uint8_t condition_hi[16] |
Definition at line 128 of file cpu_arm_instr.cc.
Referenced by arm_cpu_interpret_thumb_SLOW().