├── .cargo └── config.toml ├── .github ├── CODEOWNERS ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md └── workflows │ ├── pr.yml │ └── push.yaml ├── .gitignore ├── .reuse └── dep5 ├── .vscode └── settings.json ├── Cargo.lock ├── Cargo.nix ├── Cargo.toml ├── LICENSES ├── Apache-2.0.txt ├── BSD-2-Clause.txt ├── CC-BY-SA-4.0.txt ├── GPL-2.0-only.txt ├── ISC.txt └── MIT.txt ├── Makefile ├── README.md ├── VERSION ├── crates ├── drivers │ ├── bcm2835-aux-uart │ │ ├── Cargo.nix │ │ ├── Cargo.toml │ │ └── src │ │ │ ├── device.rs │ │ │ └── lib.rs │ ├── pl011 │ │ ├── Cargo.nix │ │ ├── Cargo.toml │ │ └── src │ │ │ ├── device.rs │ │ │ └── lib.rs │ ├── pl031 │ │ ├── Cargo.nix │ │ ├── Cargo.toml │ │ └── src │ │ │ ├── device.rs │ │ │ └── lib.rs │ ├── sp804 │ │ ├── Cargo.nix │ │ ├── Cargo.toml │ │ └── src │ │ │ ├── device.rs │ │ │ └── lib.rs │ └── virtio │ │ ├── blk │ │ ├── Cargo.nix │ │ ├── Cargo.toml │ │ └── src │ │ │ └── lib.rs │ │ ├── hal-impl │ │ ├── Cargo.nix │ │ ├── Cargo.toml │ │ └── src │ │ │ └── lib.rs │ │ └── net │ │ ├── Cargo.nix │ │ ├── Cargo.toml │ │ └── src │ │ └── lib.rs ├── examples │ ├── microkit │ │ ├── banscii │ │ │ ├── banscii.system.template │ │ │ ├── generate_system_description.py │ │ │ └── pds │ │ │ │ ├── artist │ │ │ │ ├── Cargo.nix │ │ │ │ ├── Cargo.toml │ │ │ │ ├── build.rs │ │ │ │ ├── interface-types │ │ │ │ │ ├── Cargo.nix │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ └── src │ │ │ │ │ │ └── lib.rs │ │ │ │ └── src │ │ │ │ │ ├── artistic_secrets.rs │ │ │ │ │ ├── cryptographic_secrets.rs │ │ │ │ │ └── main.rs │ │ │ │ ├── assistant │ │ │ │ ├── Cargo.nix │ │ │ │ ├── Cargo.toml │ │ │ │ ├── core │ │ │ │ │ ├── Cargo.nix │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ ├── assets │ │ │ │ │ │ └── fonts │ │ │ │ │ │ │ └── rock-salt │ │ │ │ │ │ │ └── RockSalt-Regular.ttf │ │ │ │ │ ├── src │ │ │ │ │ │ └── lib.rs │ │ │ │ │ └── test │ │ │ │ │ │ ├── Cargo.nix │ │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ │ └── src │ │ │ │ │ │ └── main.rs │ │ │ │ └── src │ │ │ │ │ └── main.rs │ │ │ │ └── serial-driver │ │ │ │ ├── Cargo.nix │ │ │ │ ├── Cargo.toml │ │ │ │ └── src │ │ │ │ └── main.rs │ │ ├── hello │ │ │ ├── hello.system │ │ │ └── pds │ │ │ │ └── hello │ │ │ │ ├── Cargo.nix │ │ │ │ ├── Cargo.toml │ │ │ │ └── src │ │ │ │ └── main.rs │ │ └── http-server │ │ │ ├── http-server.system │ │ │ └── pds │ │ │ ├── pl031-driver │ │ │ ├── Cargo.nix │ │ │ ├── Cargo.toml │ │ │ └── src │ │ │ │ └── main.rs │ │ │ ├── server │ │ │ ├── Cargo.nix │ │ │ ├── Cargo.toml │ │ │ ├── build.rs │ │ │ ├── core │ │ │ │ ├── Cargo.nix │ │ │ │ ├── Cargo.toml │ │ │ │ └── src │ │ │ │ │ ├── lib.rs │ │ │ │ │ ├── mime.rs │ │ │ │ │ └── server.rs │ │ │ └── src │ │ │ │ ├── config.rs │ │ │ │ ├── handler.rs │ │ │ │ └── main.rs │ │ │ ├── sp804-driver │ │ │ ├── Cargo.nix │ │ │ ├── Cargo.toml │ │ │ └── src │ │ │ │ └── main.rs │ │ │ ├── virtio-blk-driver │ │ │ ├── Cargo.nix │ │ │ ├── Cargo.toml │ │ │ └── src │ │ │ │ ├── config.rs │ │ │ │ └── main.rs │ │ │ └── virtio-net-driver │ │ │ ├── Cargo.nix │ │ │ ├── Cargo.toml │ │ │ └── src │ │ │ ├── config.rs │ │ │ └── main.rs │ └── root-task │ │ ├── example-root-task-without-runtime │ │ ├── Cargo.nix │ │ ├── Cargo.toml │ │ └── src │ │ │ └── main.rs │ │ ├── example-root-task │ │ ├── Cargo.nix │ │ ├── Cargo.toml │ │ └── src │ │ │ └── main.rs │ │ ├── hello │ │ ├── Cargo.nix │ │ ├── Cargo.toml │ │ └── src │ │ │ └── main.rs │ │ ├── serial-device │ │ ├── Cargo.nix │ │ ├── Cargo.toml │ │ └── src │ │ │ ├── device.rs │ │ │ └── main.rs │ │ ├── spawn-task │ │ ├── Cargo.nix │ │ ├── Cargo.toml │ │ ├── child │ │ │ ├── Cargo.nix │ │ │ ├── Cargo.toml │ │ │ └── src │ │ │ │ ├── main.rs │ │ │ │ └── runtime.rs │ │ └── src │ │ │ ├── child_vspace.rs │ │ │ ├── main.rs │ │ │ └── object_allocator.rs │ │ └── spawn-thread │ │ ├── Cargo.nix │ │ ├── Cargo.toml │ │ └── src │ │ └── main.rs ├── private │ ├── meta │ │ ├── Cargo.nix │ │ ├── Cargo.toml │ │ └── src │ │ │ └── lib.rs │ ├── support │ │ ├── sel4-root-task-with-std │ │ │ ├── Cargo.nix │ │ │ ├── Cargo.toml │ │ │ └── src │ │ │ │ ├── entry.rs │ │ │ │ ├── lib.rs │ │ │ │ └── termination.rs │ │ └── sel4-simple-task │ │ │ ├── config-types │ │ │ ├── Cargo.nix │ │ │ ├── Cargo.toml │ │ │ └── src │ │ │ │ ├── lib.rs │ │ │ │ ├── when_not_sel4.rs │ │ │ │ └── when_sel4.rs │ │ │ ├── rpc │ │ │ ├── Cargo.nix │ │ │ ├── Cargo.toml │ │ │ └── src │ │ │ │ ├── easy.rs │ │ │ │ └── lib.rs │ │ │ ├── runtime │ │ │ ├── Cargo.nix │ │ │ ├── Cargo.toml │ │ │ ├── config │ │ │ │ ├── cli │ │ │ │ │ ├── Cargo.nix │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ └── src │ │ │ │ │ │ └── bin │ │ │ │ │ │ └── sel4-simple-task-serialize-runtime-config.rs │ │ │ │ └── types │ │ │ │ │ ├── Cargo.nix │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ └── src │ │ │ │ │ ├── lib.rs │ │ │ │ │ ├── with_alloc.rs │ │ │ │ │ └── zerocopy_helpers.rs │ │ │ ├── macros │ │ │ │ ├── Cargo.nix │ │ │ │ ├── Cargo.toml │ │ │ │ └── src │ │ │ │ │ └── lib.rs │ │ │ └── src │ │ │ │ ├── declare_main.rs │ │ │ │ ├── global_allocator.rs │ │ │ │ ├── lib.rs │ │ │ │ └── termination.rs │ │ │ └── threading │ │ │ ├── Cargo.nix │ │ │ ├── Cargo.toml │ │ │ └── src │ │ │ └── lib.rs │ └── tests │ │ ├── capdl │ │ ├── threads │ │ │ ├── cdl.py │ │ │ └── components │ │ │ │ └── test │ │ │ │ ├── Cargo.nix │ │ │ │ ├── Cargo.toml │ │ │ │ └── src │ │ │ │ └── main.rs │ │ └── utcover │ │ │ ├── cdl.py │ │ │ └── components │ │ │ └── test │ │ │ ├── Cargo.nix │ │ │ ├── Cargo.toml │ │ │ └── src │ │ │ └── main.rs │ │ ├── microkit │ │ ├── minimal │ │ │ ├── Cargo.nix │ │ │ ├── Cargo.toml │ │ │ ├── src │ │ │ │ └── bin │ │ │ │ │ └── test.rs │ │ │ └── x.system │ │ ├── passive-server-with-deferred-action │ │ │ ├── pds │ │ │ │ ├── client │ │ │ │ │ ├── Cargo.nix │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ └── src │ │ │ │ │ │ └── bin │ │ │ │ │ │ └── client.rs │ │ │ │ └── server │ │ │ │ │ ├── Cargo.nix │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ └── src │ │ │ │ │ └── bin │ │ │ │ │ └── server.rs │ │ │ └── x.system │ │ ├── reset │ │ │ ├── Cargo.nix │ │ │ ├── Cargo.toml │ │ │ ├── src │ │ │ │ └── bin │ │ │ │ │ └── test.rs │ │ │ └── x.system │ │ └── unwind │ │ │ ├── Cargo.nix │ │ │ ├── Cargo.toml │ │ │ ├── src │ │ │ └── bin │ │ │ │ └── test.rs │ │ │ └── x.system │ │ └── root-task │ │ ├── alloca │ │ ├── Cargo.nix │ │ ├── Cargo.toml │ │ └── src │ │ │ └── main.rs │ │ ├── backtrace │ │ ├── Cargo.nix │ │ ├── Cargo.toml │ │ └── src │ │ │ └── main.rs │ │ ├── c │ │ ├── Cargo.nix │ │ ├── Cargo.toml │ │ ├── build.rs │ │ ├── cbits │ │ │ └── test.c │ │ └── src │ │ │ └── main.rs │ │ ├── config │ │ ├── Cargo.nix │ │ ├── Cargo.toml │ │ └── src │ │ │ └── main.rs │ │ ├── dafny │ │ ├── core │ │ │ ├── Cargo.nix │ │ │ ├── Cargo.toml │ │ │ ├── build.rs │ │ │ └── src │ │ │ │ └── lib.rs │ │ ├── hacking │ │ │ ├── .gitignore │ │ │ ├── Makefile │ │ │ └── shell.nix │ │ ├── task │ │ │ ├── Cargo.nix │ │ │ ├── Cargo.toml │ │ │ └── src │ │ │ │ └── main.rs │ │ └── verified │ │ │ └── core.dfy │ │ ├── default-test-harness │ │ ├── Cargo.nix │ │ ├── Cargo.toml │ │ └── src │ │ │ └── lib.rs │ │ ├── loader │ │ ├── Cargo.nix │ │ ├── Cargo.toml │ │ └── src │ │ │ └── main.rs │ │ ├── musl │ │ ├── Cargo.nix │ │ ├── Cargo.toml │ │ └── src │ │ │ └── main.rs │ │ ├── panicking │ │ ├── Cargo.nix │ │ ├── Cargo.toml │ │ └── src │ │ │ └── main.rs │ │ ├── ring-test-harness │ │ ├── Cargo.nix │ │ ├── Cargo.toml │ │ └── src │ │ │ └── lib.rs │ │ ├── tls │ │ ├── Cargo.nix │ │ ├── Cargo.toml │ │ └── src │ │ │ └── main.rs │ │ └── verus │ │ ├── core │ │ ├── Cargo.nix │ │ ├── Cargo.toml │ │ └── src │ │ │ └── lib.rs │ │ └── task │ │ ├── Cargo.nix │ │ ├── Cargo.toml │ │ └── src │ │ └── main.rs ├── sel4-abstract-allocator │ ├── Cargo.nix │ ├── Cargo.toml │ ├── offset-allocator │ │ ├── Cargo.nix │ │ ├── Cargo.toml │ │ └── src │ │ │ └── lib.rs │ └── src │ │ ├── basic.rs │ │ ├── bump.rs │ │ ├── by_range.rs │ │ └── lib.rs ├── sel4-abstract-ptr │ ├── Cargo.nix │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── abstract_ptr │ │ ├── atomic_operations.rs │ │ ├── macros.rs │ │ ├── mod.rs │ │ ├── operations.rs │ │ └── slice_operations.rs │ │ ├── abstract_ref.rs │ │ ├── access.rs │ │ ├── core_ext.rs │ │ ├── lib.rs │ │ └── memory_type.rs ├── sel4-abstract-rc │ ├── Cargo.nix │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── sel4-alloca │ ├── Cargo.nix │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── sel4-async │ ├── block-io │ │ ├── Cargo.nix │ │ ├── Cargo.toml │ │ ├── fat │ │ │ ├── Cargo.nix │ │ │ ├── Cargo.toml │ │ │ └── src │ │ │ │ ├── block_io_wrapper.rs │ │ │ │ ├── dummy_time_source.rs │ │ │ │ └── lib.rs │ │ └── src │ │ │ ├── access.rs │ │ │ ├── disk.rs │ │ │ ├── lib.rs │ │ │ ├── operation.rs │ │ │ └── when_alloc.rs │ ├── io │ │ ├── Cargo.nix │ │ ├── Cargo.toml │ │ └── src │ │ │ └── lib.rs │ ├── network │ │ ├── Cargo.nix │ │ ├── Cargo.toml │ │ ├── rustls │ │ │ ├── Cargo.nix │ │ │ ├── Cargo.toml │ │ │ ├── README.md │ │ │ ├── src │ │ │ │ ├── conn.rs │ │ │ │ ├── error.rs │ │ │ │ ├── lib.rs │ │ │ │ └── utils.rs │ │ │ └── utils │ │ │ │ ├── Cargo.nix │ │ │ │ ├── Cargo.toml │ │ │ │ └── src │ │ │ │ ├── dummy_custom_getrandom.rs │ │ │ │ ├── lib.rs │ │ │ │ ├── no_server_cert_verifier.rs │ │ │ │ └── time_provider_impl.rs │ │ └── src │ │ │ └── lib.rs │ ├── single-threaded-executor │ │ ├── Cargo.nix │ │ ├── Cargo.toml │ │ ├── README.md │ │ └── src │ │ │ ├── enter.rs │ │ │ └── lib.rs │ ├── time │ │ ├── Cargo.nix │ │ ├── Cargo.toml │ │ └── src │ │ │ ├── instant.rs │ │ │ ├── lib.rs │ │ │ ├── sub_key.rs │ │ │ └── timer_queue.rs │ └── unsync │ │ ├── Cargo.nix │ │ ├── Cargo.toml │ │ └── src │ │ ├── lib.rs │ │ └── mutex.rs ├── sel4-backtrace │ ├── Cargo.nix │ ├── Cargo.toml │ ├── addr2line-context-helper │ │ ├── Cargo.nix │ │ ├── Cargo.toml │ │ └── src │ │ │ └── lib.rs │ ├── cli │ │ ├── Cargo.nix │ │ ├── Cargo.toml │ │ └── src │ │ │ └── bin │ │ │ └── sel4-symbolize-backtrace.rs │ ├── embedded-debug-info │ │ ├── Cargo.nix │ │ ├── Cargo.toml │ │ ├── cli │ │ │ ├── Cargo.nix │ │ │ ├── Cargo.toml │ │ │ └── src │ │ │ │ └── bin │ │ │ │ └── sel4-embed-debug-info.rs │ │ └── src │ │ │ └── lib.rs │ ├── simple │ │ ├── Cargo.nix │ │ ├── Cargo.toml │ │ └── src │ │ │ └── lib.rs │ ├── src │ │ └── lib.rs │ ├── symbolize │ │ ├── Cargo.nix │ │ ├── Cargo.toml │ │ └── src │ │ │ └── lib.rs │ └── types │ │ ├── Cargo.nix │ │ ├── Cargo.toml │ │ └── src │ │ ├── lib.rs │ │ ├── with_alloc.rs │ │ ├── with_postcard.rs │ │ └── with_symbolize.rs ├── sel4-capdl-initializer │ ├── Cargo.nix │ ├── Cargo.toml │ ├── README.md │ ├── add-spec │ │ ├── Cargo.nix │ │ ├── Cargo.toml │ │ └── src │ │ │ ├── args.rs │ │ │ ├── main.rs │ │ │ ├── render_elf.rs │ │ │ └── reserialize_spec.rs │ ├── build.rs │ ├── core │ │ ├── Cargo.nix │ │ ├── Cargo.toml │ │ └── src │ │ │ ├── buffers.rs │ │ │ ├── cslot_allocator.rs │ │ │ ├── error.rs │ │ │ ├── hold_slots.rs │ │ │ ├── lib.rs │ │ │ └── memory.rs │ ├── embed-spec │ │ ├── Cargo.nix │ │ ├── Cargo.toml │ │ └── src │ │ │ └── lib.rs │ ├── src │ │ └── main.rs │ ├── types │ │ ├── Cargo.nix │ │ ├── Cargo.toml │ │ ├── derive │ │ │ ├── Cargo.nix │ │ │ ├── Cargo.toml │ │ │ └── src │ │ │ │ └── lib.rs │ │ └── src │ │ │ ├── cap_table.rs │ │ │ ├── footprint.rs │ │ │ ├── frame_init.rs │ │ │ ├── indirect.rs │ │ │ ├── inspect.rs │ │ │ ├── lib.rs │ │ │ ├── object_name.rs │ │ │ ├── spec.rs │ │ │ ├── traverse.rs │ │ │ ├── when_sel4.rs │ │ │ └── when_std.rs │ └── with-embedded-spec │ │ ├── Cargo.nix │ │ ├── Cargo.toml │ │ ├── build-env │ │ ├── Cargo.nix │ │ ├── Cargo.toml │ │ └── src │ │ │ └── lib.rs │ │ ├── build.rs │ │ ├── embedded-spec │ │ ├── Cargo.nix │ │ ├── Cargo.toml │ │ ├── build.rs │ │ ├── src │ │ │ └── lib.rs │ │ └── validate │ │ │ ├── Cargo.nix │ │ │ ├── Cargo.toml │ │ │ └── src │ │ │ └── lib.rs │ │ └── src │ │ └── main.rs ├── sel4-ctors-dtors │ ├── Cargo.nix │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── sel4-dlmalloc │ ├── Cargo.nix │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── sel4-driver-interfaces │ ├── Cargo.nix │ ├── Cargo.toml │ └── src │ │ ├── block.rs │ │ ├── lib.rs │ │ ├── net.rs │ │ ├── rtc.rs │ │ ├── serial │ │ ├── mod.rs │ │ └── write_buffered.rs │ │ └── timer.rs ├── sel4-elf-header │ ├── Cargo.nix │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── sel4-generate-target-specs │ ├── Cargo.nix │ ├── Cargo.toml │ ├── build.rs │ └── src │ │ ├── main.rs │ │ └── microkit-resettable.lds ├── sel4-immediate-sync-once-cell │ ├── Cargo.nix │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── sel4-immutable-cell │ ├── Cargo.nix │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── sel4-initialize-tls │ ├── Cargo.nix │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ ├── on_heap.rs │ │ ├── on_stack.rs │ │ ├── set_thread_pointer.rs │ │ └── static_allocation.rs ├── sel4-kernel-loader │ ├── Cargo.nix │ ├── Cargo.toml │ ├── README.md │ ├── add-payload │ │ ├── Cargo.nix │ │ ├── Cargo.toml │ │ └── src │ │ │ ├── args.rs │ │ │ ├── main.rs │ │ │ ├── render_elf.rs │ │ │ └── serialize_payload.rs │ ├── asm │ │ ├── aarch32 │ │ │ ├── head.S │ │ │ ├── macros.h │ │ │ ├── mm.S │ │ │ ├── mm.h │ │ │ ├── psci.S │ │ │ ├── registers.h │ │ │ └── tail.S │ │ ├── aarch64 │ │ │ ├── exception_handler.S │ │ │ ├── head.S │ │ │ ├── macros.h │ │ │ ├── mm.S │ │ │ ├── mm.h │ │ │ ├── registers.h │ │ │ └── tail.S │ │ └── riscv │ │ │ └── head.S │ ├── build.rs │ ├── config-types │ │ ├── Cargo.nix │ │ ├── Cargo.toml │ │ └── src │ │ │ └── lib.rs │ ├── embed-page-tables │ │ ├── Cargo.nix │ │ ├── Cargo.toml │ │ ├── runtime │ │ │ ├── Cargo.nix │ │ │ ├── Cargo.toml │ │ │ └── src │ │ │ │ └── lib.rs │ │ └── src │ │ │ ├── embed.rs │ │ │ ├── glue.rs │ │ │ ├── lib.rs │ │ │ ├── regions.rs │ │ │ ├── scheme.rs │ │ │ └── table.rs │ ├── payload-types │ │ ├── Cargo.nix │ │ ├── Cargo.toml │ │ └── src │ │ │ └── lib.rs │ └── src │ │ ├── arch │ │ ├── arm │ │ │ ├── arch │ │ │ │ ├── aarch32 │ │ │ │ │ ├── drivers │ │ │ │ │ │ ├── mod.rs │ │ │ │ │ │ ├── psci.rs │ │ │ │ │ │ └── spin_table.rs │ │ │ │ │ └── mod.rs │ │ │ │ ├── aarch64 │ │ │ │ │ ├── drivers │ │ │ │ │ │ ├── mod.rs │ │ │ │ │ │ ├── psci.rs │ │ │ │ │ │ └── spin_table.rs │ │ │ │ │ ├── exception_handler.rs │ │ │ │ │ └── mod.rs │ │ │ │ └── mod.rs │ │ │ └── mod.rs │ │ ├── mod.rs │ │ └── riscv │ │ │ └── mod.rs │ │ ├── barrier.rs │ │ ├── fmt.rs │ │ ├── logging.rs │ │ ├── main.rs │ │ ├── plat │ │ ├── bcm2711 │ │ │ └── mod.rs │ │ ├── mod.rs │ │ ├── qemu_arm_virt │ │ │ └── mod.rs │ │ └── riscv_generic │ │ │ └── mod.rs │ │ ├── rt.rs │ │ └── this_image.rs ├── sel4-linux-syscall-types │ ├── Cargo.nix │ ├── Cargo.toml │ └── src │ │ ├── arch │ │ ├── aarch64.rs │ │ ├── arm.rs │ │ ├── mod.rs │ │ ├── riscv32.rs │ │ ├── riscv64.rs │ │ └── x86_64.rs │ │ ├── lib.rs │ │ └── syscall_registers.rs ├── sel4-logging │ ├── Cargo.nix │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ └── synchronized.rs ├── sel4-microkit │ ├── Cargo.nix │ ├── Cargo.toml │ ├── base │ │ ├── Cargo.nix │ │ ├── Cargo.toml │ │ └── src │ │ │ ├── channel.rs │ │ │ ├── defer.rs │ │ │ ├── handler.rs │ │ │ ├── ipc.rs │ │ │ ├── lib.rs │ │ │ ├── message.rs │ │ │ └── symbols.rs │ ├── driver-adapters │ │ ├── Cargo.nix │ │ ├── Cargo.toml │ │ └── src │ │ │ ├── block │ │ │ ├── client.rs │ │ │ ├── driver.rs │ │ │ ├── message_types.rs │ │ │ └── mod.rs │ │ │ ├── lib.rs │ │ │ ├── net │ │ │ ├── client.rs │ │ │ ├── driver.rs │ │ │ ├── message_types.rs │ │ │ └── mod.rs │ │ │ ├── rtc │ │ │ ├── client.rs │ │ │ ├── driver.rs │ │ │ ├── message_types.rs │ │ │ └── mod.rs │ │ │ ├── serial │ │ │ ├── client.rs │ │ │ ├── driver.rs │ │ │ ├── message_types.rs │ │ │ └── mod.rs │ │ │ └── timer │ │ │ ├── client.rs │ │ │ ├── driver.rs │ │ │ ├── message_types.rs │ │ │ └── mod.rs │ ├── macros │ │ ├── Cargo.nix │ │ ├── Cargo.toml │ │ └── src │ │ │ └── lib.rs │ ├── message │ │ ├── Cargo.nix │ │ ├── Cargo.toml │ │ ├── src │ │ │ └── lib.rs │ │ └── types │ │ │ ├── Cargo.nix │ │ │ ├── Cargo.toml │ │ │ └── src │ │ │ ├── lib.rs │ │ │ └── when_postcard.rs │ └── src │ │ ├── entry.rs │ │ ├── heap.rs │ │ ├── lib.rs │ │ ├── panicking.rs │ │ └── printing.rs ├── sel4-mod-in-out-dir │ ├── Cargo.nix │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── sel4-musl │ ├── Cargo.nix │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── sel4-newlib │ ├── Cargo.nix │ ├── Cargo.toml │ ├── build.rs │ └── src │ │ ├── errno.rs │ │ ├── heap.rs │ │ └── lib.rs ├── sel4-one-ref-cell │ ├── Cargo.nix │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── sel4-panicking │ ├── Cargo.nix │ ├── Cargo.toml │ ├── env │ │ ├── Cargo.nix │ │ ├── Cargo.toml │ │ └── src │ │ │ └── lib.rs │ └── src │ │ ├── count │ │ ├── mod.rs │ │ ├── with_tls.rs │ │ └── without_tls.rs │ │ ├── hook.rs │ │ ├── lib.rs │ │ └── strategy │ │ ├── abort │ │ └── mod.rs │ │ ├── mod.rs │ │ └── unwind │ │ ├── mod.rs │ │ ├── with_alloc.rs │ │ └── without_alloc.rs ├── sel4-platform-info │ ├── Cargo.nix │ ├── Cargo.toml │ ├── build.rs │ ├── src │ │ └── lib.rs │ └── types │ │ ├── Cargo.nix │ │ ├── Cargo.toml │ │ └── src │ │ └── lib.rs ├── sel4-reset │ ├── Cargo.nix │ ├── Cargo.toml │ ├── cli │ │ ├── Cargo.nix │ │ ├── Cargo.toml │ │ └── src │ │ │ ├── args.rs │ │ │ └── main.rs │ └── src │ │ └── lib.rs ├── sel4-root-task │ ├── Cargo.nix │ ├── Cargo.toml │ ├── default-test-harness │ │ ├── Cargo.nix │ │ ├── Cargo.toml │ │ └── src │ │ │ └── lib.rs │ ├── macros │ │ ├── Cargo.nix │ │ ├── Cargo.toml │ │ └── src │ │ │ └── lib.rs │ └── src │ │ ├── entry.rs │ │ ├── heap.rs │ │ ├── lib.rs │ │ ├── printing.rs │ │ └── termination.rs ├── sel4-runtime-common │ ├── Cargo.nix │ ├── Cargo.toml │ └── src │ │ ├── abort.rs │ │ ├── lib.rs │ │ ├── start.rs │ │ ├── tls.rs │ │ └── unwinding.rs ├── sel4-shared-memory │ ├── Cargo.nix │ ├── Cargo.toml │ └── src │ │ ├── atomic_ops │ │ ├── generic.rs │ │ ├── mod.rs │ │ └── ordering.rs │ │ ├── lib.rs │ │ └── ops.rs ├── sel4-shared-ring-buffer │ ├── Cargo.nix │ ├── Cargo.toml │ ├── block-io │ │ ├── Cargo.nix │ │ ├── Cargo.toml │ │ ├── src │ │ │ ├── errors.rs │ │ │ ├── lib.rs │ │ │ └── owned.rs │ │ └── types │ │ │ ├── Cargo.nix │ │ │ ├── Cargo.toml │ │ │ └── src │ │ │ └── lib.rs │ ├── bookkeeping │ │ ├── Cargo.nix │ │ ├── Cargo.toml │ │ └── src │ │ │ ├── lib.rs │ │ │ ├── slot_count_tracker.rs │ │ │ ├── slot_set_semaphore.rs │ │ │ └── slot_tracker.rs │ ├── smoltcp │ │ ├── Cargo.nix │ │ ├── Cargo.toml │ │ └── src │ │ │ ├── inner.rs │ │ │ └── lib.rs │ └── src │ │ ├── descriptor.rs │ │ ├── lib.rs │ │ └── roles.rs ├── sel4-stack │ ├── Cargo.nix │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── sel4-sync │ ├── Cargo.nix │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ └── mutex.rs ├── sel4-synthetic-elf │ ├── Cargo.nix │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ ├── patches.rs │ │ └── segments.rs ├── sel4-test-harness │ ├── Cargo.nix │ ├── Cargo.toml │ └── src │ │ ├── config │ │ ├── mod.rs │ │ └── types.rs │ │ ├── entry.rs │ │ ├── for_generated_code │ │ ├── mod.rs │ │ └── types.rs │ │ ├── lib.rs │ │ ├── run_tests.rs │ │ └── short_backtrace.rs └── sel4 │ ├── Cargo.nix │ ├── Cargo.toml │ ├── bitfield-ops │ ├── Cargo.nix │ ├── Cargo.toml │ ├── build.rs │ └── src │ │ └── lib.rs │ ├── build-env │ ├── Cargo.nix │ ├── Cargo.toml │ └── src │ │ └── lib.rs │ ├── config │ ├── Cargo.nix │ ├── Cargo.toml │ ├── build.rs │ ├── data │ │ ├── Cargo.nix │ │ ├── Cargo.toml │ │ ├── build.rs │ │ └── src │ │ │ └── lib.rs │ ├── macros │ │ ├── Cargo.nix │ │ ├── Cargo.toml │ │ └── src │ │ │ ├── generic │ │ │ ├── attr_macros.rs │ │ │ ├── cfg_if.rs │ │ │ ├── common_helpers.rs │ │ │ ├── condition.rs │ │ │ ├── expr_macros.rs │ │ │ └── mod.rs │ │ │ └── lib.rs │ ├── src │ │ └── lib.rs │ └── types │ │ ├── Cargo.nix │ │ ├── Cargo.toml │ │ └── src │ │ └── lib.rs │ ├── src │ ├── arch │ │ ├── arm │ │ │ ├── arch │ │ │ │ ├── aarch32 │ │ │ │ │ ├── fault.rs │ │ │ │ │ ├── mod.rs │ │ │ │ │ ├── object.rs │ │ │ │ │ ├── user_context.rs │ │ │ │ │ └── vcpu_reg.rs │ │ │ │ ├── aarch64 │ │ │ │ │ ├── fault.rs │ │ │ │ │ ├── mod.rs │ │ │ │ │ ├── object.rs │ │ │ │ │ ├── user_context.rs │ │ │ │ │ └── vcpu_reg.rs │ │ │ │ └── mod.rs │ │ │ ├── fault.rs │ │ │ ├── invocations.rs │ │ │ ├── mod.rs │ │ │ ├── object.rs │ │ │ ├── vm_attributes.rs │ │ │ └── vspace.rs │ │ ├── mod.rs │ │ ├── riscv │ │ │ ├── fault.rs │ │ │ ├── invocations.rs │ │ │ ├── mod.rs │ │ │ ├── object.rs │ │ │ ├── user_context.rs │ │ │ ├── vm_attributes.rs │ │ │ └── vspace.rs │ │ └── x86 │ │ │ ├── arch │ │ │ ├── mod.rs │ │ │ └── x64 │ │ │ │ ├── mod.rs │ │ │ │ ├── object.rs │ │ │ │ └── user_context.rs │ │ │ ├── fault.rs │ │ │ ├── invocations.rs │ │ │ ├── mod.rs │ │ │ ├── object.rs │ │ │ ├── vm_attributes.rs │ │ │ └── vspace.rs │ ├── benchmark.rs │ ├── bootinfo.rs │ ├── cap_rights.rs │ ├── cnode_cap_data.rs │ ├── const_helpers.rs │ ├── cptr.rs │ ├── debug.rs │ ├── error.rs │ ├── fault.rs │ ├── helper_macros.rs │ ├── init_thread.rs │ ├── invocation_context.rs │ ├── invocations.rs │ ├── ipc_buffer.rs │ ├── lib.rs │ ├── message_info.rs │ ├── object.rs │ ├── printing.rs │ ├── reply_authority.rs │ ├── state │ │ ├── mod.rs │ │ └── token.rs │ ├── syscalls.rs │ └── vspace.rs │ └── sys │ ├── Cargo.nix │ ├── Cargo.toml │ ├── build │ ├── bf │ │ ├── mod.rs │ │ ├── parser │ │ │ ├── ast.rs │ │ │ ├── grammar.pest │ │ │ └── mod.rs │ │ └── simplified.rs │ ├── c.rs │ ├── main.rs │ └── xml │ │ ├── condition.rs │ │ ├── invocations │ │ ├── mod.rs │ │ └── parse.rs │ │ ├── mod.rs │ │ └── syscalls │ │ ├── mod.rs │ │ └── parse.rs │ └── src │ ├── bf.rs │ ├── c.rs │ ├── fault │ ├── arch │ │ ├── aarch32.rs │ │ ├── aarch64.rs │ │ ├── mod.rs │ │ ├── riscv.rs │ │ └── x86_64.rs │ └── mod.rs │ ├── invocations.rs │ ├── ipc_buffer.rs │ ├── lib.rs │ └── syscalls │ ├── calls.rs │ ├── helpers │ ├── arch │ │ ├── aarch32.rs │ │ ├── aarch64.rs │ │ ├── mod.rs │ │ ├── riscv.rs │ │ └── x86_64.rs │ └── mod.rs │ └── mod.rs ├── default.nix ├── hacking ├── binary-cache │ ├── Makefile │ └── fragment.nix.conf ├── cargo-manifest-management │ ├── .gitignore │ ├── Makefile │ ├── README.md │ ├── default.nix │ ├── direct-dependency-allow-list.toml │ ├── manifest-scope.nix │ ├── manual-manifests.nix │ └── tool │ │ ├── .gitignore │ │ ├── Cargo.lock │ │ ├── Cargo.toml │ │ ├── crates │ │ ├── manage-cargo-manifests │ │ │ ├── Cargo.toml │ │ │ └── src │ │ │ │ └── main.rs │ │ ├── manage-direct-dependency-allow-list │ │ │ ├── Cargo.toml │ │ │ └── src │ │ │ │ └── main.rs │ │ ├── toml-normalize │ │ │ ├── Cargo.toml │ │ │ └── src │ │ │ │ ├── builtin_policies.rs │ │ │ │ ├── format.rs │ │ │ │ ├── lib.rs │ │ │ │ ├── main.rs │ │ │ │ └── policy.rs │ │ └── toml-path-regex │ │ │ ├── Cargo.toml │ │ │ └── src │ │ │ ├── generic_regex.rs │ │ │ ├── grammar.pest │ │ │ ├── lib.rs │ │ │ ├── parse.rs │ │ │ ├── path.rs │ │ │ └── path_segment_predicate.rs │ │ └── make-blueprint.nix ├── docker │ ├── Dockerfile │ ├── Makefile │ └── nix.conf ├── nix │ ├── default.nix │ ├── overlay │ │ ├── default.nix │ │ └── python-overrides.nix │ ├── rust-utils │ │ ├── build-crates-in-layers.nix │ │ ├── build-sysroot.nix │ │ ├── crate-utils.nix │ │ ├── default.nix │ │ ├── prune-lockfile.nix │ │ ├── symlink-to-regular-file.nix │ │ ├── to-toml-file.nix │ │ └── vendor-lockfile.nix │ ├── scope │ │ ├── capdl-tool │ │ │ ├── Makefile │ │ │ ├── MissingH-1.5.0.1.nix │ │ │ ├── base-compat-0-12-2.nix │ │ │ ├── base-compat-batteries-0-12-2.nix │ │ │ ├── capDL-tool.nix │ │ │ └── default.nix │ │ ├── cmake-config-helpers.nix │ │ ├── crates.nix │ │ ├── dafny │ │ │ ├── default.nix │ │ │ └── deps.nix │ │ ├── default.nix │ │ ├── distribution.nix │ │ ├── embed-debug-info.nix │ │ ├── ferrocene │ │ │ ├── .gitignore │ │ │ └── default.nix │ │ ├── kani │ │ │ ├── cbmc-viewer.nix │ │ │ └── default.nix │ │ ├── microkit │ │ │ └── default.nix │ │ ├── musl │ │ │ ├── default.nix │ │ │ ├── dummy-libunwind.nix │ │ │ └── raw.nix │ │ ├── opensbi.nix │ │ ├── plat-utils │ │ │ ├── default.nix │ │ │ ├── qemu │ │ │ │ ├── automate_simple.py │ │ │ │ └── default.nix │ │ │ └── rpi4 │ │ │ │ ├── default.nix │ │ │ │ └── u-boot.nix │ │ ├── prepare-resettable.nix │ │ ├── qemu │ │ │ ├── default.nix │ │ │ └── xilinx.nix │ │ ├── sel4 │ │ │ └── default.nix │ │ ├── sel4test │ │ │ ├── automate.py │ │ │ └── default.nix │ │ ├── shell-for-hacking.nix │ │ ├── shell-for-makefile.nix │ │ ├── sources.nix │ │ ├── verus │ │ │ ├── default.nix │ │ │ └── z3.nix │ │ ├── world │ │ │ ├── capdl │ │ │ │ ├── dummy-capdl-spec.nix │ │ │ │ ├── mk-capdl-initializer-with-spec.nix │ │ │ │ ├── mk-simple-composition-capdl-spec.nix │ │ │ │ ├── mk-small-capdl-initializer.nix │ │ │ │ ├── object-sizes.nix │ │ │ │ ├── sel4-capdl-initializer.nix │ │ │ │ └── serialize-capdl-spec.nix │ │ │ ├── default.nix │ │ │ ├── docs.nix │ │ │ ├── instances │ │ │ │ ├── c.nix │ │ │ │ ├── dafny.nix │ │ │ │ ├── default.nix │ │ │ │ ├── microkit │ │ │ │ │ ├── banscii │ │ │ │ │ │ ├── automate.py │ │ │ │ │ │ └── default.nix │ │ │ │ │ ├── default.nix │ │ │ │ │ └── http-server │ │ │ │ │ │ ├── automate.py │ │ │ │ │ │ ├── default.nix │ │ │ │ │ │ └── mk-disk-image.nix │ │ │ │ ├── test-automation-scripts │ │ │ │ │ └── serial-device.py │ │ │ │ └── verus.nix │ │ │ ├── mk-sel4-kernel-loader-with-payload.nix │ │ │ ├── mk-task.nix │ │ │ ├── sel4-kernel-loader.nix │ │ │ └── shell.nix │ │ └── worlds.nix │ └── top-level │ │ ├── aggregates.nix │ │ ├── default.nix │ │ ├── docs │ │ ├── default.nix │ │ └── index.md │ │ └── overriding.nix ├── scripts │ ├── check-generic-formatting-helper.py │ ├── check-generic-formatting.sh │ └── git-keep.sh ├── src │ └── python │ │ └── capdl_simple_composition │ │ ├── __init__.py │ │ ├── components │ │ ├── __init__.py │ │ ├── base.py │ │ └── elf.py │ │ ├── composition.py │ │ ├── device_tree.py │ │ ├── kernel_config.py │ │ └── utils.py └── unstable-feature-monitoring │ ├── Makefile │ ├── enumerate-crates-using-unstable-features.sh │ ├── enumerate-used-unstable-features.sh │ ├── extra-used-unstable-features.rs │ ├── notes.md │ └── wishlist │ ├── .gitignore │ ├── Cargo.lock │ ├── Cargo.toml │ └── src │ └── lib.rs ├── rust-toolchain.toml ├── rustfmt.toml └── support └── targets ├── README.md ├── aarch64-sel4-microkit-minimal.json ├── aarch64-sel4-microkit-resettable-minimal.json ├── aarch64-sel4-microkit-resettable-unwind.json ├── aarch64-sel4-microkit-resettable.json ├── aarch64-sel4-microkit-unwind.json ├── aarch64-sel4-microkit.json ├── aarch64-sel4-minimal.json ├── aarch64-sel4-musl.json ├── aarch64-sel4-unwind-musl.json ├── aarch64-sel4-unwind.json ├── aarch64-sel4.json ├── armv7a-sel4-minimal.json ├── armv7a-sel4-musl.json ├── armv7a-sel4.json ├── riscv32imac-sel4-minimal.json ├── riscv32imac-sel4-musl.json ├── riscv32imac-sel4-unwind-musl.json ├── riscv32imac-sel4-unwind.json ├── riscv32imac-sel4.json ├── riscv32imafc-sel4-minimal.json ├── riscv32imafc-sel4-musl.json ├── riscv32imafc-sel4-unwind-musl.json ├── riscv32imafc-sel4-unwind.json ├── riscv32imafc-sel4.json ├── riscv64gc-sel4-microkit-minimal.json ├── riscv64gc-sel4-microkit-resettable-minimal.json ├── riscv64gc-sel4-microkit-resettable-unwind.json ├── riscv64gc-sel4-microkit-resettable.json ├── riscv64gc-sel4-microkit-unwind.json ├── riscv64gc-sel4-microkit.json ├── riscv64gc-sel4-minimal.json ├── riscv64gc-sel4-musl.json ├── riscv64gc-sel4-unwind-musl.json ├── riscv64gc-sel4-unwind.json ├── riscv64gc-sel4.json ├── riscv64imac-sel4-microkit-minimal.json ├── riscv64imac-sel4-microkit-resettable-minimal.json ├── riscv64imac-sel4-microkit-resettable-unwind.json ├── riscv64imac-sel4-microkit-resettable.json ├── riscv64imac-sel4-microkit-unwind.json ├── riscv64imac-sel4-microkit.json ├── riscv64imac-sel4-minimal.json ├── riscv64imac-sel4-musl.json ├── riscv64imac-sel4-unwind-musl.json ├── riscv64imac-sel4-unwind.json ├── riscv64imac-sel4.json ├── x86_64-sel4-minimal.json ├── x86_64-sel4-musl.json ├── x86_64-sel4-unwind-musl.json ├── x86_64-sel4-unwind.json └── x86_64-sel4.json /.cargo/config.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | [unstable] 8 | unstable-options = true 9 | 10 | [env] 11 | RUST_TARGET_PATH = { value = "support/targets", relative = true } 12 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | * @nspin 8 | -------------------------------------------------------------------------------- /.github/CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | 6 | 7 | # Code of Conduct 8 | 9 | This repository and interactions with it fall under the [seL4 Code of Conduct][1] available from the [seL4 website][2]. 10 | 11 | [1]: https://docs.sel4.systems/processes/conduct.html 12 | [2]: https://sel4.systems 13 | -------------------------------------------------------------------------------- /.github/workflows/pr.yml: -------------------------------------------------------------------------------- 1 | # Copyright 2025, Proofcraft Pty Ltd 2 | # 3 | # SPDX-License-Identifier: BSD-2-Clause 4 | 5 | # Actions to run on pull requests 6 | 7 | name: PR 8 | 9 | on: [pull_request, workflow_dispatch] 10 | 11 | jobs: 12 | pr-checks: 13 | name: Checks 14 | uses: seL4/ci-actions/.github/workflows/pr.yml@master 15 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | /target/ 8 | /out/ 9 | /tmp/ 10 | 11 | result 12 | result-* 13 | 14 | __pycache__ 15 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2024, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause 5 | // 6 | 7 | { 8 | "rust-analyzer.statusBar.clickAction": "stopServer", 9 | "rust-analyzer.linkedProjects": [ 10 | "/var/empty/Cargo.toml" 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /VERSION: -------------------------------------------------------------------------------- 1 | 1.0.0-dev 2 | -------------------------------------------------------------------------------- /crates/drivers/bcm2835-aux-uart/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2024, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, versions, localCrates }: 8 | 9 | mk { 10 | package.name = "sel4-bcm2835-aux-uart-driver"; 11 | dependencies = { 12 | inherit (versions) tock-registers embedded-hal-nb; 13 | inherit (localCrates) sel4-driver-interfaces; 14 | }; 15 | } 16 | -------------------------------------------------------------------------------- /crates/drivers/bcm2835-aux-uart/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | # 7 | # This file is generated from './Cargo.nix'. You can edit this file directly 8 | # if you are not using this project's Cargo manifest management tools. 9 | # See 'hacking/cargo-manifest-management/README.md' for more information. 10 | # 11 | 12 | [package] 13 | name = "sel4-bcm2835-aux-uart-driver" 14 | version = "0.1.0" 15 | authors = ["Nick Spinale "] 16 | edition = "2021" 17 | license = "BSD-2-Clause" 18 | 19 | [dependencies] 20 | embedded-hal-nb = "1.0" 21 | sel4-driver-interfaces = { path = "../../sel4-driver-interfaces" } 22 | tock-registers = "0.9.0" 23 | -------------------------------------------------------------------------------- /crates/drivers/pl011/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, versions, localCrates }: 8 | 9 | mk { 10 | package.name = "sel4-pl011-driver"; 11 | dependencies = { 12 | inherit (versions) tock-registers embedded-hal-nb; 13 | inherit (localCrates) sel4-driver-interfaces; 14 | }; 15 | } 16 | -------------------------------------------------------------------------------- /crates/drivers/pl011/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | # 7 | # This file is generated from './Cargo.nix'. You can edit this file directly 8 | # if you are not using this project's Cargo manifest management tools. 9 | # See 'hacking/cargo-manifest-management/README.md' for more information. 10 | # 11 | 12 | [package] 13 | name = "sel4-pl011-driver" 14 | version = "0.1.0" 15 | authors = ["Nick Spinale "] 16 | edition = "2021" 17 | license = "BSD-2-Clause" 18 | 19 | [dependencies] 20 | embedded-hal-nb = "1.0" 21 | sel4-driver-interfaces = { path = "../../sel4-driver-interfaces" } 22 | tock-registers = "0.9.0" 23 | -------------------------------------------------------------------------------- /crates/drivers/pl031/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2024, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, versions, localCrates }: 8 | 9 | mk { 10 | package.name = "sel4-pl031-driver"; 11 | dependencies = { 12 | inherit (versions) tock-registers rtcc; 13 | }; 14 | } 15 | -------------------------------------------------------------------------------- /crates/drivers/pl031/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | # 7 | # This file is generated from './Cargo.nix'. You can edit this file directly 8 | # if you are not using this project's Cargo manifest management tools. 9 | # See 'hacking/cargo-manifest-management/README.md' for more information. 10 | # 11 | 12 | [package] 13 | name = "sel4-pl031-driver" 14 | version = "0.1.0" 15 | authors = ["Nick Spinale "] 16 | edition = "2021" 17 | license = "BSD-2-Clause" 18 | 19 | [dependencies] 20 | rtcc = "0.3.2" 21 | tock-registers = "0.9.0" 22 | -------------------------------------------------------------------------------- /crates/drivers/sp804/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2024, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, versions, localCrates }: 8 | 9 | mk { 10 | package.name = "sel4-sp804-driver"; 11 | dependencies = { 12 | inherit (versions) tock-registers; 13 | inherit (localCrates) sel4-driver-interfaces; 14 | }; 15 | } 16 | -------------------------------------------------------------------------------- /crates/drivers/sp804/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | # 7 | # This file is generated from './Cargo.nix'. You can edit this file directly 8 | # if you are not using this project's Cargo manifest management tools. 9 | # See 'hacking/cargo-manifest-management/README.md' for more information. 10 | # 11 | 12 | [package] 13 | name = "sel4-sp804-driver" 14 | version = "0.1.0" 15 | authors = ["Nick Spinale "] 16 | edition = "2021" 17 | license = "BSD-2-Clause" 18 | 19 | [dependencies] 20 | sel4-driver-interfaces = { path = "../../sel4-driver-interfaces" } 21 | tock-registers = "0.9.0" 22 | -------------------------------------------------------------------------------- /crates/drivers/virtio/blk/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2024, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, versions, localCrates, virtioDriversWith }: 8 | 9 | mk { 10 | package.name = "sel4-virtio-blk"; 11 | dependencies = { 12 | inherit (versions) log; 13 | virtio-drivers = virtioDriversWith []; 14 | inherit (localCrates) sel4-driver-interfaces; 15 | }; 16 | } 17 | -------------------------------------------------------------------------------- /crates/drivers/virtio/blk/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | # 7 | # This file is generated from './Cargo.nix'. You can edit this file directly 8 | # if you are not using this project's Cargo manifest management tools. 9 | # See 'hacking/cargo-manifest-management/README.md' for more information. 10 | # 11 | 12 | [package] 13 | name = "sel4-virtio-blk" 14 | version = "0.1.0" 15 | authors = ["Nick Spinale "] 16 | edition = "2021" 17 | license = "BSD-2-Clause" 18 | 19 | [dependencies] 20 | log = "0.4.17" 21 | sel4-driver-interfaces = { path = "../../../sel4-driver-interfaces" } 22 | virtio-drivers = { version = "0.7.2", default-features = false } 23 | -------------------------------------------------------------------------------- /crates/drivers/virtio/hal-impl/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, versions, localCrates, virtioDriversWith }: 8 | 9 | mk { 10 | package.name = "sel4-virtio-hal-impl"; 11 | dependencies = { 12 | inherit (versions) 13 | one-shot-mutex 14 | ; 15 | virtio-drivers = virtioDriversWith []; 16 | inherit (localCrates) 17 | sel4-immediate-sync-once-cell 18 | sel4-shared-memory 19 | sel4-abstract-allocator 20 | ; 21 | }; 22 | } 23 | -------------------------------------------------------------------------------- /crates/examples/microkit/banscii/pds/artist/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, versions, localCrates }: 8 | 9 | mk { 10 | package.name = "banscii-artist"; 11 | dependencies = { 12 | rsa = { version = versions.rsa; default-features = false; features = [ "pem" "sha2" ]; }; 13 | inherit (localCrates) 14 | sel4-microkit-message 15 | sel4-shared-memory 16 | banscii-artist-interface-types 17 | ; 18 | sel4-microkit = localCrates.sel4-microkit // { features = [ "alloc" ]; }; 19 | }; 20 | build-dependencies = { 21 | inherit (versions) rsa; 22 | }; 23 | } 24 | -------------------------------------------------------------------------------- /crates/examples/microkit/banscii/pds/artist/build.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause 5 | // 6 | 7 | use std::env; 8 | use std::fs; 9 | use std::path::PathBuf; 10 | 11 | use rsa::pkcs1::EncodeRsaPrivateKey; 12 | 13 | const RSA_KEY_SIZE: usize = 2048; 14 | 15 | fn main() { 16 | let priv_key = rsa::RsaPrivateKey::new(&mut rsa::rand_core::OsRng, RSA_KEY_SIZE).unwrap(); 17 | let priv_key_pem = priv_key.to_pkcs1_pem(rsa::pkcs1::LineEnding::LF).unwrap(); 18 | let out_dir = env::var("OUT_DIR").unwrap(); 19 | let out_path = PathBuf::from(&out_dir).join("priv.pem"); 20 | fs::write(out_path, &priv_key_pem).unwrap(); 21 | 22 | // No external dependencies 23 | println!("cargo:rerun-if-changed=build.rs"); 24 | } 25 | -------------------------------------------------------------------------------- /crates/examples/microkit/banscii/pds/artist/interface-types/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, versions, serdeWith }: 8 | 9 | mk { 10 | package.name = "banscii-artist-interface-types"; 11 | dependencies = { 12 | serde = serdeWith []; 13 | }; 14 | } 15 | -------------------------------------------------------------------------------- /crates/examples/microkit/banscii/pds/artist/interface-types/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | # 7 | # This file is generated from './Cargo.nix'. You can edit this file directly 8 | # if you are not using this project's Cargo manifest management tools. 9 | # See 'hacking/cargo-manifest-management/README.md' for more information. 10 | # 11 | 12 | [package] 13 | name = "banscii-artist-interface-types" 14 | version = "0.1.0" 15 | authors = ["Nick Spinale "] 16 | edition = "2021" 17 | license = "BSD-2-Clause" 18 | 19 | [dependencies] 20 | serde = { version = "1.0.147", default-features = false } 21 | -------------------------------------------------------------------------------- /crates/examples/microkit/banscii/pds/artist/interface-types/src/lib.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause 5 | // 6 | 7 | #![no_std] 8 | 9 | use serde::{Deserialize, Serialize}; 10 | 11 | #[derive(Debug, Serialize, Deserialize)] 12 | pub struct Request { 13 | pub height: usize, 14 | pub width: usize, 15 | pub draft_start: usize, 16 | pub draft_size: usize, 17 | } 18 | 19 | #[derive(Debug, Serialize, Deserialize)] 20 | pub struct Response { 21 | pub height: usize, 22 | pub width: usize, 23 | pub masterpiece_start: usize, 24 | pub masterpiece_size: usize, 25 | pub signature_start: usize, 26 | pub signature_size: usize, 27 | } 28 | -------------------------------------------------------------------------------- /crates/examples/microkit/banscii/pds/artist/src/cryptographic_secrets.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause 5 | // 6 | 7 | use rsa::pkcs1::DecodeRsaPrivateKey; 8 | use rsa::pkcs1v15::{Signature, SigningKey}; 9 | use rsa::sha2::Sha256; 10 | use rsa::signature::Signer; 11 | use rsa::RsaPrivateKey; 12 | 13 | const PRIV_KEY_PEM: &str = include_str!(concat!(env!("OUT_DIR"), "/priv.pem")); 14 | 15 | fn get_priv_key() -> RsaPrivateKey { 16 | RsaPrivateKey::from_pkcs1_pem(PRIV_KEY_PEM).unwrap() 17 | } 18 | 19 | pub(crate) fn sign(data: &[u8]) -> Signature { 20 | let signing_key = SigningKey::::new(get_priv_key()); 21 | signing_key.sign(data) 22 | } 23 | -------------------------------------------------------------------------------- /crates/examples/microkit/banscii/pds/assistant/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, versions, localCrates }: 8 | 9 | mk { 10 | package.name = "banscii-assistant"; 11 | dependencies = { 12 | inherit (versions) embedded-hal-nb; 13 | hex = { version = versions.hex; default-features = false; features = [ "alloc" ]; }; 14 | inherit (localCrates) 15 | sel4-microkit-message 16 | sel4-microkit-driver-adapters 17 | sel4-shared-memory 18 | banscii-assistant-core 19 | banscii-artist-interface-types 20 | ; 21 | sel4-microkit = localCrates.sel4-microkit // { features = [ "alloc" ]; }; 22 | }; 23 | } 24 | -------------------------------------------------------------------------------- /crates/examples/microkit/banscii/pds/assistant/core/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, versions }: 8 | 9 | mk { 10 | package.name = "banscii-assistant-core"; 11 | dependencies = { 12 | inherit (versions) log; 13 | ab_glyph = { version = versions.ab_glyph; default-features = false; features = [ "libm" ]; }; 14 | num-traits = { version = versions.num-traits; default-features = false; features = [ "libm" ]; }; 15 | }; 16 | } 17 | -------------------------------------------------------------------------------- /crates/examples/microkit/banscii/pds/assistant/core/assets/fonts/rock-salt/RockSalt-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seL4/rust-sel4/64c8fb58bb1a5db9b50226d4d8821120ab88ab14/crates/examples/microkit/banscii/pds/assistant/core/assets/fonts/rock-salt/RockSalt-Regular.ttf -------------------------------------------------------------------------------- /crates/examples/microkit/banscii/pds/assistant/core/test/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, localCrates, versions }: 8 | 9 | mk { 10 | package.name = "banscii-assistant-core-test"; 11 | dependencies = { 12 | inherit (versions) log env_logger; 13 | inherit (localCrates) banscii-assistant-core; 14 | }; 15 | } 16 | -------------------------------------------------------------------------------- /crates/examples/microkit/banscii/pds/assistant/core/test/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | # 7 | # This file is generated from './Cargo.nix'. You can edit this file directly 8 | # if you are not using this project's Cargo manifest management tools. 9 | # See 'hacking/cargo-manifest-management/README.md' for more information. 10 | # 11 | 12 | [package] 13 | name = "banscii-assistant-core-test" 14 | version = "0.1.0" 15 | authors = ["Nick Spinale "] 16 | edition = "2021" 17 | license = "BSD-2-Clause" 18 | 19 | [dependencies] 20 | banscii-assistant-core = { path = ".." } 21 | env_logger = "0.11.5" 22 | log = "0.4.17" 23 | -------------------------------------------------------------------------------- /crates/examples/microkit/banscii/pds/serial-driver/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, localCrates, versions }: 8 | 9 | mk { 10 | package.name = "banscii-serial-driver"; 11 | dependencies = { 12 | inherit (localCrates) 13 | sel4-microkit 14 | sel4-microkit-message 15 | sel4-microkit-driver-adapters 16 | ; 17 | sel4-pl011-driver = localCrates.sel4-pl011-driver // { optional = true; }; 18 | }; 19 | features = { 20 | board-qemu_virt_aarch64 = [ "sel4-pl011-driver" ]; 21 | }; 22 | } 23 | -------------------------------------------------------------------------------- /crates/examples/microkit/banscii/pds/serial-driver/src/main.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause 5 | // 6 | 7 | #![no_std] 8 | #![no_main] 9 | 10 | use sel4_microkit::{memory_region_symbol, protection_domain, Channel, Handler}; 11 | use sel4_microkit_driver_adapters::serial::driver::HandlerImpl; 12 | 13 | #[cfg(feature = "board-qemu_virt_aarch64")] 14 | use sel4_pl011_driver::Driver; 15 | 16 | const DEVICE: Channel = Channel::new(0); 17 | const ASSISTANT: Channel = Channel::new(1); 18 | 19 | #[protection_domain] 20 | fn init() -> impl Handler { 21 | let driver = 22 | unsafe { Driver::new(memory_region_symbol!(serial_register_block: *mut ()).as_ptr()) }; 23 | HandlerImpl::new(driver, DEVICE, ASSISTANT) 24 | } 25 | -------------------------------------------------------------------------------- /crates/examples/microkit/hello/hello.system: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /crates/examples/microkit/hello/pds/hello/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, localCrates }: 8 | 9 | mk { 10 | package.name = "microkit-hello"; 11 | dependencies = { 12 | inherit (localCrates) sel4-microkit; 13 | }; 14 | } 15 | -------------------------------------------------------------------------------- /crates/examples/microkit/hello/pds/hello/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | # 7 | # This file is generated from './Cargo.nix'. You can edit this file directly 8 | # if you are not using this project's Cargo manifest management tools. 9 | # See 'hacking/cargo-manifest-management/README.md' for more information. 10 | # 11 | 12 | [package] 13 | name = "microkit-hello" 14 | version = "0.1.0" 15 | authors = ["Nick Spinale "] 16 | edition = "2021" 17 | license = "BSD-2-Clause" 18 | 19 | [dependencies] 20 | sel4-microkit = { path = "../../../../../sel4-microkit" } 21 | -------------------------------------------------------------------------------- /crates/examples/microkit/hello/pds/hello/src/main.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause 5 | // 6 | 7 | #![no_std] 8 | #![no_main] 9 | 10 | use sel4_microkit::{debug_println, protection_domain, Handler, Infallible}; 11 | 12 | #[protection_domain] 13 | fn init() -> HandlerImpl { 14 | debug_println!("Hello, World!"); 15 | HandlerImpl 16 | } 17 | 18 | struct HandlerImpl; 19 | 20 | impl Handler for HandlerImpl { 21 | type Error = Infallible; 22 | } 23 | -------------------------------------------------------------------------------- /crates/examples/microkit/http-server/pds/pl031-driver/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, localCrates, versions }: 8 | 9 | mk { 10 | package.name = "microkit-http-server-example-pl031-driver"; 11 | dependencies = { 12 | inherit (localCrates) 13 | sel4-pl031-driver 14 | sel4-microkit 15 | sel4-microkit-driver-adapters 16 | ; 17 | }; 18 | } 19 | -------------------------------------------------------------------------------- /crates/examples/microkit/http-server/pds/pl031-driver/src/main.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause 5 | // 6 | 7 | #![no_std] 8 | #![no_main] 9 | 10 | use sel4_microkit::{memory_region_symbol, protection_domain, Channel, Handler}; 11 | use sel4_microkit_driver_adapters::rtc::driver::HandlerImpl; 12 | use sel4_pl031_driver::Driver; 13 | 14 | const _DEVICE: Channel = Channel::new(0); 15 | const CLIENT: Channel = Channel::new(1); 16 | 17 | #[protection_domain] 18 | fn init() -> impl Handler { 19 | let driver = unsafe { Driver::new(memory_region_symbol!(pl031_mmio_vaddr: *mut ()).as_ptr()) }; 20 | HandlerImpl::new(driver, CLIENT) 21 | } 22 | -------------------------------------------------------------------------------- /crates/examples/microkit/http-server/pds/server/build.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause 5 | // 6 | 7 | use std::env; 8 | use std::fs; 9 | use std::path::PathBuf; 10 | 11 | use rcgen::generate_simple_self_signed; 12 | 13 | fn main() { 14 | let subject_alt_names = vec!["localhost".to_string()]; 15 | let cert = generate_simple_self_signed(subject_alt_names).unwrap(); 16 | let out_dir = env::var("OUT_DIR").unwrap(); 17 | let cert_path = PathBuf::from(&out_dir).join("cert.pem"); 18 | fs::write(cert_path, cert.cert.pem()).unwrap(); 19 | let priv_path = PathBuf::from(&out_dir).join("priv.pem"); 20 | fs::write(priv_path, cert.key_pair.serialize_pem()).unwrap(); 21 | } 22 | -------------------------------------------------------------------------------- /crates/examples/microkit/http-server/pds/server/src/config.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause 5 | // 6 | 7 | pub mod channels { 8 | use sel4_microkit::Channel; 9 | 10 | pub const RTC_DRIVER: Channel = Channel::new(0); 11 | pub const TIMER_DRIVER: Channel = Channel::new(1); 12 | pub const NET_DRIVER: Channel = Channel::new(2); 13 | pub const BLOCK_DRIVER: Channel = Channel::new(3); 14 | } 15 | 16 | pub const VIRTIO_NET_CLIENT_DMA_SIZE: usize = 0x200_000; 17 | pub const VIRTIO_BLK_CLIENT_DMA_SIZE: usize = 0x200_000; 18 | -------------------------------------------------------------------------------- /crates/examples/microkit/http-server/pds/sp804-driver/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, localCrates, versions }: 8 | 9 | mk { 10 | package.name = "microkit-http-server-example-sp804-driver"; 11 | dependencies = { 12 | inherit (localCrates) 13 | sel4-microkit 14 | sel4-microkit-message 15 | sel4-microkit-driver-adapters 16 | sel4-driver-interfaces 17 | sel4-sp804-driver 18 | ; 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /crates/examples/microkit/http-server/pds/virtio-blk-driver/src/config.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause 5 | // 6 | 7 | pub mod channels { 8 | use sel4_microkit::Channel; 9 | 10 | pub const DEVICE: Channel = Channel::new(0); 11 | pub const CLIENT: Channel = Channel::new(1); 12 | } 13 | 14 | pub const VIRTIO_BLK_MMIO_OFFSET: usize = 0xc00; 15 | pub const VIRTIO_BLK_DRIVER_DMA_SIZE: usize = 0x200_000; 16 | pub const VIRTIO_BLK_CLIENT_DMA_SIZE: usize = 0x200_000; 17 | -------------------------------------------------------------------------------- /crates/examples/microkit/http-server/pds/virtio-net-driver/src/config.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause 5 | // 6 | 7 | pub mod channels { 8 | use sel4_microkit::Channel; 9 | 10 | pub const DEVICE: Channel = Channel::new(0); 11 | pub const CLIENT: Channel = Channel::new(1); 12 | } 13 | 14 | pub const VIRTIO_NET_MMIO_OFFSET: usize = 0xe00; 15 | pub const VIRTIO_NET_DRIVER_DMA_SIZE: usize = 0x200_000; 16 | pub const VIRTIO_NET_CLIENT_DMA_SIZE: usize = 0x200_000; 17 | -------------------------------------------------------------------------------- /crates/examples/root-task/example-root-task-without-runtime/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, localCrates, versions }: 8 | 9 | mk { 10 | package.name = "example-root-task-without-runtime"; 11 | dependencies = { 12 | inherit (versions) cfg-if; 13 | sel4 = localCrates.sel4 // { default-features = false; }; 14 | }; 15 | } 16 | -------------------------------------------------------------------------------- /crates/examples/root-task/example-root-task-without-runtime/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | # 7 | # This file is generated from './Cargo.nix'. You can edit this file directly 8 | # if you are not using this project's Cargo manifest management tools. 9 | # See 'hacking/cargo-manifest-management/README.md' for more information. 10 | # 11 | 12 | [package] 13 | name = "example-root-task-without-runtime" 14 | version = "0.1.0" 15 | authors = ["Nick Spinale "] 16 | edition = "2021" 17 | license = "BSD-2-Clause" 18 | 19 | [dependencies] 20 | cfg-if = "1.0.0" 21 | sel4 = { path = "../../../sel4", default-features = false } 22 | -------------------------------------------------------------------------------- /crates/examples/root-task/example-root-task/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, localCrates }: 8 | 9 | mk { 10 | package.name = "example-root-task"; 11 | dependencies = { 12 | inherit (localCrates) 13 | sel4 14 | sel4-root-task 15 | ; 16 | }; 17 | } 18 | -------------------------------------------------------------------------------- /crates/examples/root-task/example-root-task/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | # 7 | # This file is generated from './Cargo.nix'. You can edit this file directly 8 | # if you are not using this project's Cargo manifest management tools. 9 | # See 'hacking/cargo-manifest-management/README.md' for more information. 10 | # 11 | 12 | [package] 13 | name = "example-root-task" 14 | version = "0.1.0" 15 | authors = ["Nick Spinale "] 16 | edition = "2021" 17 | license = "BSD-2-Clause" 18 | 19 | [dependencies] 20 | sel4 = { path = "../../../sel4" } 21 | sel4-root-task = { path = "../../../sel4-root-task" } 22 | -------------------------------------------------------------------------------- /crates/examples/root-task/hello/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, localCrates }: 8 | 9 | mk { 10 | package.name = "hello"; 11 | dependencies = { 12 | inherit (localCrates) 13 | sel4 14 | sel4-root-task 15 | ; 16 | }; 17 | } 18 | -------------------------------------------------------------------------------- /crates/examples/root-task/hello/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | # 7 | # This file is generated from './Cargo.nix'. You can edit this file directly 8 | # if you are not using this project's Cargo manifest management tools. 9 | # See 'hacking/cargo-manifest-management/README.md' for more information. 10 | # 11 | 12 | [package] 13 | name = "hello" 14 | version = "0.1.0" 15 | authors = ["Nick Spinale "] 16 | edition = "2021" 17 | license = "BSD-2-Clause" 18 | 19 | [dependencies] 20 | sel4 = { path = "../../../sel4" } 21 | sel4-root-task = { path = "../../../sel4-root-task" } 22 | -------------------------------------------------------------------------------- /crates/examples/root-task/hello/src/main.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause 5 | // 6 | 7 | #![no_std] 8 | #![no_main] 9 | 10 | use sel4_root_task::root_task; 11 | 12 | #[root_task] 13 | fn main(_bootinfo: &sel4::BootInfoPtr) -> ! { 14 | sel4::debug_println!("Hello, World!"); 15 | 16 | sel4::init_thread::suspend_self() 17 | } 18 | -------------------------------------------------------------------------------- /crates/examples/root-task/serial-device/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2024, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, versions, localCrates }: 8 | 9 | mk { 10 | package.name = "serial-device"; 11 | dependencies = { 12 | inherit (versions) tock-registers; 13 | inherit (localCrates) 14 | sel4 15 | sel4-root-task 16 | ; 17 | }; 18 | } 19 | -------------------------------------------------------------------------------- /crates/examples/root-task/serial-device/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | # 7 | # This file is generated from './Cargo.nix'. You can edit this file directly 8 | # if you are not using this project's Cargo manifest management tools. 9 | # See 'hacking/cargo-manifest-management/README.md' for more information. 10 | # 11 | 12 | [package] 13 | name = "serial-device" 14 | version = "0.1.0" 15 | authors = ["Nick Spinale "] 16 | edition = "2021" 17 | license = "BSD-2-Clause" 18 | 19 | [dependencies] 20 | sel4 = { path = "../../../sel4" } 21 | sel4-root-task = { path = "../../../sel4-root-task" } 22 | tock-registers = "0.9.0" 23 | -------------------------------------------------------------------------------- /crates/examples/root-task/spawn-task/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2024, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, versions, localCrates }: 8 | 9 | mk { 10 | package.name = "spawn-task"; 11 | dependencies = { 12 | object = { version = versions.object; default-features = false; features = [ "read" ]; }; 13 | inherit (localCrates) 14 | sel4 15 | sel4-root-task 16 | ; 17 | }; 18 | } 19 | -------------------------------------------------------------------------------- /crates/examples/root-task/spawn-task/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | # 7 | # This file is generated from './Cargo.nix'. You can edit this file directly 8 | # if you are not using this project's Cargo manifest management tools. 9 | # See 'hacking/cargo-manifest-management/README.md' for more information. 10 | # 11 | 12 | [package] 13 | name = "spawn-task" 14 | version = "0.1.0" 15 | authors = ["Nick Spinale "] 16 | edition = "2021" 17 | license = "BSD-2-Clause" 18 | 19 | [dependencies] 20 | object = { version = "0.36.5", default-features = false, features = ["read"] } 21 | sel4 = { path = "../../../sel4" } 22 | sel4-root-task = { path = "../../../sel4-root-task" } 23 | -------------------------------------------------------------------------------- /crates/examples/root-task/spawn-task/child/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2024, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, versions, localCrates }: 8 | 9 | mk { 10 | package.name = "spawn-task-child"; 11 | dependencies = { 12 | inherit (versions) 13 | cfg-if 14 | one-shot-mutex 15 | ; 16 | inherit (localCrates) 17 | sel4 18 | sel4-panicking-env 19 | sel4-dlmalloc 20 | ; 21 | sel4-panicking = localCrates.sel4-panicking // { 22 | features = [ "alloc" ]; 23 | }; 24 | sel4-runtime-common = localCrates.sel4-runtime-common // { 25 | features = [ "full" ]; 26 | }; 27 | }; 28 | } 29 | -------------------------------------------------------------------------------- /crates/examples/root-task/spawn-task/child/src/main.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2024, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause 5 | // 6 | 7 | #![no_std] 8 | #![no_main] 9 | 10 | mod runtime; 11 | 12 | fn main() -> ! { 13 | sel4::debug_println!("In child task"); 14 | 15 | sel4::cap::Notification::from_bits(1).signal(); 16 | 17 | sel4::cap::Tcb::from_bits(2).tcb_suspend().unwrap(); 18 | 19 | unreachable!() 20 | } 21 | -------------------------------------------------------------------------------- /crates/examples/root-task/spawn-thread/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2024, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, versions, localCrates }: 8 | 9 | mk { 10 | package.name = "spawn-thread"; 11 | dependencies = { 12 | inherit (versions) cfg-if; 13 | inherit (localCrates) 14 | sel4 15 | sel4-root-task 16 | sel4-elf-header 17 | sel4-stack 18 | ; 19 | sel4-initialize-tls = localCrates.sel4-initialize-tls // { features = [ "on-heap" ]; }; 20 | }; 21 | } 22 | -------------------------------------------------------------------------------- /crates/private/support/sel4-root-task-with-std/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, localCrates }: 8 | 9 | mk { 10 | package.name = "sel4-root-task-with-std"; 11 | dependencies = { 12 | inherit (localCrates) 13 | sel4 14 | sel4-panicking-env 15 | ; 16 | sel4-runtime-common = localCrates.sel4-runtime-common // { features = [ "full" ]; }; 17 | }; 18 | features = { 19 | single-threaded = [ 20 | "sel4/single-threaded" 21 | ]; 22 | }; 23 | } 24 | -------------------------------------------------------------------------------- /crates/private/support/sel4-simple-task/config-types/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, localCrates, versions, serdeWith }: 8 | 9 | mk { 10 | package.name = "sel4-simple-task-config-types"; 11 | dependencies = { 12 | inherit (versions) cfg-if; 13 | serde = serdeWith [ "derive" ]; 14 | }; 15 | target."cfg(target_os = \"none\")".dependencies = { 16 | inherit (localCrates) 17 | sel4 18 | sel4-simple-task-threading 19 | ; 20 | }; 21 | } 22 | -------------------------------------------------------------------------------- /crates/private/support/sel4-simple-task/rpc/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, localCrates, serdeWith, postcardWith }: 8 | 9 | mk { 10 | package.name = "sel4-simple-task-rpc"; 11 | dependencies = { 12 | serde = serdeWith [] // { optional = true; }; 13 | postcard = postcardWith [] // { optional = true; }; 14 | inherit (localCrates) sel4; 15 | }; 16 | features = { 17 | postcard = [ 18 | "dep:serde" 19 | "dep:postcard" 20 | ]; 21 | }; 22 | } 23 | -------------------------------------------------------------------------------- /crates/private/support/sel4-simple-task/rpc/src/lib.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause 5 | // 6 | 7 | #![no_std] 8 | 9 | #[cfg(feature = "postcard")] 10 | pub mod easy; 11 | -------------------------------------------------------------------------------- /crates/private/support/sel4-simple-task/runtime/config/cli/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, localCrates, versions }: 8 | 9 | mk { 10 | package.name = "sel4-simple-task-runtime-config-cli"; 11 | dependencies = { 12 | inherit (versions) serde_json; 13 | sel4-simple-task-runtime-config-types = localCrates.sel4-simple-task-runtime-config-types // { 14 | features = [ "serde" "alloc" ]; 15 | }; 16 | }; 17 | } 18 | -------------------------------------------------------------------------------- /crates/private/support/sel4-simple-task/runtime/config/cli/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | # 7 | # This file is generated from './Cargo.nix'. You can edit this file directly 8 | # if you are not using this project's Cargo manifest management tools. 9 | # See 'hacking/cargo-manifest-management/README.md' for more information. 10 | # 11 | 12 | [package] 13 | name = "sel4-simple-task-runtime-config-cli" 14 | version = "0.1.0" 15 | authors = ["Nick Spinale "] 16 | edition = "2021" 17 | license = "BSD-2-Clause" 18 | 19 | [dependencies] 20 | sel4-simple-task-runtime-config-types = { path = "../types", features = ["serde", "alloc"] } 21 | serde_json = "1.0.87" 22 | -------------------------------------------------------------------------------- /crates/private/support/sel4-simple-task/runtime/config/types/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, versions, zerocopyWith, serdeWith }: 8 | 9 | mk { 10 | package.name = "sel4-simple-task-runtime-config-types"; 11 | dependencies = { 12 | serde = serdeWith [ "derive" ] // { optional = true; }; 13 | zerocopy = zerocopyWith [ "derive" ]; 14 | }; 15 | features = { 16 | alloc = [ 17 | "serde?/alloc" 18 | ]; 19 | serde = [ 20 | "dep:serde" 21 | ]; 22 | }; 23 | } 24 | -------------------------------------------------------------------------------- /crates/private/support/sel4-simple-task/runtime/macros/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, versions }: 8 | 9 | mk { 10 | package.name = "sel4-simple-task-runtime-macros"; 11 | lib.proc-macro = true; 12 | dependencies = { 13 | inherit (versions) proc-macro2 quote; 14 | syn = { version = versions.syn; features = [ "full" ]; }; 15 | }; 16 | } 17 | -------------------------------------------------------------------------------- /crates/private/support/sel4-simple-task/runtime/macros/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | # 7 | # This file is generated from './Cargo.nix'. You can edit this file directly 8 | # if you are not using this project's Cargo manifest management tools. 9 | # See 'hacking/cargo-manifest-management/README.md' for more information. 10 | # 11 | 12 | [package] 13 | name = "sel4-simple-task-runtime-macros" 14 | version = "0.1.0" 15 | authors = ["Nick Spinale "] 16 | edition = "2021" 17 | license = "BSD-2-Clause" 18 | 19 | [lib] 20 | proc-macro = true 21 | 22 | [dependencies] 23 | proc-macro2 = "1.0.89" 24 | quote = "1.0.37" 25 | syn = { version = "2.0.85", features = ["full"] } 26 | -------------------------------------------------------------------------------- /crates/private/support/sel4-simple-task/runtime/src/global_allocator.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause 5 | // 6 | 7 | use sel4_dlmalloc::{DeferredStaticDlmalloc, StaticHeapBounds}; 8 | use sel4_sync::RawDeferredNotificationMutex; 9 | 10 | #[global_allocator] 11 | #[allow(clippy::type_complexity)] 12 | static GLOBAL_ALLOCATOR: DeferredStaticDlmalloc = 13 | DeferredStaticDlmalloc::new(); 14 | 15 | pub(crate) fn init(nfn: sel4::cap::Notification, bounds: StaticHeapBounds) { 16 | let _ = unsafe { GLOBAL_ALLOCATOR.raw_mutex().set_notification(nfn) }; 17 | let _ = GLOBAL_ALLOCATOR.set_bounds(bounds); 18 | } 19 | -------------------------------------------------------------------------------- /crates/private/support/sel4-simple-task/threading/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: MIT 5 | # 6 | 7 | { mk, mkDefaultFrontmatterWithReuseArgs, defaultReuseFrontmatterArgs, localCrates }: 8 | 9 | mk rec { 10 | nix.frontmatter = mkDefaultFrontmatterWithReuseArgs (defaultReuseFrontmatterArgs // { 11 | licenseID = package.license; 12 | }); 13 | package.name = "sel4-simple-task-threading"; 14 | package.license = "MIT"; 15 | dependencies = { 16 | inherit (localCrates) 17 | sel4 18 | sel4-panicking 19 | ; 20 | }; 21 | features = { 22 | alloc = []; 23 | }; 24 | } 25 | -------------------------------------------------------------------------------- /crates/private/support/sel4-simple-task/threading/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: MIT 5 | # 6 | # 7 | # This file is generated from './Cargo.nix'. You can edit this file directly 8 | # if you are not using this project's Cargo manifest management tools. 9 | # See 'hacking/cargo-manifest-management/README.md' for more information. 10 | # 11 | 12 | [package] 13 | name = "sel4-simple-task-threading" 14 | version = "0.1.0" 15 | authors = ["Nick Spinale "] 16 | edition = "2021" 17 | license = "MIT" 18 | 19 | [features] 20 | alloc = [] 21 | 22 | [dependencies] 23 | sel4 = { path = "../../../../sel4" } 24 | sel4-panicking = { path = "../../../../sel4-panicking" } 25 | -------------------------------------------------------------------------------- /crates/private/tests/capdl/threads/components/test/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, localCrates, serdeWith }: 8 | 9 | mk { 10 | package.name = "tests-capdl-threads-components-test"; 11 | dependencies = { 12 | serde = serdeWith [ "alloc" "derive" ]; 13 | inherit (localCrates) 14 | sel4 15 | sel4-sync 16 | sel4-simple-task-runtime 17 | sel4-simple-task-config-types 18 | ; 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /crates/private/tests/capdl/utcover/components/test/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, localCrates, serdeWith }: 8 | 9 | mk { 10 | package.name = "tests-capdl-utcover-components-test"; 11 | dependencies = { 12 | serde = serdeWith [ "alloc" "derive" ]; 13 | inherit (localCrates) 14 | sel4 15 | sel4-simple-task-runtime 16 | sel4-simple-task-config-types 17 | ; 18 | }; 19 | } 20 | -------------------------------------------------------------------------------- /crates/private/tests/capdl/utcover/components/test/src/main.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause 5 | // 6 | 7 | #![no_std] 8 | #![no_main] 9 | 10 | extern crate alloc; 11 | 12 | use serde::{Deserialize, Serialize}; 13 | 14 | use sel4_simple_task_config_types::*; 15 | use sel4_simple_task_runtime::{debug_println, main_json}; 16 | 17 | #[derive(Debug, Clone, Serialize, Deserialize)] 18 | pub struct Config { 19 | pub frame: ConfigCPtr, 20 | } 21 | 22 | #[main_json] 23 | fn main(config: Config) { 24 | debug_println!("{:#?}", config); 25 | 26 | debug_println!( 27 | "addr: {:#x}", 28 | config.frame.get().frame_get_address().unwrap() 29 | ); 30 | 31 | debug_println!("TEST_PASS"); 32 | } 33 | -------------------------------------------------------------------------------- /crates/private/tests/microkit/minimal/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2024, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, localCrates }: 8 | 9 | mk { 10 | package.name = "tests-microkit-minimal"; 11 | dependencies = { 12 | inherit (localCrates) 13 | sel4-microkit 14 | ; 15 | }; 16 | } 17 | -------------------------------------------------------------------------------- /crates/private/tests/microkit/minimal/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | # 7 | # This file is generated from './Cargo.nix'. You can edit this file directly 8 | # if you are not using this project's Cargo manifest management tools. 9 | # See 'hacking/cargo-manifest-management/README.md' for more information. 10 | # 11 | 12 | [package] 13 | name = "tests-microkit-minimal" 14 | version = "0.1.0" 15 | authors = ["Nick Spinale "] 16 | edition = "2021" 17 | license = "BSD-2-Clause" 18 | 19 | [dependencies] 20 | sel4-microkit = { path = "../../../../sel4-microkit" } 21 | -------------------------------------------------------------------------------- /crates/private/tests/microkit/minimal/src/bin/test.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2024, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause 5 | // 6 | 7 | #![no_std] 8 | #![no_main] 9 | 10 | use sel4_microkit::{debug_println, protection_domain, NullHandler}; 11 | 12 | #[protection_domain] 13 | fn init() -> NullHandler { 14 | debug_println!("TEST_PASS"); 15 | NullHandler::new() 16 | } 17 | -------------------------------------------------------------------------------- /crates/private/tests/microkit/minimal/x.system: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /crates/private/tests/microkit/passive-server-with-deferred-action/pds/client/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, localCrates }: 8 | 9 | mk { 10 | package.name = "tests-microkit-passive-server-with-deferred-action-pds-client"; 11 | dependencies = { 12 | inherit (localCrates) 13 | sel4-microkit 14 | ; 15 | }; 16 | } 17 | -------------------------------------------------------------------------------- /crates/private/tests/microkit/passive-server-with-deferred-action/pds/client/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | # 7 | # This file is generated from './Cargo.nix'. You can edit this file directly 8 | # if you are not using this project's Cargo manifest management tools. 9 | # See 'hacking/cargo-manifest-management/README.md' for more information. 10 | # 11 | 12 | [package] 13 | name = "tests-microkit-passive-server-with-deferred-action-pds-client" 14 | version = "0.1.0" 15 | authors = ["Nick Spinale "] 16 | edition = "2021" 17 | license = "BSD-2-Clause" 18 | 19 | [dependencies] 20 | sel4-microkit = { path = "../../../../../../sel4-microkit" } 21 | -------------------------------------------------------------------------------- /crates/private/tests/microkit/passive-server-with-deferred-action/pds/client/src/bin/client.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause 5 | // 6 | 7 | #![no_std] 8 | #![no_main] 9 | 10 | use sel4_microkit::{debug_println, protection_domain, Channel, Handler, Infallible}; 11 | 12 | const SERVER: Channel = Channel::new(0); 13 | 14 | #[protection_domain] 15 | fn init() -> impl Handler { 16 | SERVER.notify(); 17 | HandlerImpl {} 18 | } 19 | 20 | struct HandlerImpl {} 21 | 22 | impl Handler for HandlerImpl { 23 | type Error = Infallible; 24 | 25 | fn notified(&mut self, _channel: Channel) -> Result<(), Self::Error> { 26 | debug_println!("TEST_PASS"); 27 | Ok(()) 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /crates/private/tests/microkit/passive-server-with-deferred-action/pds/server/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, localCrates }: 8 | 9 | mk { 10 | package.name = "tests-microkit-passive-server-with-deferred-action-pds-server"; 11 | dependencies = { 12 | inherit (localCrates) 13 | sel4-microkit 14 | ; 15 | }; 16 | } 17 | -------------------------------------------------------------------------------- /crates/private/tests/microkit/passive-server-with-deferred-action/pds/server/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | # 7 | # This file is generated from './Cargo.nix'. You can edit this file directly 8 | # if you are not using this project's Cargo manifest management tools. 9 | # See 'hacking/cargo-manifest-management/README.md' for more information. 10 | # 11 | 12 | [package] 13 | name = "tests-microkit-passive-server-with-deferred-action-pds-server" 14 | version = "0.1.0" 15 | authors = ["Nick Spinale "] 16 | edition = "2021" 17 | license = "BSD-2-Clause" 18 | 19 | [dependencies] 20 | sel4-microkit = { path = "../../../../../../sel4-microkit" } 21 | -------------------------------------------------------------------------------- /crates/private/tests/microkit/passive-server-with-deferred-action/x.system: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /crates/private/tests/microkit/reset/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2024, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, localCrates }: 8 | 9 | mk { 10 | package.name = "tests-microkit-reset"; 11 | dependencies = { 12 | inherit (localCrates) 13 | sel4-microkit 14 | sel4-reset 15 | ; 16 | }; 17 | } 18 | -------------------------------------------------------------------------------- /crates/private/tests/microkit/reset/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | # 7 | # This file is generated from './Cargo.nix'. You can edit this file directly 8 | # if you are not using this project's Cargo manifest management tools. 9 | # See 'hacking/cargo-manifest-management/README.md' for more information. 10 | # 11 | 12 | [package] 13 | name = "tests-microkit-reset" 14 | version = "0.1.0" 15 | authors = ["Nick Spinale "] 16 | edition = "2021" 17 | license = "BSD-2-Clause" 18 | 19 | [dependencies] 20 | sel4-microkit = { path = "../../../../sel4-microkit" } 21 | sel4-reset = { path = "../../../../sel4-reset" } 22 | -------------------------------------------------------------------------------- /crates/private/tests/microkit/reset/x.system: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /crates/private/tests/microkit/unwind/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2024, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, localCrates }: 8 | 9 | mk { 10 | package.name = "tests-microkit-unwind"; 11 | dependencies = { 12 | inherit (localCrates) 13 | sel4-microkit 14 | ; 15 | }; 16 | } 17 | -------------------------------------------------------------------------------- /crates/private/tests/microkit/unwind/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | # 7 | # This file is generated from './Cargo.nix'. You can edit this file directly 8 | # if you are not using this project's Cargo manifest management tools. 9 | # See 'hacking/cargo-manifest-management/README.md' for more information. 10 | # 11 | 12 | [package] 13 | name = "tests-microkit-unwind" 14 | version = "0.1.0" 15 | authors = ["Nick Spinale "] 16 | edition = "2021" 17 | license = "BSD-2-Clause" 18 | 19 | [dependencies] 20 | sel4-microkit = { path = "../../../../sel4-microkit" } 21 | -------------------------------------------------------------------------------- /crates/private/tests/microkit/unwind/x.system: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /crates/private/tests/root-task/alloca/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, localCrates }: 8 | 9 | mk { 10 | package.name = "tests-root-task-alloca"; 11 | dependencies = { 12 | inherit (localCrates) 13 | sel4 14 | sel4-root-task 15 | sel4-alloca 16 | ; 17 | }; 18 | } 19 | -------------------------------------------------------------------------------- /crates/private/tests/root-task/alloca/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | # 7 | # This file is generated from './Cargo.nix'. You can edit this file directly 8 | # if you are not using this project's Cargo manifest management tools. 9 | # See 'hacking/cargo-manifest-management/README.md' for more information. 10 | # 11 | 12 | [package] 13 | name = "tests-root-task-alloca" 14 | version = "0.1.0" 15 | authors = ["Nick Spinale "] 16 | edition = "2021" 17 | license = "BSD-2-Clause" 18 | 19 | [dependencies] 20 | sel4 = { path = "../../../../sel4" } 21 | sel4-alloca = { path = "../../../../sel4-alloca" } 22 | sel4-root-task = { path = "../../../../sel4-root-task" } 23 | -------------------------------------------------------------------------------- /crates/private/tests/root-task/alloca/src/main.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause 5 | // 6 | 7 | #![no_std] 8 | #![no_main] 9 | 10 | use core::alloc::Layout; 11 | 12 | use sel4_alloca::*; 13 | use sel4_root_task::{debug_println, root_task}; 14 | 15 | const X: usize = 1234; 16 | 17 | #[root_task] 18 | fn main(_bootinfo: &sel4::BootInfoPtr) -> ! { 19 | let x = with_alloca_ptr(Layout::from_size_align(8, 8).unwrap(), |_| { 20 | debug_println!("abc"); 21 | X 22 | }); 23 | 24 | assert_eq!(x, X); 25 | 26 | debug_println!("TEST_PASS"); 27 | 28 | sel4::init_thread::suspend_self() 29 | } 30 | -------------------------------------------------------------------------------- /crates/private/tests/root-task/backtrace/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, localCrates }: 8 | 9 | mk { 10 | package.name = "tests-root-task-backtrace"; 11 | dependencies = { 12 | inherit (localCrates) 13 | sel4 14 | sel4-backtrace-embedded-debug-info 15 | ; 16 | sel4-root-task = localCrates.sel4-root-task // { features = [ "alloc" ]; }; 17 | sel4-backtrace-simple = localCrates.sel4-backtrace-simple // { features = [ "alloc" ]; }; 18 | sel4-backtrace = localCrates.sel4-backtrace // { features = [ "full" ]; }; 19 | sel4-backtrace-types = localCrates.sel4-backtrace-types // { features = [ "full" ]; }; 20 | }; 21 | } 22 | -------------------------------------------------------------------------------- /crates/private/tests/root-task/c/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, versions, localCrates }: 8 | 9 | mk { 10 | package.name = "tests-root-task-c"; 11 | dependencies = { 12 | inherit (localCrates) 13 | sel4 14 | sel4-root-task 15 | sel4-newlib 16 | ; 17 | }; 18 | build-dependencies = { 19 | inherit (versions) cc glob; 20 | }; 21 | } 22 | -------------------------------------------------------------------------------- /crates/private/tests/root-task/c/build.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause 5 | // 6 | 7 | fn main() { 8 | let c_files = glob::glob("cbits/*.c") 9 | .unwrap() 10 | .collect::, _>>() 11 | .unwrap(); 12 | 13 | cc::Build::new().files(&c_files).compile("cbits"); 14 | 15 | for path in &c_files { 16 | println!("cargo:rerun-if-changed={}", path.display()); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /crates/private/tests/root-task/c/cbits/test.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023, Colias Group, LLC 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #include 8 | 9 | int test(const char *s) { 10 | return atoi(s) + atoi(s + 1); 11 | } 12 | -------------------------------------------------------------------------------- /crates/private/tests/root-task/c/src/main.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause 5 | // 6 | 7 | #![no_std] 8 | #![no_main] 9 | 10 | use core::ffi::c_char; 11 | 12 | use sel4_newlib as _; 13 | use sel4_root_task::{debug_println, root_task}; 14 | 15 | extern "C" { 16 | fn test(s: *const c_char) -> i32; 17 | } 18 | 19 | #[root_task] 20 | fn main(_: &sel4::BootInfoPtr) -> ! { 21 | let s = c"1234"; 22 | let n = unsafe { test(s.as_ptr()) }; 23 | debug_println!("n = {}", n); 24 | assert_eq!(n, 1234 + 234); 25 | debug_println!("TEST_PASS"); 26 | sel4::init_thread::suspend_self() 27 | } 28 | -------------------------------------------------------------------------------- /crates/private/tests/root-task/config/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, localCrates }: 8 | 9 | mk { 10 | package.name = "tests-root-task-config"; 11 | dependencies = { 12 | inherit (localCrates) 13 | sel4 14 | sel4-root-task 15 | ; 16 | }; 17 | } 18 | -------------------------------------------------------------------------------- /crates/private/tests/root-task/config/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | # 7 | # This file is generated from './Cargo.nix'. You can edit this file directly 8 | # if you are not using this project's Cargo manifest management tools. 9 | # See 'hacking/cargo-manifest-management/README.md' for more information. 10 | # 11 | 12 | [package] 13 | name = "tests-root-task-config" 14 | version = "0.1.0" 15 | authors = ["Nick Spinale "] 16 | edition = "2021" 17 | license = "BSD-2-Clause" 18 | 19 | [dependencies] 20 | sel4 = { path = "../../../../sel4" } 21 | sel4-root-task = { path = "../../../../sel4-root-task" } 22 | -------------------------------------------------------------------------------- /crates/private/tests/root-task/dafny/core/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2024, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, versions, localCrates, dafnySource }: 8 | 9 | mk { 10 | package.name = "tests-root-task-dafny-core"; 11 | dependencies = { 12 | inherit (localCrates) 13 | sel4-mod-in-out-dir 14 | # dafny_runtime 15 | ; 16 | dafny_runtime = dafnySource; 17 | num = { version = versions.num; default-features = false; features = ["alloc"]; }; 18 | }; 19 | } 20 | -------------------------------------------------------------------------------- /crates/private/tests/root-task/dafny/core/build.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2024, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause 5 | // 6 | 7 | use std::env; 8 | use std::fs; 9 | use std::path::PathBuf; 10 | 11 | const TRANSLATED_ENV: &str = "TRANSLATED"; 12 | 13 | fn main() { 14 | let translated_src = env::var(TRANSLATED_ENV).unwrap(); 15 | let out_dir = env::var("OUT_DIR").unwrap(); 16 | let translated_dst = PathBuf::from(&out_dir).join("translated.rs"); 17 | fs::copy(&translated_src, translated_dst).unwrap(); 18 | 19 | println!("cargo:rerun-if-env-changed={TRANSLATED_ENV}"); 20 | println!("cargo:rerun-if-changed={}", translated_src); 21 | } 22 | -------------------------------------------------------------------------------- /crates/private/tests/root-task/dafny/core/src/lib.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2024, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause 5 | // 6 | 7 | #![no_std] 8 | #![feature(proc_macro_hygiene)] 9 | 10 | use dafny_runtime::DafnyInt; 11 | use num::traits::cast::ToPrimitive; 12 | use sel4_mod_in_out_dir::in_out_dir; 13 | 14 | #[rustfmt::skip] 15 | #[in_out_dir] 16 | mod translated; 17 | 18 | pub fn max(a: usize, b: usize) -> usize { 19 | translated::_module::_default::Max(&DafnyInt::from(a), &DafnyInt::from(b)) 20 | .to_usize() 21 | .unwrap() 22 | } 23 | 24 | #[cfg(test)] 25 | mod tests { 26 | use super::max; 27 | 28 | #[test] 29 | fn x() { 30 | assert_eq!(max(13, 37), 37); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /crates/private/tests/root-task/dafny/hacking/.gitignore: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2024, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | /build/ 8 | -------------------------------------------------------------------------------- /crates/private/tests/root-task/dafny/hacking/shell.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2024, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | let 8 | topLevelDir = ../../../../../..; 9 | topLevel = import topLevelDir {}; 10 | 11 | in 12 | topLevel.worlds.default.shell.overrideAttrs (self: super: { 13 | nativeBuildInputs = (super.nativeBuildInputs or []) ++ [ 14 | topLevel.pkgs.build.dafny 15 | ]; 16 | 17 | TOP_LEVEL_DIR = toString topLevelDir; 18 | TRANSLATED = toString ./build/translated.rs; 19 | }) 20 | -------------------------------------------------------------------------------- /crates/private/tests/root-task/dafny/task/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2024, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, localCrates }: 8 | 9 | mk { 10 | package.name = "tests-root-task-dafny-task"; 11 | dependencies = { 12 | inherit (localCrates) 13 | sel4 14 | sel4-root-task 15 | tests-root-task-dafny-core 16 | ; 17 | }; 18 | } 19 | -------------------------------------------------------------------------------- /crates/private/tests/root-task/dafny/task/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | # 7 | # This file is generated from './Cargo.nix'. You can edit this file directly 8 | # if you are not using this project's Cargo manifest management tools. 9 | # See 'hacking/cargo-manifest-management/README.md' for more information. 10 | # 11 | 12 | [package] 13 | name = "tests-root-task-dafny-task" 14 | version = "0.1.0" 15 | authors = ["Nick Spinale "] 16 | edition = "2021" 17 | license = "BSD-2-Clause" 18 | 19 | [dependencies] 20 | sel4 = { path = "../../../../../sel4" } 21 | sel4-root-task = { path = "../../../../../sel4-root-task" } 22 | tests-root-task-dafny-core = { path = "../core" } 23 | -------------------------------------------------------------------------------- /crates/private/tests/root-task/dafny/task/src/main.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2024, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause 5 | // 6 | 7 | #![no_std] 8 | #![no_main] 9 | 10 | use sel4_root_task::{debug_println, root_task}; 11 | 12 | #[root_task(heap_size = 1024 * 1024)] 13 | fn main(_: &sel4::BootInfoPtr) -> ! { 14 | assert_eq!(tests_root_task_dafny_core::max(13, 37), 37); 15 | 16 | debug_println!("TEST_PASS"); 17 | sel4::init_thread::suspend_self() 18 | } 19 | -------------------------------------------------------------------------------- /crates/private/tests/root-task/dafny/verified/core.dfy: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2024, Colias Group, LLC 3 | // Copyright (c) Microsoft Corporation 4 | // 5 | // SPDX-License-Identifier: MIT 6 | // 7 | 8 | method Max(a: int, b:int) returns (c: int) 9 | ensures a < b ==> c == b 10 | ensures b <= a ==> c == a 11 | { 12 | if (a < b) { 13 | return b; 14 | } else { 15 | return a; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /crates/private/tests/root-task/default-test-harness/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, localCrates, versions }: 8 | 9 | mk { 10 | package.name = "tests-root-task-default-test-harness"; 11 | dependencies = { 12 | inherit (versions) log; 13 | }; 14 | dev-dependencies = { 15 | test = let package = "sel4-root-task-default-test-harness"; in localCrates.${package} // { 16 | inherit package; 17 | }; 18 | }; 19 | } 20 | -------------------------------------------------------------------------------- /crates/private/tests/root-task/loader/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, localCrates, versions }: 8 | 9 | mk { 10 | package.name = "tests-root-task-loader"; 11 | dependencies = { 12 | inherit (versions) fdt; 13 | inherit (localCrates) 14 | sel4 15 | sel4-root-task 16 | sel4-platform-info 17 | ; 18 | }; 19 | } 20 | -------------------------------------------------------------------------------- /crates/private/tests/root-task/musl/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2024, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, versions, localCrates }: 8 | 9 | mk { 10 | package.name = "tests-root-task-musl"; 11 | dependencies = { 12 | inherit (versions) 13 | dlmalloc 14 | one-shot-mutex 15 | ; 16 | inherit (localCrates) 17 | sel4 18 | sel4-root-task-with-std 19 | sel4-musl 20 | sel4-linux-syscall-types 21 | sel4-dlmalloc 22 | ; 23 | }; 24 | } 25 | -------------------------------------------------------------------------------- /crates/private/tests/root-task/panicking/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, localCrates, versions }: 8 | 9 | mk { 10 | package.name = "tests-root-task-panicking"; 11 | dependencies = { 12 | inherit (versions) cfg-if; 13 | inherit (localCrates) 14 | sel4 15 | sel4-root-task 16 | ; 17 | }; 18 | features = { 19 | alloc = [ "sel4-root-task/alloc" ]; 20 | panic-unwind = []; 21 | panic-abort = []; 22 | }; 23 | } 24 | -------------------------------------------------------------------------------- /crates/private/tests/root-task/tls/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, localCrates }: 8 | 9 | mk { 10 | package.name = "tests-root-task-tls"; 11 | dependencies = { 12 | inherit (localCrates) 13 | sel4 14 | sel4-root-task 15 | ; 16 | }; 17 | } 18 | -------------------------------------------------------------------------------- /crates/private/tests/root-task/tls/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | # 7 | # This file is generated from './Cargo.nix'. You can edit this file directly 8 | # if you are not using this project's Cargo manifest management tools. 9 | # See 'hacking/cargo-manifest-management/README.md' for more information. 10 | # 11 | 12 | [package] 13 | name = "tests-root-task-tls" 14 | version = "0.1.0" 15 | authors = ["Nick Spinale "] 16 | edition = "2021" 17 | license = "BSD-2-Clause" 18 | 19 | [dependencies] 20 | sel4 = { path = "../../../../sel4" } 21 | sel4-root-task = { path = "../../../../sel4-root-task" } 22 | -------------------------------------------------------------------------------- /crates/private/tests/root-task/tls/src/main.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause 5 | // 6 | 7 | #![no_std] 8 | #![no_main] 9 | #![feature(thread_local)] 10 | 11 | use core::hint::black_box; 12 | 13 | use sel4_root_task::{debug_println, root_task}; 14 | 15 | const X: i32 = 1337; 16 | 17 | #[repr(C, align(4096))] 18 | struct T(i32); 19 | 20 | #[no_mangle] 21 | #[thread_local] 22 | static Y: T = T(X); 23 | 24 | #[root_task] 25 | fn main(_: &sel4::BootInfoPtr) -> ! { 26 | let observed = Y.0; 27 | debug_println!("{}", observed); 28 | assert_eq!(observed, black_box(X)); 29 | debug_println!("TEST_PASS"); 30 | sel4::init_thread::suspend_self() 31 | } 32 | -------------------------------------------------------------------------------- /crates/private/tests/root-task/verus/core/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2024, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, verusSource }: 8 | 9 | mk { 10 | package.name = "tests-root-task-verus-core"; 11 | dependencies = { 12 | builtin = verusSource; 13 | builtin_macros = verusSource; 14 | vstd = verusSource // { default-features = false; }; 15 | }; 16 | package.metadata.verus = { 17 | verify = true; 18 | }; 19 | } 20 | -------------------------------------------------------------------------------- /crates/private/tests/root-task/verus/core/src/lib.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2024, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause 5 | // 6 | 7 | #![no_std] 8 | 9 | use vstd::prelude::*; 10 | 11 | verus! { 12 | pub fn max(a: u64, b: u64) -> (ret: u64) 13 | ensures 14 | ret == a || ret == b, 15 | ret >= a && ret >= b, 16 | { 17 | if a >= b { 18 | a 19 | } else { 20 | b 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /crates/private/tests/root-task/verus/task/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2024, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, localCrates }: 8 | 9 | mk { 10 | package.name = "tests-root-task-verus-task"; 11 | dependencies = { 12 | inherit (localCrates) 13 | sel4 14 | tests-root-task-verus-core 15 | ; 16 | sel4-root-task = localCrates.sel4-root-task // { 17 | default-features = false; 18 | }; 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /crates/private/tests/root-task/verus/task/src/main.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2024, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause 5 | // 6 | 7 | #![no_std] 8 | #![no_main] 9 | 10 | use sel4_root_task::{debug_println, root_task}; 11 | 12 | #[root_task(heap_size = 1024 * 1024)] 13 | fn main(_: &sel4::BootInfoPtr) -> ! { 14 | assert_eq!(tests_root_task_verus_core::max(13, 37), 37); 15 | 16 | debug_println!("TEST_PASS"); 17 | sel4::init_thread::suspend_self() 18 | } 19 | -------------------------------------------------------------------------------- /crates/sel4-abstract-allocator/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, versions }: 8 | 9 | mk { 10 | package.name = "sel4-abstract-allocator"; 11 | dependencies = { 12 | inherit (versions) log; 13 | }; 14 | features = { 15 | default = [ "alloc" ]; 16 | alloc = []; 17 | }; 18 | } 19 | -------------------------------------------------------------------------------- /crates/sel4-abstract-allocator/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | # 7 | # This file is generated from './Cargo.nix'. You can edit this file directly 8 | # if you are not using this project's Cargo manifest management tools. 9 | # See 'hacking/cargo-manifest-management/README.md' for more information. 10 | # 11 | 12 | [package] 13 | name = "sel4-abstract-allocator" 14 | version = "0.1.0" 15 | authors = ["Nick Spinale "] 16 | edition = "2021" 17 | license = "BSD-2-Clause" 18 | 19 | [features] 20 | alloc = [] 21 | default = ["alloc"] 22 | 23 | [dependencies] 24 | log = "0.4.17" 25 | -------------------------------------------------------------------------------- /crates/sel4-abstract-allocator/offset-allocator/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, versions, localCrates, offsetAllocatorSource }: 8 | 9 | mk { 10 | package.name = "sel4-abstract-allocator-offset-allocator"; 11 | dependencies = { 12 | offset-allocator = offsetAllocatorSource; 13 | inherit (localCrates) 14 | sel4-abstract-allocator 15 | # offset-allocator 16 | ; 17 | }; 18 | } 19 | -------------------------------------------------------------------------------- /crates/sel4-abstract-ptr/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2024, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: MIT OR Apache-2.0 5 | # 6 | 7 | { mk, mkDefaultFrontmatterWithReuseArgs, defaultReuseFrontmatterArgs, versions }: 8 | 9 | mk rec { 10 | nix.frontmatter = mkDefaultFrontmatterWithReuseArgs (defaultReuseFrontmatterArgs // { 11 | licenseID = package.license; 12 | }); 13 | package.name = "sel4-abstract-ptr"; 14 | package.license = "MIT OR Apache-2.0"; 15 | dependencies = { 16 | ptr_meta = { version = versions.ptr_meta; default-features = false; }; 17 | }; 18 | } 19 | -------------------------------------------------------------------------------- /crates/sel4-abstract-ptr/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: MIT OR Apache-2.0 5 | # 6 | # 7 | # This file is generated from './Cargo.nix'. You can edit this file directly 8 | # if you are not using this project's Cargo manifest management tools. 9 | # See 'hacking/cargo-manifest-management/README.md' for more information. 10 | # 11 | 12 | [package] 13 | name = "sel4-abstract-ptr" 14 | version = "0.1.0" 15 | authors = ["Nick Spinale "] 16 | edition = "2021" 17 | license = "MIT OR Apache-2.0" 18 | 19 | [dependencies] 20 | ptr_meta = { version = "0.3", default-features = false } 21 | -------------------------------------------------------------------------------- /crates/sel4-abstract-ptr/README.md: -------------------------------------------------------------------------------- 1 | 6 | 7 | The code in this crate is derived from (the `volatile` crate)[https://github.com/rust-osdev/volatile] at `6e288f14bb9bad6331d0d5c7f3813bc6d0977457`. 8 | -------------------------------------------------------------------------------- /crates/sel4-abstract-ptr/src/lib.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2024, Colias Group, LLC 3 | // Copyright (c) 2020 Philipp Oppermann 4 | // 5 | // SPDX-License-Identifier: MIT OR Apache-2.0 6 | // 7 | 8 | #![no_std] 9 | #![allow(clippy::missing_safety_doc)] 10 | 11 | mod abstract_ptr; 12 | mod abstract_ref; 13 | mod core_ext; 14 | 15 | pub mod access; 16 | pub mod memory_type; 17 | 18 | pub use abstract_ptr::AbstractPtr; 19 | pub use abstract_ref::AbstractRef; 20 | -------------------------------------------------------------------------------- /crates/sel4-abstract-rc/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2024, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk }: 8 | 9 | mk { 10 | package.name = "sel4-abstract-rc"; 11 | } 12 | -------------------------------------------------------------------------------- /crates/sel4-abstract-rc/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | # 7 | # This file is generated from './Cargo.nix'. You can edit this file directly 8 | # if you are not using this project's Cargo manifest management tools. 9 | # See 'hacking/cargo-manifest-management/README.md' for more information. 10 | # 11 | 12 | [package] 13 | name = "sel4-abstract-rc" 14 | version = "0.1.0" 15 | authors = ["Nick Spinale "] 16 | edition = "2021" 17 | license = "BSD-2-Clause" 18 | -------------------------------------------------------------------------------- /crates/sel4-abstract-rc/src/lib.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2024, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause 5 | // 6 | 7 | #![no_std] 8 | 9 | extern crate alloc; 10 | 11 | use alloc::rc::Rc; 12 | use alloc::sync::Arc; 13 | use core::ops::Deref; 14 | 15 | pub trait AbstractRcT { 16 | type Rc: AbstractRc; 17 | } 18 | 19 | pub struct RcT(()); 20 | 21 | impl AbstractRcT for RcT { 22 | type Rc = Rc; 23 | } 24 | 25 | pub struct ArcT(()); 26 | 27 | impl AbstractRcT for ArcT { 28 | type Rc = Arc; 29 | } 30 | 31 | pub trait AbstractRc: Deref + From + Clone {} 32 | 33 | impl AbstractRc for Rc {} 34 | 35 | impl AbstractRc for Arc {} 36 | -------------------------------------------------------------------------------- /crates/sel4-alloca/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, versions }: 8 | 9 | mk { 10 | package.name = "sel4-alloca"; 11 | dependencies = { 12 | inherit (versions) cfg-if; 13 | }; 14 | } 15 | -------------------------------------------------------------------------------- /crates/sel4-alloca/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | # 7 | # This file is generated from './Cargo.nix'. You can edit this file directly 8 | # if you are not using this project's Cargo manifest management tools. 9 | # See 'hacking/cargo-manifest-management/README.md' for more information. 10 | # 11 | 12 | [package] 13 | name = "sel4-alloca" 14 | version = "0.1.0" 15 | authors = ["Nick Spinale "] 16 | edition = "2021" 17 | license = "BSD-2-Clause" 18 | 19 | [dependencies] 20 | cfg-if = "1.0.0" 21 | -------------------------------------------------------------------------------- /crates/sel4-async/block-io/fat/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, localCrates, versions, fatSource }: 8 | 9 | mk { 10 | package.name = "sel4-async-block-io-fat"; 11 | dependencies = { 12 | inherit (versions) log heapless lru; 13 | hex = { version = versions.hex; default-features = false; }; 14 | futures = { 15 | version = versions.futures; 16 | default-features = false; 17 | features = [ 18 | "alloc" 19 | ]; 20 | }; 21 | embedded-fat = fatSource; 22 | inherit (localCrates) 23 | sel4-async-block-io 24 | # embedded-fat 25 | ; 26 | }; 27 | } 28 | -------------------------------------------------------------------------------- /crates/sel4-async/block-io/fat/src/dummy_time_source.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause 5 | // 6 | 7 | pub use embedded_fat as fat; 8 | 9 | #[derive(Default)] 10 | pub struct DummyTimeSource(()); 11 | 12 | impl DummyTimeSource { 13 | pub fn new() -> Self { 14 | Self(()) 15 | } 16 | } 17 | 18 | impl fat::TimeSource for DummyTimeSource { 19 | fn get_timestamp(&self) -> fat::Timestamp { 20 | unimplemented!() 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /crates/sel4-async/block-io/fat/src/lib.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause 5 | // 6 | 7 | #![no_std] 8 | 9 | pub use embedded_fat::*; 10 | 11 | mod block_io_wrapper; 12 | mod dummy_time_source; 13 | 14 | pub use block_io_wrapper::BlockIOWrapper; 15 | pub use dummy_time_source::DummyTimeSource; 16 | -------------------------------------------------------------------------------- /crates/sel4-async/io/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, mkDefaultFrontmatterWithReuseArgs, defaultReuseFrontmatterArgs, versions }: 8 | 9 | mk rec { 10 | nix.frontmatter = mkDefaultFrontmatterWithReuseArgs (defaultReuseFrontmatterArgs // { 11 | licenseID = package.license; 12 | }); 13 | package.name = "sel4-async-io"; 14 | package.license = "MIT OR Apache-2.0"; 15 | dependencies = { 16 | inherit (versions) embedded-io-async; 17 | }; 18 | } 19 | -------------------------------------------------------------------------------- /crates/sel4-async/io/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: MIT OR Apache-2.0 5 | # 6 | # 7 | # This file is generated from './Cargo.nix'. You can edit this file directly 8 | # if you are not using this project's Cargo manifest management tools. 9 | # See 'hacking/cargo-manifest-management/README.md' for more information. 10 | # 11 | 12 | [package] 13 | name = "sel4-async-io" 14 | version = "0.1.0" 15 | authors = ["Nick Spinale "] 16 | edition = "2021" 17 | license = "MIT OR Apache-2.0" 18 | 19 | [dependencies] 20 | embedded-io-async = "0.6.1" 21 | -------------------------------------------------------------------------------- /crates/sel4-async/network/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, localCrates, versions, smoltcpWith }: 8 | 9 | mk { 10 | package.name = "sel4-async-network"; 11 | dependencies = { 12 | inherit (localCrates) sel4-async-io; 13 | inherit (versions) log; 14 | smoltcp = smoltcpWith [ 15 | "async" 16 | "alloc" 17 | # "verbose" 18 | ]; 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /crates/sel4-async/network/rustls/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, mkDefaultFrontmatterWithReuseArgs, defaultReuseFrontmatterArgs, localCrates, versions, rustlsWith }: 8 | 9 | mk rec { 10 | nix.frontmatter = mkDefaultFrontmatterWithReuseArgs (defaultReuseFrontmatterArgs // { 11 | licenseID = package.license; 12 | }); 13 | package.name = "sel4-async-network-rustls"; 14 | package.license = "Apache-2.0 OR ISC OR MIT"; 15 | dependencies = { 16 | inherit (localCrates) 17 | sel4-async-io 18 | ; 19 | inherit (versions) log embedded-io-async; 20 | rustls = rustlsWith [] // (localCrates.rustls or {}); 21 | }; 22 | } 23 | -------------------------------------------------------------------------------- /crates/sel4-async/network/rustls/README.md: -------------------------------------------------------------------------------- 1 | 6 | 7 | The code in this crate is derived from https://github.com/rustls/rustls/pull/1648 by https://github.com/japaric. 8 | -------------------------------------------------------------------------------- /crates/sel4-async/network/rustls/src/lib.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 OR ISC OR MIT 5 | // 6 | 7 | #![no_std] 8 | 9 | extern crate alloc; 10 | 11 | mod conn; 12 | mod error; 13 | mod utils; 14 | 15 | pub use conn::{ClientConnector, ServerConnector, TlsStream}; 16 | pub use error::Error; 17 | -------------------------------------------------------------------------------- /crates/sel4-async/network/rustls/utils/src/lib.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause 5 | // 6 | 7 | #![no_std] 8 | #![feature(cfg_target_thread_local)] 9 | #![feature(thread_local)] 10 | 11 | extern crate alloc; 12 | 13 | mod dummy_custom_getrandom; 14 | mod no_server_cert_verifier; 15 | mod time_provider_impl; 16 | 17 | pub use dummy_custom_getrandom::seed_dummy_custom_getrandom; 18 | pub use no_server_cert_verifier::NoServerCertVerifier; 19 | pub use time_provider_impl::TimeProviderImpl; 20 | -------------------------------------------------------------------------------- /crates/sel4-async/single-threaded-executor/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, mkDefaultFrontmatterWithReuseArgs, defaultReuseFrontmatterArgs, versions }: 8 | 9 | mk rec { 10 | nix.frontmatter = mkDefaultFrontmatterWithReuseArgs (defaultReuseFrontmatterArgs // { 11 | licenseID = package.license; 12 | }); 13 | package.name = "sel4-async-single-threaded-executor"; 14 | package.license = "MIT OR Apache-2.0"; 15 | dependencies = { 16 | futures = { 17 | version = versions.futures; 18 | default-features = false; 19 | features = [ 20 | "alloc" 21 | ]; 22 | }; 23 | }; 24 | } 25 | -------------------------------------------------------------------------------- /crates/sel4-async/single-threaded-executor/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: MIT OR Apache-2.0 5 | # 6 | # 7 | # This file is generated from './Cargo.nix'. You can edit this file directly 8 | # if you are not using this project's Cargo manifest management tools. 9 | # See 'hacking/cargo-manifest-management/README.md' for more information. 10 | # 11 | 12 | [package] 13 | name = "sel4-async-single-threaded-executor" 14 | version = "0.1.0" 15 | authors = ["Nick Spinale "] 16 | edition = "2021" 17 | license = "MIT OR Apache-2.0" 18 | 19 | [dependencies] 20 | futures = { version = "0.3.28", default-features = false, features = ["alloc"] } 21 | -------------------------------------------------------------------------------- /crates/sel4-async/single-threaded-executor/README.md: -------------------------------------------------------------------------------- 1 | 6 | 7 | This crate is derived, with significant modification, from: 8 | 9 | https://github.com/rust-lang/futures-rs/tree/master/futures-executor 10 | -------------------------------------------------------------------------------- /crates/sel4-async/time/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, versions, smoltcpWith }: 8 | 9 | mk { 10 | package.name = "sel4-async-time"; 11 | dependencies = { 12 | inherit (versions) log pin-project; 13 | }; 14 | } 15 | -------------------------------------------------------------------------------- /crates/sel4-async/time/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | # 7 | # This file is generated from './Cargo.nix'. You can edit this file directly 8 | # if you are not using this project's Cargo manifest management tools. 9 | # See 'hacking/cargo-manifest-management/README.md' for more information. 10 | # 11 | 12 | [package] 13 | name = "sel4-async-time" 14 | version = "0.1.0" 15 | authors = ["Nick Spinale "] 16 | edition = "2021" 17 | license = "BSD-2-Clause" 18 | 19 | [dependencies] 20 | log = "0.4.17" 21 | pin-project = "1.1.3" 22 | -------------------------------------------------------------------------------- /crates/sel4-async/unsync/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, versions }: 8 | 9 | mk { 10 | package.name = "sel4-async-unsync"; 11 | dependencies = { 12 | async-unsync = { version = versions.async-unsync; default-features = false; }; 13 | }; 14 | } 15 | -------------------------------------------------------------------------------- /crates/sel4-async/unsync/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | # 7 | # This file is generated from './Cargo.nix'. You can edit this file directly 8 | # if you are not using this project's Cargo manifest management tools. 9 | # See 'hacking/cargo-manifest-management/README.md' for more information. 10 | # 11 | 12 | [package] 13 | name = "sel4-async-unsync" 14 | version = "0.1.0" 15 | authors = ["Nick Spinale "] 16 | edition = "2021" 17 | license = "BSD-2-Clause" 18 | 19 | [dependencies] 20 | async-unsync = { version = "0.3.0", default-features = false } 21 | -------------------------------------------------------------------------------- /crates/sel4-async/unsync/src/lib.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause 5 | // 6 | 7 | #![no_std] 8 | 9 | pub mod mutex; 10 | 11 | pub use mutex::Mutex; 12 | -------------------------------------------------------------------------------- /crates/sel4-backtrace/addr2line-context-helper/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, versions }: 8 | 9 | mk { 10 | package.name = "sel4-backtrace-addr2line-context-helper"; 11 | dependencies = { 12 | addr2line = { version = versions.addr2line; default-features = false; features = [ "rustc-demangle" "cpp_demangle" "fallible-iterator" "smallvec" ]; }; 13 | gimli = { version = versions.gimli; default-features = false; features = [ "endian-reader" ]; }; 14 | object = { version = versions.object; default-features = false; features = [ "read" ]; }; 15 | stable_deref_trait = { version = versions.stable_deref_trait; default-features = false; features = [ "alloc" ]; }; 16 | }; 17 | } 18 | -------------------------------------------------------------------------------- /crates/sel4-backtrace/cli/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, localCrates, versions }: 8 | 9 | mk { 10 | package.name = "sel4-backtrace-cli"; 11 | dependencies = { 12 | inherit (versions) object clap hex; 13 | inherit (localCrates) sel4-backtrace-addr2line-context-helper; 14 | sel4-backtrace-types = localCrates.sel4-backtrace-types // { features = [ "full" ]; }; 15 | }; 16 | } 17 | -------------------------------------------------------------------------------- /crates/sel4-backtrace/embedded-debug-info/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, localCrates, versions }: 8 | 9 | mk { 10 | package.name = "sel4-backtrace-embedded-debug-info"; 11 | dependencies = { 12 | addr2line = { version = versions.addr2line; default-features = false; }; 13 | object = { version = versions.object; default-features = false; features = [ "read" ]; }; 14 | inherit (localCrates) 15 | sel4-backtrace-addr2line-context-helper 16 | ; 17 | }; 18 | } 19 | -------------------------------------------------------------------------------- /crates/sel4-backtrace/embedded-debug-info/cli/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, localCrates, versions }: 8 | 9 | mk { 10 | package.name = "sel4-backtrace-embedded-debug-info-cli"; 11 | dependencies = { 12 | inherit (versions) num clap; 13 | inherit (localCrates) sel4-synthetic-elf; 14 | }; 15 | } 16 | -------------------------------------------------------------------------------- /crates/sel4-backtrace/embedded-debug-info/cli/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | # 7 | # This file is generated from './Cargo.nix'. You can edit this file directly 8 | # if you are not using this project's Cargo manifest management tools. 9 | # See 'hacking/cargo-manifest-management/README.md' for more information. 10 | # 11 | 12 | [package] 13 | name = "sel4-backtrace-embedded-debug-info-cli" 14 | version = "0.1.0" 15 | authors = ["Nick Spinale "] 16 | edition = "2021" 17 | license = "BSD-2-Clause" 18 | 19 | [dependencies] 20 | clap = "4.4.6" 21 | num = "0.4.1" 22 | sel4-synthetic-elf = { path = "../../../sel4-synthetic-elf" } 23 | -------------------------------------------------------------------------------- /crates/sel4-backtrace/simple/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, localCrates }: 8 | 9 | mk { 10 | package.name = "sel4-backtrace-simple"; 11 | dependencies = { 12 | inherit (localCrates) sel4-panicking-env; 13 | sel4-backtrace = localCrates.sel4-backtrace // { features = [ "postcard" "unwinding" ]; }; 14 | }; 15 | features = { 16 | alloc = [ 17 | "sel4-backtrace/alloc" 18 | ]; 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /crates/sel4-backtrace/symbolize/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2024, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, mkDefaultFrontmatterWithReuseArgs, defaultReuseFrontmatterArgs, versions }: 8 | 9 | mk rec { 10 | nix.frontmatter = mkDefaultFrontmatterWithReuseArgs (defaultReuseFrontmatterArgs // { 11 | licenseID = package.license; 12 | }); 13 | package.name = "sel4-backtrace-symbolize"; 14 | package.license = "MIT OR Apache-2.0"; 15 | dependencies = { 16 | addr2line = { 17 | version = versions.addr2line; 18 | default-features = false; 19 | features = [ "rustc-demangle" "cpp_demangle" "fallible-iterator" "smallvec" ]; 20 | }; 21 | }; 22 | } 23 | -------------------------------------------------------------------------------- /crates/sel4-backtrace/symbolize/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: MIT OR Apache-2.0 5 | # 6 | # 7 | # This file is generated from './Cargo.nix'. You can edit this file directly 8 | # if you are not using this project's Cargo manifest management tools. 9 | # See 'hacking/cargo-manifest-management/README.md' for more information. 10 | # 11 | 12 | [package] 13 | name = "sel4-backtrace-symbolize" 14 | version = "0.1.0" 15 | authors = ["Nick Spinale "] 16 | edition = "2021" 17 | license = "MIT OR Apache-2.0" 18 | 19 | [dependencies.addr2line] 20 | version = "0.24.2" 21 | default-features = false 22 | features = ["rustc-demangle", "cpp_demangle", "fallible-iterator", "smallvec"] 23 | -------------------------------------------------------------------------------- /crates/sel4-capdl-initializer/add-spec/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, localCrates, versions, postcardWith }: 8 | 9 | mk { 10 | package.name = "sel4-capdl-initializer-add-spec"; 11 | dependencies = { 12 | inherit (versions) 13 | anyhow 14 | serde_json 15 | num 16 | clap 17 | ; 18 | object = { version = versions.object; features = [ "all" ]; }; 19 | postcard = postcardWith [ "alloc" ]; 20 | inherit (localCrates) 21 | sel4-synthetic-elf 22 | ; 23 | sel4-capdl-initializer-types = localCrates.sel4-capdl-initializer-types // { features = [ "std" "serde" "deflate" ]; }; 24 | }; 25 | } 26 | -------------------------------------------------------------------------------- /crates/sel4-capdl-initializer/build.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause 5 | // 6 | 7 | fn main() { 8 | // No use in root task. 9 | // Remove unnecessary alignment gap between segments. 10 | println!("cargo:rustc-link-arg=--no-rosegment"); 11 | 12 | // No external dependencies 13 | println!("cargo:rerun-if-changed=build.rs"); 14 | } 15 | -------------------------------------------------------------------------------- /crates/sel4-capdl-initializer/core/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, localCrates, versions }: 8 | 9 | mk { 10 | package.name = "sel4-capdl-initializer-core"; 11 | dependencies = { 12 | inherit (versions) log; 13 | inherit (localCrates) 14 | sel4 15 | ; 16 | sel4-capdl-initializer-types = localCrates.sel4-capdl-initializer-types // { features = [ "sel4" ]; }; 17 | }; 18 | } 19 | -------------------------------------------------------------------------------- /crates/sel4-capdl-initializer/core/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | # 7 | # This file is generated from './Cargo.nix'. You can edit this file directly 8 | # if you are not using this project's Cargo manifest management tools. 9 | # See 'hacking/cargo-manifest-management/README.md' for more information. 10 | # 11 | 12 | [package] 13 | name = "sel4-capdl-initializer-core" 14 | version = "0.1.0" 15 | authors = ["Nick Spinale "] 16 | edition = "2021" 17 | license = "BSD-2-Clause" 18 | 19 | [dependencies] 20 | log = "0.4.17" 21 | sel4 = { path = "../../sel4" } 22 | sel4-capdl-initializer-types = { path = "../types", features = ["sel4"] } 23 | -------------------------------------------------------------------------------- /crates/sel4-capdl-initializer/embed-spec/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, localCrates, versions }: 8 | 9 | mk { 10 | package.name = "sel4-capdl-initializer-embed-spec"; 11 | dependencies = { 12 | inherit (versions) 13 | proc-macro2 14 | quote 15 | syn 16 | serde 17 | serde_json 18 | hex 19 | ; 20 | sel4-capdl-initializer-types = localCrates.sel4-capdl-initializer-types // { features = [ "serde" "std" "deflate" ]; }; 21 | }; 22 | } 23 | -------------------------------------------------------------------------------- /crates/sel4-capdl-initializer/types/derive/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, versions }: 8 | 9 | mk { 10 | package.name = "sel4-capdl-initializer-types-derive"; 11 | lib.proc-macro = true; 12 | dependencies = { 13 | inherit (versions) 14 | proc-macro2 15 | quote 16 | syn 17 | ; 18 | }; 19 | } 20 | -------------------------------------------------------------------------------- /crates/sel4-capdl-initializer/types/derive/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | # 7 | # This file is generated from './Cargo.nix'. You can edit this file directly 8 | # if you are not using this project's Cargo manifest management tools. 9 | # See 'hacking/cargo-manifest-management/README.md' for more information. 10 | # 11 | 12 | [package] 13 | name = "sel4-capdl-initializer-types-derive" 14 | version = "0.1.0" 15 | authors = ["Nick Spinale "] 16 | edition = "2021" 17 | license = "BSD-2-Clause" 18 | 19 | [lib] 20 | proc-macro = true 21 | 22 | [dependencies] 23 | proc-macro2 = "1.0.89" 24 | quote = "1.0.37" 25 | syn = "2.0.85" 26 | -------------------------------------------------------------------------------- /crates/sel4-capdl-initializer/with-embedded-spec/build-env/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, localCrates, versions }: 8 | 9 | mk { 10 | package.name = "sel4-capdl-initializer-with-embedded-spec-build-env"; 11 | dependencies = { 12 | inherit (versions) serde serde_json; 13 | inherit (localCrates) 14 | sel4-capdl-initializer-embed-spec 15 | ; 16 | sel4-capdl-initializer-types = localCrates.sel4-capdl-initializer-types // { features = [ "std" "serde" ]; }; 17 | }; 18 | } 19 | -------------------------------------------------------------------------------- /crates/sel4-capdl-initializer/with-embedded-spec/build.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause 5 | // 6 | 7 | fn main() { 8 | sel4_capdl_initializer_with_embedded_spec_embedded_spec_validate::run(true); 9 | 10 | // No use in root task. 11 | // Remove unnecessary alignment gap between segments. 12 | println!("cargo:rustc-link-arg=--no-rosegment"); 13 | 14 | // No external dependencies 15 | println!("cargo:rerun-if-changed=build.rs"); 16 | } 17 | -------------------------------------------------------------------------------- /crates/sel4-capdl-initializer/with-embedded-spec/embedded-spec/src/lib.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause 5 | // 6 | 7 | #![no_std] 8 | #![allow(clippy::type_complexity)] 9 | 10 | mod gen { 11 | include!(concat!(env!("OUT_DIR"), "/spec.rs")); 12 | } 13 | 14 | pub use gen::SPEC; 15 | -------------------------------------------------------------------------------- /crates/sel4-capdl-initializer/with-embedded-spec/embedded-spec/validate/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, localCrates }: 8 | 9 | mk { 10 | package.name = "sel4-capdl-initializer-with-embedded-spec-embedded-spec-validate"; 11 | features = { 12 | deflate = [ "sel4-capdl-initializer-with-embedded-spec-embedded-spec/deflate" ]; 13 | }; 14 | dependencies = { 15 | inherit (localCrates) 16 | sel4-capdl-initializer-types 17 | sel4-capdl-initializer-with-embedded-spec-build-env 18 | sel4-capdl-initializer-with-embedded-spec-embedded-spec 19 | ; 20 | }; 21 | } 22 | -------------------------------------------------------------------------------- /crates/sel4-ctors-dtors/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2024, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk }: 8 | 9 | mk { 10 | package.name = "sel4-ctors-dtors"; 11 | } 12 | -------------------------------------------------------------------------------- /crates/sel4-ctors-dtors/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | # 7 | # This file is generated from './Cargo.nix'. You can edit this file directly 8 | # if you are not using this project's Cargo manifest management tools. 9 | # See 'hacking/cargo-manifest-management/README.md' for more information. 10 | # 11 | 12 | [package] 13 | name = "sel4-ctors-dtors" 14 | version = "0.1.0" 15 | authors = ["Nick Spinale "] 16 | edition = "2021" 17 | license = "BSD-2-Clause" 18 | -------------------------------------------------------------------------------- /crates/sel4-dlmalloc/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, versions }: 8 | 9 | mk { 10 | package.name = "sel4-dlmalloc"; 11 | dependencies = { 12 | inherit (versions) 13 | lock_api 14 | dlmalloc 15 | ; 16 | }; 17 | } 18 | -------------------------------------------------------------------------------- /crates/sel4-dlmalloc/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | # 7 | # This file is generated from './Cargo.nix'. You can edit this file directly 8 | # if you are not using this project's Cargo manifest management tools. 9 | # See 'hacking/cargo-manifest-management/README.md' for more information. 10 | # 11 | 12 | [package] 13 | name = "sel4-dlmalloc" 14 | version = "0.1.0" 15 | authors = ["Nick Spinale "] 16 | edition = "2021" 17 | license = "BSD-2-Clause" 18 | 19 | [dependencies] 20 | dlmalloc = "0.2.3" 21 | lock_api = "0.4.12" 22 | -------------------------------------------------------------------------------- /crates/sel4-driver-interfaces/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, versions, serdeWith }: 8 | 9 | mk { 10 | package.name = "sel4-driver-interfaces"; 11 | dependencies = { 12 | inherit (versions) embedded-hal-nb rtcc heapless lock_api; 13 | serde = serdeWith [ "derive" ]; 14 | }; 15 | } 16 | -------------------------------------------------------------------------------- /crates/sel4-driver-interfaces/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | # 7 | # This file is generated from './Cargo.nix'. You can edit this file directly 8 | # if you are not using this project's Cargo manifest management tools. 9 | # See 'hacking/cargo-manifest-management/README.md' for more information. 10 | # 11 | 12 | [package] 13 | name = "sel4-driver-interfaces" 14 | version = "0.1.0" 15 | authors = ["Nick Spinale "] 16 | edition = "2021" 17 | license = "BSD-2-Clause" 18 | 19 | [dependencies] 20 | embedded-hal-nb = "1.0" 21 | heapless = "0.8.0" 22 | lock_api = "0.4.12" 23 | rtcc = "0.3.2" 24 | serde = { version = "1.0.147", default-features = false, features = ["derive"] } 25 | -------------------------------------------------------------------------------- /crates/sel4-elf-header/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2024, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk }: 8 | 9 | mk { 10 | package.name = "sel4-elf-header"; 11 | } 12 | -------------------------------------------------------------------------------- /crates/sel4-elf-header/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | # 7 | # This file is generated from './Cargo.nix'. You can edit this file directly 8 | # if you are not using this project's Cargo manifest management tools. 9 | # See 'hacking/cargo-manifest-management/README.md' for more information. 10 | # 11 | 12 | [package] 13 | name = "sel4-elf-header" 14 | version = "0.1.0" 15 | authors = ["Nick Spinale "] 16 | edition = "2021" 17 | license = "BSD-2-Clause" 18 | -------------------------------------------------------------------------------- /crates/sel4-generate-target-specs/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, versions }: 8 | 9 | mk { 10 | package.name = "sel4-generate-target-specs"; 11 | dependencies = { 12 | inherit (versions) cfg-if serde_json clap; 13 | }; 14 | build-dependencies = { 15 | inherit (versions) rustversion; 16 | }; 17 | package.metadata.rust-analyzer = { 18 | rustc_private = true; 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /crates/sel4-generate-target-specs/src/microkit-resettable.lds: -------------------------------------------------------------------------------- 1 | SECTIONS { 2 | .persistent : { 3 | *(.persistent .persistent.*) 4 | } 5 | } INSERT BEFORE .data; 6 | 7 | ASSERT(DEFINED(_reset), "_reset is not defined") 8 | 9 | ENTRY(_reset) 10 | -------------------------------------------------------------------------------- /crates/sel4-immediate-sync-once-cell/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk }: 8 | 9 | mk { 10 | package.name = "sel4-immediate-sync-once-cell"; 11 | } 12 | -------------------------------------------------------------------------------- /crates/sel4-immediate-sync-once-cell/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | # 7 | # This file is generated from './Cargo.nix'. You can edit this file directly 8 | # if you are not using this project's Cargo manifest management tools. 9 | # See 'hacking/cargo-manifest-management/README.md' for more information. 10 | # 11 | 12 | [package] 13 | name = "sel4-immediate-sync-once-cell" 14 | version = "0.1.0" 15 | authors = ["Nick Spinale "] 16 | edition = "2021" 17 | license = "BSD-2-Clause" 18 | -------------------------------------------------------------------------------- /crates/sel4-immutable-cell/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk }: 8 | 9 | mk { 10 | package.name = "sel4-immutable-cell"; 11 | } 12 | -------------------------------------------------------------------------------- /crates/sel4-immutable-cell/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | # 7 | # This file is generated from './Cargo.nix'. You can edit this file directly 8 | # if you are not using this project's Cargo manifest management tools. 9 | # See 'hacking/cargo-manifest-management/README.md' for more information. 10 | # 11 | 12 | [package] 13 | name = "sel4-immutable-cell" 14 | version = "0.1.0" 15 | authors = ["Nick Spinale "] 16 | edition = "2021" 17 | license = "BSD-2-Clause" 18 | -------------------------------------------------------------------------------- /crates/sel4-initialize-tls/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, versions, localCrates }: 8 | 9 | mk { 10 | package.name = "sel4-initialize-tls"; 11 | dependencies = { 12 | inherit (versions) cfg-if; 13 | sel4-alloca = localCrates.sel4-alloca // { optional = true; }; 14 | }; 15 | features = { 16 | on-stack = [ "sel4-alloca" ]; 17 | on-heap = [ "alloc" ]; 18 | alloc = []; 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /crates/sel4-initialize-tls/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | # 7 | # This file is generated from './Cargo.nix'. You can edit this file directly 8 | # if you are not using this project's Cargo manifest management tools. 9 | # See 'hacking/cargo-manifest-management/README.md' for more information. 10 | # 11 | 12 | [package] 13 | name = "sel4-initialize-tls" 14 | version = "0.1.0" 15 | authors = ["Nick Spinale "] 16 | edition = "2021" 17 | license = "BSD-2-Clause" 18 | 19 | [features] 20 | alloc = [] 21 | on-heap = ["alloc"] 22 | on-stack = ["sel4-alloca"] 23 | 24 | [dependencies] 25 | cfg-if = "1.0.0" 26 | sel4-alloca = { path = "../sel4-alloca", optional = true } 27 | -------------------------------------------------------------------------------- /crates/sel4-kernel-loader/asm/aarch32/macros.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023, Colias Group, LLC 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #define BEGIN_LOCAL_FUNC(_name) \ 8 | .type _name, %function ; \ 9 | _name: 10 | 11 | #define BEGIN_FUNC(_name) \ 12 | .global _name ; \ 13 | BEGIN_LOCAL_FUNC(_name) 14 | 15 | #define END_FUNC(_name) \ 16 | .size _name, .-_name 17 | -------------------------------------------------------------------------------- /crates/sel4-kernel-loader/asm/aarch32/psci.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #include "macros.h" 8 | 9 | .macro psci_func op 10 | stmfd sp!, {r3-r11, lr} 11 | dsb 12 | \op #0 13 | ldmfd sp!, {r3-r11, pc} 14 | .endm 15 | 16 | .arch_extension sec 17 | .arch_extension virt 18 | 19 | .text 20 | 21 | BEGIN_FUNC(smc_psci_func) 22 | psci_func smc 23 | END_FUNC(smc_psci_func) 24 | 25 | BEGIN_FUNC(hvc_psci_func) 26 | psci_func hvc 27 | END_FUNC(hvc_psci_func) 28 | -------------------------------------------------------------------------------- /crates/sel4-kernel-loader/asm/aarch64/macros.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023, Colias Group, LLC 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #define BEGIN_LOCAL_FUNC(_name) \ 8 | .type _name, %function ; \ 9 | _name: 10 | 11 | #define BEGIN_FUNC(_name) \ 12 | .global _name ; \ 13 | BEGIN_LOCAL_FUNC(_name) 14 | 15 | #define END_FUNC(_name) \ 16 | .size _name, .-_name 17 | -------------------------------------------------------------------------------- /crates/sel4-kernel-loader/config-types/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, serdeWith }: 8 | 9 | mk { 10 | package.name = "sel4-kernel-loader-config-types"; 11 | dependencies = { 12 | serde = serdeWith [ "derive" ]; 13 | }; 14 | } 15 | -------------------------------------------------------------------------------- /crates/sel4-kernel-loader/config-types/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | # 7 | # This file is generated from './Cargo.nix'. You can edit this file directly 8 | # if you are not using this project's Cargo manifest management tools. 9 | # See 'hacking/cargo-manifest-management/README.md' for more information. 10 | # 11 | 12 | [package] 13 | name = "sel4-kernel-loader-config-types" 14 | version = "0.1.0" 15 | authors = ["Nick Spinale "] 16 | edition = "2021" 17 | license = "BSD-2-Clause" 18 | 19 | [dependencies] 20 | serde = { version = "1.0.147", default-features = false, features = ["derive"] } 21 | -------------------------------------------------------------------------------- /crates/sel4-kernel-loader/config-types/src/lib.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause 5 | // 6 | 7 | use serde::{Deserialize, Serialize}; 8 | 9 | #[derive(Debug, Clone, Serialize, Deserialize)] 10 | pub struct LoaderConfig {} 11 | -------------------------------------------------------------------------------- /crates/sel4-kernel-loader/embed-page-tables/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, versions }: 8 | 9 | mk { 10 | package.name = "sel4-kernel-loader-embed-page-tables"; 11 | dependencies = { 12 | inherit (versions) proc-macro2 quote bitfield; 13 | }; 14 | } 15 | -------------------------------------------------------------------------------- /crates/sel4-kernel-loader/embed-page-tables/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | # 7 | # This file is generated from './Cargo.nix'. You can edit this file directly 8 | # if you are not using this project's Cargo manifest management tools. 9 | # See 'hacking/cargo-manifest-management/README.md' for more information. 10 | # 11 | 12 | [package] 13 | name = "sel4-kernel-loader-embed-page-tables" 14 | version = "0.1.0" 15 | authors = ["Nick Spinale "] 16 | edition = "2021" 17 | license = "BSD-2-Clause" 18 | 19 | [dependencies] 20 | bitfield = "0.17.0" 21 | proc-macro2 = "1.0.89" 22 | quote = "1.0.37" 23 | -------------------------------------------------------------------------------- /crates/sel4-kernel-loader/embed-page-tables/runtime/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk }: 8 | 9 | mk { 10 | package.name = "sel4-kernel-loader-embed-page-tables-runtime"; 11 | } 12 | -------------------------------------------------------------------------------- /crates/sel4-kernel-loader/embed-page-tables/runtime/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | # 7 | # This file is generated from './Cargo.nix'. You can edit this file directly 8 | # if you are not using this project's Cargo manifest management tools. 9 | # See 'hacking/cargo-manifest-management/README.md' for more information. 10 | # 11 | 12 | [package] 13 | name = "sel4-kernel-loader-embed-page-tables-runtime" 14 | version = "0.1.0" 15 | authors = ["Nick Spinale "] 16 | edition = "2021" 17 | license = "BSD-2-Clause" 18 | -------------------------------------------------------------------------------- /crates/sel4-kernel-loader/embed-page-tables/src/lib.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause 5 | // 6 | 7 | mod embed; 8 | mod glue; 9 | mod regions; 10 | mod scheme; 11 | mod table; 12 | 13 | pub use glue::{Region, Regions, RegionsBuilder}; 14 | pub use regions::{AbstractRegion, AbstractRegions, AbstractRegionsBuilder}; 15 | pub use scheme::{Scheme, SchemeHelpers}; 16 | pub use table::{LeafLocation, MkLeafFn, RegionContent, Table}; 17 | 18 | pub mod schemes { 19 | pub use crate::scheme::{AArch32, AArch64, RiscV32Sv32, RiscV64Sv39}; 20 | } 21 | -------------------------------------------------------------------------------- /crates/sel4-kernel-loader/payload-types/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, localCrates, serdeWith, versions }: 8 | 9 | mk { 10 | package.name = "sel4-kernel-loader-payload-types"; 11 | dependencies = { 12 | serde = serdeWith [ "derive" ] // { optional = true; }; 13 | heapless = { version = versions.heapless; features = [ "serde" ]; }; 14 | num-traits = { version = versions.num-traits; default-features = false; }; 15 | inherit (localCrates) sel4-platform-info-types; 16 | }; 17 | } 18 | -------------------------------------------------------------------------------- /crates/sel4-kernel-loader/src/arch/arm/arch/aarch32/drivers/mod.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2024, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause 5 | // 6 | 7 | pub(crate) mod psci; 8 | pub(crate) mod spin_table; 9 | -------------------------------------------------------------------------------- /crates/sel4-kernel-loader/src/arch/arm/arch/aarch64/drivers/mod.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause 5 | // 6 | 7 | pub(crate) mod psci; 8 | pub(crate) mod spin_table; 9 | -------------------------------------------------------------------------------- /crates/sel4-kernel-loader/src/arch/arm/arch/mod.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2024, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause 5 | // 6 | 7 | sel4_config::sel4_cfg_if! { 8 | if #[sel4_cfg(ARCH_AARCH64)] { 9 | #[path = "aarch64/mod.rs"] 10 | mod imp; 11 | } else if #[sel4_cfg(ARCH_AARCH32)] { 12 | #[path = "aarch32/mod.rs"] 13 | mod imp; 14 | } 15 | } 16 | 17 | // HACK for rustfmt 18 | #[cfg(any())] 19 | mod aarch32; 20 | #[cfg(any())] 21 | mod aarch64; 22 | 23 | pub(crate) use imp::*; 24 | -------------------------------------------------------------------------------- /crates/sel4-kernel-loader/src/arch/arm/mod.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2024, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause 5 | // 6 | 7 | pub(crate) mod arch; 8 | 9 | pub(crate) use arch::*; 10 | -------------------------------------------------------------------------------- /crates/sel4-kernel-loader/src/rt.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause 5 | // 6 | 7 | use core::panic::PanicInfo; 8 | 9 | use crate::arch::{Arch, ArchImpl}; 10 | 11 | #[panic_handler] 12 | fn panic_handler(info: &PanicInfo) -> ! { 13 | log::error!("{}", info); 14 | ArchImpl::idle() 15 | } 16 | -------------------------------------------------------------------------------- /crates/sel4-linux-syscall-types/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2024, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, versions }: 8 | 9 | mk { 10 | package.name = "sel4-linux-syscall-types"; 11 | dependencies = { 12 | inherit (versions) cfg-if; 13 | }; 14 | } 15 | -------------------------------------------------------------------------------- /crates/sel4-linux-syscall-types/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | # 7 | # This file is generated from './Cargo.nix'. You can edit this file directly 8 | # if you are not using this project's Cargo manifest management tools. 9 | # See 'hacking/cargo-manifest-management/README.md' for more information. 10 | # 11 | 12 | [package] 13 | name = "sel4-linux-syscall-types" 14 | version = "0.1.0" 15 | authors = ["Nick Spinale "] 16 | edition = "2021" 17 | license = "BSD-2-Clause" 18 | 19 | [dependencies] 20 | cfg-if = "1.0.0" 21 | -------------------------------------------------------------------------------- /crates/sel4-logging/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, versions }: 8 | 9 | mk { 10 | package.name = "sel4-logging"; 11 | dependencies = { 12 | inherit (versions) log lock_api; 13 | }; 14 | } 15 | -------------------------------------------------------------------------------- /crates/sel4-logging/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | # 7 | # This file is generated from './Cargo.nix'. You can edit this file directly 8 | # if you are not using this project's Cargo manifest management tools. 9 | # See 'hacking/cargo-manifest-management/README.md' for more information. 10 | # 11 | 12 | [package] 13 | name = "sel4-logging" 14 | version = "0.1.0" 15 | authors = ["Nick Spinale "] 16 | edition = "2021" 17 | license = "BSD-2-Clause" 18 | 19 | [dependencies] 20 | lock_api = "0.4.12" 21 | log = "0.4.17" 22 | -------------------------------------------------------------------------------- /crates/sel4-microkit/base/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, localCrates }: 8 | 9 | mk { 10 | package.name = "sel4-microkit-base"; 11 | dependencies = { 12 | inherit (localCrates) 13 | sel4-immutable-cell 14 | sel4 15 | ; 16 | }; 17 | features = { 18 | extern-symbols = []; 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /crates/sel4-microkit/base/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | # 7 | # This file is generated from './Cargo.nix'. You can edit this file directly 8 | # if you are not using this project's Cargo manifest management tools. 9 | # See 'hacking/cargo-manifest-management/README.md' for more information. 10 | # 11 | 12 | [package] 13 | name = "sel4-microkit-base" 14 | version = "0.1.0" 15 | authors = ["Nick Spinale "] 16 | edition = "2021" 17 | license = "BSD-2-Clause" 18 | 19 | [features] 20 | extern-symbols = [] 21 | 22 | [dependencies] 23 | sel4 = { path = "../../sel4" } 24 | sel4-immutable-cell = { path = "../../sel4-immutable-cell" } 25 | -------------------------------------------------------------------------------- /crates/sel4-microkit/driver-adapters/src/block/message_types.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2024, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause 5 | // 6 | 7 | use serde::{Deserialize, Serialize}; 8 | 9 | #[derive(Debug, Serialize, Deserialize)] 10 | pub(crate) enum Request { 11 | GetBlockSize, 12 | GetNumBlocks, 13 | } 14 | 15 | pub(crate) type Response = Result; 16 | 17 | #[derive(Debug, Serialize, Deserialize)] 18 | pub(crate) enum SuccessResponse { 19 | GetBlockSize(usize), 20 | GetNumBlocks(u64), 21 | } 22 | 23 | #[derive(Debug, Copy, Clone, Serialize, Deserialize)] 24 | pub enum ErrorResponse { 25 | Unspecified, 26 | } 27 | -------------------------------------------------------------------------------- /crates/sel4-microkit/driver-adapters/src/block/mod.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2024, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause 5 | // 6 | 7 | mod message_types; 8 | 9 | pub mod client; 10 | pub mod driver; 11 | 12 | pub use message_types::ErrorResponse; 13 | -------------------------------------------------------------------------------- /crates/sel4-microkit/driver-adapters/src/lib.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023, Colias Group, LLC 3 | // Copyright 2023, Galois, Inc. 4 | // 5 | // SPDX-License-Identifier: BSD-2-Clause 6 | // 7 | 8 | #![no_std] 9 | 10 | pub mod block; 11 | pub mod net; 12 | pub mod rtc; 13 | pub mod serial; 14 | pub mod timer; 15 | -------------------------------------------------------------------------------- /crates/sel4-microkit/driver-adapters/src/net/message_types.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023, Colias Group, LLC 3 | // Copyright 2023, Galois, Inc. 4 | // 5 | // SPDX-License-Identifier: BSD-2-Clause 6 | // 7 | 8 | use serde::{Deserialize, Serialize}; 9 | 10 | use sel4_driver_interfaces::net::MacAddress; 11 | 12 | #[derive(Debug, Serialize, Deserialize)] 13 | pub(crate) enum Request { 14 | GetMacAddress, 15 | } 16 | 17 | pub(crate) type Response = Result; 18 | 19 | #[derive(Debug, Serialize, Deserialize)] 20 | pub(crate) enum SuccessResponse { 21 | GetMacAddress(MacAddress), 22 | } 23 | 24 | #[derive(Debug, Copy, Clone, Serialize, Deserialize)] 25 | pub enum ErrorResponse { 26 | Unspecified, 27 | } 28 | -------------------------------------------------------------------------------- /crates/sel4-microkit/driver-adapters/src/net/mod.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023, Colias Group, LLC 3 | // Copyright 2023, Galois, Inc. 4 | // 5 | // SPDX-License-Identifier: BSD-2-Clause 6 | // 7 | 8 | mod message_types; 9 | 10 | pub mod client; 11 | pub mod driver; 12 | 13 | pub use message_types::ErrorResponse; 14 | -------------------------------------------------------------------------------- /crates/sel4-microkit/driver-adapters/src/rtc/message_types.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2024, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause 5 | // 6 | 7 | use rtcc::NaiveDateTime; 8 | use serde::{Deserialize, Serialize}; 9 | 10 | #[derive(Debug, Serialize, Deserialize)] 11 | pub(crate) enum Request { 12 | DateTime, 13 | SetDateTime(NaiveDateTime), 14 | } 15 | 16 | pub(crate) type Response = Result; 17 | 18 | #[derive(Debug, Serialize, Deserialize)] 19 | pub(crate) enum SuccessResponse { 20 | DateTime(NaiveDateTime), 21 | SetDateTime, 22 | } 23 | 24 | #[derive(Debug, Copy, Clone, Serialize, Deserialize)] 25 | pub enum ErrorResponse { 26 | DateTimeError, 27 | SetDateTimeError, 28 | } 29 | -------------------------------------------------------------------------------- /crates/sel4-microkit/driver-adapters/src/rtc/mod.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2024, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause 5 | // 6 | 7 | mod message_types; 8 | 9 | pub mod client; 10 | pub mod driver; 11 | 12 | pub use message_types::ErrorResponse; 13 | -------------------------------------------------------------------------------- /crates/sel4-microkit/driver-adapters/src/serial/mod.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023, Colias Group, LLC 3 | // Copyright 2023, Galois, Inc. 4 | // 5 | // SPDX-License-Identifier: BSD-2-Clause 6 | // 7 | 8 | mod message_types; 9 | 10 | pub mod client; 11 | pub mod driver; 12 | 13 | pub use message_types::ErrorResponse; 14 | -------------------------------------------------------------------------------- /crates/sel4-microkit/driver-adapters/src/timer/mod.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2024, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause 5 | // 6 | 7 | mod message_types; 8 | 9 | pub mod client; 10 | pub mod driver; 11 | 12 | pub use message_types::ErrorResponse; 13 | -------------------------------------------------------------------------------- /crates/sel4-microkit/macros/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, versions }: 8 | 9 | mk { 10 | package.name = "sel4-microkit-macros"; 11 | lib.proc-macro = true; 12 | dependencies = { 13 | syn = { version = versions.syn; features = [ "full" ]; }; 14 | inherit (versions) proc-macro2 quote; 15 | }; 16 | } 17 | -------------------------------------------------------------------------------- /crates/sel4-microkit/macros/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | # 7 | # This file is generated from './Cargo.nix'. You can edit this file directly 8 | # if you are not using this project's Cargo manifest management tools. 9 | # See 'hacking/cargo-manifest-management/README.md' for more information. 10 | # 11 | 12 | [package] 13 | name = "sel4-microkit-macros" 14 | version = "0.1.0" 15 | authors = ["Nick Spinale "] 16 | edition = "2021" 17 | license = "BSD-2-Clause" 18 | 19 | [lib] 20 | proc-macro = true 21 | 22 | [dependencies] 23 | proc-macro2 = "1.0.89" 24 | quote = "1.0.37" 25 | syn = { version = "2.0.85", features = ["full"] } 26 | -------------------------------------------------------------------------------- /crates/sel4-microkit/macros/src/lib.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause 5 | // 6 | 7 | use proc_macro::TokenStream; 8 | use proc_macro2::TokenStream as TokenStream2; 9 | use quote::quote; 10 | use syn::parse_macro_input; 11 | 12 | #[proc_macro_attribute] 13 | pub fn protection_domain(attr: TokenStream, item: TokenStream) -> TokenStream { 14 | let item = parse_macro_input!(item as syn::ItemFn); 15 | let ident = &item.sig.ident; 16 | let attr = TokenStream2::from(attr); 17 | quote! { 18 | ::sel4_microkit::declare_protection_domain!(init = #ident, #attr); 19 | 20 | #item 21 | } 22 | .into() 23 | } 24 | -------------------------------------------------------------------------------- /crates/sel4-microkit/message/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, localCrates, serdeWith }: 8 | 9 | mk { 10 | package.name = "sel4-microkit-message"; 11 | dependencies = { 12 | serde = serdeWith [] // { 13 | optional = true; 14 | }; 15 | inherit (localCrates) 16 | sel4-microkit-base 17 | sel4-microkit-message-types 18 | ; 19 | }; 20 | features = { 21 | default = [ "postcard" ]; 22 | postcard = [ "dep:serde" "sel4-microkit-message-types/postcard" ]; 23 | }; 24 | } 25 | -------------------------------------------------------------------------------- /crates/sel4-microkit/message/types/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, versions, serdeWith, postcardWith }: 8 | 9 | mk { 10 | package.name = "sel4-microkit-message-types"; 11 | dependencies = { 12 | inherit (versions) zerocopy; 13 | num_enum = { version = versions.num_enum; default-features = false; }; 14 | serde = serdeWith [] // { 15 | optional = true; 16 | }; 17 | postcard = postcardWith [] // { 18 | optional = true; 19 | }; 20 | }; 21 | features = { 22 | default = [ "postcard" ]; 23 | postcard = [ "dep:postcard" "dep:serde" ]; 24 | }; 25 | } 26 | -------------------------------------------------------------------------------- /crates/sel4-mod-in-out-dir/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2024, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, versions }: 8 | 9 | mk { 10 | package.name = "sel4-mod-in-out-dir"; 11 | lib.proc-macro = true; 12 | dependencies = { 13 | inherit (versions) quote; 14 | syn = { version = versions.syn; features = [ "full" ]; }; 15 | }; 16 | } 17 | -------------------------------------------------------------------------------- /crates/sel4-mod-in-out-dir/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | # 7 | # This file is generated from './Cargo.nix'. You can edit this file directly 8 | # if you are not using this project's Cargo manifest management tools. 9 | # See 'hacking/cargo-manifest-management/README.md' for more information. 10 | # 11 | 12 | [package] 13 | name = "sel4-mod-in-out-dir" 14 | version = "0.1.0" 15 | authors = ["Nick Spinale "] 16 | edition = "2021" 17 | license = "BSD-2-Clause" 18 | 19 | [lib] 20 | proc-macro = true 21 | 22 | [dependencies] 23 | quote = "1.0.37" 24 | syn = { version = "2.0.85", features = ["full"] } 25 | -------------------------------------------------------------------------------- /crates/sel4-musl/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2024, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, localCrates }: 8 | 9 | mk { 10 | package.name = "sel4-musl"; 11 | dependencies = { 12 | inherit (localCrates) 13 | sel4-immediate-sync-once-cell 14 | sel4-linux-syscall-types 15 | ; 16 | }; 17 | } 18 | -------------------------------------------------------------------------------- /crates/sel4-musl/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | # 7 | # This file is generated from './Cargo.nix'. You can edit this file directly 8 | # if you are not using this project's Cargo manifest management tools. 9 | # See 'hacking/cargo-manifest-management/README.md' for more information. 10 | # 11 | 12 | [package] 13 | name = "sel4-musl" 14 | version = "0.1.0" 15 | authors = ["Nick Spinale "] 16 | edition = "2021" 17 | license = "BSD-2-Clause" 18 | 19 | [dependencies] 20 | sel4-immediate-sync-once-cell = { path = "../sel4-immediate-sync-once-cell" } 21 | sel4-linux-syscall-types = { path = "../sel4-linux-syscall-types" } 22 | -------------------------------------------------------------------------------- /crates/sel4-newlib/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, localCrates, versions }: 8 | 9 | mk { 10 | package.name = "sel4-newlib"; 11 | features = { 12 | default = [ "detect-libc" ]; 13 | detect-libc = [ "cc" ]; 14 | nosys = []; 15 | _exit = []; 16 | _write = []; 17 | errno = []; 18 | all-symbols = [ 19 | "_exit" 20 | "_write" 21 | "errno" 22 | ]; 23 | }; 24 | dependencies = { 25 | inherit (localCrates) sel4-panicking-env; 26 | log = { version = versions.log; optional = true; }; 27 | }; 28 | build-dependencies = { 29 | cc = { version = versions.cc; optional = true; }; 30 | }; 31 | } 32 | -------------------------------------------------------------------------------- /crates/sel4-newlib/src/errno.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause 5 | // 6 | 7 | use core::ffi::c_int; 8 | 9 | #[cfg(feature = "errno")] 10 | #[no_mangle] 11 | static mut errno: c_int = 0; 12 | 13 | #[cfg(not(feature = "errno"))] 14 | extern "C" { 15 | static mut errno: c_int; 16 | } 17 | 18 | pub(crate) fn set_errno(err: c_int) { 19 | unsafe { 20 | errno = err; 21 | } 22 | } 23 | 24 | #[allow(dead_code)] 25 | pub(crate) mod values { 26 | use super::*; 27 | 28 | pub(crate) const ENOENT: c_int = 2; 29 | pub(crate) const ENOMEM: c_int = 12; 30 | } 31 | -------------------------------------------------------------------------------- /crates/sel4-one-ref-cell/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk }: 8 | 9 | mk { 10 | package.name = "sel4-one-ref-cell"; 11 | } 12 | -------------------------------------------------------------------------------- /crates/sel4-one-ref-cell/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | # 7 | # This file is generated from './Cargo.nix'. You can edit this file directly 8 | # if you are not using this project's Cargo manifest management tools. 9 | # See 'hacking/cargo-manifest-management/README.md' for more information. 10 | # 11 | 12 | [package] 13 | name = "sel4-one-ref-cell" 14 | version = "0.1.0" 15 | authors = ["Nick Spinale "] 16 | edition = "2021" 17 | license = "BSD-2-Clause" 18 | -------------------------------------------------------------------------------- /crates/sel4-panicking/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, localCrates, versions, unwindingWith }: 8 | 9 | mk { 10 | package.name = "sel4-panicking"; 11 | dependencies = { 12 | inherit (versions) cfg-if; 13 | inherit (localCrates) 14 | sel4-panicking-env 15 | sel4-immediate-sync-once-cell 16 | ; 17 | }; 18 | target."cfg(panic = \"unwind\")".dependencies = { 19 | unwinding = unwindingWith [ "personality" ]; 20 | }; 21 | features = { 22 | alloc = []; 23 | }; 24 | } 25 | -------------------------------------------------------------------------------- /crates/sel4-panicking/env/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk }: 8 | 9 | mk { 10 | package.name = "sel4-panicking-env"; 11 | } 12 | -------------------------------------------------------------------------------- /crates/sel4-panicking/env/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | # 7 | # This file is generated from './Cargo.nix'. You can edit this file directly 8 | # if you are not using this project's Cargo manifest management tools. 9 | # See 'hacking/cargo-manifest-management/README.md' for more information. 10 | # 11 | 12 | [package] 13 | name = "sel4-panicking-env" 14 | version = "0.1.0" 15 | authors = ["Nick Spinale "] 16 | edition = "2021" 17 | license = "BSD-2-Clause" 18 | -------------------------------------------------------------------------------- /crates/sel4-panicking/src/count/mod.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause 5 | // 6 | 7 | cfg_if::cfg_if! { 8 | if #[cfg(target_thread_local)] { 9 | mod with_tls; 10 | use with_tls as whether_tls; 11 | } else { 12 | mod without_tls; 13 | use without_tls as whether_tls; 14 | } 15 | } 16 | 17 | pub(crate) use whether_tls::*; 18 | -------------------------------------------------------------------------------- /crates/sel4-panicking/src/strategy/abort/mod.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause 5 | // 6 | 7 | use sel4_panicking_env::abort_without_info; 8 | 9 | #[cfg(panic = "unwind")] 10 | use sel4_panicking_env::abort; 11 | 12 | pub(crate) fn panic_cleanup(_exception: *mut u8) { 13 | unreachable!() 14 | } 15 | 16 | pub(crate) fn start_panic() -> i32 { 17 | abort_without_info() 18 | } 19 | 20 | #[cfg(panic = "unwind")] 21 | #[lang = "eh_personality"] 22 | fn eh_personality() -> ! { 23 | abort!("unexpected call to eh_personality") 24 | } 25 | -------------------------------------------------------------------------------- /crates/sel4-panicking/src/strategy/mod.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause 5 | // 6 | 7 | cfg_if::cfg_if! { 8 | if #[cfg(panic = "unwind")] { 9 | mod unwind; 10 | use unwind as imp; 11 | } else { 12 | mod abort; 13 | use abort as imp; 14 | } 15 | } 16 | 17 | pub(crate) use imp::*; 18 | -------------------------------------------------------------------------------- /crates/sel4-panicking/src/strategy/unwind/mod.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause 5 | // 6 | 7 | use sel4_panicking_env::abort; 8 | 9 | cfg_if::cfg_if! { 10 | if #[cfg(feature = "alloc")] { 11 | mod with_alloc; 12 | use with_alloc as whether_alloc; 13 | } else { 14 | mod without_alloc; 15 | use without_alloc as whether_alloc; 16 | } 17 | } 18 | 19 | pub(crate) use whether_alloc::*; 20 | 21 | const RUST_EXCEPTION_CLASS: u64 = u64::from_be_bytes(*b"MOZ\0RUST"); 22 | 23 | pub(crate) fn drop_panic() -> ! { 24 | abort!("Rust panics must be rethrown") 25 | } 26 | 27 | pub(crate) fn foreign_exception() -> ! { 28 | abort!("Rust cannot catch foreign exceptions"); 29 | } 30 | -------------------------------------------------------------------------------- /crates/sel4-platform-info/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, localCrates, versions }: 8 | 9 | mk { 10 | package.name = "sel4-platform-info"; 11 | dependencies = { 12 | inherit (localCrates) 13 | sel4-platform-info-types 14 | ; 15 | }; 16 | build-dependencies = { 17 | inherit (versions) proc-macro2 quote serde_yaml; 18 | serde = { version = versions.serde; features = [ "derive" ]; }; 19 | inherit (localCrates) 20 | sel4-build-env 21 | sel4-config 22 | ; 23 | }; 24 | } 25 | -------------------------------------------------------------------------------- /crates/sel4-platform-info/src/lib.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause 5 | // 6 | 7 | #![no_std] 8 | #![allow(clippy::single_range_in_vec_init)] 9 | 10 | use sel4_platform_info_types::PlatformInfo; 11 | 12 | include! { 13 | concat!(env!("OUT_DIR"), "/gen.rs") 14 | } 15 | -------------------------------------------------------------------------------- /crates/sel4-platform-info/types/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk }: 8 | 9 | mk { 10 | package.name = "sel4-platform-info-types"; 11 | } 12 | -------------------------------------------------------------------------------- /crates/sel4-platform-info/types/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | # 7 | # This file is generated from './Cargo.nix'. You can edit this file directly 8 | # if you are not using this project's Cargo manifest management tools. 9 | # See 'hacking/cargo-manifest-management/README.md' for more information. 10 | # 11 | 12 | [package] 13 | name = "sel4-platform-info-types" 14 | version = "0.1.0" 15 | authors = ["Nick Spinale "] 16 | edition = "2021" 17 | license = "BSD-2-Clause" 18 | -------------------------------------------------------------------------------- /crates/sel4-platform-info/types/src/lib.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause 5 | // 6 | 7 | #![no_std] 8 | 9 | use core::ops::Range; 10 | 11 | #[derive(Debug, Clone)] 12 | pub struct PlatformInfo<'a, T> { 13 | pub memory: &'a [Range], 14 | pub devices: &'a [Range], 15 | } 16 | -------------------------------------------------------------------------------- /crates/sel4-reset/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2024, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, versions, localCrates }: 8 | 9 | mk { 10 | package.name = "sel4-reset"; 11 | dependencies = { 12 | inherit (versions) cfg-if; 13 | inherit (localCrates) sel4-stack; 14 | }; 15 | } 16 | -------------------------------------------------------------------------------- /crates/sel4-reset/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | # 7 | # This file is generated from './Cargo.nix'. You can edit this file directly 8 | # if you are not using this project's Cargo manifest management tools. 9 | # See 'hacking/cargo-manifest-management/README.md' for more information. 10 | # 11 | 12 | [package] 13 | name = "sel4-reset" 14 | version = "0.1.0" 15 | authors = ["Nick Spinale "] 16 | edition = "2021" 17 | license = "BSD-2-Clause" 18 | 19 | [dependencies] 20 | cfg-if = "1.0.0" 21 | sel4-stack = { path = "../sel4-stack" } 22 | -------------------------------------------------------------------------------- /crates/sel4-reset/cli/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2024, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, localCrates, versions }: 8 | 9 | mk { 10 | package.name = "sel4-reset-cli"; 11 | dependencies = { 12 | inherit (versions) 13 | anyhow 14 | num 15 | clap 16 | ; 17 | inherit (localCrates) 18 | sel4-synthetic-elf 19 | ; 20 | }; 21 | } 22 | -------------------------------------------------------------------------------- /crates/sel4-reset/cli/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | # 7 | # This file is generated from './Cargo.nix'. You can edit this file directly 8 | # if you are not using this project's Cargo manifest management tools. 9 | # See 'hacking/cargo-manifest-management/README.md' for more information. 10 | # 11 | 12 | [package] 13 | name = "sel4-reset-cli" 14 | version = "0.1.0" 15 | authors = ["Nick Spinale "] 16 | edition = "2021" 17 | license = "BSD-2-Clause" 18 | 19 | [dependencies] 20 | anyhow = "1.0.66" 21 | clap = "4.4.6" 22 | num = "0.4.1" 23 | sel4-synthetic-elf = { path = "../../sel4-synthetic-elf" } 24 | -------------------------------------------------------------------------------- /crates/sel4-root-task/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, localCrates }: 8 | 9 | mk { 10 | package.name = "sel4-root-task"; 11 | dependencies = { 12 | inherit (localCrates) 13 | sel4 14 | sel4-immediate-sync-once-cell 15 | sel4-panicking 16 | sel4-panicking-env 17 | sel4-dlmalloc 18 | sel4-sync 19 | sel4-root-task-macros 20 | ; 21 | sel4-runtime-common = localCrates.sel4-runtime-common // { features = [ "full" ]; }; 22 | }; 23 | features = { 24 | full = [ 25 | "alloc" 26 | ]; 27 | alloc = [ 28 | "sel4-panicking/alloc" 29 | ]; 30 | single-threaded = [ 31 | "sel4/single-threaded" 32 | ]; 33 | }; 34 | } 35 | -------------------------------------------------------------------------------- /crates/sel4-root-task/default-test-harness/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, localCrates, versions }: 8 | 9 | mk rec { 10 | package.name = "sel4-root-task-default-test-harness"; 11 | dependencies = { 12 | inherit (localCrates) 13 | sel4 14 | sel4-root-task 15 | sel4-test-harness 16 | ; 17 | }; 18 | } 19 | -------------------------------------------------------------------------------- /crates/sel4-root-task/default-test-harness/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | # 7 | # This file is generated from './Cargo.nix'. You can edit this file directly 8 | # if you are not using this project's Cargo manifest management tools. 9 | # See 'hacking/cargo-manifest-management/README.md' for more information. 10 | # 11 | 12 | [package] 13 | name = "sel4-root-task-default-test-harness" 14 | version = "0.1.0" 15 | authors = ["Nick Spinale "] 16 | edition = "2021" 17 | license = "BSD-2-Clause" 18 | 19 | [dependencies] 20 | sel4 = { path = "../../sel4" } 21 | sel4-root-task = { path = ".." } 22 | sel4-test-harness = { path = "../../sel4-test-harness" } 23 | -------------------------------------------------------------------------------- /crates/sel4-root-task/default-test-harness/src/lib.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause 5 | // 6 | 7 | #![no_std] 8 | #![no_main] 9 | 10 | use sel4_root_task::root_task; 11 | use sel4_test_harness::run_test_main; 12 | 13 | pub use sel4_test_harness::for_generated_code::*; 14 | 15 | const HEAP_SIZE: usize = 64 * 1024 * 1024; 16 | 17 | #[root_task(heap_size = HEAP_SIZE)] 18 | fn main(_bootinfo: &sel4::BootInfoPtr) -> ! { 19 | run_test_main(); 20 | sel4::init_thread::suspend_self() 21 | } 22 | -------------------------------------------------------------------------------- /crates/sel4-root-task/macros/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, versions }: 8 | 9 | mk { 10 | package.name = "sel4-root-task-macros"; 11 | lib.proc-macro = true; 12 | dependencies = { 13 | syn = { version = versions.syn; features = [ "full" ]; }; 14 | inherit (versions) proc-macro2 quote; 15 | }; 16 | } 17 | -------------------------------------------------------------------------------- /crates/sel4-root-task/macros/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | # 7 | # This file is generated from './Cargo.nix'. You can edit this file directly 8 | # if you are not using this project's Cargo manifest management tools. 9 | # See 'hacking/cargo-manifest-management/README.md' for more information. 10 | # 11 | 12 | [package] 13 | name = "sel4-root-task-macros" 14 | version = "0.1.0" 15 | authors = ["Nick Spinale "] 16 | edition = "2021" 17 | license = "BSD-2-Clause" 18 | 19 | [lib] 20 | proc-macro = true 21 | 22 | [dependencies] 23 | proc-macro2 = "1.0.89" 24 | quote = "1.0.37" 25 | syn = { version = "2.0.85", features = ["full"] } 26 | -------------------------------------------------------------------------------- /crates/sel4-root-task/macros/src/lib.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause 5 | // 6 | 7 | use proc_macro::TokenStream; 8 | use proc_macro2::TokenStream as TokenStream2; 9 | use quote::quote; 10 | use syn::parse_macro_input; 11 | 12 | #[proc_macro_attribute] 13 | pub fn root_task(attr: TokenStream, item: TokenStream) -> TokenStream { 14 | let item = parse_macro_input!(item as syn::ItemFn); 15 | let ident = &item.sig.ident; 16 | let attr = TokenStream2::from(attr); 17 | quote! { 18 | ::sel4_root_task::declare_root_task!(main = #ident, #attr); 19 | 20 | #item 21 | } 22 | .into() 23 | } 24 | -------------------------------------------------------------------------------- /crates/sel4-runtime-common/src/abort.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2024, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause 5 | // 6 | 7 | sel4_panicking_env::register_abort_trap!(trap); 8 | 9 | fn trap() -> ! { 10 | core::intrinsics::abort() 11 | } 12 | -------------------------------------------------------------------------------- /crates/sel4-shared-memory/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, localCrates, versions, mkDefaultFrontmatterWithReuseArgs, defaultReuseFrontmatterArgs }: 8 | 9 | mk rec { 10 | nix.frontmatter = mkDefaultFrontmatterWithReuseArgs (defaultReuseFrontmatterArgs // { 11 | licenseID = package.license; 12 | }); 13 | package.name = "sel4-shared-memory"; 14 | package.license = "MIT OR Apache-2.0"; 15 | dependencies = { 16 | inherit (versions) cfg-if zerocopy; 17 | aligned = { version = versions.aligned; optional = true; }; 18 | inherit (localCrates) 19 | sel4-abstract-ptr 20 | ; 21 | }; 22 | features = { 23 | "atomics" = [ "dep:aligned" ]; 24 | }; 25 | } 26 | -------------------------------------------------------------------------------- /crates/sel4-shared-ring-buffer/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, localCrates, versions, zerocopyWith }: 8 | 9 | mk { 10 | package.name = "sel4-shared-ring-buffer"; 11 | dependencies = { 12 | inherit (versions) log; 13 | zerocopy = zerocopyWith [ "derive" ]; 14 | sel4-shared-memory = localCrates.sel4-shared-memory // { 15 | features = [ "atomics" ]; 16 | }; 17 | }; 18 | } 19 | -------------------------------------------------------------------------------- /crates/sel4-shared-ring-buffer/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | # 7 | # This file is generated from './Cargo.nix'. You can edit this file directly 8 | # if you are not using this project's Cargo manifest management tools. 9 | # See 'hacking/cargo-manifest-management/README.md' for more information. 10 | # 11 | 12 | [package] 13 | name = "sel4-shared-ring-buffer" 14 | version = "0.1.0" 15 | authors = ["Nick Spinale "] 16 | edition = "2021" 17 | license = "BSD-2-Clause" 18 | 19 | [dependencies] 20 | log = "0.4.17" 21 | sel4-shared-memory = { path = "../sel4-shared-memory", features = ["atomics"] } 22 | zerocopy = { version = "0.8.7", features = ["derive"] } 23 | -------------------------------------------------------------------------------- /crates/sel4-shared-ring-buffer/block-io/types/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, localCrates, versions, zerocopyWith }: 8 | 9 | mk { 10 | package.name = "sel4-shared-ring-buffer-block-io-types"; 11 | dependencies = { 12 | num_enum = { version = versions.num_enum; default-features = false; }; 13 | zerocopy = zerocopyWith [ "derive" ]; 14 | inherit (localCrates) 15 | sel4-shared-ring-buffer 16 | ; 17 | }; 18 | } 19 | -------------------------------------------------------------------------------- /crates/sel4-shared-ring-buffer/bookkeeping/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, versions }: 8 | 9 | mk { 10 | package.name = "sel4-shared-ring-buffer-bookkeeping"; 11 | dependencies = { 12 | async-unsync = { version = versions.async-unsync; default-features = false; optional = true; }; 13 | }; 14 | } 15 | -------------------------------------------------------------------------------- /crates/sel4-shared-ring-buffer/bookkeeping/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | # 7 | # This file is generated from './Cargo.nix'. You can edit this file directly 8 | # if you are not using this project's Cargo manifest management tools. 9 | # See 'hacking/cargo-manifest-management/README.md' for more information. 10 | # 11 | 12 | [package] 13 | name = "sel4-shared-ring-buffer-bookkeeping" 14 | version = "0.1.0" 15 | authors = ["Nick Spinale "] 16 | edition = "2021" 17 | license = "BSD-2-Clause" 18 | 19 | [dependencies] 20 | async-unsync = { version = "0.3.0", default-features = false, optional = true } 21 | -------------------------------------------------------------------------------- /crates/sel4-shared-ring-buffer/bookkeeping/src/lib.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause 5 | // 6 | 7 | #![no_std] 8 | 9 | extern crate alloc; 10 | 11 | pub mod slot_count_tracker; 12 | pub mod slot_set_semaphore; 13 | pub mod slot_tracker; 14 | -------------------------------------------------------------------------------- /crates/sel4-shared-ring-buffer/smoltcp/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, localCrates, versions, smoltcpWith }: 8 | 9 | mk { 10 | package.name = "sel4-shared-ring-buffer-smoltcp"; 11 | dependencies = { 12 | inherit (versions) 13 | log 14 | lock_api 15 | one-shot-mutex 16 | ; 17 | smoltcp = smoltcpWith []; 18 | inherit (localCrates) 19 | sel4-abstract-rc 20 | sel4-shared-ring-buffer 21 | sel4-shared-ring-buffer-bookkeeping 22 | sel4-abstract-allocator 23 | sel4-shared-memory 24 | ; 25 | }; 26 | } 27 | -------------------------------------------------------------------------------- /crates/sel4-stack/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2024, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk }: 8 | 9 | mk { 10 | package.name = "sel4-stack"; 11 | } 12 | -------------------------------------------------------------------------------- /crates/sel4-stack/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | # 7 | # This file is generated from './Cargo.nix'. You can edit this file directly 8 | # if you are not using this project's Cargo manifest management tools. 9 | # See 'hacking/cargo-manifest-management/README.md' for more information. 10 | # 11 | 12 | [package] 13 | name = "sel4-stack" 14 | version = "0.1.0" 15 | authors = ["Nick Spinale "] 16 | edition = "2021" 17 | license = "BSD-2-Clause" 18 | -------------------------------------------------------------------------------- /crates/sel4-sync/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: MIT 5 | # 6 | 7 | { mk, mkDefaultFrontmatterWithReuseArgs, defaultReuseFrontmatterArgs, versions, localCrates }: 8 | 9 | mk rec { 10 | nix.frontmatter = mkDefaultFrontmatterWithReuseArgs (defaultReuseFrontmatterArgs // { 11 | licenseID = package.license; 12 | }); 13 | package.name = "sel4-sync"; 14 | package.license = "MIT"; 15 | dependencies = { 16 | inherit (versions) lock_api; 17 | inherit (localCrates) 18 | sel4 19 | sel4-immediate-sync-once-cell 20 | ; 21 | }; 22 | } 23 | -------------------------------------------------------------------------------- /crates/sel4-sync/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: MIT 5 | # 6 | # 7 | # This file is generated from './Cargo.nix'. You can edit this file directly 8 | # if you are not using this project's Cargo manifest management tools. 9 | # See 'hacking/cargo-manifest-management/README.md' for more information. 10 | # 11 | 12 | [package] 13 | name = "sel4-sync" 14 | version = "0.1.0" 15 | authors = ["Nick Spinale "] 16 | edition = "2021" 17 | license = "MIT" 18 | 19 | [dependencies] 20 | lock_api = "0.4.12" 21 | sel4 = { path = "../sel4" } 22 | sel4-immediate-sync-once-cell = { path = "../sel4-immediate-sync-once-cell" } 23 | -------------------------------------------------------------------------------- /crates/sel4-sync/src/lib.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // 6 | 7 | #![no_std] 8 | 9 | pub use lock_api; 10 | 11 | mod mutex; 12 | 13 | pub use mutex::{RawDeferredNotificationMutex, RawLazyNotificationMutex, RawNotificationMutex}; 14 | -------------------------------------------------------------------------------- /crates/sel4-synthetic-elf/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, versions }: 8 | 9 | mk { 10 | package.name = "sel4-synthetic-elf"; 11 | dependencies = { 12 | inherit (versions) thiserror num; 13 | object = { version = versions.object; features = [ "all" ]; }; 14 | }; 15 | } 16 | -------------------------------------------------------------------------------- /crates/sel4-synthetic-elf/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | # 7 | # This file is generated from './Cargo.nix'. You can edit this file directly 8 | # if you are not using this project's Cargo manifest management tools. 9 | # See 'hacking/cargo-manifest-management/README.md' for more information. 10 | # 11 | 12 | [package] 13 | name = "sel4-synthetic-elf" 14 | version = "0.1.0" 15 | authors = ["Nick Spinale "] 16 | edition = "2021" 17 | license = "BSD-2-Clause" 18 | 19 | [dependencies] 20 | num = "0.4.1" 21 | object = { version = "0.36.5", features = ["all"] } 22 | thiserror = "1.0" 23 | -------------------------------------------------------------------------------- /crates/sel4-test-harness/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, localCrates, mkDefaultFrontmatterWithReuseArgs, defaultReuseFrontmatterArgs }: 8 | 9 | mk rec { 10 | nix.frontmatter = mkDefaultFrontmatterWithReuseArgs (defaultReuseFrontmatterArgs // { 11 | licenseID = package.license; 12 | }); 13 | package.name = "sel4-test-harness"; 14 | package.license = "MIT OR Apache-2.0"; 15 | dependencies = { 16 | inherit (localCrates) 17 | sel4-panicking-env 18 | sel4-panicking 19 | sel4-immediate-sync-once-cell 20 | ; 21 | }; 22 | } 23 | -------------------------------------------------------------------------------- /crates/sel4-test-harness/src/config/mod.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: MIT OR Apache-2.0 5 | // 6 | 7 | use alloc::borrow::Cow; 8 | 9 | use sel4_immediate_sync_once_cell::ImmediateSyncOnceCell; 10 | 11 | pub(crate) mod types; 12 | 13 | use types::Config; 14 | 15 | static CONFIG: ImmediateSyncOnceCell = ImmediateSyncOnceCell::new(); 16 | 17 | pub fn set_config(config: Config) { 18 | CONFIG.set(config).unwrap_or_else(|_| panic!()) 19 | } 20 | 21 | pub(crate) fn get_config() -> Cow<'static, Config> { 22 | CONFIG 23 | .get() 24 | .map(Cow::Borrowed) 25 | .unwrap_or_else(|| Default::default()) 26 | } 27 | -------------------------------------------------------------------------------- /crates/sel4-test-harness/src/config/types.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023, Colias Group, LLC 3 | // Copyright 2023, Rust project contributors 4 | // 5 | // SPDX-License-Identifier: MIT OR Apache-2.0 6 | // 7 | 8 | #[derive(Copy, Clone, Debug, PartialEq, Eq, Default)] 9 | pub struct Config { 10 | pub run_ignored: RunIgnored, 11 | } 12 | 13 | /// Whether ignored test should be run or not 14 | #[derive(Copy, Clone, Debug, PartialEq, Eq)] 15 | pub enum RunIgnored { 16 | Yes, 17 | No, 18 | /// Run only ignored tests 19 | Only, 20 | } 21 | 22 | impl Default for RunIgnored { 23 | fn default() -> Self { 24 | Self::No 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /crates/sel4-test-harness/src/entry.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: MIT OR Apache-2.0 5 | // 6 | 7 | pub fn run_test_main() { 8 | unsafe { 9 | main(0, core::ptr::null()); 10 | } 11 | } 12 | 13 | extern "C" { 14 | fn main(argc: isize, argv: *const *const u8); 15 | } 16 | 17 | // HACK 18 | trait IsUnit {} 19 | 20 | impl IsUnit for () {} 21 | 22 | #[lang = "start"] 23 | fn lang_start( 24 | main: fn() -> T, 25 | _argc: isize, 26 | _argv: *const *const u8, 27 | _sigpipe: u8, 28 | ) -> isize { 29 | main(); 30 | 0 31 | } 32 | -------------------------------------------------------------------------------- /crates/sel4-test-harness/src/lib.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: MIT OR Apache-2.0 5 | // 6 | 7 | #![no_std] 8 | #![feature(lang_items)] 9 | #![feature(never_type)] 10 | #![allow(internal_features)] 11 | 12 | extern crate alloc; 13 | 14 | mod config; 15 | mod entry; 16 | mod run_tests; 17 | mod short_backtrace; 18 | 19 | pub mod for_generated_code; 20 | 21 | pub use { 22 | config::{set_config, types::*}, 23 | entry::run_test_main, 24 | }; 25 | -------------------------------------------------------------------------------- /crates/sel4-test-harness/src/short_backtrace.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023, Colias Group, LLC 3 | // Copyright 2023, Rust project contributors 4 | // 5 | // SPDX-License-Identifier: MIT OR Apache-2.0 6 | // 7 | 8 | use core::hint::black_box; 9 | 10 | #[inline(never)] 11 | pub(crate) fn __rust_begin_short_backtrace T>(f: F) -> T { 12 | let result = f(); 13 | 14 | // prevent this frame from being tail-call optimised away 15 | black_box(result) 16 | } 17 | -------------------------------------------------------------------------------- /crates/sel4/bitfield-ops/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, versions }: 8 | 9 | mk { 10 | package.name = "sel4-bitfield-ops"; 11 | build-dependencies = { 12 | inherit (versions) rustversion; 13 | }; 14 | } 15 | -------------------------------------------------------------------------------- /crates/sel4/bitfield-ops/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | # 7 | # This file is generated from './Cargo.nix'. You can edit this file directly 8 | # if you are not using this project's Cargo manifest management tools. 9 | # See 'hacking/cargo-manifest-management/README.md' for more information. 10 | # 11 | 12 | [package] 13 | name = "sel4-bitfield-ops" 14 | version = "0.1.0" 15 | authors = ["Nick Spinale "] 16 | edition = "2021" 17 | license = "BSD-2-Clause" 18 | 19 | [build-dependencies] 20 | rustversion = "1.0.18" 21 | -------------------------------------------------------------------------------- /crates/sel4/bitfield-ops/build.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2024, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause 5 | // 6 | 7 | fn main() { 8 | if rustversion::cfg!(any( 9 | all(not(nightly), since(1.80)), 10 | all(nightly, since(2024 - 05 - 05)) 11 | )) { 12 | println!("cargo:rustc-check-cfg=cfg(kani)"); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /crates/sel4/build-env/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk }: 8 | 9 | mk { 10 | package.name = "sel4-build-env"; 11 | } 12 | -------------------------------------------------------------------------------- /crates/sel4/build-env/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | # 7 | # This file is generated from './Cargo.nix'. You can edit this file directly 8 | # if you are not using this project's Cargo manifest management tools. 9 | # See 'hacking/cargo-manifest-management/README.md' for more information. 10 | # 11 | 12 | [package] 13 | name = "sel4-build-env" 14 | version = "0.1.0" 15 | authors = ["Nick Spinale "] 16 | edition = "2021" 17 | license = "BSD-2-Clause" 18 | -------------------------------------------------------------------------------- /crates/sel4/config/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, versions, localCrates }: 8 | 9 | mk { 10 | package.name = "sel4-config"; 11 | dependencies = { 12 | inherit (localCrates) 13 | sel4-config-macros 14 | ; 15 | }; 16 | build-dependencies = { 17 | inherit (versions) 18 | prettyplease 19 | proc-macro2 20 | quote 21 | ; 22 | syn = { version = versions.syn; features = [ "parsing" ]; }; 23 | inherit (localCrates) 24 | sel4-config-data 25 | sel4-config-types 26 | ; 27 | }; 28 | } 29 | -------------------------------------------------------------------------------- /crates/sel4/config/data/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, localCrates, versions }: 8 | 9 | mk { 10 | package.name = "sel4-config-data"; 11 | dependencies = { 12 | inherit (versions) serde_json lazy_static; 13 | sel4-config-types = localCrates.sel4-config-types // { features = [ "serde" ]; }; 14 | }; 15 | build-dependencies = { 16 | inherit (versions) serde_json; 17 | inherit (localCrates) sel4-build-env; 18 | sel4-config-types = localCrates.sel4-config-types // { features = [ "serde" ]; }; 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /crates/sel4/config/data/src/lib.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause 5 | // 6 | 7 | #![allow(unused_imports)] 8 | 9 | pub use sel4_config_types::Configuration; 10 | 11 | pub fn get_kernel_config() -> &'static Configuration { 12 | &KERNEL_CONFIG 13 | } 14 | 15 | lazy_static::lazy_static! { 16 | static ref KERNEL_CONFIG: Configuration = { 17 | serde_json::from_str(KERNEL_CONFIG_JSON).unwrap() 18 | }; 19 | } 20 | 21 | const KERNEL_CONFIG_JSON: &str = include_str!(concat!(env!("OUT_DIR"), "/kernel_config.json")); 22 | -------------------------------------------------------------------------------- /crates/sel4/config/macros/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, versions, localCrates }: 8 | 9 | mk { 10 | package.name = "sel4-config-macros"; 11 | lib.proc-macro = true; 12 | dependencies = { 13 | inherit (versions) 14 | fallible-iterator 15 | proc-macro2 16 | quote 17 | ; 18 | syn = { version = versions.syn; features = [ "full" ]; }; 19 | inherit (localCrates) 20 | sel4-config-types 21 | sel4-config-data 22 | ; 23 | }; 24 | } 25 | -------------------------------------------------------------------------------- /crates/sel4/config/macros/src/generic/common_helpers.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause 5 | // 6 | 7 | macro_rules! parse_or_return { 8 | ($tokenstream:ident as $ty:ty) => { 9 | match parse2::<$ty>($tokenstream) { 10 | Ok(parsed) => parsed, 11 | Err(err) => { 12 | return err.to_compile_error(); 13 | } 14 | } 15 | }; 16 | } 17 | 18 | pub(crate) use parse_or_return; 19 | -------------------------------------------------------------------------------- /crates/sel4/config/types/Cargo.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { mk, serdeWith }: 8 | 9 | mk { 10 | package.name = "sel4-config-types"; 11 | dependencies = { 12 | serde = serdeWith [ "alloc" "derive" ] // { optional = true; }; 13 | }; 14 | } 15 | -------------------------------------------------------------------------------- /crates/sel4/config/types/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | # 7 | # This file is generated from './Cargo.nix'. You can edit this file directly 8 | # if you are not using this project's Cargo manifest management tools. 9 | # See 'hacking/cargo-manifest-management/README.md' for more information. 10 | # 11 | 12 | [package] 13 | name = "sel4-config-types" 14 | version = "0.1.0" 15 | authors = ["Nick Spinale "] 16 | edition = "2021" 17 | license = "BSD-2-Clause" 18 | 19 | [dependencies.serde] 20 | version = "1.0.147" 21 | default-features = false 22 | features = ["alloc", "derive"] 23 | optional = true 24 | -------------------------------------------------------------------------------- /crates/sel4/src/arch/arm/arch/aarch32/mod.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // 6 | 7 | mod fault; 8 | mod object; 9 | mod user_context; 10 | 11 | sel4_config::sel4_cfg_if! { 12 | if #[sel4_cfg(ARM_HYPERVISOR_SUPPORT)] { 13 | mod vcpu_reg; 14 | } 15 | } 16 | 17 | // HACK for rustfmt 18 | #[cfg(any())] 19 | mod vcpu_reg; 20 | 21 | pub(crate) mod top_level { 22 | pub use super::{ 23 | object::{ 24 | ObjectBlueprintAArch32, ObjectBlueprintSeL4Arch, ObjectTypeAArch32, ObjectTypeSeL4Arch, 25 | }, 26 | user_context::UserContext, 27 | }; 28 | 29 | #[sel4_config::sel4_cfg(ARM_HYPERVISOR_SUPPORT)] 30 | pub use super::vcpu_reg::VCpuReg; 31 | } 32 | -------------------------------------------------------------------------------- /crates/sel4/src/arch/arm/arch/aarch32/vcpu_reg.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // 6 | 7 | use sel4_config::sel4_cfg_enum; 8 | 9 | use crate::sys; 10 | 11 | /// Corresponds to `seL4_VCPUReg`. 12 | #[repr(u32)] 13 | #[allow(non_camel_case_types)] 14 | #[sel4_cfg_enum] 15 | pub enum VCpuReg { 16 | // TODO 17 | } 18 | 19 | impl VCpuReg { 20 | pub const fn into_sys(self) -> sys::seL4_VCPUReg::Type { 21 | self as sys::seL4_VCPUReg::Type 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /crates/sel4/src/arch/arm/arch/aarch64/mod.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // 6 | 7 | mod fault; 8 | mod object; 9 | mod user_context; 10 | 11 | sel4_config::sel4_cfg_if! { 12 | if #[sel4_cfg(ARM_HYPERVISOR_SUPPORT)] { 13 | mod vcpu_reg; 14 | } 15 | } 16 | 17 | // HACK for rustfmt 18 | #[cfg(any())] 19 | mod vcpu_reg; 20 | 21 | pub(crate) mod top_level { 22 | pub use super::{ 23 | object::{ 24 | ObjectBlueprintAArch64, ObjectBlueprintSeL4Arch, ObjectTypeAArch64, ObjectTypeSeL4Arch, 25 | }, 26 | user_context::UserContext, 27 | }; 28 | 29 | #[sel4_config::sel4_cfg(ARM_HYPERVISOR_SUPPORT)] 30 | pub use super::vcpu_reg::VCpuReg; 31 | } 32 | -------------------------------------------------------------------------------- /crates/sel4/src/arch/arm/arch/mod.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // 6 | 7 | use sel4_config::sel4_cfg_if; 8 | 9 | sel4_cfg_if! { 10 | if #[sel4_cfg(ARCH_AARCH64)] { 11 | #[path = "aarch64/mod.rs"] 12 | mod imp; 13 | } else if #[sel4_cfg(ARCH_AARCH32)] { 14 | #[path = "aarch32/mod.rs"] 15 | mod imp; 16 | } 17 | } 18 | 19 | // HACK for rustfmt 20 | #[cfg(any())] 21 | mod aarch32; 22 | #[cfg(any())] 23 | mod aarch64; 24 | 25 | pub(crate) use imp::*; 26 | -------------------------------------------------------------------------------- /crates/sel4/src/arch/x86/arch/mod.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // 6 | 7 | use sel4_config::sel4_cfg_if; 8 | 9 | sel4_cfg_if! { 10 | if #[sel4_cfg(ARCH_X86_64)] { 11 | #[path = "x64/mod.rs"] 12 | mod imp; 13 | } 14 | } 15 | 16 | // HACK for rustfmt 17 | #[cfg(any())] 18 | mod x64; 19 | 20 | pub(crate) use imp::*; 21 | -------------------------------------------------------------------------------- /crates/sel4/src/arch/x86/arch/x64/mod.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // 6 | 7 | mod object; 8 | mod user_context; 9 | 10 | pub(crate) mod top_level { 11 | pub use super::{ 12 | object::{ObjectBlueprintSeL4Arch, ObjectBlueprintX64, ObjectTypeSeL4Arch, ObjectTypeX64}, 13 | user_context::UserContext, 14 | }; 15 | } 16 | -------------------------------------------------------------------------------- /crates/sel4/src/fault.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // 6 | 7 | //! Fault types. 8 | 9 | use crate::{sys, IpcBuffer, MessageInfo}; 10 | 11 | pub use crate::arch::fault::*; 12 | 13 | impl Fault { 14 | pub fn new(ipc_buffer: &IpcBuffer, info: &MessageInfo) -> Self { 15 | Self::from_sys(sys::seL4_Fault::get_from_ipc_buffer( 16 | info.inner(), 17 | ipc_buffer.inner(), 18 | )) 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /crates/sel4/sys/build/xml/mod.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause 5 | // 6 | 7 | use std::fs::File; 8 | use std::path::Path; 9 | 10 | use xmltree::Element; 11 | 12 | pub mod invocations; 13 | pub mod syscalls; 14 | 15 | mod condition; 16 | 17 | use condition::Condition; 18 | 19 | fn parse_xml(path: impl AsRef) -> Element { 20 | Element::parse(File::open(path).unwrap()).unwrap() 21 | } 22 | -------------------------------------------------------------------------------- /crates/sel4/sys/src/bf.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause 5 | // 6 | 7 | use core::fmt; 8 | 9 | use sel4_bitfield_ops::Bitfield; 10 | 11 | pub(crate) type SeL4Bitfield = Bitfield<[T; N], T>; 12 | 13 | include!(concat!(env!("OUT_DIR"), "/types.rs")); 14 | include!(concat!(env!("OUT_DIR"), "/shared_types.rs")); 15 | -------------------------------------------------------------------------------- /crates/sel4/sys/src/c.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause 5 | // 6 | 7 | use crate::bf::*; 8 | 9 | include!(concat!(env!("OUT_DIR"), "/bindings.rs")); 10 | -------------------------------------------------------------------------------- /crates/sel4/sys/src/invocations.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause 5 | // 6 | 7 | use crate::bf::*; 8 | use crate::c::*; 9 | 10 | pub mod invocation_label { 11 | include!(concat!(env!("OUT_DIR"), "/invocation_labels.rs")); 12 | } 13 | 14 | include!(concat!(env!("OUT_DIR"), "/invocations.rs")); 15 | -------------------------------------------------------------------------------- /crates/sel4/sys/src/syscalls/helpers/mod.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause 5 | // 6 | 7 | use crate::bf::SeL4Bitfield; 8 | 9 | use crate::{seL4_MessageInfo, seL4_Word}; 10 | 11 | mod arch; 12 | 13 | pub use arch::*; 14 | 15 | impl seL4_MessageInfo { 16 | pub(crate) fn from_word(word: seL4_Word) -> Self { 17 | Self(SeL4Bitfield::new([word])) 18 | } 19 | 20 | pub(crate) fn into_word(self) -> seL4_Word { 21 | self.0.into_inner()[0] 22 | } 23 | 24 | pub(crate) fn msg_helper(&self, msg: Option, i: seL4_Word) -> seL4_Word { 25 | match msg { 26 | Some(msg) if i < self.get_length() => msg, 27 | _ => 0, 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /crates/sel4/sys/src/syscalls/mod.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause 5 | // 6 | 7 | mod calls; 8 | mod helpers; 9 | 10 | pub use calls::*; 11 | 12 | pub mod syscall_id { 13 | include!(concat!(env!("OUT_DIR"), "/syscall_ids.rs")); 14 | } 15 | -------------------------------------------------------------------------------- /default.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | import ./hacking/nix 8 | -------------------------------------------------------------------------------- /hacking/binary-cache/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | P ?= ../.. 8 | A ?= withClippy.everything 9 | 10 | path := $(P) 11 | attr := $(A) 12 | 13 | nix_build_cmd := nix-build $(path) -A $(attr) --no-out-link 14 | 15 | cache_name := coliasgroup 16 | 17 | .PHONY: push 18 | push: 19 | nix-store -qR --include-outputs $$(nix-store -qd $$($(nix_build_cmd))) \ 20 | | grep -v '\.drv$$' \ 21 | | cachix push $(cache_name) 22 | -------------------------------------------------------------------------------- /hacking/binary-cache/fragment.nix.conf: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | extra-substituters = https://coliasgroup.cachix.org 8 | extra-trusted-public-keys = coliasgroup.cachix.org-1:vYRVaHS5FCjsGmVVXlzF5LaIWjeEK17W+MHxK886zIE= 9 | -------------------------------------------------------------------------------- /hacking/cargo-manifest-management/.gitignore: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | blueprint.json 8 | -------------------------------------------------------------------------------- /hacking/cargo-manifest-management/manual-manifests.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { lib }: 8 | 9 | let 10 | 11 | relativeToWorkspaceRoot = relativePath: "${toString ../..}/${relativePath}"; 12 | 13 | relativeToTmpSrc = relativePath: relativeToWorkspaceRoot "tmp/src/${relativePath}"; 14 | 15 | in { 16 | # ring = relativeToTmpSrc "ring"; 17 | # rustls = relativeToTmpSrc "rustls/rustls"; 18 | # lock_api = relativeToTmpSrc "parking_lot/lock_api"; 19 | # volatile = relativeToTmpSrc "volatile"; 20 | # dafny_runtime = relativeToTmpSrc "dafny/Source/DafnyRuntime/DafnyRuntimeRust"; 21 | # offset-allocator = relativeToTmpSrc "offset-allocator"; 22 | } 23 | -------------------------------------------------------------------------------- /hacking/cargo-manifest-management/tool/.gitignore: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | /target/ 8 | -------------------------------------------------------------------------------- /hacking/cargo-manifest-management/tool/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | [workspace] 8 | resolver = "2" 9 | members = [ 10 | "crates/toml-path-regex", 11 | "crates/toml-normalize", 12 | "crates/manage-cargo-manifests", 13 | "crates/manage-direct-dependency-allow-list", 14 | ] 15 | -------------------------------------------------------------------------------- /hacking/cargo-manifest-management/tool/crates/manage-cargo-manifests/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | [package] 8 | name = "manage-cargo-manifests" 9 | version = "0.1.0" 10 | authors = ["Nick Spinale "] 11 | edition = "2021" 12 | license = "BSD-2-Clause" 13 | 14 | [dependencies] 15 | anyhow = "1.0.75" 16 | clap = { version = "4.4.6", features = [ "derive" ] } 17 | serde = { version = "1.0", features = [ "derive" ] } 18 | serde_json = "1.0" 19 | similar = "2.3" 20 | toml = "0.8.6" 21 | toml-normalize = { path = "../toml-normalize" } 22 | -------------------------------------------------------------------------------- /hacking/cargo-manifest-management/tool/crates/manage-direct-dependency-allow-list/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2024, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | [package] 8 | name = "manage-direct-dependency-allow-list" 9 | version = "0.1.0" 10 | authors = ["Nick Spinale "] 11 | edition = "2021" 12 | license = "BSD-2-Clause" 13 | 14 | [dependencies] 15 | anyhow = "1.0.75" 16 | cargo_metadata = "0.18.1" 17 | clap = { version = "4.4.6", features = [ "derive" ] } 18 | serde_json = "1.0.132" 19 | toml_edit = "0.20.4" 20 | ureq = "2.10.1" 21 | -------------------------------------------------------------------------------- /hacking/cargo-manifest-management/tool/crates/toml-normalize/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | [package] 8 | name = "toml-normalize" 9 | version = "0.1.0" 10 | authors = ["Nick Spinale "] 11 | edition = "2021" 12 | license = "BSD-2-Clause" 13 | 14 | [dependencies] 15 | clap = { version = "4.4.6", features = [ "derive" ] } 16 | serde = { version = "1.0", features = [ "derive" ] } 17 | serde_with = "3.4.0" 18 | serde_json = "1.0" 19 | thiserror = "1.0" 20 | toml = "0.8.6" 21 | toml_edit = "0.20.4" 22 | toml-path-regex = { path = "../toml-path-regex" } 23 | -------------------------------------------------------------------------------- /hacking/cargo-manifest-management/tool/crates/toml-normalize/src/lib.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause 5 | // 6 | 7 | mod format; 8 | mod policy; 9 | 10 | pub mod builtin_policies; 11 | 12 | pub use format::{AbstractPolicy, Error, Formatter}; 13 | pub use policy::{KeyOrdering, Policy, TableRule}; 14 | -------------------------------------------------------------------------------- /hacking/cargo-manifest-management/tool/crates/toml-path-regex/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | [package] 8 | name = "toml-path-regex" 9 | version = "0.1.0" 10 | authors = ["Nick Spinale "] 11 | edition = "2021" 12 | license = "BSD-2-Clause" 13 | 14 | [dependencies] 15 | regex = "1.10.2" 16 | rangemap = "1.4.0" 17 | pest = "2.7.5" 18 | pest_derive = "2.7.5" 19 | -------------------------------------------------------------------------------- /hacking/docker/nix.conf: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | sandbox-fallback = false 8 | 9 | keep-outputs = true 10 | keep-derivations = true 11 | 12 | experimental-features = nix-command flakes 13 | 14 | extra-substituters = https://coliasgroup.cachix.org 15 | extra-trusted-public-keys = coliasgroup.cachix.org-1:vYRVaHS5FCjsGmVVXlzF5LaIWjeEK17W+MHxK886zIE= 16 | -------------------------------------------------------------------------------- /hacking/nix/overlay/default.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | self: super: with self; 8 | 9 | let 10 | scopeName = "this"; 11 | in 12 | 13 | assert !(super ? scopeName); 14 | 15 | { 16 | 17 | "${scopeName}" = makeScopeWithSplicing' rec { 18 | otherSplices = generateSplicesForMkScope scopeName; 19 | f = self: callPackage ../scope {} self // { 20 | __dontMashWhenSplicingChildren = true; 21 | inherit otherSplices; # for child spliced scopes 22 | }; 23 | }; 24 | 25 | # Add Python packages needed by the seL4 ecosystem 26 | pythonPackagesExtensions = super.pythonPackagesExtensions ++ [ 27 | (callPackage ./python-overrides.nix {}) 28 | ]; 29 | 30 | } 31 | -------------------------------------------------------------------------------- /hacking/nix/rust-utils/symlink-to-regular-file.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { runCommand }: 8 | 9 | name: path: 10 | 11 | runCommand name {} '' 12 | cp -L ${path} $out 13 | '' 14 | -------------------------------------------------------------------------------- /hacking/nix/rust-utils/to-toml-file.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { runCommand, remarshal }: 8 | 9 | name: expr: 10 | 11 | runCommand name { 12 | nativeBuildInputs = [ 13 | remarshal 14 | ]; 15 | json = builtins.toJSON expr; 16 | passAsFile = [ "json" ]; 17 | } '' 18 | remarshal -if json -of toml -i $jsonPath -o $out 19 | '' 20 | -------------------------------------------------------------------------------- /hacking/nix/scope/capdl-tool/base-compat-0-12-2.nix: -------------------------------------------------------------------------------- 1 | { mkDerivation, base, ghc-prim, lib, unix }: 2 | mkDerivation { 3 | pname = "base-compat"; 4 | version = "0.12.2"; 5 | sha256 = "a62adc883a5ac436f80e4ae02c3c56111cf1007492f267c291139a668d2150bd"; 6 | libraryHaskellDepends = [ base ghc-prim unix ]; 7 | description = "A compatibility layer for base"; 8 | license = lib.licenses.mit; 9 | } 10 | -------------------------------------------------------------------------------- /hacking/nix/scope/capdl-tool/base-compat-batteries-0-12-2.nix: -------------------------------------------------------------------------------- 1 | { mkDerivation, base, base-compat, ghc-prim, hspec, hspec-discover 2 | , lib, QuickCheck 3 | }: 4 | mkDerivation { 5 | pname = "base-compat-batteries"; 6 | version = "0.12.2"; 7 | sha256 = "ede9092e07f904e0759160bf1ecd3fb7eb043bae6dc89a37c3dc94829ec5eb99"; 8 | libraryHaskellDepends = [ base base-compat ghc-prim ]; 9 | testHaskellDepends = [ base hspec QuickCheck ]; 10 | testToolDepends = [ hspec-discover ]; 11 | description = "base-compat with extra batteries"; 12 | license = lib.licenses.mit; 13 | } 14 | -------------------------------------------------------------------------------- /hacking/nix/scope/capdl-tool/capDL-tool.nix: -------------------------------------------------------------------------------- 1 | { mkDerivation, aeson, array, base, base-compat, bytestring 2 | , containers, filepath, lens, lib, MissingH, mtl, parsec, pretty 3 | , regex-compat, split, text, unix, yaml 4 | , sources 5 | }: 6 | mkDerivation { 7 | pname = "capDL-tool"; 8 | version = "1.0.0.1"; 9 | src = sources.capdlTool; 10 | isLibrary = false; 11 | isExecutable = true; 12 | executableHaskellDepends = [ 13 | aeson array base base-compat bytestring containers filepath lens 14 | MissingH mtl parsec pretty regex-compat split text unix yaml 15 | ]; 16 | homepage = "https://github.com/seL4/capdl"; 17 | description = "A tool for processing seL4 capDL specifications"; 18 | license = lib.licenses.bsd2; 19 | mainProgram = "parse-capDL"; 20 | } 21 | -------------------------------------------------------------------------------- /hacking/nix/scope/capdl-tool/default.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { lib, stdenv 8 | , haskell 9 | , sources 10 | }: 11 | 12 | let 13 | haskellPackages = haskell.packages.ghc928.override { 14 | overrides = self: super: { 15 | base-compat = self.callPackage ./base-compat-0-12-2.nix {}; 16 | base-compat-batteries = self.callPackage ./base-compat-batteries-0-12-2.nix {}; 17 | MissingH = self.callPackage ./MissingH-1.5.0.1.nix {}; 18 | capDL-tool = self.callPackage ./capDL-tool.nix { 19 | inherit sources; 20 | }; 21 | }; 22 | }; 23 | 24 | in 25 | haskellPackages.capDL-tool 26 | -------------------------------------------------------------------------------- /hacking/nix/scope/cmake-config-helpers.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { lib }: 8 | 9 | let 10 | mkType = type: value: { 11 | inherit type value; 12 | }; 13 | 14 | in rec { 15 | mkString = mkType "STRING"; 16 | mkBool = mkType "BOOL"; 17 | on = mkBool "ON"; 18 | off = mkBool "OFF"; 19 | 20 | fromBool = x: if x then on else off; 21 | } 22 | -------------------------------------------------------------------------------- /hacking/nix/scope/embed-debug-info.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { lib, runCommandCC 8 | , sel4-backtrace-embedded-debug-cli 9 | }: 10 | 11 | elf: 12 | 13 | runCommandCC "elf" { 14 | nativeBuildInputs = [ 15 | sel4-backtrace-embedded-debug-cli 16 | ]; 17 | } '' 18 | $OBJCOPY --only-keep-debug ${elf} dbg.elf 19 | sel4-embed-debug-info -i ${elf} -d dbg.elf -o $out 20 | '' 21 | -------------------------------------------------------------------------------- /hacking/nix/scope/ferrocene/.gitignore: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2024, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | /SHA256SUMS 8 | -------------------------------------------------------------------------------- /hacking/nix/scope/kani/cbmc-viewer.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2024, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { lib 8 | , buildPythonPackage 9 | , fetchFromGitHub 10 | , setuptools 11 | , jinja2 12 | , voluptuous 13 | }: 14 | 15 | buildPythonPackage rec { 16 | pname = "cbmc-viewer"; 17 | version = "3.9"; 18 | 19 | format = "pyproject"; 20 | 21 | src = fetchFromGitHub { 22 | owner = "model-checking"; 23 | repo = "cbmc-viewer"; 24 | rev = "viewer-3.9"; 25 | hash = "sha256-BfXusrOXGBvquM841K4gb5HQVSryiZS8+ihgj7DVxbI="; 26 | }; 27 | 28 | propagatedBuildInputs = [ 29 | setuptools 30 | jinja2 31 | voluptuous 32 | ]; 33 | } 34 | -------------------------------------------------------------------------------- /hacking/nix/scope/musl/default.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2024, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { runCommand 8 | , muslForSeL4Raw 9 | }: 10 | 11 | runCommand "musl" {} '' 12 | mkdir -p $out/lib 13 | ln -s ${muslForSeL4Raw}/include $out 14 | ln -s ${muslForSeL4Raw}/lib/libc.a $out/lib 15 | '' 16 | -------------------------------------------------------------------------------- /hacking/nix/scope/musl/dummy-libunwind.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2024, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { runCommandCC }: 8 | 9 | runCommandCC "dummy-libunwind" {} '' 10 | mkdir -p $out/lib 11 | touch empty.o 12 | $AR r $out/lib/libunwind.a empty.o 13 | '' 14 | -------------------------------------------------------------------------------- /hacking/nix/scope/plat-utils/default.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { callPackage }: 8 | 9 | { 10 | qemu = callPackage ./qemu {}; 11 | rpi4 = callPackage ./rpi4 {}; 12 | 13 | composePlatformExtensions = a: b: { 14 | attrs = a.attrs // b.attrs; 15 | links = a.links ++ b.links; 16 | }; 17 | } 18 | -------------------------------------------------------------------------------- /hacking/nix/scope/prepare-resettable.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2024, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { lib, runCommand 8 | , sel4-reset-cli 9 | }: 10 | 11 | elf: 12 | 13 | runCommand "elf" { 14 | nativeBuildInputs = [ 15 | sel4-reset-cli 16 | ]; 17 | } '' 18 | sel4-reset-cli ${elf} -o $out 19 | '' 20 | -------------------------------------------------------------------------------- /hacking/nix/scope/shell-for-makefile.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { lib, hostPlatform 8 | , mkShell 9 | , python3 10 | , reuse 11 | , cargo-audit 12 | , lychee 13 | , kani 14 | }: 15 | 16 | let 17 | # HACK for composability 18 | apply = attrs: attrs // { 19 | IN_NIX_SHELL_FOR_MAKEFILE = 1; 20 | 21 | hardeningDisable = [ "all" ]; 22 | 23 | nativeBuildInputs = (attrs.nativeBuildInputs or []) ++ [ 24 | python3 25 | reuse 26 | cargo-audit 27 | lychee 28 | ] ++ lib.optionals hostPlatform.isx86_64 [ 29 | kani 30 | ]; 31 | }; 32 | 33 | in 34 | mkShell (apply { 35 | passthru = { 36 | inherit apply; 37 | }; 38 | }) 39 | -------------------------------------------------------------------------------- /hacking/nix/scope/world/capdl/dummy-capdl-spec.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { lib, emptyDirectory, linkFarm, writeText }: 8 | 9 | { 10 | cdl = writeText "x.cdl" '' 11 | arch aarch64 12 | 13 | objects { 14 | foo = notification 15 | } 16 | caps {} 17 | ''; 18 | fill = emptyDirectory; 19 | } 20 | -------------------------------------------------------------------------------- /hacking/nix/scope/world/capdl/object-sizes.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { runCommandCC, sources, libsel4 }: 8 | 9 | runCommandCC "object_sizes.yaml" { 10 | buildInputs = [ libsel4 ]; 11 | } '' 12 | $CC -E -P - < ${sources.objectSizes}/object_sizes.yaml > $out 13 | '' 14 | -------------------------------------------------------------------------------- /hacking/nix/scope/world/capdl/sel4-capdl-initializer.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { runCommand 8 | , capdl-tool 9 | , objectSizes 10 | , mkTask, crates 11 | , crateUtils 12 | , seL4Modifications 13 | , mkSeL4RustTargetTriple 14 | }: 15 | 16 | mkTask { 17 | 18 | rootCrate = crates.sel4-capdl-initializer; 19 | 20 | targetTriple = mkSeL4RustTargetTriple { minimal = true; }; 21 | 22 | release = true; 23 | 24 | # layers = [ 25 | # crateUtils.defaultIntermediateLayer 26 | # { 27 | # crates = [ "sel4-capdl-initializer-core" ]; 28 | # modifications = seL4Modifications; 29 | # } 30 | # ]; 31 | 32 | } 33 | -------------------------------------------------------------------------------- /hacking/nix/scope/world/capdl/serialize-capdl-spec.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | { runCommand 8 | , capdl-tool 9 | , objectSizes 10 | , sources 11 | }: 12 | 13 | { cdl }: 14 | 15 | let 16 | exe = "parse-capDL"; 17 | # exe = sources.localRoot + "/capdl/capDL-tool/parse-capDL"; 18 | in 19 | 20 | runCommand "spec.json" { 21 | nativeBuildInputs = [ 22 | capdl-tool 23 | 24 | # HACK HACK HACK 25 | # (import {}).stack 26 | ]; 27 | } '' 28 | ${exe} --object-sizes=${objectSizes} --json=$out ${cdl} 29 | '' 30 | -------------------------------------------------------------------------------- /hacking/nix/scope/world/instances/microkit/banscii/automate.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | import sys 8 | import argparse 9 | import pexpect 10 | 11 | def main(): 12 | parser = argparse.ArgumentParser() 13 | parser.add_argument('simulate') 14 | args = parser.parse_args() 15 | run(args) 16 | 17 | def run(args): 18 | child = pexpect.spawn(args.simulate, encoding='utf-8') 19 | child.logfile = sys.stdout 20 | child.expect('banscii>', timeout=10) 21 | child.sendline('Hello, World!') 22 | child.expect('banscii>', timeout=10) 23 | print() 24 | 25 | if __name__ == '__main__': 26 | main() 27 | -------------------------------------------------------------------------------- /hacking/nix/scope/world/instances/test-automation-scripts/serial-device.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2024, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | import sys 8 | import time 9 | import argparse 10 | import pexpect 11 | 12 | def main(): 13 | parser = argparse.ArgumentParser() 14 | parser.add_argument('simulate') 15 | args = parser.parse_args() 16 | run(args) 17 | 18 | def run(args): 19 | child = pexpect.spawn(args.simulate, encoding='utf-8') 20 | child.logfile = sys.stdout 21 | child.expect('echo> ', timeout=5) 22 | time.sleep(1) 23 | child.send('xxx') 24 | child.expect('\[x\]\[x\]\[x\]', timeout=5) 25 | print() 26 | 27 | if __name__ == '__main__': 28 | main() 29 | -------------------------------------------------------------------------------- /hacking/scripts/check-generic-formatting-helper.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | import sys 8 | 9 | def check(content): 10 | if len(content) > 0 and content[-1] != ord('\n'): 11 | return False 12 | if len(content) > 1 and content[-2] == ord('\n'): 13 | return False 14 | return True 15 | 16 | def main(): 17 | ok = True 18 | for line in sys.stdin: 19 | path = line.rstrip() 20 | with open(path, 'rb') as f: 21 | content = f.read() 22 | if not check(content): 23 | print("!", path) 24 | ok = False 25 | if not ok: 26 | sys.exit(1) 27 | 28 | if __name__ == '__main__': 29 | main() 30 | -------------------------------------------------------------------------------- /hacking/scripts/check-generic-formatting.sh: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | set -eu -o pipefail 8 | 9 | here=$(realpath $(dirname $0)) 10 | top_level_dir=$here/../.. 11 | 12 | ignore_patterns=" \ 13 | -e ^docs/images/ \ 14 | -e .ttf\$ \ 15 | -e .patch\$ \ 16 | " 17 | 18 | cd $top_level_dir 19 | 20 | git ls-files | \ 21 | grep -v $ignore_patterns | \ 22 | ( 23 | while read path; do 24 | [ -f "$path" ] && echo $path; 25 | done 26 | ) | \ 27 | python3 $here/check-generic-formatting-helper.py 28 | -------------------------------------------------------------------------------- /hacking/scripts/git-keep.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright 2023, Colias Group, LLC 4 | # 5 | # SPDX-License-Identifier: BSD-2-Clause 6 | # 7 | 8 | # example usage: git-keep origin HEAD 9 | 10 | set -eu -o pipefail 11 | 12 | remote="${1:-origin}" 13 | ref="${2:-HEAD}" 14 | short_rev=$(git rev-parse --short=32 "$ref") 15 | tag=keep/$short_rev 16 | git tag $tag $short_rev 17 | git push "$remote" $tag 18 | -------------------------------------------------------------------------------- /hacking/src/python/capdl_simple_composition/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | from capdl_simple_composition.kernel_config import KernelConfig 8 | from capdl_simple_composition.device_tree import DeviceTree 9 | from capdl_simple_composition.composition import BaseComposition 10 | from capdl_simple_composition.components.base import BaseComponent 11 | from capdl_simple_composition.components.elf import ElfComponent, ElfThread, DEFAULT_PRIO 12 | -------------------------------------------------------------------------------- /hacking/src/python/capdl_simple_composition/components/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seL4/rust-sel4/64c8fb58bb1a5db9b50226d4d8821120ab88ab14/hacking/src/python/capdl_simple_composition/components/__init__.py -------------------------------------------------------------------------------- /hacking/src/python/capdl_simple_composition/device_tree.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | from pyfdt.pyfdt import FdtBlobParse 8 | 9 | class DeviceTree: 10 | 11 | def __init__(self, path): 12 | with open(path, 'rb') as f: 13 | dtb = FdtBlobParse(f) 14 | 15 | self._inner = dtb.to_fdt() 16 | 17 | def _inner(self): 18 | return self._inner 19 | -------------------------------------------------------------------------------- /hacking/unstable-feature-monitoring/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2024, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | .PHONY: none 8 | none: 9 | 10 | .PHONY: clean 11 | clean: 12 | rm -rf wishlist/target 13 | 14 | .PHONY: used 15 | used: 16 | ./enumerate-used-unstable-features.sh 17 | 18 | .PHONY: crates-using 19 | crates-using: 20 | ./enumerate-crates-using-unstable-features.sh 21 | 22 | .PHONY: wishlist 23 | wishlist: 24 | cargo build --manifest-path wishlist/Cargo.toml 25 | -------------------------------------------------------------------------------- /hacking/unstable-feature-monitoring/enumerate-crates-using-unstable-features.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Copyright 2023, Colias Group, LLC 4 | # 5 | # SPDX-License-Identifier: BSD-2-Clause 6 | # 7 | 8 | set -eu -o pipefail 9 | 10 | here=$(realpath $(dirname $0)) 11 | top_level_dir=$here/../.. 12 | 13 | find \ 14 | $top_level_dir/crates \ 15 | $here/extra-used-unstable-features.rs \ 16 | -type f -name 'lib.rs' \ 17 | -exec grep -q '^#!\[feature(' '{}' ';' \ 18 | -printf "%P\n" \ 19 | | sort 20 | -------------------------------------------------------------------------------- /hacking/unstable-feature-monitoring/enumerate-used-unstable-features.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Copyright 2023, Colias Group, LLC 4 | # 5 | # SPDX-License-Identifier: BSD-2-Clause 6 | # 7 | 8 | set -eu -o pipefail 9 | 10 | here=$(realpath $(dirname $0)) 11 | top_level_dir=$here/../.. 12 | 13 | find \ 14 | $top_level_dir/crates \ 15 | $here/extra-used-unstable-features.rs \ 16 | -type f -name '*.rs' \ 17 | -exec sed -n 's|\(^#!\[feature([^]]*]\).*|\1|p' '{}' ';' \ 18 | | sort \ 19 | | uniq 20 | -------------------------------------------------------------------------------- /hacking/unstable-feature-monitoring/extra-used-unstable-features.rs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2024, Colias Group, LLC 3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause 5 | // 6 | -------------------------------------------------------------------------------- /hacking/unstable-feature-monitoring/wishlist/.gitignore: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2024, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | /target/ 8 | -------------------------------------------------------------------------------- /hacking/unstable-feature-monitoring/wishlist/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "x" 7 | version = "0.1.0" 8 | -------------------------------------------------------------------------------- /hacking/unstable-feature-monitoring/wishlist/Cargo.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2024, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | [package] 8 | name = "x" 9 | version = "0.1.0" 10 | edition = "2021" 11 | 12 | [workspace] 13 | -------------------------------------------------------------------------------- /rust-toolchain.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | [toolchain] 8 | channel = "nightly-2025-02-26" 9 | components = [ "rust-src", "rustc-dev", "llvm-tools-preview" ] 10 | profile = "default" 11 | -------------------------------------------------------------------------------- /rustfmt.toml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023, Colias Group, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | ignore = [ 8 | "/tmp/", 9 | ] 10 | -------------------------------------------------------------------------------- /support/targets/riscv32imac-sel4-minimal.json: -------------------------------------------------------------------------------- 1 | { 2 | "arch": "riscv32", 3 | "cpu": "generic-rv32", 4 | "crt-objects-fallback": "false", 5 | "data-layout": "e-m:e-p:32:32-i64:64-n32-S128", 6 | "emit-debug-gdb-scripts": false, 7 | "exe-suffix": ".elf", 8 | "features": "+m,+a,+c", 9 | "linker": "rust-lld", 10 | "linker-flavor": "gnu-lld", 11 | "llvm-abiname": "ilp32", 12 | "llvm-target": "riscv32", 13 | "max-atomic-width": 32, 14 | "metadata": { 15 | "description": null, 16 | "host_tools": null, 17 | "std": null, 18 | "tier": null 19 | }, 20 | "panic-strategy": "abort", 21 | "relocation-model": "static", 22 | "target-pointer-width": "32" 23 | } 24 | -------------------------------------------------------------------------------- /support/targets/riscv32imac-sel4-unwind.json: -------------------------------------------------------------------------------- 1 | { 2 | "arch": "riscv32", 3 | "cpu": "generic-rv32", 4 | "crt-objects-fallback": "false", 5 | "data-layout": "e-m:e-p:32:32-i64:64-n32-S128", 6 | "emit-debug-gdb-scripts": false, 7 | "exe-suffix": ".elf", 8 | "features": "+m,+a,+c", 9 | "has-thread-local": true, 10 | "linker": "rust-lld", 11 | "linker-flavor": "gnu-lld", 12 | "llvm-abiname": "ilp32", 13 | "llvm-target": "riscv32", 14 | "max-atomic-width": 32, 15 | "metadata": { 16 | "description": null, 17 | "host_tools": null, 18 | "std": null, 19 | "tier": null 20 | }, 21 | "relocation-model": "static", 22 | "target-pointer-width": "32" 23 | } 24 | -------------------------------------------------------------------------------- /support/targets/riscv32imac-sel4.json: -------------------------------------------------------------------------------- 1 | { 2 | "arch": "riscv32", 3 | "cpu": "generic-rv32", 4 | "crt-objects-fallback": "false", 5 | "data-layout": "e-m:e-p:32:32-i64:64-n32-S128", 6 | "emit-debug-gdb-scripts": false, 7 | "exe-suffix": ".elf", 8 | "features": "+m,+a,+c", 9 | "has-thread-local": true, 10 | "linker": "rust-lld", 11 | "linker-flavor": "gnu-lld", 12 | "llvm-abiname": "ilp32", 13 | "llvm-target": "riscv32", 14 | "max-atomic-width": 32, 15 | "metadata": { 16 | "description": null, 17 | "host_tools": null, 18 | "std": null, 19 | "tier": null 20 | }, 21 | "panic-strategy": "abort", 22 | "relocation-model": "static", 23 | "target-pointer-width": "32" 24 | } 25 | -------------------------------------------------------------------------------- /support/targets/riscv32imafc-sel4-minimal.json: -------------------------------------------------------------------------------- 1 | { 2 | "arch": "riscv32", 3 | "cpu": "generic-rv32", 4 | "crt-objects-fallback": "false", 5 | "data-layout": "e-m:e-p:32:32-i64:64-n32-S128", 6 | "emit-debug-gdb-scripts": false, 7 | "exe-suffix": ".elf", 8 | "features": "+m,+a,+c,+f", 9 | "linker": "rust-lld", 10 | "linker-flavor": "gnu-lld", 11 | "llvm-abiname": "ilp32f", 12 | "llvm-target": "riscv32", 13 | "max-atomic-width": 32, 14 | "metadata": { 15 | "description": null, 16 | "host_tools": null, 17 | "std": null, 18 | "tier": null 19 | }, 20 | "panic-strategy": "abort", 21 | "relocation-model": "static", 22 | "target-pointer-width": "32" 23 | } 24 | -------------------------------------------------------------------------------- /support/targets/riscv32imafc-sel4-unwind.json: -------------------------------------------------------------------------------- 1 | { 2 | "arch": "riscv32", 3 | "cpu": "generic-rv32", 4 | "crt-objects-fallback": "false", 5 | "data-layout": "e-m:e-p:32:32-i64:64-n32-S128", 6 | "emit-debug-gdb-scripts": false, 7 | "exe-suffix": ".elf", 8 | "features": "+m,+a,+c,+f", 9 | "has-thread-local": true, 10 | "linker": "rust-lld", 11 | "linker-flavor": "gnu-lld", 12 | "llvm-abiname": "ilp32f", 13 | "llvm-target": "riscv32", 14 | "max-atomic-width": 32, 15 | "metadata": { 16 | "description": null, 17 | "host_tools": null, 18 | "std": null, 19 | "tier": null 20 | }, 21 | "relocation-model": "static", 22 | "target-pointer-width": "32" 23 | } 24 | -------------------------------------------------------------------------------- /support/targets/riscv32imafc-sel4.json: -------------------------------------------------------------------------------- 1 | { 2 | "arch": "riscv32", 3 | "cpu": "generic-rv32", 4 | "crt-objects-fallback": "false", 5 | "data-layout": "e-m:e-p:32:32-i64:64-n32-S128", 6 | "emit-debug-gdb-scripts": false, 7 | "exe-suffix": ".elf", 8 | "features": "+m,+a,+c,+f", 9 | "has-thread-local": true, 10 | "linker": "rust-lld", 11 | "linker-flavor": "gnu-lld", 12 | "llvm-abiname": "ilp32f", 13 | "llvm-target": "riscv32", 14 | "max-atomic-width": 32, 15 | "metadata": { 16 | "description": null, 17 | "host_tools": null, 18 | "std": null, 19 | "tier": null 20 | }, 21 | "panic-strategy": "abort", 22 | "relocation-model": "static", 23 | "target-pointer-width": "32" 24 | } 25 | --------------------------------------------------------------------------------