mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-01-23 02:14:37 +00:00
Return page size as unsigned long
Currently page_size() returns unsigned int value that is after "bitwise not" is promoted to unsigned long value e.g. in uffd.c handle_page_fault. Since the value is unsigned promotion is done with 0 MSB that results in lost of MSB pagefault address bits. So make page_size to return unsigned long to avoid such situation. Signed-off-by: Vladislav Khmelevsky <och95@yandex.ru>
This commit is contained in:
parent
00f8a56b6e
commit
28adebefb7
6 changed files with 10 additions and 10 deletions
|
|
@ -10,7 +10,7 @@
|
|||
extern unsigned __page_size;
|
||||
extern unsigned __page_shift;
|
||||
|
||||
static inline unsigned page_size(void)
|
||||
static inline unsigned long page_size(void)
|
||||
{
|
||||
if (!__page_size)
|
||||
__page_size = sysconf(_SC_PAGESIZE);
|
||||
|
|
@ -37,7 +37,7 @@ static inline unsigned page_shift(void)
|
|||
|
||||
#else /* CR_NOGLIBC */
|
||||
|
||||
extern unsigned page_size(void);
|
||||
extern unsigned long page_size(void);
|
||||
#define PAGE_SIZE page_size()
|
||||
|
||||
#endif /* CR_NOGLIBC */
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
static unsigned __page_size;
|
||||
static unsigned __page_shift;
|
||||
|
||||
static inline unsigned page_size(void)
|
||||
static inline unsigned long page_size(void)
|
||||
{
|
||||
if (!__page_size)
|
||||
__page_size = sysconf(_SC_PAGESIZE);
|
||||
|
|
@ -31,7 +31,7 @@ static inline unsigned page_shift(void)
|
|||
#define PAGE_PFN(addr) ((addr) / PAGE_SIZE)
|
||||
#else /* CR_NOGLIBC */
|
||||
|
||||
extern unsigned page_size(void);
|
||||
extern unsigned long page_size(void);
|
||||
#define PAGE_SIZE page_size()
|
||||
|
||||
#endif /* CR_NOGLIBC */
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
static unsigned __page_size;
|
||||
static unsigned __page_shift;
|
||||
|
||||
static inline unsigned page_size(void)
|
||||
static inline unsigned long page_size(void)
|
||||
{
|
||||
if (!__page_size)
|
||||
__page_size = sysconf(_SC_PAGESIZE);
|
||||
|
|
@ -31,7 +31,7 @@ static inline unsigned page_shift(void)
|
|||
#define PAGE_PFN(addr) ((addr) / PAGE_SIZE)
|
||||
#else /* CR_NOGLIBC */
|
||||
|
||||
extern unsigned page_size(void);
|
||||
extern unsigned long page_size(void);
|
||||
#define PAGE_SIZE page_size()
|
||||
|
||||
#endif /* CR_NOGLIBC */
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
extern unsigned __page_size;
|
||||
extern unsigned __page_shift;
|
||||
|
||||
static inline unsigned page_size(void)
|
||||
static inline unsigned long page_size(void)
|
||||
{
|
||||
if (!__page_size)
|
||||
__page_size = sysconf(_SC_PAGESIZE);
|
||||
|
|
@ -37,7 +37,7 @@ static inline unsigned page_shift(void)
|
|||
|
||||
#else /* CR_NOGLIBC */
|
||||
|
||||
extern unsigned page_size(void);
|
||||
extern unsigned long page_size(void);
|
||||
#define PAGE_SIZE page_size()
|
||||
|
||||
#endif /* CR_NOGLIBC */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue