diff options
Diffstat (limited to 'src/emu/cpu')
| -rw-r--r-- | src/emu/cpu/drcuml.c | 8 | ||||
| -rw-r--r-- | src/emu/cpu/mips/mips3com.c | 10 | ||||
| -rw-r--r-- | src/emu/cpu/mips/mips3drc.c | 2 | ||||
| -rw-r--r-- | src/emu/cpu/powerpc/ppccom.c | 4 | ||||
| -rw-r--r-- | src/emu/cpu/powerpc/ppcdrc.c | 4 | ||||
| -rw-r--r-- | src/emu/cpu/vtlb.c | 54 |
6 files changed, 41 insertions, 41 deletions
diff --git a/src/emu/cpu/drcuml.c b/src/emu/cpu/drcuml.c index c68cfa24523..a3e46bfbcf9 100644 --- a/src/emu/cpu/drcuml.c +++ b/src/emu/cpu/drcuml.c @@ -1960,7 +1960,7 @@ static const bevalidate_test bevalidate_test_list[] = TEST_ENTRY_3F(SUBB, 8, 0x8123456789abcdef, 0x0000000000000000, 0x7edcba9876543210, DRCUML_FLAG_C, DRCUML_FLAG_C | DRCUML_FLAG_S) TEST_ENTRY_3F(SUBB, 8, 0x123456789abcdef0, 0x123456789abcdef0, 0xffffffffffffffff, DRCUML_FLAG_C, DRCUML_FLAG_C) TEST_ENTRY_3F(SUBB, 8, 0x0000000000000000, 0x123456789abcdef0, 0x123456789abcdeef, DRCUML_FLAG_C, DRCUML_FLAG_Z) - + TEST_ENTRY_2(CMP, 4, 0x7fffffff, 0x6dcba987, 0) TEST_ENTRY_2(CMP, 4, 0x80000000, 0x6dcba988, DRCUML_FLAG_V) TEST_ENTRY_2(CMP, 4, 0xffffffff, 0x6dcba987, DRCUML_FLAG_S) @@ -1978,7 +1978,7 @@ static const bevalidate_test bevalidate_test_list[] = TEST_ENTRY_4(MULU, 4, 0x00000000, 0x00000000, 0x11111111, 0x00000000, DRCUML_FLAG_Z) TEST_ENTRY_4(MULU, 4, 0xea61d951, 0x37c048d0, 0x77777777, 0x77777777, DRCUML_FLAG_V) TEST_ENTRY_4(MULU, 4, 0x32323233, 0xcdcdcdcc, 0xcdcdcdcd, 0xffffffff, DRCUML_FLAG_V | DRCUML_FLAG_S) - + TEST_ENTRY_4(MULU, 8, 0x7777777777777777, 0x0000000000000000, 0x1111111111111111, 0x0000000000000007, 0) TEST_ENTRY_4(MULU, 8, 0xffffffffffffffff, 0x0000000000000000, 0x1111111111111111, 0x000000000000000f, 0) TEST_ENTRY_4(MULU, 8, 0x0000000000000000, 0x0000000000000000, 0x1111111111111111, 0x0000000000000000, DRCUML_FLAG_Z) @@ -1990,7 +1990,7 @@ static const bevalidate_test bevalidate_test_list[] = TEST_ENTRY_4(MULS, 4, 0x00000000, 0x00000000, 0x11111111, 0x00000000, DRCUML_FLAG_Z) TEST_ENTRY_4(MULS, 4, 0x9e26af38, 0xc83fb72e, 0x77777777, 0x88888888, DRCUML_FLAG_V | DRCUML_FLAG_S) TEST_ENTRY_4(MULS, 4, 0x32323233, 0x00000000, 0xcdcdcdcd, 0xffffffff, 0) - + TEST_ENTRY_4(MULS, 8, 0x7777777777777777, 0x0000000000000000, 0x1111111111111111, 0x0000000000000007, 0) TEST_ENTRY_4(MULS, 8, 0xffffffffffffffff, 0x0000000000000000, 0x1111111111111111, 0x000000000000000f, DRCUML_FLAG_V) TEST_ENTRY_4(MULS, 8, 0x0000000000000000, 0x0000000000000000, 0x1111111111111111, 0x0000000000000000, DRCUML_FLAG_Z) @@ -2125,7 +2125,7 @@ static void bevalidate_iterate_over_params(drcuml_state *drcuml, drcuml_codehand for (pscannum = 0; pscannum < pnum; pscannum++) if ((opinfo->param[pscannum].output & PIO_IN) && ptype == paramlist[pscannum].type && pindex == paramlist[pscannum].value) skip = TRUE; - + /* can't duplicate multiple dest parameters */ if (opinfo->param[pnum].output & PIO_OUT) diff --git a/src/emu/cpu/mips/mips3com.c b/src/emu/cpu/mips/mips3com.c index 74d1a8f8bac..97969495ed7 100644 --- a/src/emu/cpu/mips/mips3com.c +++ b/src/emu/cpu/mips/mips3com.c @@ -113,7 +113,7 @@ void mips3com_exit(mips3_state *mips) void mips3com_reset(mips3_state *mips) { int tlbindex; - + /* initialize the state */ mips->pc = 0xbfc00000; mips->cpr[0][COP0_Status] = SR_BEV | SR_ERL; @@ -789,7 +789,7 @@ static void tlb_map_entry(mips3_state *mips, int tlbindex) mips3_tlb_entry *entry = &mips->tlb[tlbindex]; UINT32 count, vpn; int which; - + /* the ASID doesn't match the current ASID, and if the page isn't global, unmap it from the TLB */ if (!tlb_entry_matches_asid(entry, current_asid) && !tlb_entry_is_global(entry)) { @@ -817,16 +817,16 @@ static void tlb_map_entry(mips3_state *mips, int tlbindex) UINT64 lo = entry->entry_lo[which]; UINT32 pfn = (lo >> 6) & 0x00ffffff; UINT32 flags = 0; - + /* valid? */ if ((lo & 2) != 0) { flags |= VTLB_FLAG_VALID | VTLB_READ_ALLOWED | VTLB_FETCH_ALLOWED; - + /* writable? */ if ((lo & 4) != 0) flags |= VTLB_WRITE_ALLOWED; - + /* mirror the flags for user mode if the VPN is in user space */ if (effvpn < (0x80000000 >> MIPS3_MIN_PAGE_SHIFT)) flags |= (flags << 4) & (VTLB_USER_READ_ALLOWED | VTLB_USER_WRITE_ALLOWED | VTLB_USER_FETCH_ALLOWED); diff --git a/src/emu/cpu/mips/mips3drc.c b/src/emu/cpu/mips/mips3drc.c index 225f58dfe19..8c9b380eadc 100644 --- a/src/emu/cpu/mips/mips3drc.c +++ b/src/emu/cpu/mips/mips3drc.c @@ -1586,7 +1586,7 @@ static void generate_sequence_instruction(drcuml_block *block, compiler_state *c if ((desc->flags & OPFLAG_VALIDATE_TLB) && (desc->pc < 0x80000000 || desc->pc >= 0xc0000000)) { const vtlb_entry *tlbtable = vtlb_table(mips3->vtlb); - + /* if we currently have a valid TLB read entry, we just verify */ if (tlbtable[desc->pc >> 12] & VTLB_FETCH_ALLOWED) { diff --git a/src/emu/cpu/powerpc/ppccom.c b/src/emu/cpu/powerpc/ppccom.c index 6a56669d009..07eb604c19f 100644 --- a/src/emu/cpu/powerpc/ppccom.c +++ b/src/emu/cpu/powerpc/ppccom.c @@ -236,7 +236,7 @@ void ppccom_exit(powerpc_state *ppc) void ppccom_reset(powerpc_state *ppc) { int tlbindex; - + /* initialize the OEA state */ if (ppc->cap & PPCCAP_OEA) { @@ -508,7 +508,7 @@ void ppccom_execute_tlbl(powerpc_state *ppc) int isitlb = ppc->param1; vtlb_entry flags = 0; int entrynum; - + /* determine entry number; we use rand() for associativity */ entrynum = ((address >> 12) & 0x1f) | (mame_rand(Machine) & 0x20) | (isitlb ? 0x40 : 0); diff --git a/src/emu/cpu/powerpc/ppcdrc.c b/src/emu/cpu/powerpc/ppcdrc.c index 6ec4a47680c..da78e66d87c 100644 --- a/src/emu/cpu/powerpc/ppcdrc.c +++ b/src/emu/cpu/powerpc/ppcdrc.c @@ -1451,7 +1451,7 @@ static void static_generate_memory_accessor(drcuml_state *drcuml, int mode, int int tlbmiss = 0; int label = 1; int ramnum; - + if (mode & MODE_USER) translate_type = iswrite ? TRANSLATE_WRITE_USER : TRANSLATE_READ_USER; else @@ -2166,7 +2166,7 @@ static void generate_sequence_instruction(drcuml_block *block, compiler_state *c if ((desc->flags & OPFLAG_VALIDATE_TLB) && (ppc->impstate->mode & MODE_DATA_TRANSLATION)) { const vtlb_entry *tlbtable = vtlb_table(ppc->vtlb); - + /* if we currently have a valid TLB read entry, we just verify */ if (tlbtable[desc->pc >> 12] != 0) { diff --git a/src/emu/cpu/vtlb.c b/src/emu/cpu/vtlb.c index 932b3b4c5a5..921cd01551b 100644 --- a/src/emu/cpu/vtlb.c +++ b/src/emu/cpu/vtlb.c @@ -48,18 +48,18 @@ struct _vtlb_state ***************************************************************************/ /*------------------------------------------------- - vtlb_alloc - allocate a new VTLB for the + vtlb_alloc - allocate a new VTLB for the given CPU -------------------------------------------------*/ vtlb_state *vtlb_alloc(int cpunum, int space, int fixed_entries, int dynamic_entries) { vtlb_state *vtlb; - + /* allocate memory for the core structure */ vtlb = malloc_or_die(sizeof(*vtlb)); memset(vtlb, 0, sizeof(*vtlb)); - + /* fill in CPU information */ vtlb->space = space; vtlb->dynamic = dynamic_entries; @@ -72,22 +72,22 @@ vtlb_state *vtlb_alloc(int cpunum, int space, int fixed_entries, int dynamic_ent assert((1 << vtlb->pageshift) > VTLB_FLAGS_MASK); assert(vtlb->translate != NULL); assert(vtlb->addrwidth > vtlb->pageshift); - + /* allocate the entry array */ vtlb->live = malloc_or_die(sizeof(vtlb->live[0]) * (fixed_entries + dynamic_entries)); memset(vtlb->live, 0, sizeof(vtlb->live[0]) * (fixed_entries + dynamic_entries)); - + /* allocate the lookup table */ vtlb->table = malloc_or_die(sizeof(vtlb->table[0]) << (vtlb->addrwidth - vtlb->pageshift)); memset(vtlb->table, 0, sizeof(vtlb->table[0]) << (vtlb->addrwidth - vtlb->pageshift)); - + /* allocate the fixed page count array */ if (fixed_entries > 0) { vtlb->fixedpages = malloc_or_die(sizeof(vtlb->fixedpages[0]) * fixed_entries); memset(vtlb->fixedpages, 0, sizeof(vtlb->fixedpages[0]) * fixed_entries); } - + return vtlb; } @@ -108,7 +108,7 @@ void vtlb_free(vtlb_state *vtlb) if (vtlb->table != NULL) free(vtlb->table); - /* and then the VTLB object itself */ + /* and then the VTLB object itself */ free(vtlb); } @@ -119,7 +119,7 @@ void vtlb_free(vtlb_state *vtlb) ***************************************************************************/ /*------------------------------------------------- - vtlb_fill - rcalled by the CPU core in + vtlb_fill - rcalled by the CPU core in response to an unmapped access -------------------------------------------------*/ @@ -133,8 +133,8 @@ int vtlb_fill(vtlb_state *vtlb, offs_t address, int intention) printf("vtlb_fill: %08X(%X) ... ", address, intention); /* should not be called here if the entry is in the table already */ -// assert((entry & (1 << intention)) == 0); - +// assert((entry & (1 << intention)) == 0); + /* if we have no dynamic entries, we always fail */ if (vtlb->dynamic == 0) { @@ -142,7 +142,7 @@ int vtlb_fill(vtlb_state *vtlb, offs_t address, int intention) printf("failed: no dynamic entries\n"); return FALSE; } - + /* ask the CPU core to translate for us */ taddress = address; if (!(*vtlb->translate)(vtlb->space, intention, &taddress)) @@ -151,19 +151,19 @@ int vtlb_fill(vtlb_state *vtlb, offs_t address, int intention) printf("failed: no translation\n"); return FALSE; } - + /* if this is the first successful translation for this address, allocate a new entry */ if ((entry & VTLB_FLAGS_MASK) == 0) { int liveindex = vtlb->dynindex++ % vtlb->dynamic; - + /* if an entry already exists at this index, free it */ if (vtlb->live[liveindex] != 0) vtlb->table[vtlb->live[liveindex] - 1] = 0; - + /* claim this new entry */ vtlb->live[liveindex] = tableindex + 1; - + /* form a new blank entry */ entry = (taddress >> vtlb->pageshift) << vtlb->pageshift; entry |= VTLB_FLAG_VALID; @@ -171,7 +171,7 @@ int vtlb_fill(vtlb_state *vtlb, offs_t address, int intention) if (PRINTF_TLB) printf("success (%08X), new entry\n", taddress); } - + /* otherwise, ensure that different intentions do not produce different addresses */ else { @@ -181,7 +181,7 @@ int vtlb_fill(vtlb_state *vtlb, offs_t address, int intention) if (PRINTF_TLB) printf("success (%08X), existing entry\n", taddress); } - + /* add the intention to the list of valid intentions and store */ entry |= 1 << (intention & (TRANSLATE_TYPE_MASK | TRANSLATE_USER_MASK)); vtlb->table[tableindex] = entry; @@ -201,10 +201,10 @@ void vtlb_load(vtlb_state *vtlb, int entrynum, int numpages, offs_t address, vtl /* must be in range */ assert(entrynum >= 0 && entrynum < vtlb->fixed); - + if (PRINTF_TLB) printf("vtlb_load %d for %d pages at %08X == %08X\n", entrynum, numpages, address, value); - + /* if an entry already exists at this index, free it */ if (vtlb->live[liveindex] != 0) { @@ -212,7 +212,7 @@ void vtlb_load(vtlb_state *vtlb, int entrynum, int numpages, offs_t address, vtl for (pagenum = 0; pagenum < pagecount; pagenum++) vtlb->table[vtlb->live[liveindex] - 1 + pagenum] = 0; } - + /* claim this new entry */ vtlb->live[liveindex] = tableindex + 1; @@ -229,7 +229,7 @@ void vtlb_load(vtlb_state *vtlb, int entrynum, int numpages, offs_t address, vtl ***************************************************************************/ /*------------------------------------------------- - vtlb_flush_dynamic - flush all knowledge + vtlb_flush_dynamic - flush all knowledge from the dynamic part of the VTLB -------------------------------------------------*/ @@ -239,7 +239,7 @@ void vtlb_flush_dynamic(vtlb_state *vtlb) if (PRINTF_TLB) printf("vtlb_flush_dynamic\n"); - + /* loop over live entries and release them from the table */ for (liveindex = 0; liveindex < vtlb->dynamic; liveindex++) if (vtlb->live[liveindex] != 0) @@ -252,17 +252,17 @@ void vtlb_flush_dynamic(vtlb_state *vtlb) /*------------------------------------------------- - vtlb_flush_address - flush knowledge of a + vtlb_flush_address - flush knowledge of a particular address from the VTLB -------------------------------------------------*/ void vtlb_flush_address(vtlb_state *vtlb, offs_t address) { offs_t tableindex = address >> vtlb->pageshift; - + if (PRINTF_TLB) printf("vtlb_flush_address %08X\n", address); - + /* free the entry in the table; for speed, we leave the entry in the live array */ vtlb->table[tableindex] = 0; } @@ -274,7 +274,7 @@ void vtlb_flush_address(vtlb_state *vtlb, offs_t address) ***************************************************************************/ /*------------------------------------------------- - vtlb_table - return a pointer to the base of + vtlb_table - return a pointer to the base of the linear VTLB lookup table -------------------------------------------------*/ |
