aboutsummaryrefslogtreecommitdiff
path: root/hw/mips/malta.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/mips/malta.c')
-rw-r--r--hw/mips/malta.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/hw/mips/malta.c b/hw/mips/malta.c
index ff3225b..beb0f43 100644
--- a/hw/mips/malta.c
+++ b/hw/mips/malta.c
@@ -1077,9 +1077,9 @@ static int64_t load_kernel(void)
* the initrd. It takes at most 128kiB for 2GB RAM and 4kiB
* pages.
*/
- initrd_offset = (loaderparams.ram_low_size - initrd_size
- - (128 * KiB)
- - ~INITRD_PAGE_MASK) & INITRD_PAGE_MASK;
+ initrd_offset = ROUND_UP(loaderparams.ram_low_size
+ - (initrd_size + 128 * KiB),
+ INITRD_PAGE_SIZE);
if (kernel_high >= initrd_offset) {
error_report("memory too small for initial ram disk '%s'",
loaderparams.initrd_filename);