#include <sys/types.h>
#include <inttypes.h>
#include <sys/time.h>
#include "../../config.h"
#include "timer.h"
#include "cpu_alpha.h"
#include "cpu_arm.h"
#include "cpu_m88k.h"
#include "cpu_mips.h"
#include "cpu_ppc.h"
#include "cpu_sh.h"
Go to the source code of this file.
Classes | |
struct | physpage_ranges |
struct | cpu_family |
struct | cpu |
Functions | |
struct cpu * | cpu_new (struct memory *mem, struct machine *machine, int cpu_id, char *cpu_type_name) |
void | cpu_destroy (struct cpu *cpu) |
void | cpu_tlbdump (struct machine *m, int x, int rawflag) |
void | cpu_register_dump (struct machine *m, struct cpu *cpu, int gprs, int coprocs) |
int | cpu_disassemble_instr (struct machine *m, struct cpu *cpu, unsigned char *instr, int running, uint64_t addr) |
void | cpu_functioncall_trace (struct cpu *cpu, uint64_t f) |
void | cpu_functioncall_trace_return (struct cpu *cpu) |
void | cpu_create_or_reset_tc (struct cpu *cpu) |
void | cpu_run_init (struct machine *machine) |
void | cpu_run_deinit (struct machine *machine) |
void | cpu_dumpinfo (struct machine *m, struct cpu *cpu) |
void | cpu_list_available_types (void) |
void | cpu_show_cycles (struct machine *machine, int forced) |
struct cpu_family * | cpu_family_ptr_by_number (int arch) |
void | cpu_init (void) |
#define CPU_FAMILY_INIT | ( | n, | |
s | |||
) |
#define CPU_SETTINGS_ADD_REGISTER16 | ( | name, | |
var | |||
) |
#define CPU_SETTINGS_ADD_REGISTER32 | ( | name, | |
var | |||
) |
Definition at line 490 of file cpu.h.
Referenced by arm_cpu_new(), m88k_cpu_new(), ppc_cpu_new(), and sh_cpu_new().
#define CPU_SETTINGS_ADD_REGISTER64 | ( | name, | |
var | |||
) |
Definition at line 486 of file cpu.h.
Referenced by alpha_cpu_new(), arm_cpu_new(), m88k_cpu_new(), mips_cpu_new(), ppc_cpu_new(), and sh_cpu_new().
#define CPU_SETTINGS_ADD_REGISTER8 | ( | name, | |
var | |||
) |
#define DYNTRANS_CACHE_MARGIN 200000 |
Definition at line 316 of file cpu.h.
Referenced by cpu_create_or_reset_tc().
#define DYNTRANS_ITC | ( | arch | ) |
#define DYNTRANS_MISC64_DECLARATIONS | ( | arch, | |
ARCH, | |||
tlbindextype | |||
) |
#define DYNTRANS_MISC_DECLARATIONS | ( | arch, | |
ARCH, | |||
addrtype | |||
) |
#define EXCEPTION_IN_DELAY_SLOT 8 |
Definition at line 308 of file cpu.h.
Referenced by m88k_exception(), sh_exception(), and X().
#define INVALIDATE_ALL 2 |
Definition at line 478 of file cpu.h.
Referenced by alpha_palcode(), arm_coproc_15(), cpu_create_or_reset_tc(), debugger(), DEVICE_ACCESS(), m88k_stcr(), X(), and Y().
#define INVALIDATE_PADDR 4 |
Definition at line 479 of file cpu.h.
Referenced by coproc_tlbwri(), DEVICE_ACCESS(), memory_device_dyntrans_access(), and MEMORY_RW().
#define INVALIDATE_VADDR 8 |
Definition at line 480 of file cpu.h.
Referenced by alpha_palcode(), arm_coproc_15(), coproc_tlbwri(), DEVICE_ACCESS(), m88k_translate_v2p(), and X().
#define INVALIDATE_VADDR_UPPER4 16 /* useful for PPC emulation */ |
#define JUST_MARK_AS_NON_WRITABLE 1 |
Definition at line 477 of file cpu.h.
Referenced by memory_device_dyntrans_access().
#define N_BASE_TABLE_ENTRIES 65536 |
Definition at line 318 of file cpu.h.
Referenced by cpu_create_or_reset_tc().
#define N_SAFE_DYNTRANS_LIMIT ((1 << (N_SAFE_DYNTRANS_LIMIT_SHIFT - 1)) - 1) |
#define N_SAFE_DYNTRANS_LIMIT_SHIFT 14 |
Definition at line 310 of file cpu.h.
Referenced by machine_add_tickfunction().
#define NOT_DELAYED 0 |
Definition at line 305 of file cpu.h.
Referenced by m88k_exception(), and X().
#define PAGENR_TO_TABLE_INDEX | ( | a | ) | ((a) & (N_BASE_TABLE_ENTRIES-1)) |
#define VPH32 | ( | arch, | |
ARCH | |||
) |
#define VPH32_16BITVPHENTRIES | ( | arch, | |
ARCH | |||
) |
#define VPH32EXTENDED | ( | arch, | |
ARCH, | |||
ex | |||
) |
#define VPH64 | ( | arch, | |
ARCH | |||
) |
#define VPH_TLBS | ( | arch, | |
ARCH | |||
) |
void cpu_create_or_reset_tc | ( | struct cpu * | cpu | ) |
Definition at line 289 of file cpu.cc.
References DYNTRANS_CACHE_MARGIN, dyntrans_cache_size, INVALIDATE_ALL, cpu::invalidate_code_translation, N_BASE_TABLE_ENTRIES, cpu::translation_cache, cpu::translation_cache_cur_ofs, and zeroed_alloc().
Referenced by cpu_new(), and debugger().
void cpu_destroy | ( | struct cpu * | cpu | ) |
Definition at line 140 of file cpu.cc.
References cpu::path, cpu::settings, settings_destroy(), settings_remove(), and settings_remove_all().
Referenced by machine_destroy().
int cpu_disassemble_instr | ( | struct machine * | m, |
struct cpu * | cpu, | ||
unsigned char * | instr, | ||
int | running, | ||
uint64_t | addr | ||
) |
Definition at line 183 of file cpu.cc.
References machine::cpu_family, cpu_family::disassemble_instr, and fatal().
Definition at line 318 of file cpu.cc.
References machine::cpu_family, cpu::cpu_id, debug, cpu_family::dumpinfo, fatal(), cpu::name, and cpu::running.
Referenced by machine_dumpinfo().
struct cpu_family* cpu_family_ptr_by_number | ( | int | arch | ) |
Definition at line 541 of file cpu.cc.
Referenced by emul_machine_setup(), machine_entry_register(), and machine_list_available_types_and_cpus().
void cpu_functioncall_trace | ( | struct cpu * | cpu, |
uint64_t | f | ||
) |
Definition at line 219 of file cpu.cc.
References machine::arch, ARCH_M88K, cpu::cd, machine::cpu_family, cpu::cpu_id, m88k_cpu::cr, fatal(), cpu_family::functioncall_trace, get_symbol_name_and_n_args(), cpu::is_32bit, cpu::m88k, M88K_CR_PSR, M88K_PSR_MODE, cpu::machine, cpu::mem, memory_checksum(), machine::ncpus, machine::symbol_context, and cpu::trace_tree_depth.
Referenced by A__NAME_PC(), X(), and Y().
void cpu_functioncall_trace_return | ( | struct cpu * | cpu | ) |
Definition at line 275 of file cpu.cc.
References cpu::trace_tree_depth.
void cpu_list_available_types | ( | void | ) |
Definition at line 335 of file cpu.cc.
References DEBUG_INDENTATION.
Referenced by machine_list_available_types_and_cpus().
struct cpu* cpu_new | ( | struct memory * | mem, |
struct machine * | machine, | ||
int | cpu_id, | ||
char * | cpu_type_name | ||
) |
Definition at line 58 of file cpu.cc.
References cpu::byte_order, CHECK_ALLOCATION, cpu_create_or_reset_tc(), cpu::cpu_id, EMUL_UNDEFINED_ENDIAN, cpu::machine, cpu::mem, cpu::memory_rw, cpu::name, machine::path, cpu::path, cpu::running, machine::settings, cpu::settings, settings_add(), SETTINGS_FORMAT_STRING, SETTINGS_FORMAT_YESNO, settings_new(), SETTINGS_TYPE_STRING, SETTINGS_TYPE_SUBSETTINGS, SETTINGS_TYPE_UINT8, strlen(), and zeroed_alloc().
Referenced by emul_machine_setup().
Definition at line 203 of file cpu.cc.
References machine::cpu_family, fatal(), and cpu_family::register_dump.
Referenced by arcbios_private_emul(), dec_jumptable_func(), luna88kprom_emul(), mvmeprom_emul(), playstation2_sifbios_emul(), and yamon_emul().
void cpu_run_deinit | ( | struct machine * | machine | ) |
Definition at line 368 of file cpu.cc.
References cpu_show_cycles(), machine::cpus, tick_functions::extra, tick_functions::f(), tick_functions::n_entries, machine::show_nr_of_instructions, and machine::tick_functions.
void cpu_run_init | ( | struct machine * | machine | ) |
Definition at line 474 of file cpu.cc.
References machine::cpus, machine::ncpus, cpu::ninstrs, cpu::ninstrs_flush, cpu::ninstrs_show, cpu::ninstrs_since_gettimeofday, and cpu::starttime.
void cpu_show_cycles | ( | struct machine * | machine, |
int | forced | ||
) |
Definition at line 399 of file cpu.cc.
References machine::arch, ARCH_M88K, machine::bootstrap_cpu, cpu::cd, machine::cpus, m88k_cpu::cr, get_symbol_name(), cpu::has_been_idling, cpu::is_32bit, cpu::m88k, M88K_CR_PSR, M88K_PSR_MODE, cpu::machine, machine::ncpus, cpu::ninstrs, cpu::ninstrs_since_gettimeofday, cpu::pc, machine::show_nr_of_instructions, cpu::starttime, and machine::symbol_context.
Referenced by cpu_run_deinit().
void cpu_tlbdump | ( | struct machine * | m, |
int | x, | ||
int | rawflag | ||
) |
Definition at line 168 of file cpu.cc.
References machine::cpu_family, fatal(), and cpu_family::tlbdump.