Skip to content

Commit

Permalink
Add riscv64*-sel4-microkit* target specs
Browse files Browse the repository at this point in the history
Signed-off-by: Nick Spinale <[email protected]>
  • Loading branch information
nspin committed Sep 18, 2024
1 parent a73b041 commit fd01ea6
Show file tree
Hide file tree
Showing 9 changed files with 241 additions and 1 deletion.
2 changes: 1 addition & 1 deletion crates/sel4-generate-target-specs/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ impl Arch {
}

fn microkit_support(&self) -> bool {
matches!(self, Self::AArch64)
matches!(self, Self::AArch64 | Self::RiscV64(_))
}

fn unwinding_support(&self) -> bool {
Expand Down
31 changes: 31 additions & 0 deletions support/targets/riscv64gc-sel4-microkit-minimal.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"arch": "riscv64",
"code-model": "medium",
"cpu": "generic-rv64",
"crt-objects-fallback": "false",
"data-layout": "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128",
"eh-frame-header": false,
"emit-debug-gdb-scripts": false,
"env": "sel4",
"exe-suffix": ".elf",
"features": "+m,+a,+f,+d,+c",
"link-script": "__sel4_ipc_buffer_obj = (__ehdr_start & ~(4096 - 1)) - 4096;",
"linker": "rust-lld",
"linker-flavor": "gnu-lld",
"llvm-abiname": "lp64d",
"llvm-target": "riscv64",
"max-atomic-width": 64,
"metadata": {
"description": "Bare RISC-V (RV64IMAFDC ISA)",
"host_tools": false,
"std": false,
"tier": 2
},
"panic-strategy": "abort",
"relocation-model": "static",
"supported-sanitizers": [
"shadow-call-stack",
"kernel-address"
],
"target-pointer-width": "64"
}
31 changes: 31 additions & 0 deletions support/targets/riscv64gc-sel4-microkit-resettable-minimal.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"arch": "riscv64",
"code-model": "medium",
"cpu": "generic-rv64",
"crt-objects-fallback": "false",
"data-layout": "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128",
"eh-frame-header": false,
"emit-debug-gdb-scripts": false,
"env": "sel4",
"exe-suffix": ".elf",
"features": "+m,+a,+f,+d,+c",
"link-script": "SECTIONS {\n .persistent : {\n *(.persistent .persistent.*)\n }\n} INSERT BEFORE .data;\n\nASSERT(DEFINED(_reset), \"_reset is not defined\")\n\nENTRY(_reset)\n__sel4_ipc_buffer_obj = (__ehdr_start & ~(4096 - 1)) - 4096;",
"linker": "rust-lld",
"linker-flavor": "gnu-lld",
"llvm-abiname": "lp64d",
"llvm-target": "riscv64",
"max-atomic-width": 64,
"metadata": {
"description": "Bare RISC-V (RV64IMAFDC ISA)",
"host_tools": false,
"std": false,
"tier": 2
},
"panic-strategy": "abort",
"relocation-model": "static",
"supported-sanitizers": [
"shadow-call-stack",
"kernel-address"
],
"target-pointer-width": "64"
}
30 changes: 30 additions & 0 deletions support/targets/riscv64gc-sel4-microkit-resettable.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"arch": "riscv64",
"code-model": "medium",
"cpu": "generic-rv64",
"crt-objects-fallback": "false",
"data-layout": "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128",
"emit-debug-gdb-scripts": false,
"env": "sel4",
"exe-suffix": ".elf",
"features": "+m,+a,+f,+d,+c",
"has-thread-local": true,
"link-script": "SECTIONS {\n .persistent : {\n *(.persistent .persistent.*)\n }\n} INSERT BEFORE .data;\n\nASSERT(DEFINED(_reset), \"_reset is not defined\")\n\nENTRY(_reset)\n__sel4_ipc_buffer_obj = (__ehdr_start & ~(4096 - 1)) - 4096;",
"linker": "rust-lld",
"linker-flavor": "gnu-lld",
"llvm-abiname": "lp64d",
"llvm-target": "riscv64",
"max-atomic-width": 64,
"metadata": {
"description": "Bare RISC-V (RV64IMAFDC ISA)",
"host_tools": false,
"std": false,
"tier": 2
},
"relocation-model": "static",
"supported-sanitizers": [
"shadow-call-stack",
"kernel-address"
],
"target-pointer-width": "64"
}
30 changes: 30 additions & 0 deletions support/targets/riscv64gc-sel4-microkit.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"arch": "riscv64",
"code-model": "medium",
"cpu": "generic-rv64",
"crt-objects-fallback": "false",
"data-layout": "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128",
"emit-debug-gdb-scripts": false,
"env": "sel4",
"exe-suffix": ".elf",
"features": "+m,+a,+f,+d,+c",
"has-thread-local": true,
"link-script": "__sel4_ipc_buffer_obj = (__ehdr_start & ~(4096 - 1)) - 4096;",
"linker": "rust-lld",
"linker-flavor": "gnu-lld",
"llvm-abiname": "lp64d",
"llvm-target": "riscv64",
"max-atomic-width": 64,
"metadata": {
"description": "Bare RISC-V (RV64IMAFDC ISA)",
"host_tools": false,
"std": false,
"tier": 2
},
"relocation-model": "static",
"supported-sanitizers": [
"shadow-call-stack",
"kernel-address"
],
"target-pointer-width": "64"
}
30 changes: 30 additions & 0 deletions support/targets/riscv64imac-sel4-microkit-minimal.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"arch": "riscv64",
"code-model": "medium",
"cpu": "generic-rv64",
"crt-objects-fallback": "false",
"data-layout": "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128",
"eh-frame-header": false,
"emit-debug-gdb-scripts": false,
"env": "sel4",
"exe-suffix": ".elf",
"features": "+m,+a,+c",
"link-script": "__sel4_ipc_buffer_obj = (__ehdr_start & ~(4096 - 1)) - 4096;",
"linker": "rust-lld",
"linker-flavor": "gnu-lld",
"llvm-target": "riscv64",
"max-atomic-width": 64,
"metadata": {
"description": "Bare RISC-V (RV64IMAC ISA)",
"host_tools": false,
"std": false,
"tier": 2
},
"panic-strategy": "abort",
"relocation-model": "static",
"supported-sanitizers": [
"shadow-call-stack",
"kernel-address"
],
"target-pointer-width": "64"
}
30 changes: 30 additions & 0 deletions support/targets/riscv64imac-sel4-microkit-resettable-minimal.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"arch": "riscv64",
"code-model": "medium",
"cpu": "generic-rv64",
"crt-objects-fallback": "false",
"data-layout": "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128",
"eh-frame-header": false,
"emit-debug-gdb-scripts": false,
"env": "sel4",
"exe-suffix": ".elf",
"features": "+m,+a,+c",
"link-script": "SECTIONS {\n .persistent : {\n *(.persistent .persistent.*)\n }\n} INSERT BEFORE .data;\n\nASSERT(DEFINED(_reset), \"_reset is not defined\")\n\nENTRY(_reset)\n__sel4_ipc_buffer_obj = (__ehdr_start & ~(4096 - 1)) - 4096;",
"linker": "rust-lld",
"linker-flavor": "gnu-lld",
"llvm-target": "riscv64",
"max-atomic-width": 64,
"metadata": {
"description": "Bare RISC-V (RV64IMAC ISA)",
"host_tools": false,
"std": false,
"tier": 2
},
"panic-strategy": "abort",
"relocation-model": "static",
"supported-sanitizers": [
"shadow-call-stack",
"kernel-address"
],
"target-pointer-width": "64"
}
29 changes: 29 additions & 0 deletions support/targets/riscv64imac-sel4-microkit-resettable.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"arch": "riscv64",
"code-model": "medium",
"cpu": "generic-rv64",
"crt-objects-fallback": "false",
"data-layout": "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128",
"emit-debug-gdb-scripts": false,
"env": "sel4",
"exe-suffix": ".elf",
"features": "+m,+a,+c",
"has-thread-local": true,
"link-script": "SECTIONS {\n .persistent : {\n *(.persistent .persistent.*)\n }\n} INSERT BEFORE .data;\n\nASSERT(DEFINED(_reset), \"_reset is not defined\")\n\nENTRY(_reset)\n__sel4_ipc_buffer_obj = (__ehdr_start & ~(4096 - 1)) - 4096;",
"linker": "rust-lld",
"linker-flavor": "gnu-lld",
"llvm-target": "riscv64",
"max-atomic-width": 64,
"metadata": {
"description": "Bare RISC-V (RV64IMAC ISA)",
"host_tools": false,
"std": false,
"tier": 2
},
"relocation-model": "static",
"supported-sanitizers": [
"shadow-call-stack",
"kernel-address"
],
"target-pointer-width": "64"
}
29 changes: 29 additions & 0 deletions support/targets/riscv64imac-sel4-microkit.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"arch": "riscv64",
"code-model": "medium",
"cpu": "generic-rv64",
"crt-objects-fallback": "false",
"data-layout": "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128",
"emit-debug-gdb-scripts": false,
"env": "sel4",
"exe-suffix": ".elf",
"features": "+m,+a,+c",
"has-thread-local": true,
"link-script": "__sel4_ipc_buffer_obj = (__ehdr_start & ~(4096 - 1)) - 4096;",
"linker": "rust-lld",
"linker-flavor": "gnu-lld",
"llvm-target": "riscv64",
"max-atomic-width": 64,
"metadata": {
"description": "Bare RISC-V (RV64IMAC ISA)",
"host_tools": false,
"std": false,
"tier": 2
},
"relocation-model": "static",
"supported-sanitizers": [
"shadow-call-stack",
"kernel-address"
],
"target-pointer-width": "64"
}

0 comments on commit fd01ea6

Please sign in to comment.