diff --git a/build_sdk.py b/build_sdk.py index ecd6ef64..1baeda4e 100644 --- a/build_sdk.py +++ b/build_sdk.py @@ -32,6 +32,7 @@ KERNEL_CONFIG_TYPE = Union[bool, str] KERNEL_OPTIONS = Dict[str, KERNEL_CONFIG_TYPE] + @dataclass class BoardInfo: name: str @@ -53,12 +54,12 @@ class ConfigInfo: name="tqma8xqp1gb", gcc_cpu="cortex-a35", loader_link_address=0x80280000, - kernel_options = { + kernel_options={ "KernelPlatform": "tqma8xqp1gb", "KernelIsMCS": True, "KernelArmExportPCNTUser": True, }, - examples = { + examples={ "ethernet": Path("example/tqma8xqp1gb/ethernet") } ), @@ -66,13 +67,13 @@ class ConfigInfo: name="zcu102", gcc_cpu="cortex-a53", loader_link_address=0x40000000, - kernel_options = { + kernel_options={ "KernelPlatform": "zynqmp", "KernelARMPlatform": "zcu102", "KernelIsMCS": True, "KernelArmExportPCNTUser": True, }, - examples = { + examples={ "hello": Path("example/zcu102/hello") } ), @@ -80,12 +81,12 @@ class ConfigInfo: # name="imx8mm", # gcc_cpu="cortex-a53", # loader_link_address=0x41000000, - # kernel_options = { + # kernel_options={ # "KernelPlatform": "imx8mm-evk", # "KernelIsMCS": True, # "KernelArmExportPCNTUser": True, # }, - # examples = { + # examples={ # "passive_server": Path("example/imx8mm/passive_server") # } # ) @@ -95,12 +96,12 @@ class ConfigInfo: ConfigInfo( name="release", debug=False, - kernel_options = {}, + kernel_options={}, ), ConfigInfo( name="debug", debug=True, - kernel_options = { + kernel_options={ "KernelDebugBuild": True, "KernelPrinting": True, "KernelVerificationBuild": False @@ -139,6 +140,7 @@ def test_tool() -> None: ) assert r == 0 + def build_tool(tool_target: Path) -> None: pyoxidizer = ENV_BIN_DIR / "pyoxidizer" if not pyoxidizer.exists(): @@ -188,9 +190,9 @@ def build_sel4( platform = board.name cmd = ( - f"cmake -GNinja -DCMAKE_INSTALL_PREFIX={sel4_install_dir.absolute()} "\ - f" -DPYTHON3={executable} " \ - f" -DKernelPlatform={platform} {config_str} " \ + f"cmake -GNinja -DCMAKE_INSTALL_PREFIX={sel4_install_dir.absolute()} " + f" -DPYTHON3={executable} " + f" -DKernelPlatform={platform} {config_str} " f"-S {sel4_dir.absolute()} -B {sel4_build_dir.absolute()}") r = system(cmd) @@ -299,7 +301,6 @@ def build_lib_component( # Make output read-only dest.chmod(0o444) - link_script = Path(component_name) / "microkit.ld" dest = lib_dir / "microkit.ld" dest.unlink(missing_ok=True) @@ -335,7 +336,6 @@ def main() -> None: if not sel4_dir.exists(): raise Exception(f"sel4_dir: {sel4_dir} does not exist") - root_dir = Path("release") / f"{NAME}-sdk-{VERSION}" tar_file = Path("release") / f"{NAME}-sdk-{VERSION}.tar.gz" source_tar_file = Path("release") / f"{NAME}-source-{VERSION}.tar.gz" @@ -406,5 +406,6 @@ def main() -> None: for filename in filenames: tar.add(filename, arcname=source_prefix / filename, filter=tar_filter) + if __name__ == "__main__": main() diff --git a/example/imx8mm/passive_server/client.c b/example/imx8mm/passive_server/client.c index 81487106..20482484 100644 --- a/example/imx8mm/passive_server/client.c +++ b/example/imx8mm/passive_server/client.c @@ -6,10 +6,9 @@ #include -#define SERVER_CH 0 +#define SERVER_CH 0 -void -init(void) +void init(void) { microkit_dbg_puts("client: client protection domain init function running\n"); @@ -18,8 +17,7 @@ init(void) (void) microkit_ppcall(SERVER_CH, microkit_msginfo_new(1, 1)); } -void -notified(microkit_channel ch) +void notified(microkit_channel ch) { microkit_dbg_puts("client: recieved a notification on an unexpected channel\n"); } diff --git a/example/imx8mm/passive_server/server.c b/example/imx8mm/passive_server/server.c index 5687079c..2c0aead4 100644 --- a/example/imx8mm/passive_server/server.c +++ b/example/imx8mm/passive_server/server.c @@ -6,29 +6,26 @@ #include -microkit_msginfo -protected(microkit_channel ch, microkit_msginfo msginfo) +microkit_msginfo protected(microkit_channel ch, microkit_msginfo msginfo) { switch (microkit_msginfo_get_label(msginfo)) { - case 0: - microkit_dbg_puts("server: is running on clients scheduling context\n"); - break; - default: - microkit_dbg_puts("server: received an unexpected message\n"); + case 0: + microkit_dbg_puts("server: is running on clients scheduling context\n"); + break; + default: + microkit_dbg_puts("server: received an unexpected message\n"); } return seL4_MessageInfo_new(0, 0, 0, 0); } -void -init(void) +void init(void) { microkit_dbg_puts("server: server protection domain init function running\n"); /* Nothing to initialise */ } -void -notified(microkit_channel ch) +void notified(microkit_channel ch) { microkit_dbg_puts("server: recieved a notification on an unexpected channel\n"); }