ppcemu: remove unused global variables.

This commit is contained in:
Maxim Poliakovski 2020-01-03 20:09:07 +01:00
parent 4b843157d9
commit 74882c8082
4 changed files with 1 additions and 104 deletions

View File

@ -231,19 +231,6 @@ void ppc_exception_handler(uint32_t exception_type, uint32_t handle_args);
extern MemCtrlBase *mem_ctrl_instance; extern MemCtrlBase *mem_ctrl_instance;
extern unsigned char * machine_sysram_mem; 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; extern unsigned char * machine_sysrom_mem;
//The functions used by the PowerPC processor //The functions used by the PowerPC processor

View File

@ -12,8 +12,6 @@
#include <cinttypes> #include <cinttypes>
#include <string> #include <string>
#include <array> #include <array>
#include <thread>
#include <atomic>
#include "memreadwrite.h" #include "memreadwrite.h"
#include "ppcemu.h" #include "ppcemu.h"
#include "ppcmmu.h" #include "ppcmmu.h"
@ -21,40 +19,6 @@
#include "devices/mmiodevice.h" #include "devices/mmiodevice.h"
#include "devices/mpc106.h" #include "devices/mpc106.h"
std::vector<uint32_t> 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<bool> hash_found (false);
/** PowerPC-style MMU BAT arrays (NULL initialization isn't prescribed). */ /** PowerPC-style MMU BAT arrays (NULL initialization isn't prescribed). */
PPC_BAT_entry ibat_array[4] = {{0}}; 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, static uint32_t page_address_translate(uint32_t la, bool is_instr_fetch,
unsigned msr_pr, bool is_write) 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; unsigned key, pp;
uint8_t *pte_addr; uint8_t *pte_addr;

View File

@ -22,10 +22,6 @@ typedef struct PPC_BAT_entry {
uint32_t bepi; /* copy of Block effective page index */ uint32_t bepi; /* copy of Block effective page index */
} PPC_BAT_entry; } 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 ibat_update(uint32_t bat_reg);
extern void dbat_update(uint32_t bat_reg); extern void dbat_update(uint32_t bat_reg);

View File

@ -82,23 +82,7 @@ MemCtrlBase *mem_ctrl_instance = 0;
HeathrowIC *heathrow = 0; HeathrowIC *heathrow = 0;
GossamerID *machine_id; 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_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; unsigned char * machine_sysrom_mem;
uint32_t grab_sysram_size; uint32_t grab_sysram_size;
@ -381,32 +365,9 @@ int main(int argc, char **argv)
} }
machine_sysram_mem = (unsigned char*) calloc (67108864, 1); 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); machine_sysrom_mem = (unsigned char*) calloc (rom_filesize, 1);
memset(machine_sysram_mem, 0x0, 67108864); 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_sysram_size = sizeof(machine_sysram_mem);
grab_sysrom_size = rom_filesize; grab_sysrom_size = rom_filesize;
@ -711,17 +672,6 @@ int main(int argc, char **argv)
//Free memory after the emulation is completed. //Free memory after the emulation is completed.
free(machine_sysram_mem); 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); free(machine_sysrom_mem);
return 0; return 0;