Use uintptr_t rather than unsigned here for 64-bit correctness.

This commit is contained in:
Warner Losh 2009-07-05 07:01:34 +00:00
parent da96ff5dae
commit f547073088

View File

@ -146,12 +146,13 @@
/*
* Conversion macros
*/
#define mips_round_page(x) ((((unsigned)(x)) + NBPG - 1) & ~(NBPG-1))
#define mips_trunc_page(x) ((unsigned)(x) & ~(NBPG-1))
#define mips_btop(x) ((unsigned)(x) >> PGSHIFT)
#define mips_ptob(x) ((unsigned)(x) << PGSHIFT)
#define mips_round_page(x) ((((uintptr_t)(x)) + NBPG - 1) & ~(NBPG-1))
#define mips_trunc_page(x) ((uintptr_t)(x) & ~(NBPG-1))
#define mips_btop(x) ((uintptr_t)(x) >> PGSHIFT)
#define mips_ptob(x) ((uintptr_t)(x) << PGSHIFT)
#define round_page mips_round_page
#define trunc_page mips_trunc_page
/* XXXimp: Is unsigned long the right cast type here? PA can be > 32bits */
#define atop(x) ((unsigned long)(x) >> PAGE_SHIFT)
#define ptoa(x) ((unsigned long)(x) << PAGE_SHIFT)