Re: R5000SC issues and fix
Izumi Tsutsui <[email protected]> Fri, 5 Dec 2025 18:58:33 +0900
| Newsgroups | gmane.os.netbsd.ports.mips.devel |
|---|---|
| Message-ID | <[email protected]> |
> Simply reverting the math change done fixes it, ie: > > === > diff --git a/sys/arch/mips/include/cache_r5k.h > b/sys/arch/mips/include/cache_r5k.h > index a59fa18fdc02..6bdf9bd688c2 100644 > --- a/sys/arch/mips/include/cache_r5k.h > +++ b/sys/arch/mips/include/cache_r5k.h > @@ -68,6 +68,11 @@ void r5k_sdcache_wb_range(register_t, vsize_t); > #define R5K_SC_PAGESIZE (R5K_SC_LINESIZE * 128) > #define R5K_SC_PAGEMASK (R5K_SC_PAGESIZE - 1) > > +#if 0 > #define mips_r5k_round_page(x) (((x) + (register_t)R5K_SC_PAGEMASK) \ > & (register_t)R5K_SC_PAGEMASK) > #define mips_r5k_trunc_page(x) ((x) & (register_t)R5K_SC_PAGEMASK) > +#else > +#define mips_r5k_round_page(x) round_line(x, PAGE_SIZE) > +#define mips_r5k_trunc_page(x) trunc_line(x, PAGE_SIZE) > +#endif > === Ah, sorry, my serious botch. It should be: >> #define mips_r5k_round_page(x) (((x) + (register_t)R5K_SC_PAGEMASK) \ >> & (register_t)~R5K_SC_PAGEMASK) >> #define mips_r5k_trunc_page(x) ((x) & (register_t)~R5K_SC_PAGEMASK) The intention was it should be 4096 (i.e. R5K_SC_LINESIZE * 128) rather than PAGE_SIZE (that could be 8K or 16K etc. per kernel settings). Thanks, --- Izumi Tsutsui