Skip to content

Commit deac5a8

Browse files
committed
feat!: update M68K to 5.1.0
1 parent 220332e commit deac5a8

File tree

6 files changed

+59
-133
lines changed

6 files changed

+59
-133
lines changed

qemu/target/m68k/cpu.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -236,12 +236,6 @@ static void m68k_cpu_class_init(CPUClass *c)
236236
cc->tcg_initialize = m68k_tcg_init;
237237
}
238238

239-
#define DEFINE_M68K_CPU_TYPE(cpu_model, initfn) \
240-
{ \
241-
.name = cpu_model, \
242-
.initfn = initfn, \
243-
}
244-
245239
struct M68kCPUInfo {
246240
const char *name;
247241
void (*initfn)(CPUState *obj);

qemu/target/m68k/helper.c

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ static int get_physical_address(CPUM68KState *env, hwaddr *physical,
284284
/* Transparent Translation Register bit */
285285
env->mmu.mmusr = M68K_MMU_T_040 | M68K_MMU_R_040;
286286
}
287-
*physical = address & TARGET_PAGE_MASK;
287+
*physical = address;
288288
*page_size = TARGET_PAGE_SIZE;
289289
return 0;
290290
}
@@ -412,7 +412,7 @@ static int get_physical_address(CPUM68KState *env, hwaddr *physical,
412412
}
413413
*page_size = 1 << page_bits;
414414
page_mask = ~(*page_size - 1);
415-
*physical = next & page_mask;
415+
*physical = (next & page_mask) + (address & (*page_size - 1));
416416

417417
if (access_type & ACCESS_PTEST) {
418418
env->mmu.mmusr |= next & M68K_MMU_SR_MASK_040;
@@ -461,6 +461,7 @@ hwaddr m68k_cpu_get_phys_page_debug(CPUState *cs, vaddr addr)
461461
if (env->sr & SR_S) {
462462
access_type |= ACCESS_SUPER;
463463
}
464+
464465
if (get_physical_address(env, &phys_addr, &prot,
465466
addr, access_type, &page_size) != 0) {
466467
return -1;
@@ -525,10 +526,8 @@ bool m68k_cpu_tlb_fill(CPUState *cs, vaddr address, int size,
525526
ret = get_physical_address(&cpu->env, &physical, &prot,
526527
address, access_type, &page_size);
527528
if (likely(ret == 0)) {
528-
address &= TARGET_PAGE_MASK;
529-
physical += address & (page_size - 1);
530-
tlb_set_page(cs, address, physical,
531-
prot, mmu_idx, TARGET_PAGE_SIZE);
529+
tlb_set_page(cs, address & TARGET_PAGE_MASK,
530+
physical & TARGET_PAGE_MASK, prot, mmu_idx, page_size);
532531
return true;
533532
}
534533

@@ -1015,9 +1014,8 @@ void HELPER(ptest)(CPUM68KState *env, uint32_t addr, uint32_t is_read)
10151014
ret = get_physical_address(env, &physical, &prot, addr,
10161015
access_type, &page_size);
10171016
if (ret == 0) {
1018-
addr &= TARGET_PAGE_MASK;
1019-
physical += addr & (page_size - 1);
1020-
tlb_set_page(env_cpu(env), addr, physical,
1017+
tlb_set_page(env_cpu(env), addr & TARGET_PAGE_MASK,
1018+
physical & TARGET_PAGE_MASK,
10211019
prot, access_type & ACCESS_SUPER ?
10221020
MMU_KERNEL_IDX : MMU_USER_IDX, page_size);
10231021
}

qemu/target/m68k/helper.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ DEF_HELPER_3(fatan, void, env, fp, fp)
8686
DEF_HELPER_3(fasin, void, env, fp, fp)
8787
DEF_HELPER_3(facos, void, env, fp, fp)
8888
DEF_HELPER_3(fatanh, void, env, fp, fp)
89+
DEF_HELPER_3(fetoxm1, void, env, fp, fp)
8990
DEF_HELPER_3(ftanh, void, env, fp, fp)
9091
DEF_HELPER_3(fsinh, void, env, fp, fp)
9192
DEF_HELPER_3(fcosh, void, env, fp, fp)

0 commit comments

Comments
 (0)