-
Notifications
You must be signed in to change notification settings - Fork 322
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
llext: automatically calculate module addresses
Currently LLEXT module starting addresses are hard-coded in their respective CMakeLists.txt files. This is very wasteful, since it's unknown in what order modules are loaded, inflexible and not easily extendible to other platforms. Switch to calculating addresses automatically based on a single per-platform Kconfig value. Signed-off-by: Guennadi Liakhovetski <[email protected]>
- Loading branch information
Showing
10 changed files
with
98 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
CONFIG_LIBRARY_BASE_ADDRESS=0xa0688000 | ||
CONFIG_SAMPLE_SMART_AMP=m | ||
CONFIG_COMP_MIXIN_MIXOUT=m | ||
CONFIG_COMP_IIR=m | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
CONFIG_LIBRARY_BASE_ADDRESS=0xa0688000 | ||
CONFIG_SAMPLE_SMART_AMP=m | ||
CONFIG_COMP_MIXIN_MIXOUT=m | ||
CONFIG_COMP_IIR=m | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/usr/bin/env python3 | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
|
||
# Add rounded new file size to accumulated module size cache | ||
|
||
import argparse | ||
import pathlib | ||
import os | ||
|
||
args = None | ||
|
||
def parse_args(): | ||
global args | ||
|
||
parser = argparse.ArgumentParser(description='Add a file size to a sum in a file') | ||
|
||
parser.add_argument("-i", "--input", required=True, type=str, | ||
help='Object file name') | ||
parser.add_argument("-s", "--size-file", required=True, type=str, | ||
help='File to store accumulated size') | ||
|
||
args = parser.parse_args() | ||
|
||
def main(): | ||
global args | ||
|
||
parse_args() | ||
|
||
f_output = pathlib.Path(args.size_file) | ||
|
||
try: | ||
with open(f_output, 'r') as f_size: | ||
size = int(f_size.read().strip(), base = 0) | ||
except OSError: | ||
size = 0 | ||
|
||
# Failure will raise an exception | ||
f_size = open(f_output, "w") | ||
|
||
# align to a page border | ||
size += os.path.getsize(args.input) + 0xfff | ||
size &= ~0xfff | ||
|
||
f_size.write(f'0x{size:x}\n') | ||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,5 +6,4 @@ sof_llext_build("eq_iir" | |
SOURCES ../eq_iir.c | ||
../eq_iir_ipc4.c | ||
../eq_iir_generic.c | ||
TEXT_ADDR 0xa06ea000 | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,5 +11,4 @@ sof_llext_build("volume" | |
../volume_hifi4_with_peakvol.c | ||
../volume.c | ||
../volume_ipc4.c | ||
TEXT_ADDR 0xa068a000 | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters