From fd1c4c4f8c774118e9c6c85b16d629d900d4487c Mon Sep 17 00:00:00 2001 From: Eric Curtin Date: Tue, 9 May 2023 09:59:10 +0100 Subject: [PATCH] Force bundle alignment to 64K In addition to padding the size of the bundle to 64k, tell GCC to align its beginning to that value. This should fix loading the bundle in 4k/16k/64k environments without causing any trouble smaller page size environments. Signed-off-by: Eric Curtin --- bin2cbundle.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin2cbundle.py b/bin2cbundle.py index df3775e..48c08fa 100644 --- a/bin2cbundle.py +++ b/bin2cbundle.py @@ -5,13 +5,13 @@ import argparse import sys -# Use Apple Silicon's page size for rounding. -PAGE_SIZE = 16384 +# Use 64k page size for rounding. This should cover 4k/16k/64k kernels +PAGE_SIZE = 65536 AARCH64_LOAD_ADDR = '0x80000000' def write_header(ofile, bundle_name): ofile.write('#include \n') - ofile.write('__attribute__ ((aligned (16384))) char {}_BUNDLE[] = \n"'.format(bundle_name)) + ofile.write('__attribute__ ((aligned ({}))) char {}_BUNDLE[] = \n"'.format(PAGE_SIZE, bundle_name)) def write_padding(ofile, padding, col):