#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <unistd.h>
#include "cpu.h"
#include "device.h"
#include "float_emul.h"
#include "interrupt.h"
#include "machine.h"
#include "memory.h"
#include "misc.h"
#include "settings.h"
#include "symbol.h"
#include "thirdparty/sh4_exception.h"
#include "thirdparty/sh4_mmu.h"
#include "tmp_sh_head.cc"
#include "tmp_sh_tail.cc"
Go to the source code of this file.
Macros | |
#define | DYNTRANS_32 |
#define | DYNTRANS_DELAYSLOT |
Functions | |
void | sh_pc_to_pointers (struct cpu *) |
void | sh3_cpu_interrupt_assert (struct interrupt *interrupt) |
void | sh3_cpu_interrupt_deassert (struct interrupt *interrupt) |
int | sh_cpu_new (struct cpu *cpu, struct memory *mem, struct machine *machine, int cpu_id, char *cpu_type_name) |
void | sh_update_interrupt_priorities (struct cpu *cpu) |
void | sh_cpu_interrupt_assert (struct interrupt *interrupt) |
void | sh_cpu_interrupt_deassert (struct interrupt *interrupt) |
void | sh_cpu_list_available_types (void) |
void | sh_cpu_dumpinfo (struct cpu *cpu) |
int | sh_cpu_instruction_has_delayslot (struct cpu *cpu, unsigned char *ib) |
void | sh_cpu_register_dump (struct cpu *cpu, int gprs, int coprocs) |
void | sh_cpu_tlbdump (struct machine *m, int x, int rawflag) |
void | sh_update_sr (struct cpu *cpu, uint32_t new_sr) |
void | sh_update_fpscr (struct cpu *cpu, uint32_t new_fpscr) |
void | sh_exception (struct cpu *cpu, int expevt, int intevt, uint32_t vaddr) |
int | sh_cpu_disassemble_instr (struct cpu *cpu, unsigned char *instr, int running, uint64_t dumpaddr) |
Variables | |
int | quiet_mode |
void sh3_cpu_interrupt_assert | ( | struct interrupt * | interrupt | ) |
Definition at line 291 of file cpu_sh.cc.
Referenced by sh_cpu_new().
void sh3_cpu_interrupt_deassert | ( | struct interrupt * | interrupt | ) |
Definition at line 295 of file cpu_sh.cc.
Referenced by sh_cpu_new().
int sh_cpu_disassemble_instr | ( | struct cpu * | cpu, |
unsigned char * | instr, | ||
int | running, | ||
uint64_t | dumpaddr | ||
) |
Definition at line 775 of file cpu_sh.cc.
References addr, cpu::byte_order, cpu::cd, cpu::cpu_id, debug, cpu::delay_slot, EMUL_BIG_ENDIAN, sh_cpu::fpscr, get_symbol_name(), cpu::machine, machine::ncpus, cpu::pc, sh_cpu::r, cpu::sh, SH_FPSCR_PR, SH_FPSCR_SZ, SH_INVALID_INSTR, and machine::symbol_context.
void sh_cpu_dumpinfo | ( | struct cpu * | cpu | ) |
Definition at line 383 of file cpu_sh.cc.
References cpu::byte_order, debug, and EMUL_BIG_ENDIAN.
int sh_cpu_instruction_has_delayslot | ( | struct cpu * | cpu, |
unsigned char * | ib | ||
) |
Definition at line 395 of file cpu_sh.cc.
References BE16_TO_HOST, cpu::byte_order, EMUL_BIG_ENDIAN, cpu::is_32bit, and LE16_TO_HOST.
Referenced by sh_cpu_new().
void sh_cpu_interrupt_assert | ( | struct interrupt * | interrupt | ) |
Definition at line 304 of file cpu_sh.cc.
References cpu::cd, interrupt::extra, fatal(), if(), sh_cpu::int_level, sh_cpu::int_prio_and_pending, sh_cpu::int_to_assert, interrupt::line, cpu::sh, SH_INT_ASSERTED, and SH_INT_PRIO_MASK.
Referenced by sh_cpu_new().
void sh_cpu_interrupt_deassert | ( | struct interrupt * | interrupt | ) |
Definition at line 331 of file cpu_sh.cc.
References cpu::cd, interrupt::extra, if(), sh_cpu::int_level, sh_cpu::int_prio_and_pending, sh_cpu::int_to_assert, interrupt::line, cpu::sh, SH_INT_ASSERTED, and SH_INT_PRIO_MASK.
Referenced by sh_cpu_new().
void sh_cpu_list_available_types | ( | void | ) |
Definition at line 364 of file cpu_sh.cc.
References debug, sh_cpu_type_def::name, SH_CPU_TYPE_DEFS, and strlen().
int sh_cpu_new | ( | struct cpu * | cpu, |
struct memory * | mem, | ||
struct machine * | machine, | ||
int | cpu_id, | ||
char * | cpu_type_name | ||
) |
Definition at line 77 of file cpu_sh.cc.
References sh_cpu_type_def::arch, sh_cpu_type_def::bits, cpu::byte_order, cpu::cd, CPU_SETTINGS_ADD_REGISTER32, CPU_SETTINGS_ADD_REGISTER64, sh_cpu::cpu_type, sh_cpu::dbr, debug, device_add(), EMUL_LITTLE_ENDIAN, sh_cpu::expevt, interrupt::extra, fatal(), sh_cpu::fpscr, sh_cpu::fpul, sh_cpu::fr, sh_cpu::gbr, cpu::instruction_has_delayslot, sh_cpu::intc_intmsk00, sh_cpu::intc_intmsk04, sh_cpu::intc_intpri00, sh_cpu::intc_intpri04, sh_cpu::intc_intpri08, sh_cpu::intc_intpri0c, sh_cpu::intc_iprd, interrupt::interrupt_assert, interrupt::interrupt_deassert, interrupt_handler_register(), sh_cpu::intevt, cpu::invalidate_code_translation, cpu::invalidate_translation_caches, cpu::is_32bit, sh_cpu::itlb_hi, sh_cpu::itlb_lo, interrupt::line, sh_cpu::mach, cpu::machine, sh_cpu::macl, cpu::memory_rw, sh_cpu_type_def::name, interrupt::name, cpu::name, cpu::path, cpu::pc, sh_cpu::pcic_pcibus, machine::physical_ram_in_mb, sh_cpu::pr, sh_cpu::r, sh_cpu::r_bank, cpu::run_instr, sh_cpu::sgr, cpu::sh, sh3_cpu_interrupt_assert(), sh3_cpu_interrupt_deassert(), sh_cpu_instruction_has_delayslot(), sh_cpu_interrupt_assert(), sh_cpu_interrupt_deassert(), SH_CPU_TYPE_DEFS, SH_INTEVT_NMI, sh_invalidate_code_translation(), sh_invalidate_translation_caches(), sh_memory_rw(), SH_N_FPRS, SH_N_GPRS, SH_N_GPRS_BANKED, SH_N_ITLB_ENTRIES, SH_N_UTLB_ENTRIES, sh_run_instr(), SH_SR_IMASK, SH_SR_MD, sh_translate_v2p(), sh_update_interrupt_priorities(), sh_update_translation_table(), sh_cpu::sr, sh_cpu::tra, cpu::translate_v2p, cpu::update_translation_table, sh_cpu::utlb_hi, sh_cpu::utlb_lo, sh_cpu::vbr, and sh_cpu::xf.
void sh_cpu_register_dump | ( | struct cpu * | cpu, |
int | gprs, | ||
int | coprocs | ||
) |
Definition at line 454 of file cpu_sh.cc.
References cpu::cd, cpu::cpu_id, sh_cpu::dbr, debug, sh_cpu::expevt, sh_cpu::fpscr, sh_cpu::fpul, sh_cpu::fr, sh_cpu::gbr, get_symbol_name(), sh_cpu::intevt, sh_cpu::mach, cpu::machine, sh_cpu::macl, cpu::pc, sh_cpu::pr, sh_cpu::r, sh_cpu::r_bank, sh_cpu::sgr, cpu::sh, SH_FPSCR_FR, SH_FPSCR_PR, SH_FPSCR_SZ, SH_N_FPRS, SH_N_GPRS, SH_N_GPRS_BANKED, SH_SR_BL, SH_SR_FD, SH_SR_IMASK, SH_SR_IMASK_SHIFT, SH_SR_M, SH_SR_MD, SH_SR_Q, SH_SR_RB, SH_SR_S, SH_SR_T, sh_cpu::spc, sh_cpu::sr, sh_cpu::ssr, machine::symbol_context, sh_cpu::tra, sh_cpu::vbr, and sh_cpu::xf.
void sh_cpu_tlbdump | ( | struct machine * | m, |
int | x, | ||
int | rawflag | ||
) |
Definition at line 556 of file cpu_sh.cc.
References cpu::cd, machine::cpus, sh_cpu::itlb_hi, sh_cpu::itlb_lo, machine::ncpus, cpu::sh, SH_N_ITLB_ENTRIES, SH_N_UTLB_ENTRIES, sh_cpu::utlb_hi, and sh_cpu::utlb_lo.
void sh_exception | ( | struct cpu * | cpu, |
int | expevt, | ||
int | intevt, | ||
uint32_t | vaddr | ||
) |
Definition at line 632 of file cpu_sh.cc.
References cpu::cd, debug, cpu::delay_slot, EXCEPTION_IN_DELAY_SLOT, sh_cpu::expevt, EXPEVT_FPU_DISABLE, EXPEVT_RES_INST, EXPEVT_RESET_MANUAL, EXPEVT_RESET_POWER, EXPEVT_TLB_MISS_LD, EXPEVT_TLB_MISS_ST, EXPEVT_TLB_MOD, EXPEVT_TLB_PROT_LD, EXPEVT_TLB_PROT_ST, EXPEVT_TRAPA, fatal(), sh_cpu::intevt, cpu::is_halted, cpu::pc, sh_cpu::pteh, quiet_mode, sh_cpu::r, sh_cpu::sgr, cpu::sh, SH4_PTEH_VPN_MASK, sh_pc_to_pointers(), SH_SR_BL, SH_SR_FD, SH_SR_IMASK, SH_SR_MD, SH_SR_RB, sh_update_sr(), sh_cpu::spc, sh_cpu::sr, sh_cpu::ssr, sh_cpu::tea, and sh_cpu::vbr.
Referenced by DEVICE_ACCESS(), and X().
void sh_pc_to_pointers | ( | struct cpu * | ) |
Referenced by sh_exception().
void sh_update_fpscr | ( | struct cpu * | cpu, |
uint32_t | new_fpscr | ||
) |
Definition at line 607 of file cpu_sh.cc.
References cpu::cd, sh_cpu::fpscr, sh_cpu::fr, cpu::sh, SH_FPSCR_FR, SH_N_FPRS, and sh_cpu::xf.
Referenced by X().
void sh_update_interrupt_priorities | ( | struct cpu * | cpu | ) |
Definition at line 249 of file cpu_sh.cc.
References cpu::cd, sh_cpu::int_prio_and_pending, sh_cpu::intc_intpri08, sh_cpu::intc_ipra, cpu::sh, SH4_INTEVT_IRQ0, SH4_INTEVT_IRQ14, SH4_INTEVT_SCIF_ERI, SH4_INTEVT_SCIF_TXI, SH_INT_PRIO_MASK, SH_INTEVT_TMU0_TUNI0, SH_INTEVT_TMU1_TUNI1, and SH_INTEVT_TMU2_TUNI2.
Referenced by sh_cpu_new().
void sh_update_sr | ( | struct cpu * | cpu, |
uint32_t | new_sr | ||
) |
Definition at line 585 of file cpu_sh.cc.
References cpu::cd, sh_cpu::r, sh_cpu::r_bank, cpu::sh, SH_N_GPRS_BANKED, SH_SR_RB, and sh_cpu::sr.
Referenced by sh_exception(), and X().
int quiet_mode |
Definition at line 68 of file emul.cc.
Referenced by arm_exception(), mips_cpu_exception(), ppc_exception(), and sh_exception().