summaryrefslogtreecommitdiff
path: root/sys/src/9/port/rebootcmd.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/src/9/port/rebootcmd.c')
-rw-r--r--sys/src/9/port/rebootcmd.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/sys/src/9/port/rebootcmd.c b/sys/src/9/port/rebootcmd.c
index e130dc516..517d25a03 100644
--- a/sys/src/9/port/rebootcmd.c
+++ b/sys/src/9/port/rebootcmd.c
@@ -37,7 +37,7 @@ rebootcmd(int argc, char *argv[])
{
Chan *c;
Exec exec;
- ulong magic, text, rtext, entry, data, size;
+ ulong magic, text, rtext, entry, data, size, align;
uchar *p;
if(argc == 0)
@@ -68,8 +68,17 @@ rebootcmd(int argc, char *argv[])
if(magic & HDR_MAGIC)
readn(c, &exec, 8);
+ switch(magic){
+ case R_MAGIC:
+ align = 0x10000; /* 64k segment alignment for arm64 */
+ break;
+ default:
+ align = BY2PG;
+ break;
+ }
+
/* round text out to page boundary */
- rtext = PGROUND(entry+text)-entry;
+ rtext = ROUND(entry+text, align)-entry;
size = rtext + data;
p = malloc(size);
if(p == nil)