Go to the source code of this file.
Classes | |
struct | memory_device |
struct | memory |
Macros | |
#define | DEFAULT_RAM_IN_MB 32 |
#define | BITS_PER_PAGETABLE 20 |
#define | BITS_PER_MEMBLOCK 20 |
#define | MAX_BITS 40 |
#define | MEM_PCI_LITTLE_ENDIAN 128 |
#define | MEM_READ 0 |
#define | MEM_WRITE 1 |
#define | MEM_DOWNGRADE 128 |
#define | CACHE_DATA 0 |
#define | CACHE_INSTRUCTION 1 |
#define | CACHE_NONE 2 |
#define | CACHE_FLAGS_MASK 0x3 |
#define | NO_EXCEPTIONS 16 |
#define | PHYSICAL 32 |
#define | MEMORY_USER_ACCESS 64 /* for ARM and M88K */ |
#define | DM_DEFAULT 0 |
#define | DM_DYNTRANS_OK 1 |
#define | DM_DYNTRANS_WRITE_OK 2 |
#define | DM_READS_HAVE_NO_SIDE_EFFECTS 4 |
#define | DM_EMULATED_RAM 8 |
#define | FLAG_WRITEFLAG 1 |
#define | FLAG_NOEXCEPTIONS 2 |
#define | FLAG_INSTR 4 |
#define | MEMORY_ACCESS_FAILED 0 |
#define | MEMORY_ACCESS_OK 1 |
#define | MEMORY_ACCESS_OK_WRITE 2 |
#define | MEMORY_NOT_FULL_PAGE 256 |
#define | DEVICE_ACCESS(x) |
Functions | |
uint64_t | memory_readmax64 (struct cpu *cpu, unsigned char *buf, int len) |
void | memory_writemax64 (struct cpu *cpu, unsigned char *buf, int len, uint64_t data) |
void * | zeroed_alloc (size_t s) |
struct memory * | memory_new (uint64_t physical_max, int arch) |
int | memory_points_to_string (struct cpu *cpu, struct memory *mem, uint64_t addr, int min_string_length) |
char * | memory_conv_to_string (struct cpu *cpu, struct memory *mem, uint64_t addr, char *buf, int bufsize) |
unsigned char * | memory_paddr_to_hostaddr (struct memory *mem, uint64_t paddr, int writeflag) |
void | memory_device_dyntrans_access (struct cpu *, struct memory *mem, void *extra, uint64_t *low, uint64_t *high) |
void | memory_device_update_data (struct memory *mem, void *extra, unsigned char *data) |
void | memory_device_register (struct memory *mem, const char *, uint64_t baseaddr, uint64_t len, int(*f)(struct cpu *, struct memory *, uint64_t, unsigned char *, size_t, int, void *), void *extra, int flags, unsigned char *dyntrans_data) |
void | memory_device_remove (struct memory *mem, int i) |
uint64_t | memory_checksum (struct memory *mem) |
void | dump_mem_string (struct cpu *cpu, uint64_t addr) |
void | store_string (struct cpu *cpu, uint64_t addr, const char *s) |
int | store_64bit_word (struct cpu *cpu, uint64_t addr, uint64_t data64) |
int | store_32bit_word (struct cpu *cpu, uint64_t addr, uint64_t data32) |
int | store_16bit_word (struct cpu *cpu, uint64_t addr, uint64_t data16) |
void | store_byte (struct cpu *cpu, uint64_t addr, uint8_t data) |
void | store_64bit_word_in_host (struct cpu *cpu, unsigned char *data, uint64_t data32) |
void | store_32bit_word_in_host (struct cpu *cpu, unsigned char *data, uint64_t data32) |
void | store_16bit_word_in_host (struct cpu *cpu, unsigned char *data, uint16_t data16) |
uint64_t | load_64bit_word (struct cpu *cpu, uint64_t addr) |
uint32_t | load_32bit_word (struct cpu *cpu, uint64_t addr) |
uint16_t | load_16bit_word (struct cpu *cpu, uint64_t addr) |
void | store_buf (struct cpu *cpu, uint64_t addr, const char *s, size_t len) |
void | add_environment_string (struct cpu *cpu, const char *s, uint64_t *addr) |
void | add_environment_string_dual (struct cpu *cpu, uint64_t *ptrp, uint64_t *addrp, const char *s1, const char *s2) |
void | store_pointer_and_advance (struct cpu *cpu, uint64_t *addrp, uint64_t data, int flag64) |
void | memory_warn_about_unimplemented_addr (struct cpu *cpu, struct memory *mem, int writeflag, uint64_t paddr, uint8_t *data, size_t len) |
#define DEVICE_ACCESS | ( | x | ) |
void add_environment_string | ( | struct cpu * | cpu, |
const char * | s, | ||
uint64_t * | addr | ||
) |
Definition at line 710 of file memory.cc.
References addr, store_string(), and strlen().
Referenced by MACHINE_SETUP().
void add_environment_string_dual | ( | struct cpu * | cpu, |
uint64_t * | ptrp, | ||
uint64_t * | addrp, | ||
const char * | s1, | ||
const char * | s2 | ||
) |
Definition at line 723 of file memory.cc.
References addr, store_32bit_word(), store_string(), and strlen().
Referenced by yamon_machine_setup().
void dump_mem_string | ( | struct cpu * | cpu, |
uint64_t | addr | ||
) |
Definition at line 656 of file memory.cc.
Referenced by arcbios_emul(), and arcbios_private_emul().
uint16_t load_16bit_word | ( | struct cpu * | cpu, |
uint64_t | addr | ||
) |
Definition at line 923 of file memory.cc.
References addr, cpu::byte_order, CACHE_DATA, data, EMUL_LITTLE_ENDIAN, cpu::mem, MEM_READ, and cpu::memory_rw.
uint32_t load_32bit_word | ( | struct cpu * | cpu, |
uint64_t | addr | ||
) |
Definition at line 902 of file memory.cc.
References addr, cpu::byte_order, CACHE_DATA, data, EMUL_LITTLE_ENDIAN, cpu::mem, MEM_READ, and cpu::memory_rw.
Referenced by alpha_palcode(), of_emul(), and playstation2_sifbios_emul().
uint64_t load_64bit_word | ( | struct cpu * | cpu, |
uint64_t | addr | ||
) |
Definition at line 875 of file memory.cc.
References addr, cpu::byte_order, CACHE_DATA, data, EMUL_LITTLE_ENDIAN, cpu::mem, MEM_READ, and cpu::memory_rw.
Referenced by alpha_palcode().
uint64_t memory_checksum | ( | struct memory * | mem | ) |
Definition at line 563 of file memory.cc.
References BITS_PER_MEMBLOCK, BITS_PER_PAGETABLE, if(), memory::pagetable, and UPDATE_CHECKSUM.
Referenced by cpu_functioncall_trace().
char* memory_conv_to_string | ( | struct cpu * | cpu, |
struct memory * | mem, | ||
uint64_t | addr, | ||
char * | buf, | ||
int | bufsize | ||
) |
Definition at line 220 of file memory.cc.
References addr, CACHE_NONE, MEM_READ, cpu::memory_rw, and NO_EXCEPTIONS.
void memory_device_dyntrans_access | ( | struct cpu * | , |
struct memory * | mem, | ||
void * | extra, | ||
uint64_t * | low, | ||
uint64_t * | high | ||
) |
Definition at line 264 of file memory.cc.
References machine::arch_pagesize, memory_device::baseaddr, memory::devices, DM_DYNTRANS_WRITE_OK, memory_device::dyntrans_data, memory_device::dyntrans_write_high, memory_device::dyntrans_write_low, memory_device::extra, memory_device::flags, INVALIDATE_PADDR, cpu::invalidate_translation_caches, JUST_MARK_AS_NON_WRITABLE, cpu::machine, and memory::n_mmapped_devices.
Referenced by DEVICE_TICK().
void memory_device_register | ( | struct memory * | mem, |
const char * | , | ||
uint64_t | baseaddr, | ||
uint64_t | len, | ||
int(*)(struct cpu *, struct memory *, uint64_t, unsigned char *, size_t, int, void *) | f, | ||
void * | extra, | ||
int | flags, | ||
unsigned char * | dyntrans_data | ||
) |
Definition at line 339 of file memory.cc.
References memory_device::baseaddr, CHECK_ALLOCATION, debug, memory::dev_dyntrans_alignment, memory::devices, DM_DYNTRANS_OK, DM_DYNTRANS_WRITE_OK, DM_EMULATED_RAM, memory_device::dyntrans_data, memory_device::dyntrans_write_high, memory_device::dyntrans_write_low, memory_device::endaddr, memory_device::extra, f(), memory_device::f, fatal(), memory_device::flags, memory::last_accessed_device, memory_device::length, memory::mmap_dev_maxaddr, memory::mmap_dev_minaddr, memory::n_mmapped_devices, memory_device::name, and verbose.
Referenced by dev_asc_init(), dev_bt431_init(), dev_bt455_init(), dev_bt459_init(), dev_colorplanemask_init(), dev_crime_init(), dev_dc7085_init(), dev_dec5500_ioboard_init(), dev_dec_ioasic_init(), dev_deccca_init(), dev_decxmi_init(), dev_gt_init(), dev_kn01_init(), dev_le_init(), dev_macepci_init(), dev_mc146818_init(), dev_pckbc_init(), dev_pmagja_init(), dev_px_init(), dev_ram_init(), dev_scc_init(), dev_sfb_init(), dev_sgec_init(), dev_sgi_de_init(), dev_sgi_de_status_init(), dev_sgi_gbe_init(), dev_sgi_ip20_init(), dev_sgi_ip22_init(), dev_sgi_mte_init(), dev_sgi_re_init(), dev_sgi_ust_init(), dev_sii_init(), dev_ssc_init(), dev_turbochannel_init(), dev_uninorth_init(), dev_vdac_init(), dev_vga_init(), dev_vr41xx_init(), and DEVINIT().
void memory_device_remove | ( | struct memory * | mem, |
int | i | ||
) |
Definition at line 463 of file memory.cc.
References memory::devices, fatal(), memory::last_accessed_device, and memory::n_mmapped_devices.
void memory_device_update_data | ( | struct memory * | mem, |
void * | extra, | ||
unsigned char * | data | ||
) |
Definition at line 318 of file memory.cc.
References data, memory::devices, memory_device::dyntrans_data, memory_device::dyntrans_write_high, memory_device::dyntrans_write_low, memory_device::extra, and memory::n_mmapped_devices.
Referenced by dev_fb_resize().
struct memory* memory_new | ( | uint64_t | physical_max, |
int | arch | ||
) |
Definition at line 146 of file memory.cc.
References BITS_PER_MEMBLOCK, BITS_PER_PAGETABLE, CHECK_ALLOCATION, memory::dev_dyntrans_alignment, MAX_BITS, memory::mmap_dev_maxaddr, memory::mmap_dev_minaddr, memory::pagetable, and memory::physical_max.
Referenced by dev_pmagja_init(), dev_px_init(), and emul_machine_setup().
unsigned char* memory_paddr_to_hostaddr | ( | struct memory * | mem, |
uint64_t | paddr, | ||
int | writeflag | ||
) |
Definition at line 495 of file memory.cc.
References BITS_PER_MEMBLOCK, BITS_PER_PAGETABLE, CHECK_ALLOCATION, MAX_BITS, MEM_READ, and memory::pagetable.
Referenced by alpha_translate_v2p(), arm_translate_v2p_mmu(), coproc_tlbwri(), m8820x_mark_page_as_modified(), m88k_translate_v2p(), and MEMORY_RW().
int memory_points_to_string | ( | struct cpu * | cpu, |
struct memory * | mem, | ||
uint64_t | addr, | ||
int | min_string_length | ||
) |
Definition at line 190 of file memory.cc.
References addr, CACHE_NONE, MEM_READ, cpu::memory_rw, and NO_EXCEPTIONS.
uint64_t memory_readmax64 | ( | struct cpu * | cpu, |
unsigned char * | buf, | ||
int | len | ||
) |
Definition at line 55 of file memory.cc.
References cpu::byte_order, EMUL_BIG_ENDIAN, EMUL_LITTLE_ENDIAN, and MEM_PCI_LITTLE_ENDIAN.
Referenced by DEVICE_ACCESS().
void memory_warn_about_unimplemented_addr | ( | struct cpu * | cpu, |
struct memory * | mem, | ||
int | writeflag, | ||
uint64_t | paddr, | ||
uint8_t * | data, | ||
size_t | len | ||
) |
Definition at line 594 of file memory.cc.
References data, debug, fatal(), get_symbol_name(), machine::halt_on_nonexistant_memaccess, cpu::is_32bit, cpu::machine, cpu::pc, memory::physical_max, quiet_mode, and machine::symbol_context.
Referenced by MEMORY_RW().
void memory_writemax64 | ( | struct cpu * | cpu, |
unsigned char * | buf, | ||
int | len, | ||
uint64_t | data | ||
) |
Definition at line 89 of file memory.cc.
References cpu::byte_order, data, EMUL_LITTLE_ENDIAN, and MEM_PCI_LITTLE_ENDIAN.
Referenced by DEVICE_ACCESS().
int store_16bit_word | ( | struct cpu * | cpu, |
uint64_t | addr, | ||
uint64_t | data16 | ||
) |
Definition at line 807 of file memory.cc.
References addr, cpu::byte_order, CACHE_DATA, data, EMUL_LITTLE_ENDIAN, cpu::mem, MEM_WRITE, and cpu::memory_rw.
Referenced by dreamcast_machine_setup(), MACHINE_SETUP(), and sh_ipl_g_emul_init().
void store_16bit_word_in_host | ( | struct cpu * | cpu, |
unsigned char * | data, | ||
uint16_t | data16 | ||
) |
Definition at line 992 of file memory.cc.
References cpu::byte_order, data, and EMUL_LITTLE_ENDIAN.
Referenced by MACHINE_SETUP(), and mvmeprom_init().
int store_32bit_word | ( | struct cpu * | cpu, |
uint64_t | addr, | ||
uint64_t | data32 | ||
) |
Definition at line 783 of file memory.cc.
References addr, cpu::byte_order, CACHE_DATA, data, EMUL_LITTLE_ENDIAN, cpu::mem, MEM_WRITE, and cpu::memory_rw.
Referenced by add_environment_string_dual(), alpha_palcode(), arcbios_emul(), arcbios_set_default_exception_handler(), dreamcast_machine_setup(), luna88kprom_init(), MACHINE_SETUP(), mvmeprom_init(), OF_SERVICE(), playstation2_sifbios_emul(), and store_pointer_and_advance().
void store_32bit_word_in_host | ( | struct cpu * | cpu, |
unsigned char * | data, | ||
uint64_t | data32 | ||
) |
Definition at line 973 of file memory.cc.
References cpu::byte_order, data, and EMUL_LITTLE_ENDIAN.
Referenced by arcbios_add_memory_descriptor(), and MACHINE_SETUP().
int store_64bit_word | ( | struct cpu * | cpu, |
uint64_t | addr, | ||
uint64_t | data64 | ||
) |
Definition at line 752 of file memory.cc.
References addr, cpu::byte_order, CACHE_DATA, data, EMUL_LITTLE_ENDIAN, cpu::mem, MEM_WRITE, and cpu::memory_rw.
Referenced by alpha_palcode(), dreamcast_machine_setup(), MACHINE_SETUP(), and store_pointer_and_advance().
void store_64bit_word_in_host | ( | struct cpu * | cpu, |
unsigned char * | data, | ||
uint64_t | data32 | ||
) |
Definition at line 945 of file memory.cc.
References cpu::byte_order, data, and EMUL_LITTLE_ENDIAN.
Referenced by arcbios_add_memory_descriptor(), and MACHINE_SETUP().
void store_buf | ( | struct cpu * | cpu, |
uint64_t | addr, | ||
const char * | s, | ||
size_t | len | ||
) |
Definition at line 826 of file memory.cc.
References addr, CACHE_DATA, cpu::mem, MEM_WRITE, cpu::memory_rw, and store_byte().
Referenced by alpha_prom_call(), arcbios_add_memory_descriptor(), dec_jumptable_func(), MACHINE_SETUP(), and mvmeprom_init().
void store_byte | ( | struct cpu * | cpu, |
uint64_t | addr, | ||
uint8_t | data | ||
) |
Definition at line 679 of file memory.cc.
References addr, CACHE_DATA, data, cpu::mem, MEM_WRITE, and cpu::memory_rw.
Referenced by MACHINE_SETUP(), store_buf(), and store_string().
void store_pointer_and_advance | ( | struct cpu * | cpu, |
uint64_t * | addrp, | ||
uint64_t | data, | ||
int | flag64 | ||
) |
Definition at line 855 of file memory.cc.
References addr, data, store_32bit_word(), and store_64bit_word().
void store_string | ( | struct cpu * | cpu, |
uint64_t | addr, | ||
const char * | s | ||
) |
Definition at line 695 of file memory.cc.
References addr, and store_byte().
Referenced by add_environment_string(), add_environment_string_dual(), and MACHINE_SETUP().
void* zeroed_alloc | ( | size_t | s | ) |
Definition at line 118 of file memory.cc.
References CHECK_ALLOCATION.
Referenced by cpu_create_or_reset_tc(), cpu_new(), DEVINIT(), and mips_coproc_new().