changelog shortlog tags branches changeset file revisions annotate raw help

Mercurial > hg > plan9front / sys/src/9/port/rebootcmd.c

revision 7244: 2e8af1bf191d
parent 6080: d7064304ada5
     1.1--- a/sys/src/9/port/rebootcmd.c
     1.2+++ b/sys/src/9/port/rebootcmd.c
     1.3@@ -37,7 +37,7 @@ rebootcmd(int argc, char *argv[])
     1.4 {
     1.5 	Chan *c;
     1.6 	Exec exec;
     1.7-	ulong magic, text, rtext, entry, data, size;
     1.8+	ulong magic, text, rtext, entry, data, size, align;
     1.9 	uchar *p;
    1.10 
    1.11 	if(argc == 0)
    1.12@@ -68,8 +68,17 @@ rebootcmd(int argc, char *argv[])
    1.13 	if(magic & HDR_MAGIC)
    1.14 		readn(c, &exec, 8);
    1.15 
    1.16+	switch(magic){
    1.17+	case R_MAGIC:
    1.18+		align = 0x10000;	/* 64k segment alignment for arm64 */
    1.19+		break;
    1.20+	default:
    1.21+		align = BY2PG;
    1.22+		break;
    1.23+	}
    1.24+
    1.25 	/* round text out to page boundary */
    1.26-	rtext = PGROUND(entry+text)-entry;
    1.27+	rtext = ROUND(entry+text, align)-entry;
    1.28 	size = rtext + data;
    1.29 	p = malloc(size);
    1.30 	if(p == nil)