Skip to content

Commit 723be3c

Browse files
committed
m68k: sun3: Fix DEBUG_MMU_EMU build
With DEBUG_MMU_EMU enabled: arch/m68k/sun3/mmu_emu.c: In function ‘mmu_emu_handle_fault’: arch/m68k/sun3/mmu_emu.c:420:38: error: implicit declaration of function ‘get_fs’; did you mean ‘sget_fc’? [-Werror=implicit-function-declaration] 420 | pr_info("seg:%ld crp:%p ->", get_fs().seg, crp); | ^~~~~~ [...] arch/m68k/sun3/mmu_emu.c:420:46: error: request for member ‘seg’ in something not a structure or union 420 | pr_info("seg:%ld crp:%p ->", get_fs().seg, crp); | ^ Fix this by reintroducing and using a helper to retrieve the current value of the DFC register. While at it, replace "%p" by "%px", as there is no point in printing obfuscated pointers during debugging. Fixes: 9fde034 ("m68k: Remove set_fs()") Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Link: https://lore.kernel.org/b1d12a1d24b4aea9f98d905383ba932b2dc382e6.1737387419.git.geert@linux-m68k.org
1 parent 751b3d8 commit 723be3c

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

arch/m68k/include/asm/processor.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,24 @@ static inline void set_fc(unsigned long val)
9595
"movec %0,%/dfc\n\t"
9696
: /* no outputs */ : "r" (val) : "memory");
9797
}
98+
99+
static inline unsigned long get_fc(void)
100+
{
101+
unsigned long val;
102+
103+
__asm__ ("movec %/dfc,%0" : "=r" (val) : );
104+
105+
return val;
106+
}
98107
#else
99108
static inline void set_fc(unsigned long val)
100109
{
101110
}
111+
112+
static inline unsigned long get_fc(void)
113+
{
114+
return USER_DATA;
115+
}
102116
#endif /* CONFIG_CPU_HAS_ADDRESS_SPACES */
103117

104118
struct thread_struct {

arch/m68k/sun3/mmu_emu.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ int mmu_emu_handle_fault (unsigned long vaddr, int read_flag, int kernel_fault)
371371
}
372372

373373
#ifdef DEBUG_MMU_EMU
374-
pr_info("%s: vaddr=%lx type=%s crp=%p\n", __func__, vaddr,
374+
pr_info("%s: vaddr=%lx type=%s crp=%px\n", __func__, vaddr,
375375
str_read_write(read_flag), crp);
376376
#endif
377377

@@ -418,7 +418,7 @@ int mmu_emu_handle_fault (unsigned long vaddr, int read_flag, int kernel_fault)
418418
pte_val (*pte) |= SUN3_PAGE_ACCESSED;
419419

420420
#ifdef DEBUG_MMU_EMU
421-
pr_info("seg:%ld crp:%p ->", get_fs().seg, crp);
421+
pr_info("seg:%ld crp:%px ->", get_fc(), crp);
422422
print_pte_vaddr (vaddr);
423423
pr_cont("\n");
424424
#endif

0 commit comments

Comments
 (0)