From 74882c8082198052b7d713970365ed60ada75fdc Mon Sep 17 00:00:00 2001 From: Maxim Poliakovski Date: Fri, 3 Jan 2020 20:09:07 +0100 Subject: [PATCH] ppcemu: remove unused global variables. --- cpu/ppc/ppcemu.h | 13 ------------ cpu/ppc/ppcmmu.cpp | 38 +---------------------------------- cpu/ppc/ppcmmu.h | 4 ---- main.cpp | 50 ---------------------------------------------- 4 files changed, 1 insertion(+), 104 deletions(-) diff --git a/cpu/ppc/ppcemu.h b/cpu/ppc/ppcemu.h index 5001d60..ed6a35f 100644 --- a/cpu/ppc/ppcemu.h +++ b/cpu/ppc/ppcemu.h @@ -231,19 +231,6 @@ void ppc_exception_handler(uint32_t exception_type, uint32_t handle_args); extern MemCtrlBase *mem_ctrl_instance; extern unsigned char * machine_sysram_mem; -extern unsigned char * machine_sysconfig_mem; -//Mapped to 0x68000000 - extern unsigned char * machine_68kemu_mem; -extern unsigned char * machine_upperiocontrol_mem; -extern unsigned char * machine_iocontrolcdma_mem; -extern unsigned char * machine_loweriocontrol_mem; -extern unsigned char * machine_interruptack_mem; -extern unsigned char * machine_iocontrolmem_mem; -extern unsigned char * machine_f8xxxx_mem; -extern unsigned char * machine_fexxxx_mem; -extern unsigned char * machine_fecxxx_mem; -extern unsigned char * machine_feexxx_mem; -extern unsigned char * machine_ff00xx_mem; -extern unsigned char * machine_ff80xx_mem; extern unsigned char * machine_sysrom_mem; //The functions used by the PowerPC processor diff --git a/cpu/ppc/ppcmmu.cpp b/cpu/ppc/ppcmmu.cpp index 1f67736..3fab510 100644 --- a/cpu/ppc/ppcmmu.cpp +++ b/cpu/ppc/ppcmmu.cpp @@ -12,8 +12,6 @@ #include #include #include -#include -#include #include "memreadwrite.h" #include "ppcemu.h" #include "ppcmmu.h" @@ -21,40 +19,6 @@ #include "devices/mmiodevice.h" #include "devices/mpc106.h" -std::vector pte_storage; - -uint32_t pte_word1; -uint32_t pte_word2; - -uint32_t msr_ir_test; -uint32_t msr_dr_test; -uint32_t msr_ip_test; - -uint32_t choose_sr; -uint32_t pteg_hash1; -uint32_t pteg_hash2; -uint32_t pteg_answer; - -uint32_t pteg_address1; -uint32_t pteg_temp1; -uint32_t pteg_address2; -uint32_t pteg_temp2; - -uint32_t pteg_check1; -uint32_t rev_pteg_check1; -uint32_t pteg_check2; -uint32_t rev_pteg_check2; - -unsigned char * grab_tempmem_ptr1; -unsigned char * grab_tempmem_ptr2; -unsigned char * grab_tempmem_ptr3; -unsigned char * grab_tempmem_ptr4; - -unsigned char * grab_macmem_ptr; -unsigned char * grab_pteg1_ptr; -unsigned char * grab_pteg2_ptr; - -std::atomic hash_found (false); /** PowerPC-style MMU BAT arrays (NULL initialization isn't prescribed). */ PPC_BAT_entry ibat_array[4] = {{0}}; @@ -221,7 +185,7 @@ static bool search_pteg(uint8_t *pteg_addr, uint8_t **ret_pte_addr, static uint32_t page_address_translate(uint32_t la, bool is_instr_fetch, unsigned msr_pr, bool is_write) { - uint32_t sr_val, page_index, vsid, pte_word2; + uint32_t sr_val, page_index, pteg_hash1, vsid, pte_word2; unsigned key, pp; uint8_t *pte_addr; diff --git a/cpu/ppc/ppcmmu.h b/cpu/ppc/ppcmmu.h index 73d306a..e90c911 100644 --- a/cpu/ppc/ppcmmu.h +++ b/cpu/ppc/ppcmmu.h @@ -22,10 +22,6 @@ typedef struct PPC_BAT_entry { uint32_t bepi; /* copy of Block effective page index */ } PPC_BAT_entry; -extern uint32_t bat_srch; -extern uint32_t bepi_chk; - -extern unsigned char * grab_macmem_ptr; extern void ibat_update(uint32_t bat_reg); extern void dbat_update(uint32_t bat_reg); diff --git a/main.cpp b/main.cpp index 49c0f34..6fff221 100644 --- a/main.cpp +++ b/main.cpp @@ -82,23 +82,7 @@ MemCtrlBase *mem_ctrl_instance = 0; HeathrowIC *heathrow = 0; GossamerID *machine_id; -//A pointer to a pointer, used for quick movement to one of the following -//memory areas. These are listed right below. -unsigned char * grab_array_ptr; - unsigned char * machine_sysram_mem; -unsigned char * machine_sysconfig_mem; -unsigned char * machine_upperiocontrol_mem; -unsigned char * machine_iocontrolcdma_mem; -unsigned char * machine_loweriocontrol_mem; -unsigned char * machine_interruptack_mem; -unsigned char * machine_iocontrolmem_mem; -unsigned char * machine_f8xxxx_mem; -unsigned char * machine_fexxxx_mem; -unsigned char * machine_fecxxx_mem; -unsigned char * machine_feexxx_mem; -unsigned char * machine_ff00xx_mem; -unsigned char * machine_ff80xx_mem; unsigned char * machine_sysrom_mem; uint32_t grab_sysram_size; @@ -381,32 +365,9 @@ int main(int argc, char **argv) } machine_sysram_mem = (unsigned char*) calloc (67108864, 1); - machine_sysconfig_mem = (unsigned char*) calloc (2048, 1); - machine_upperiocontrol_mem = (unsigned char*) calloc (8388608, 1); - machine_iocontrolcdma_mem = (unsigned char*) calloc (8388608, 1); - machine_loweriocontrol_mem = (unsigned char*) calloc (33554432, 1); - machine_interruptack_mem = (unsigned char*) calloc (16, 1); - machine_iocontrolmem_mem = (unsigned char*) calloc (67108864, 1); - machine_f8xxxx_mem = (unsigned char*) calloc (4096, 1); - machine_fexxxx_mem = (unsigned char*) calloc (262144, 1); - machine_fecxxx_mem = (unsigned char*) calloc (4096, 1); - machine_feexxx_mem = (unsigned char*) calloc (4096, 1); - machine_ff00xx_mem = (unsigned char*) calloc (4096, 1); - machine_ff80xx_mem = (unsigned char*) calloc (1048576, 1); machine_sysrom_mem = (unsigned char*) calloc (rom_filesize, 1); memset(machine_sysram_mem, 0x0, 67108864); - memset(machine_sysconfig_mem, 0x0, 2048); - memset(machine_upperiocontrol_mem, 0x0, 8388607); - memset(machine_iocontrolcdma_mem, 0x0, 8388607); - memset(machine_interruptack_mem, 0x0, 16); - memset(machine_iocontrolmem_mem, 0x0, 67108864); - memset(machine_f8xxxx_mem, 0x0, 4096); - memset(machine_fexxxx_mem, 0x0, 262144); - memset(machine_fecxxx_mem, 0x0, 4096); - memset(machine_feexxx_mem, 0x0, 4096); - memset(machine_ff00xx_mem, 0x0, 4096); - memset(machine_ff80xx_mem, 0x0, 1048576); grab_sysram_size = sizeof(machine_sysram_mem); grab_sysrom_size = rom_filesize; @@ -711,17 +672,6 @@ int main(int argc, char **argv) //Free memory after the emulation is completed. free(machine_sysram_mem); - free(machine_upperiocontrol_mem); - free(machine_iocontrolcdma_mem); - free(machine_loweriocontrol_mem); - free(machine_interruptack_mem); - free(machine_iocontrolmem_mem); - free(machine_f8xxxx_mem); - free(machine_fexxxx_mem); - free(machine_fecxxx_mem); - free(machine_feexxx_mem); - free(machine_ff00xx_mem); - free(machine_ff80xx_mem); free(machine_sysrom_mem); return 0;