#include <sys/types.h>
#include <inttypes.h>
#include "../../config.h"
#include <string>
#include <map>
#include <list>
#include <vector>
#include <sstream>
#include <ostream>
#include <iostream>
#include "thirdparty/debug_new.h"
#include "refcount_ptr.h"
Go to the source code of this file.
Macros | |
#define | COPYRIGHT_MSG "Copyright (C) 2003-2018 Anders Gavare" |
#define | SECONDARY_MSG "" |
#define | DEFAULT_TMP_DIR "/tmp" |
#define | NO_BYTE_ORDER_OVERRIDE -1 |
#define | EMUL_UNDEFINED_ENDIAN 0 |
#define | EMUL_LITTLE_ENDIAN 1 |
#define | EMUL_BIG_ENDIAN 2 |
#define | SWAP32(x) |
#define | SWAP16(x) ((((x) & 0xff00) >> 8) | (((x)&0xff) << 8)) |
#define | LE16_TO_HOST(x) (x) |
#define | BE16_TO_HOST(x) (SWAP16(x)) |
#define | LE32_TO_HOST(x) (x) |
#define | BE32_TO_HOST(x) (SWAP32(x)) |
#define | LE64_TO_HOST(x) (x) |
#define | BE64_TO_HOST(x) |
#define | DEBUG_BUFSIZE 1024 |
#define | DEBUG_INDENTATION 4 |
#define | FAILURE(error_msg) |
#define | CHECK_ALLOCATION(ptr) |
Typedefs | |
typedef char | stringchar |
Enumerations | |
enum | Endianness { BigEndian = 0, LittleEndian } |
Functions | |
int | load_bootblock (struct machine *m, struct cpu *cpu, int *n_loadp, char ***load_namesp) |
int | apple_load_bootblock (struct machine *m, struct cpu *cpu, int disk_id, int disk_type, int *n_loadp, char ***load_namesp) |
int | iso_load_bootblock (struct machine *m, struct cpu *cpu, int disk_id, int disk_type, int iso_type, unsigned char *buf, int *n_loadp, char ***load_namesp) |
int | decstation_prom_emul (struct cpu *cpu) |
void | dreamcast_machine_setup (struct machine *) |
void | dreamcast_emul (struct cpu *cpu) |
void | dreamcast_descramble (char *from, char *to) |
int | file_n_executables_loaded (void) |
void | file_load (struct machine *machine, struct memory *mem, char *filename, uint64_t *entrypointp, int arch, uint64_t *gpp, int *byte_order, uint64_t *tocp) |
void | luna88kprom_init (struct machine *machine) |
int | luna88kprom_emul (struct cpu *cpu) |
void | debug_indentation (int diff) |
void | debug (const char *fmt,...) |
void | fatal (const char *fmt,...) |
unsigned long long | mystrtoull (const char *s, char **endp, int base) |
int | mymkstemp (char *templ) |
size_t | mystrlcpy (char *dst, const char *src, size_t size) |
size_t | mystrlcat (char *dst, const char *src, size_t size) |
void | print_separator_line (void) |
void | mvmeprom_init (struct machine *machine) |
int | mvmeprom_emul (struct cpu *cpu) |
int | playstation2_sifbios_emul (struct cpu *cpu) |
void | sh_ipl_g_emul_init (struct machine *machine) |
int | sh_ipl_g_emul (struct cpu *) |
void | yamon_machine_setup (struct machine *machine, uint64_t env) |
int | yamon_emul (struct cpu *) |
#define BE64_TO_HOST | ( | x | ) |
#define CHECK_ALLOCATION | ( | ptr | ) |
#define FAILURE | ( | error_msg | ) |
#define SWAP16 | ( | x | ) | ((((x) & 0xff00) >> 8) | (((x)&0xff) << 8)) |
#define SWAP32 | ( | x | ) |
typedef char stringchar |
enum Endianness |
int apple_load_bootblock | ( | struct machine * | m, |
struct cpu * | cpu, | ||
int | disk_id, | ||
int | disk_type, | ||
int * | n_loadp, | ||
char *** | load_namesp | ||
) |
Definition at line 53 of file bootblock_apple.cc.
References debug, diskimage_access(), and fatal().
void debug | ( | const char * | fmt, |
... | |||
) |
Definition at line 133 of file main.cc.
References quiet_mode.
void debug_indentation | ( | int | diff | ) |
Definition at line 120 of file main.cc.
Referenced by diskimage_dump_info(), emul_create_from_configfile(), emul_dumpinfo(), emul_machine_setup(), emul_simple_init(), file_load(), iso_load_bootblock(), machine_list_available_types_and_cpus(), mips_cpu_dumpinfo(), and net_dumpinfo().
int decstation_prom_emul | ( | struct cpu * | cpu | ) |
Definition at line 229 of file dec_prom.cc.
References dec_jumptable_func(), and cpu::pc.
Referenced by X().
void dreamcast_descramble | ( | char * | from, |
char * | to | ||
) |
Definition at line 190 of file dreamcast_scramble.cc.
References read_file().
void dreamcast_emul | ( | struct cpu * | cpu | ) |
Definition at line 239 of file dreamcast.cc.
References cpu::cd, DREAMCAST_MACHINE_ID_ADDRESS, DREAMCAST_ROMFONT_BASE, fatal(), cpu::pc, sh_cpu::r, cpu::running, and cpu::sh.
Referenced by X().
void dreamcast_machine_setup | ( | struct machine * | ) |
Definition at line 200 of file dreamcast.cc.
References machine::cpus, DREAMCAST_MACHINE_ID_ADDRESS, SH_INVALID_INSTR, store_16bit_word(), store_32bit_word(), and store_64bit_word().
Referenced by MACHINE_SETUP().
void fatal | ( | const char * | fmt, |
... | |||
) |
Definition at line 152 of file main.cc.
Referenced by add_to_rx_queue(), alpha_palcode(), alpha_prom_call(), alpha_translate_v2p(), apple_load_bootblock(), arcbios_emul(), arcbios_private_emul(), arm_cdp(), arm_coproc_15(), arm_coproc_i80321_6(), arm_coproc_xscale_14(), arm_cpu_interpret_thumb_SLOW(), arm_exception(), arm_load_register_bank(), arm_mcr_mrc(), arm_pop(), arm_save_register_bank(), bus_isa_init(), bus_pci_add(), bus_pci_data_access(), bus_pci_decompose_1(), bus_pci_setaddr(), coproc_function(), coproc_register_read(), coproc_register_write(), coproc_tlbpr(), coproc_tlbwri(), cpu_disassemble_instr(), cpu_dumpinfo(), cpu_functioncall_trace(), cpu_register_dump(), cpu_tlbdump(), crime_update_crime_time(), dec21143_rx(), dec21143_tx(), dec_jumptable_func(), dev_fb_resize(), dev_gt_init(), dev_jazz_dma_controller(), dev_px_init(), dev_ram_init(), dev_scc_add_to_rx_queue(), dev_turbochannel_init(), DEVICE_ACCESS(), device_add(), DEVICE_TICK(), device_unregister(), DEVINIT(), diskimage_access(), diskimage_add(), diskimage_getchs(), diskimage_scsicommand(), diskimage_set_baseoffset(), do_mte_transfer(), draw_primitive(), dreamcast_emul(), emul_machine_setup(), framebuffer_blockcopyfill(), get_rgb(), horrible_getputpixel(), ieee_interpret_float_value(), ieee_store_float_value(), lca_interrupt_assert(), lca_interrupt_deassert(), le_register_write(), load_bootblock(), LS_GENERIC_N(), luna88kprom_emul(), m88k_exception(), m88k_fstcr(), m88k_ldcr(), m88k_stcr(), m88k_translate_v2p(), machine_add_tickfunction(), MACHINE_DEFAULT_CPU(), machine_default_cputype(), machine_init(), machine_list_available_types_and_cpus(), machine_memsize_fix(), machine_name_to_type(), MACHINE_SETUP(), machine_setup(), maple_do_dma_xfer(), memory_device_register(), memory_device_remove(), memory_warn_about_unimplemented_addr(), mvmeprom_emul(), net_debugaddr(), net_ethernet_tx(), net_generate_unique_mac(), net_ip_broadcast(), net_ip_tcp_connectionreply(), net_tcp_rx_avail(), net_udp_rx_avail(), of_emul(), OF_SERVICE(), osiop_execute_scripts_instr(), osiop_get_next_scripts_word(), pcctwo_interrupt_common(), PCIINIT(), pckbc_add_code(), pckbc_get_code(), playstation2_sifbios_emul(), ppc_bat(), ppc_exception(), ppc_translate_v2p(), pvr_dma_transfer(), pvr_render(), reg_access_msr(), sh4_dmac_transfer(), sh_cpu_interrupt_assert(), sh_exception(), TRANSLATE_ADDRESS(), X(), Y(), and yamon_emul().
void file_load | ( | struct machine * | machine, |
struct memory * | mem, | ||
char * | filename, | ||
uint64_t * | entrypointp, | ||
int | arch, | ||
uint64_t * | gpp, | ||
int * | byte_order, | ||
uint64_t * | tocp | ||
) |
Definition at line 118 of file file.cc.
References ARCH_NOARCH, debug, DEBUG_INDENTATION, debug_indentation(), DEFAULT_TMP_DIR, f(), old_quiet_mode, quiet_mode, and verbose.
Referenced by emul_machine_setup().
int iso_load_bootblock | ( | struct machine * | m, |
struct cpu * | cpu, | ||
int | disk_id, | ||
int | disk_type, | ||
int | iso_type, | ||
unsigned char * | buf, | ||
int * | n_loadp, | ||
char *** | load_namesp | ||
) |
Definition at line 99 of file bootblock_iso9660.cc.
References machine::boot_kernel_filename, CHECK_ALLOCATION, debug, DEBUG_INDENTATION, debug_indentation(), DEFAULT_TMP_DIR, and cpu::machine.
Definition at line 65 of file bootblock.cc.
References CHECK_ALLOCATION, debug, diskimage_bootdev(), diskimage_get_baseoffset(), diskimage_is_a_cdrom(), fatal(), cpu::machine, MACHINE_DREAMCAST, and machine::machine_type.
Referenced by emul_machine_setup().
int luna88kprom_emul | ( | struct cpu * | cpu | ) |
Definition at line 90 of file luna88kprom.cc.
References cpu::cd, console_putchar(), cpu_register_dump(), fatal(), cpu::m88k, cpu::machine, machine::main_console_handle, cpu::pc, m88k_cpu::r, and cpu::running.
Referenced by X().
void luna88kprom_init | ( | struct machine * | machine | ) |
Definition at line 50 of file luna88kprom.cc.
References machine::cpus, x11_md::in_use, M88K_PROM_INSTR, store_32bit_word(), and machine::x11_md.
Referenced by MACHINE_SETUP().
int mvmeprom_emul | ( | struct cpu * | cpu | ) |
Definition at line 99 of file mvmeprom.cc.
References cpu::cd, console_putchar(), cpu_register_dump(), fatal(), cpu::m88k, cpu::machine, machine::main_console_handle, MVMEPROM_BRDID_ADDR, MVMEPROM_EXIT, MVMEPROM_GETBRDID, MVMEPROM_OUTCHR, MVMEPROM_OUTCRLF, m88k_cpu::r, and cpu::running.
Referenced by X().
void mvmeprom_init | ( | struct machine * | machine | ) |
Definition at line 55 of file mvmeprom.cc.
References cpu::cd, machine::cpus, m88k_cpu::cr, cpu::m88k, M88K_CR_VBR, M88K_PROM_INSTR, MACHINE_MVME88K_187, MACHINE_MVME88K_188, MACHINE_MVME88K_197, machine::machine_subtype, mvmeprom_brdid::model, MVMEPROM_BRDID_ADDR, MVMEPROM_VECTOR, mvmeprom_brdid::speed, store_16bit_word_in_host(), store_32bit_word(), and store_buf().
Referenced by MACHINE_SETUP().
size_t mystrlcat | ( | char * | dst, |
const char * | src, | ||
size_t | size | ||
) |
size_t mystrlcpy | ( | char * | dst, |
const char * | src, | ||
size_t | size | ||
) |
unsigned long long mystrtoull | ( | const char * | s, |
char ** | endp, | ||
int | base | ||
) |
int playstation2_sifbios_emul | ( | struct cpu * | cpu | ) |
Definition at line 51 of file ps2_bios.cc.
References cpu::cd, console_charavail(), console_putchar(), console_readchar(), cpu_register_dump(), debug, fatal(), mips_cpu::gpr, load_32bit_word(), cpu::machine, machine::main_console_handle, cpu::mips, MIPS_GPR_A0, MIPS_GPR_A1, MIPS_GPR_A2, MIPS_GPR_A3, MIPS_GPR_V0, quiet_mode, cpu::running, and store_32bit_word().
Referenced by X().
int sh_ipl_g_emul | ( | struct cpu * | ) |
Definition at line 98 of file sh_ipl_g.cc.
References cpu::cd, sh_cpu::expevt, EXPEVT_TRAPA, cpu::sh, and sh_cpu::tra.
Referenced by X().
void sh_ipl_g_emul_init | ( | struct machine * | machine | ) |
Definition at line 51 of file sh_ipl_g.cc.
References cpu::cd, machine::cpus, cpu::sh, SH_INVALID_INSTR, store_16bit_word(), and sh_cpu::vbr.
Referenced by MACHINE_SETUP().
int yamon_emul | ( | struct cpu * | ) |
Definition at line 139 of file yamon.cc.
References BE32_TO_HOST, cpu::byte_order, CACHE_DATA, cpu::cd, console_putchar(), console_readchar(), cpu_register_dump(), debug, EMUL_LITTLE_ENDIAN, machine::emulated_hz, fatal(), mips_cpu::gpr, LE32_TO_HOST, cpu::machine, machine::main_console_handle, cpu::mem, MEM_READ, MEM_WRITE, cpu::memory_rw, cpu::mips, MIPS_GPR_A0, MIPS_GPR_A1, MIPS_GPR_A2, MIPS_GPR_V0, NO_EXCEPTIONS, cpu::pc, cpu::running, SYSCON_BOARD_CPU_CLOCK_FREQ_ID, YAMON_EXIT_OFS, YAMON_FUNCTION_BASE, YAMON_GETCHAR_OFS, YAMON_PRINT_COUNT_OFS, and YAMON_SYSCON_READ_OFS.
Referenced by X().
void yamon_machine_setup | ( | struct machine * | machine, |
uint64_t | env | ||
) |
Definition at line 52 of file yamon.cc.
References add_environment_string_dual(), machine::cpus, machine::emulated_hz, net_generate_unique_mac(), and machine::physical_ram_in_mb.
Referenced by MACHINE_SETUP().