Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Force bundle alignment to 64K #46

Merged
merged 1 commit into from
May 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions bin2cbundle.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 <stddef.h>\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):
Expand Down