Skip to content

Commit

Permalink
The 32-bit MIPS PGD_ORDER() macro expects __PGD_ORDER to be signed,
Browse files Browse the repository at this point in the history
which it isn't now since the internal machdep->pagesize is unsigned.
Without this patch, module loading fails during initialization on a
kernel that has a page size of 16KB, with messages that indicate
"please wait... (gathering module symbol data)" followed by
"crash: invalid size request: 0  type: pgd page".
(rabinv@axis.com)
  • Loading branch information
Dave Anderson committed Dec 5, 2016
1 parent c7a6b86 commit ec02834
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mips.c
Expand Up @@ -28,7 +28,7 @@ typedef ulong pte_t;
#define PGD_T_LOG2 (__builtin_ffs(sizeof(pgd_t)) - 1)
#define PTE_T_LOG2 (__builtin_ffs(sizeof(pte_t)) - 1)

#define __PGD_ORDER (32 - 3 * PAGESHIFT() + PGD_T_LOG2 + PTE_T_LOG2)
#define __PGD_ORDER (32 - 3 * (int)PAGESHIFT() + PGD_T_LOG2 + PTE_T_LOG2)
#define PGD_ORDER (__PGD_ORDER >= 0 ? __PGD_ORDER : 0)
#define PGD_SIZE (PAGESIZE() << PGD_ORDER)

Expand Down

0 comments on commit ec02834

Please sign in to comment.