#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 | ) |
void sh3_cpu_interrupt_deassert | ( | struct interrupt * | interrupt | ) |
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(), instr, cpu::machine, machine::ncpus, cpu::pc, sh_cpu::r, cpu::running, 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.
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.
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.
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().
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.
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().