diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2023-08-28 21:41:36 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2023-08-28 21:41:36 +0200 |
commit | 2e84449e022783b5f5628495b164f46d2f37bb61 (patch) | |
tree | b6c734ba62dae3e6a5163098c9d05dace81b976b /i386 | |
parent | 53650a96706d999274d59688dbecf163a84eba17 (diff) | |
download | gnumach-2e84449e022783b5f5628495b164f46d2f37bb61.tar.gz gnumach-2e84449e022783b5f5628495b164f46d2f37bb61.tar.bz2 gnumach-2e84449e022783b5f5628495b164f46d2f37bb61.zip |
i386_btop/ptob/trunc/round_page: Fix PAE case
We need to extend to 64bit (or keep the 64bits) before shifting.
Diffstat (limited to 'i386')
-rw-r--r-- | i386/include/mach/i386/vm_param.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/i386/include/mach/i386/vm_param.h b/i386/include/mach/i386/vm_param.h index 1576f048..3e5c18c9 100644 --- a/i386/include/mach/i386/vm_param.h +++ b/i386/include/mach/i386/vm_param.h @@ -52,8 +52,8 @@ * No rounding is used. */ -#define i386_btop(x) (((unsigned long)(x)) >> I386_PGSHIFT) -#define i386_ptob(x) (((unsigned long)(x)) << I386_PGSHIFT) +#define i386_btop(x) (((phys_addr_t)(x)) >> I386_PGSHIFT) +#define i386_ptob(x) (((phys_addr_t)(x)) << I386_PGSHIFT) /* * Round off or truncate to the nearest page. These will work @@ -61,9 +61,9 @@ * bytes.) */ -#define i386_round_page(x) ((((unsigned long)(x)) + I386_PGBYTES - 1) & \ +#define i386_round_page(x) ((((phys_addr_t)(x)) + I386_PGBYTES - 1) & \ ~(I386_PGBYTES-1)) -#define i386_trunc_page(x) (((unsigned long)(x)) & ~(I386_PGBYTES-1)) +#define i386_trunc_page(x) (((phys_addr_t)(x)) & ~(I386_PGBYTES-1)) /* User address spaces are 3GB each on a 32-bit kernel, starting at virtual and linear address 0. |