├── .cmake-format.yaml ├── .github └── workflows │ ├── compilation-checks.yml │ ├── cparser.yml │ ├── manual.yml │ ├── pr.yml │ ├── preprocess-deploy.yml │ ├── proof.yml │ ├── push.yml │ ├── sel4test-deploy.yml │ ├── sel4test-hw.yml │ ├── sel4test-sim.yml │ ├── trigger.yml │ └── xml_lint.yml ├── .gitignore ├── .licenseignore ├── .reuse └── dep5 ├── CAVEATS-generic.md ├── CAVEATS-ia32.md ├── CHANGES ├── CMakeLists.txt ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── CONTRIBUTORS.md ├── FindseL4.cmake ├── LICENSE.md ├── LICENSES ├── Apache-2.0.txt ├── BSD-2-Clause.txt ├── BSD-3-Clause.txt ├── CC-BY-SA-4.0.txt ├── GPL-2.0-only.txt ├── GPL-2.0-or-later.txt ├── LPPL-1.3c.txt ├── LicenseRef-Trademark.txt ├── MIT.txt └── SHL-0.51.txt ├── README.md ├── SECURITY.md ├── VERSION ├── config.cmake ├── configs ├── AARCH64_verified.cmake ├── ARM_HYP_verified.cmake ├── ARM_MCS_verified.cmake ├── ARM_verified.cmake ├── RISCV64_MCS_verified.cmake ├── RISCV64_verified.cmake ├── X64_verified.cmake └── seL4Config.cmake ├── gcc.cmake ├── gdb-macros ├── include ├── 32 │ └── mode │ │ ├── api │ │ └── ipc_buffer.h │ │ ├── config.cmake │ │ ├── stdint.h │ │ └── util.h ├── 64 │ └── mode │ │ ├── api │ │ └── ipc_buffer.h │ │ ├── config.cmake │ │ ├── stdint.h │ │ └── util.h ├── api.h ├── api │ ├── debug.h │ ├── failures.h │ ├── faults.h │ ├── syscall.h │ └── types.h ├── arch │ ├── arm │ │ ├── arch │ │ │ ├── 32 │ │ │ │ └── mode │ │ │ │ │ ├── fastpath │ │ │ │ │ └── fastpath.h │ │ │ │ │ ├── hardware.h │ │ │ │ │ ├── kernel │ │ │ │ │ ├── stack.h │ │ │ │ │ ├── thread.h │ │ │ │ │ └── vspace.h │ │ │ │ │ ├── machine.h │ │ │ │ │ ├── machine │ │ │ │ │ ├── debug.h │ │ │ │ │ ├── fpu.h │ │ │ │ │ ├── hardware.h │ │ │ │ │ ├── registerset.h │ │ │ │ │ └── timer.h │ │ │ │ │ ├── machine_pl2.h │ │ │ │ │ ├── model │ │ │ │ │ └── statedata.h │ │ │ │ │ ├── object │ │ │ │ │ ├── structures.bf │ │ │ │ │ └── structures.h │ │ │ │ │ ├── smp │ │ │ │ │ ├── ipi.h │ │ │ │ │ └── smp.h │ │ │ │ │ └── types.h │ │ │ ├── 64 │ │ │ │ └── mode │ │ │ │ │ ├── fastpath │ │ │ │ │ └── fastpath.h │ │ │ │ │ ├── hardware.h │ │ │ │ │ ├── kernel │ │ │ │ │ ├── stack.h │ │ │ │ │ ├── thread.h │ │ │ │ │ └── vspace.h │ │ │ │ │ ├── machine.h │ │ │ │ │ ├── machine │ │ │ │ │ ├── debug.h │ │ │ │ │ ├── fpu.h │ │ │ │ │ ├── hardware.h │ │ │ │ │ ├── registerset.h │ │ │ │ │ └── timer.h │ │ │ │ │ ├── machine_pl2.h │ │ │ │ │ ├── model │ │ │ │ │ └── statedata.h │ │ │ │ │ ├── object │ │ │ │ │ ├── structures.bf │ │ │ │ │ └── structures.h │ │ │ │ │ ├── smp │ │ │ │ │ ├── ipi.h │ │ │ │ │ └── smp.h │ │ │ │ │ └── types.h │ │ │ ├── api │ │ │ │ └── types.h │ │ │ ├── benchmark.h │ │ │ ├── bootinfo.h │ │ │ ├── fastpath │ │ │ │ └── fastpath.h │ │ │ ├── kernel │ │ │ │ ├── boot.h │ │ │ │ ├── thread.h │ │ │ │ ├── traps.h │ │ │ │ └── vspace.h │ │ │ ├── linker.h │ │ │ ├── machine.h │ │ │ ├── machine │ │ │ │ ├── capdl.h │ │ │ │ ├── debug.h │ │ │ │ ├── debug_conf.h │ │ │ │ ├── fpu.h │ │ │ │ ├── gic_common.h │ │ │ │ ├── gic_v2.h │ │ │ │ ├── gic_v3.h │ │ │ │ ├── hardware.h │ │ │ │ ├── l2c_310.h │ │ │ │ ├── registerset.h │ │ │ │ ├── timer.h │ │ │ │ └── tlb.h │ │ │ ├── model │ │ │ │ ├── smp.h │ │ │ │ └── statedata.h │ │ │ ├── object │ │ │ │ ├── interrupt.h │ │ │ │ ├── iospace.h │ │ │ │ ├── objecttype.h │ │ │ │ ├── smmu.h │ │ │ │ ├── structures.bf │ │ │ │ ├── structures.h │ │ │ │ └── vcpu.h │ │ │ ├── smp │ │ │ │ ├── ipi.h │ │ │ │ └── ipi_inline.h │ │ │ ├── types.h │ │ │ └── user_access.h │ │ └── armv │ │ │ ├── armv7-a │ │ │ └── armv │ │ │ │ ├── benchmark.h │ │ │ │ ├── context_switch.h │ │ │ │ ├── debug.h │ │ │ │ ├── machine.h │ │ │ │ └── vcpu.h │ │ │ ├── armv7ve │ │ │ └── armv8-a │ │ │ ├── 32 │ │ │ └── armv │ │ │ │ ├── benchmark.h │ │ │ │ ├── context_switch.h │ │ │ │ ├── debug.h │ │ │ │ ├── machine.h │ │ │ │ └── vcpu.h │ │ │ └── 64 │ │ │ └── armv │ │ │ ├── benchmark.h │ │ │ ├── context_switch.h │ │ │ ├── debug.h │ │ │ ├── machine.h │ │ │ ├── tlb.h │ │ │ └── vcpu.h │ ├── riscv │ │ └── arch │ │ │ ├── 32 │ │ │ └── mode │ │ │ │ ├── hardware.h │ │ │ │ ├── kernel │ │ │ │ └── stack.h │ │ │ │ ├── machine.h │ │ │ │ ├── object │ │ │ │ ├── structures.bf │ │ │ │ └── structures.h │ │ │ │ ├── smp │ │ │ │ └── ipi.h │ │ │ │ └── types.h │ │ │ ├── 64 │ │ │ └── mode │ │ │ │ ├── hardware.h │ │ │ │ ├── kernel │ │ │ │ └── stack.h │ │ │ │ ├── machine.h │ │ │ │ ├── object │ │ │ │ ├── structures.bf │ │ │ │ └── structures.h │ │ │ │ ├── smp │ │ │ │ └── ipi.h │ │ │ │ └── types.h │ │ │ ├── api │ │ │ └── types.h │ │ │ ├── benchmark.h │ │ │ ├── bootinfo.h │ │ │ ├── fastpath │ │ │ └── fastpath.h │ │ │ ├── kernel │ │ │ ├── boot.h │ │ │ ├── thread.h │ │ │ ├── traps.h │ │ │ └── vspace.h │ │ │ ├── linker.h │ │ │ ├── machine.h │ │ │ ├── machine │ │ │ ├── capdl.h │ │ │ ├── fpu.h │ │ │ ├── hardware.h │ │ │ ├── plic.h │ │ │ ├── registerset.h │ │ │ └── timer.h │ │ │ ├── model │ │ │ ├── smp.h │ │ │ └── statedata.h │ │ │ ├── object │ │ │ ├── interrupt.h │ │ │ ├── objecttype.h │ │ │ ├── structures.bf │ │ │ └── structures.h │ │ │ ├── sbi.h │ │ │ ├── smp │ │ │ ├── ipi.h │ │ │ └── ipi_inline.h │ │ │ └── types.h │ └── x86 │ │ └── arch │ │ ├── 32 │ │ └── mode │ │ │ ├── fastpath │ │ │ └── fastpath.h │ │ │ ├── hardware.h │ │ │ ├── kernel │ │ │ ├── elf.h │ │ │ ├── stack.h │ │ │ ├── tlb.h │ │ │ └── vspace.h │ │ │ ├── machine.h │ │ │ ├── machine │ │ │ ├── cpu_registers.h │ │ │ ├── debug.h │ │ │ └── registerset.h │ │ │ ├── model │ │ │ ├── smp.h │ │ │ └── statedata.h │ │ │ ├── object │ │ │ ├── structures.bf │ │ │ └── structures.h │ │ │ ├── smp │ │ │ └── ipi.h │ │ │ ├── stack.h │ │ │ └── types.h │ │ ├── 64 │ │ └── mode │ │ │ ├── fastpath │ │ │ └── fastpath.h │ │ │ ├── hardware.h │ │ │ ├── kernel │ │ │ ├── elf.h │ │ │ ├── stack.h │ │ │ ├── tlb.h │ │ │ └── vspace.h │ │ │ ├── machine.h │ │ │ ├── machine │ │ │ ├── cpu_registers.h │ │ │ ├── debug.h │ │ │ └── registerset.h │ │ │ ├── model │ │ │ ├── smp.h │ │ │ └── statedata.h │ │ │ ├── object │ │ │ ├── structures.bf │ │ │ └── structures.h │ │ │ ├── smp │ │ │ └── ipi.h │ │ │ └── types.h │ │ ├── api │ │ └── types.h │ │ ├── benchmark.h │ │ ├── bootinfo.h │ │ ├── fastpath │ │ └── fastpath.h │ │ ├── kernel │ │ ├── apic.h │ │ ├── boot.h │ │ ├── boot_sys.h │ │ ├── cmdline.h │ │ ├── elf.h │ │ ├── ept.h │ │ ├── multiboot.h │ │ ├── multiboot2.h │ │ ├── smp_sys.h │ │ ├── thread.h │ │ ├── tlb.h │ │ ├── tlb_bitmap.h │ │ ├── tlb_bitmap_defs.h │ │ ├── traps.h │ │ ├── vspace.h │ │ ├── x2apic.h │ │ └── xapic.h │ │ ├── linker.h │ │ ├── machine.h │ │ ├── machine │ │ ├── capdl.h │ │ ├── cpu_registers.h │ │ ├── debug.h │ │ ├── fpu.h │ │ ├── hardware.h │ │ ├── pat.h │ │ ├── registerset.h │ │ └── timer.h │ │ ├── model │ │ ├── smp.h │ │ └── statedata.h │ │ ├── object │ │ ├── interrupt.h │ │ ├── ioport.h │ │ ├── iospace.h │ │ ├── objecttype.h │ │ ├── structures.bf │ │ ├── structures.h │ │ ├── tcb.h │ │ └── vcpu.h │ │ ├── smp │ │ ├── ipi.h │ │ └── ipi_inline.h │ │ └── types.h ├── assert.h ├── basic_types.h ├── benchmark │ ├── benchmark.h │ ├── benchmark_track.h │ ├── benchmark_utilisation.h │ └── benchmark_utilisation_.h ├── bootinfo.h ├── compound_types.h ├── config.h ├── drivers │ ├── irq │ │ ├── am335x.h │ │ ├── bcm2836-armctrl-ic.h │ │ ├── omap3.h │ │ ├── riscv_plic0.h │ │ └── riscv_plic_dummy.h │ ├── smmu │ │ └── smmuv2.h │ ├── timer │ │ ├── am335x.h │ │ ├── arm_generic.h │ │ ├── arm_global.h │ │ ├── arm_priv.h │ │ ├── exynos4412-mct.h │ │ ├── mct.h │ │ └── omap3430.h │ └── uart.h ├── fastpath │ └── fastpath.h ├── hardware.h ├── kernel │ ├── boot.h │ ├── cspace.h │ ├── faulthandler.h │ ├── sporadic.h │ ├── stack.h │ ├── thread.h │ ├── traps.h │ └── vspace.h ├── linker.h ├── machine.h ├── machine │ ├── assembler.h │ ├── capdl.h │ ├── debug.h │ ├── fpu.h │ ├── interrupt.h │ ├── io.h │ ├── profiler.h │ ├── registerset.h │ └── timer.h ├── model │ ├── preemption.h │ ├── smp.h │ └── statedata.h ├── object.h ├── object │ ├── cap.h │ ├── cnode.h │ ├── endpoint.h │ ├── interrupt.h │ ├── notification.h │ ├── objecttype.h │ ├── reply.h │ ├── schedcontext.h │ ├── schedcontrol.h │ ├── structures.h │ ├── structures_32.bf │ ├── structures_64.bf │ ├── tcb.h │ └── untyped.h ├── plat │ ├── default │ │ └── plat │ │ │ ├── machine.h │ │ │ └── machine │ │ │ └── hardware.h │ ├── pc99 │ │ └── plat │ │ │ ├── 32 │ │ │ └── plat_mode │ │ │ │ └── machine │ │ │ │ ├── hardware.bf │ │ │ │ └── hardware.h │ │ │ ├── 64 │ │ │ └── plat_mode │ │ │ │ └── machine │ │ │ │ ├── hardware.bf │ │ │ │ └── hardware.h │ │ │ ├── machine.h │ │ │ └── machine │ │ │ ├── acpi.h │ │ │ ├── devices.h │ │ │ ├── hardware.h │ │ │ ├── intel-vtd.h │ │ │ ├── interrupt.h │ │ │ ├── io.h │ │ │ ├── ioapic.h │ │ │ ├── pci.h │ │ │ ├── pic.h │ │ │ └── pit.h │ └── tk1 │ │ └── plat │ │ └── machine │ │ ├── hardware.bf │ │ └── smmu.h ├── smp │ ├── ipi.h │ └── lock.h ├── stdarg.h ├── stdint.h ├── string.h ├── types.h └── util.h ├── libsel4 ├── CMakeLists.txt ├── arch_include │ ├── arm │ │ ├── interfaces │ │ │ └── sel4arch.xml │ │ └── sel4 │ │ │ └── arch │ │ │ ├── constants.h │ │ │ ├── constants_cortex_a15.h │ │ │ ├── constants_cortex_a35.h │ │ │ ├── constants_cortex_a53.h │ │ │ ├── constants_cortex_a55.h │ │ │ ├── constants_cortex_a57.h │ │ │ ├── constants_cortex_a7.h │ │ │ ├── constants_cortex_a72.h │ │ │ ├── constants_cortex_a8.h │ │ │ ├── constants_cortex_a9.h │ │ │ ├── deprecated.h │ │ │ ├── mapping.h │ │ │ ├── objecttype.h │ │ │ ├── pfIPC.h │ │ │ ├── shared_types.bf │ │ │ ├── shared_types.h │ │ │ ├── simple_types.h │ │ │ ├── syscalls.h │ │ │ └── types.h │ ├── riscv │ │ ├── interfaces │ │ │ └── sel4arch.xml │ │ └── sel4 │ │ │ └── arch │ │ │ ├── constants.h │ │ │ ├── deprecated.h │ │ │ ├── exIPC.h │ │ │ ├── mapping.h │ │ │ ├── objecttype.h │ │ │ ├── pfIPC.h │ │ │ ├── shared_types.bf │ │ │ ├── shared_types.h │ │ │ ├── simple_types.h │ │ │ ├── syscalls.h │ │ │ └── types.h │ └── x86 │ │ ├── interfaces │ │ └── sel4arch.xml │ │ └── sel4 │ │ └── arch │ │ ├── bootinfo_types.h │ │ ├── constants.h │ │ ├── deprecated.h │ │ ├── exIPC.h │ │ ├── mapping.h │ │ ├── objecttype.h │ │ ├── pfIPC.h │ │ ├── shared_types.bf │ │ ├── simple_types.h │ │ ├── syscalls.h │ │ ├── types.h │ │ └── vmenter.h ├── include │ ├── api │ │ ├── syscall.xml │ │ └── syscall.xsd │ ├── interfaces │ │ └── sel4.xml │ └── sel4 │ │ ├── assert.h │ │ ├── benchmark_tracepoints_types.h │ │ ├── benchmark_track_types.h │ │ ├── benchmark_utilisation_types.h │ │ ├── bootinfo.h │ │ ├── bootinfo_types.h │ │ ├── config.h │ │ ├── constants.h │ │ ├── debug_assert.h │ │ ├── deprecated.h │ │ ├── errors.h │ │ ├── faults.h │ │ ├── functions.h │ │ ├── macros.h │ │ ├── messages.h │ │ ├── objecttype.h │ │ ├── sel4.h │ │ ├── shared_types.h │ │ ├── simple_types.h │ │ ├── syscalls.h │ │ ├── syscalls_master.h │ │ ├── syscalls_mcs.h │ │ ├── types.h │ │ └── virtual_client.h ├── mode_include │ ├── 32 │ │ └── sel4 │ │ │ ├── mode │ │ │ └── types.h │ │ │ └── shared_types.bf │ └── 64 │ │ └── sel4 │ │ ├── mode │ │ └── types.h │ │ └── shared_types.bf ├── sel4_arch_include │ ├── aarch32 │ │ ├── interfaces │ │ │ └── sel4arch.xml │ │ └── sel4 │ │ │ └── sel4_arch │ │ │ ├── constants.h │ │ │ ├── deprecated.h │ │ │ ├── exIPC.h │ │ │ ├── faults.h │ │ │ ├── mapping.h │ │ │ ├── objecttype.h │ │ │ ├── pfIPC.h │ │ │ ├── simple_types.h │ │ │ ├── syscalls.h │ │ │ ├── types.bf │ │ │ └── types.h │ ├── aarch64 │ │ ├── interfaces │ │ │ └── sel4arch.xml │ │ └── sel4 │ │ │ └── sel4_arch │ │ │ ├── constants.h │ │ │ ├── deprecated.h │ │ │ ├── exIPC.h │ │ │ ├── faults.h │ │ │ ├── mapping.h │ │ │ ├── objecttype.h │ │ │ ├── pfIPC.h │ │ │ ├── simple_types.h │ │ │ ├── syscalls.h │ │ │ ├── types.bf │ │ │ └── types.h │ ├── arm_hyp │ ├── ia32 │ │ ├── interfaces │ │ │ └── sel4arch.xml │ │ └── sel4 │ │ │ └── sel4_arch │ │ │ ├── constants.h │ │ │ ├── deprecated.h │ │ │ ├── exIPC.h │ │ │ ├── faults.h │ │ │ ├── mapping.h │ │ │ ├── objecttype.h │ │ │ ├── pfIPC.h │ │ │ ├── simple_types.h │ │ │ ├── syscalls.h │ │ │ ├── types.bf │ │ │ └── types.h │ ├── riscv32 │ │ ├── interfaces │ │ │ └── sel4arch.xml │ │ └── sel4 │ │ │ └── sel4_arch │ │ │ ├── constants.h │ │ │ ├── deprecated.h │ │ │ ├── faults.h │ │ │ ├── mapping.h │ │ │ ├── objecttype.h │ │ │ ├── simple_types.h │ │ │ ├── syscalls.h │ │ │ ├── types.bf │ │ │ └── types.h │ ├── riscv64 │ │ ├── interfaces │ │ │ └── sel4arch.xml │ │ └── sel4 │ │ │ └── sel4_arch │ │ │ ├── constants.h │ │ │ ├── deprecated.h │ │ │ ├── faults.h │ │ │ ├── mapping.h │ │ │ ├── objecttype.h │ │ │ ├── simple_types.h │ │ │ ├── syscalls.h │ │ │ ├── types.bf │ │ │ └── types.h │ └── x86_64 │ │ ├── interfaces │ │ └── sel4arch.xml │ │ └── sel4 │ │ └── sel4_arch │ │ ├── constants.h │ │ ├── deprecated.h │ │ ├── exIPC.h │ │ ├── faults.h │ │ ├── mapping.h │ │ ├── objecttype.h │ │ ├── pfIPC.h │ │ ├── simple_types.h │ │ ├── syscalls.h │ │ ├── syscalls_syscall.h │ │ ├── syscalls_sysenter.h │ │ ├── types.bf │ │ └── types.h ├── sel4_plat_include │ ├── allwinnerA20 │ │ └── sel4 │ │ │ └── plat │ │ │ └── api │ │ │ └── constants.h │ ├── am335x │ │ └── sel4 │ │ │ └── plat │ │ │ └── api │ │ │ └── constants.h │ ├── apq8064 │ │ └── sel4 │ │ │ └── plat │ │ │ └── api │ │ │ └── constants.h │ ├── ariane │ │ └── sel4 │ │ │ └── plat │ │ │ └── api │ │ │ └── constants.h │ ├── bcm2711 │ │ └── sel4 │ │ │ └── plat │ │ │ └── api │ │ │ └── constants.h │ ├── bcm2837 │ │ └── sel4 │ │ │ └── plat │ │ │ └── api │ │ │ └── constants.h │ ├── exynos4 │ │ └── sel4 │ │ │ └── plat │ │ │ └── api │ │ │ └── constants.h │ ├── exynos5 │ │ └── sel4 │ │ │ └── plat │ │ │ └── api │ │ │ └── constants.h │ ├── exynos_common │ │ └── sel4 │ │ │ └── plat │ │ │ └── api │ │ │ └── constants.h │ ├── fvp │ │ └── sel4 │ │ │ └── plat │ │ │ └── api │ │ │ └── constants.h │ ├── hifive │ │ └── sel4 │ │ │ └── plat │ │ │ └── api │ │ │ └── constants.h │ ├── hikey │ │ └── sel4 │ │ │ └── plat │ │ │ └── api │ │ │ └── constants.h │ ├── imx6 │ │ └── sel4 │ │ │ └── plat │ │ │ └── api │ │ │ └── constants.h │ ├── imx7 │ │ └── sel4 │ │ │ └── plat │ │ │ └── api │ │ │ └── constants.h │ ├── imx8mm-evk │ │ └── sel4 │ │ │ └── plat │ │ │ └── api │ │ │ └── constants.h │ ├── imx8mq-evk │ │ └── sel4 │ │ │ └── plat │ │ │ └── api │ │ │ └── constants.h │ ├── maaxboard │ │ └── sel4 │ │ │ └── plat │ │ │ └── api │ │ │ └── constants.h │ ├── odroidc2 │ │ └── sel4 │ │ │ └── plat │ │ │ └── api │ │ │ └── constants.h │ ├── odroidc4 │ │ └── sel4 │ │ │ └── plat │ │ │ └── api │ │ │ └── constants.h │ ├── omap3 │ │ └── sel4 │ │ │ └── plat │ │ │ └── api │ │ │ └── constants.h │ ├── pc99 │ │ └── sel4 │ │ │ └── plat │ │ │ └── api │ │ │ └── constants.h │ ├── polarfire │ │ └── sel4 │ │ │ └── plat │ │ │ └── api │ │ │ └── constants.h │ ├── qemu-arm-virt │ │ └── sel4 │ │ │ └── plat │ │ │ └── api │ │ │ └── constants.h │ ├── rocketchip │ │ └── sel4 │ │ │ └── plat │ │ │ └── api │ │ │ └── constants.h │ ├── rockpro64 │ │ └── sel4 │ │ │ └── plat │ │ │ └── api │ │ │ └── constants.h │ ├── spike │ │ └── sel4 │ │ │ └── plat │ │ │ └── api │ │ │ └── constants.h │ ├── tk1 │ │ └── sel4 │ │ │ └── plat │ │ │ └── api │ │ │ └── constants.h │ ├── tqma8xqp1gb │ │ └── sel4 │ │ │ └── plat │ │ │ └── api │ │ │ └── constants.h │ ├── tx1 │ │ └── sel4 │ │ │ └── plat │ │ │ └── api │ │ │ └── constants.h │ ├── tx2 │ │ └── sel4 │ │ │ └── plat │ │ │ └── api │ │ │ └── constants.h │ ├── zynq7000 │ │ └── sel4 │ │ │ └── plat │ │ │ └── api │ │ │ └── constants.h │ └── zynqmp │ │ └── sel4 │ │ └── plat │ │ └── api │ │ └── constants.h ├── src │ └── sel4_bootinfo.c └── tools │ ├── __init__.py │ ├── bitfield_gen.py │ ├── changed.sh │ ├── condition.py │ ├── invocation_header_gen.py │ ├── loader │ └── __init__.py │ ├── sel4_idl.xsd │ ├── syscall_header_gen.py │ ├── syscall_stub_gen.py │ ├── syscall_stub_gen_rs.py │ └── xmllint.sh ├── llvm.cmake ├── manual ├── Doxyfile ├── Makefile ├── README.md ├── VERSION ├── export.bst ├── extra.bib ├── figs │ ├── CDT.graffle │ ├── CDT.pdf │ ├── fig1-1.pdf │ ├── fig1-1.svg │ ├── fig1-2.pdf │ ├── fig1-2.svg │ ├── fig1-3.pdf │ ├── fig1-3.svg │ ├── fig1-4.pdf │ ├── fig1-4.svg │ ├── fig2-1.pdf │ └── fig2-1.svg ├── logos │ ├── blacktriangle.pdf │ ├── blacktriangle.pdf.license │ ├── seL4-Foundation-logo.pdf │ └── seL4-Foundation-logo.pdf.license ├── manual.tex ├── parts │ ├── api.tex │ ├── api │ │ ├── debug_halt.tex │ │ └── debug_putchar.tex │ ├── bootup.tex │ ├── cspace.tex │ ├── intro.tex │ ├── io.tex │ ├── ipc.tex │ ├── notifications.tex │ ├── objects.tex │ ├── threads.tex │ └── vspace.tex ├── references.bib ├── sel4.sty └── tools │ ├── gen_env.py │ ├── gen_invocations.py │ ├── libsel4_tools │ └── parse_doxygen_xml.py ├── src ├── api │ ├── faults.c │ └── syscall.c ├── arch │ ├── arm │ │ ├── 32 │ │ │ ├── c_traps.c │ │ │ ├── config.cmake │ │ │ ├── head.S │ │ │ ├── hyp_traps.S │ │ │ ├── idle.c │ │ │ ├── kernel │ │ │ │ ├── thread.c │ │ │ │ └── vspace.c │ │ │ ├── machine │ │ │ │ ├── capdl.c │ │ │ │ ├── fpu.c │ │ │ │ └── registerset.c │ │ │ ├── model │ │ │ │ └── statedata.c │ │ │ ├── object │ │ │ │ └── objecttype.c │ │ │ └── traps.S │ │ ├── 64 │ │ │ ├── c_traps.c │ │ │ ├── config.cmake │ │ │ ├── head.S │ │ │ ├── idle.c │ │ │ ├── kernel │ │ │ │ ├── thread.c │ │ │ │ └── vspace.c │ │ │ ├── machine │ │ │ │ ├── capdl.c │ │ │ │ ├── fpu.c │ │ │ │ └── registerset.c │ │ │ ├── model │ │ │ │ └── statedata.c │ │ │ ├── object │ │ │ │ └── objecttype.c │ │ │ └── traps.S │ │ ├── api │ │ │ └── faults.c │ │ ├── armv │ │ │ ├── armv7-a │ │ │ │ ├── cache.c │ │ │ │ ├── config.cmake │ │ │ │ ├── machine_asm.S │ │ │ │ ├── tlb.c │ │ │ │ └── user_access.c │ │ │ └── armv8-a │ │ │ │ ├── 32 │ │ │ │ ├── cache.c │ │ │ │ ├── machine_asm.S │ │ │ │ └── user_access.c │ │ │ │ ├── 64 │ │ │ │ ├── cache.c │ │ │ │ ├── machine_asm.S │ │ │ │ └── user_access.c │ │ │ │ └── config.cmake │ │ ├── benchmark │ │ │ └── benchmark.c │ │ ├── c_traps.c │ │ ├── common_arm.lds │ │ ├── config.cmake │ │ ├── kernel │ │ │ ├── boot.c │ │ │ └── thread.c │ │ ├── machine │ │ │ ├── cache.c │ │ │ ├── debug.c │ │ │ ├── errata.c │ │ │ ├── gic_v2.c │ │ │ ├── gic_v3.c │ │ │ ├── hardware.c │ │ │ ├── io.c │ │ │ ├── l2c_310.c │ │ │ └── l2c_nop.c │ │ ├── object │ │ │ ├── interrupt.c │ │ │ ├── iospace.c │ │ │ ├── smmu.c │ │ │ ├── tcb.c │ │ │ └── vcpu.c │ │ ├── platform_gen.h.in │ │ └── smp │ │ │ └── ipi.c │ ├── riscv │ │ ├── api │ │ │ ├── benchmark.c │ │ │ └── faults.c │ │ ├── c_traps.c │ │ ├── common_riscv.lds │ │ ├── config.cmake │ │ ├── head.S │ │ ├── idle.c │ │ ├── kernel │ │ │ ├── boot.c │ │ │ ├── thread.c │ │ │ └── vspace.c │ │ ├── machine │ │ │ ├── capdl.c │ │ │ ├── fpu.c │ │ │ ├── hardware.c │ │ │ ├── io.c │ │ │ └── registerset.c │ │ ├── model │ │ │ └── statedata.c │ │ ├── object │ │ │ ├── interrupt.c │ │ │ ├── objecttype.c │ │ │ └── tcb.c │ │ ├── platform_gen.h.in │ │ ├── smp │ │ │ └── ipi.c │ │ └── traps.S │ └── x86 │ │ ├── 32 │ │ ├── c_traps.c │ │ ├── config.cmake │ │ ├── head.S │ │ ├── kernel │ │ │ ├── elf.c │ │ │ ├── thread.c │ │ │ ├── vspace.c │ │ │ └── vspace_32paging.c │ │ ├── machine │ │ │ ├── capdl.c │ │ │ └── registerset.c │ │ ├── machine_asm.S │ │ ├── model │ │ │ └── statedata.c │ │ ├── object │ │ │ └── objecttype.c │ │ ├── smp │ │ │ └── ipi.c │ │ └── traps.S │ │ ├── 64 │ │ ├── c_traps.c │ │ ├── config.cmake │ │ ├── head.S │ │ ├── kernel │ │ │ ├── elf.c │ │ │ ├── thread.c │ │ │ └── vspace.c │ │ ├── machine │ │ │ ├── capdl.c │ │ │ └── registerset.c │ │ ├── machine_asm.S │ │ ├── model │ │ │ ├── smp.c │ │ │ └── statedata.c │ │ ├── object │ │ │ └── objecttype.c │ │ ├── smp │ │ │ └── ipi.c │ │ └── traps.S │ │ ├── api │ │ └── faults.c │ │ ├── benchmark │ │ └── benchmark.c │ │ ├── c_traps.c │ │ ├── config.cmake │ │ ├── idle.c │ │ ├── kernel │ │ ├── apic.c │ │ ├── boot.c │ │ ├── boot_sys.c │ │ ├── cmdline.c │ │ ├── ept.c │ │ ├── smp_sys.c │ │ ├── thread.c │ │ ├── vspace.c │ │ ├── x2apic.c │ │ └── xapic.c │ │ ├── machine │ │ ├── breakpoint.c │ │ ├── capdl.c │ │ ├── cpu_identification.c │ │ ├── fpu.c │ │ ├── hardware.c │ │ └── registerset.c │ │ ├── model │ │ └── statedata.c │ │ ├── multiboot.S │ │ ├── object │ │ ├── interrupt.c │ │ ├── ioport.c │ │ ├── iospace.c │ │ ├── objecttype.c │ │ ├── tcb.c │ │ └── vcpu.c │ │ └── smp │ │ └── ipi.c ├── assert.c ├── benchmark │ ├── benchmark.c │ ├── benchmark_track.c │ └── benchmark_utilisation.c ├── config.cmake ├── config │ └── default_domain.c ├── drivers │ ├── config.cmake │ ├── serial │ │ ├── bcm2835-aux-uart.c │ │ ├── config.cmake │ │ ├── exynos4210-uart.c │ │ ├── imx-lpuart.c │ │ ├── imx.c │ │ ├── meson-gx-uart.c │ │ ├── msm-uartdm.c │ │ ├── pl011.c │ │ ├── tegra_omap3_dwapb.c │ │ └── xuartps.c │ ├── smmu │ │ ├── config.cmake │ │ └── smmuv2.c │ └── timer │ │ ├── am335x-timer.c │ │ ├── config.cmake │ │ ├── exynos4210-mct.c │ │ ├── exynos4412-mct.c │ │ ├── generic_timer.c │ │ ├── global_timer.c │ │ ├── kpss-timer.c │ │ ├── omap3430-timer.c │ │ └── priv_timer.c ├── fastpath │ └── fastpath.c ├── inlines.c ├── kernel │ ├── boot.c │ ├── cspace.c │ ├── faulthandler.c │ ├── sporadic.c │ ├── stack.c │ └── thread.c ├── machine │ ├── capdl.c │ ├── fpu.c │ ├── io.c │ ├── profiler.c │ └── registerset.c ├── model │ ├── preemption.c │ ├── smp.c │ └── statedata.c ├── object │ ├── cnode.c │ ├── endpoint.c │ ├── interrupt.c │ ├── notification.c │ ├── objecttype.c │ ├── reply.c │ ├── schedcontext.c │ ├── schedcontrol.c │ ├── tcb.c │ └── untyped.c ├── plat │ ├── allwinnerA20 │ │ ├── config.cmake │ │ ├── machine │ │ │ └── l2cache.c │ │ └── overlay-allwinnerA20.dts │ ├── am335x │ │ ├── config.cmake │ │ ├── machine │ │ │ ├── hardware.c │ │ │ └── l2cache.c │ │ ├── overlay-am335x-boneblack.dts │ │ └── overlay-am335x.dts │ ├── apq8064 │ │ ├── config.cmake │ │ └── overlay-apq8064.dts │ ├── ariane │ │ ├── config.cmake │ │ └── overlay-ariane.dts │ ├── bcm2711 │ │ ├── config.cmake │ │ ├── overlay-rpi4-address-mapping.dts │ │ └── overlay-rpi4.dts │ ├── bcm2837 │ │ ├── config.cmake │ │ ├── machine │ │ │ └── intc.c │ │ └── overlay-rpi3.dts │ ├── exynos4 │ │ ├── config.cmake │ │ └── overlay-exynos4.dts │ ├── exynos5 │ │ ├── config.cmake │ │ ├── overlay-exynos5250.dts │ │ ├── overlay-exynos5410.dts │ │ └── overlay-exynos5422.dts │ ├── fvp │ │ ├── config.cmake │ │ └── overlay-fvp.dts │ ├── hifive │ │ ├── config.cmake │ │ └── overlay-hifive.dts │ ├── hikey │ │ ├── config.cmake │ │ └── overlay-hikey.dts │ ├── imx6 │ │ ├── config.cmake │ │ ├── mcs-overlay-imx6.dts │ │ ├── mcs-overlay-nitrogen6sx.dts │ │ ├── overlay-nitrogen6sx.dts │ │ ├── overlay-sabre.dts │ │ └── overlay-wandq.dts │ ├── imx7 │ │ ├── config.cmake │ │ └── overlay-imx7sabre.dts │ ├── imx8m-evk │ │ ├── config.cmake │ │ ├── overlay-imx8m-32bit.dts │ │ ├── overlay-imx8mm-evk.dts │ │ └── overlay-imx8mq-evk.dts │ ├── maaxboard │ │ ├── config.cmake │ │ ├── overlay-maaxboard-32bit.dts │ │ └── overlay-maaxboard.dts │ ├── odroidc2 │ │ ├── config.cmake │ │ └── overlay-odroidc2.dts │ ├── odroidc4 │ │ ├── config.cmake │ │ └── overlay-odroidc4.dts │ ├── omap3 │ │ ├── config.cmake │ │ ├── machine │ │ │ ├── hardware.c │ │ │ └── l2cache.c │ │ └── overlay-omap3.dts │ ├── pc99 │ │ ├── config.cmake │ │ ├── linker.lds │ │ └── machine │ │ │ ├── acpi.c │ │ │ ├── hardware.c │ │ │ ├── intel-vtd.c │ │ │ ├── io.c │ │ │ ├── ioapic.c │ │ │ ├── pic.c │ │ │ └── pit.c │ ├── polarfire │ │ ├── config.cmake │ │ └── overlay-polarfire.dts │ ├── qemu-arm-virt │ │ ├── config.cmake │ │ ├── overlay-qemu-arm-virt.dts │ │ └── overlay-reserve-vm-memory.dts │ ├── rocketchip │ │ └── config.cmake │ ├── rockpro64 │ │ ├── config.cmake │ │ └── overlay-rockpro64.dts │ ├── spike │ │ └── config.cmake │ ├── tk1 │ │ ├── config.cmake │ │ ├── machine │ │ │ └── smmu.c │ │ └── overlay-tk1.dts │ ├── tqma8xqp1gb │ │ ├── config.cmake │ │ └── overlay-tqma8xqp1gb.dts │ ├── tx1 │ │ ├── config.cmake │ │ └── overlay-tx1.dts │ ├── tx2 │ │ ├── config.cmake │ │ └── overlay-tx2.dts │ ├── zynq7000 │ │ ├── config.cmake │ │ ├── mcs-overlay-zynq7000.dts │ │ └── overlay-zynq7000.dts │ └── zynqmp │ │ ├── config.cmake │ │ ├── overlay-hs-zynqmp.dts │ │ ├── overlay-zynqmp.dts │ │ └── overlay-zynqmp32.dts ├── smp │ ├── ipi.c │ └── lock.c ├── string.c └── util.c └── tools ├── bf.vim ├── bitfield_gen.py ├── changed.sh ├── circular_includes.py ├── condition.py ├── cpp_gen.sh ├── dts ├── allwinnerA20.dts ├── am335x-bone.dts ├── am335x-boneblack.dts ├── am335x-boneblue.dts ├── apq8064.dts ├── ariane.dts ├── exynos4.dts ├── exynos5250.dts ├── exynos5410.dts ├── exynos5422.dts ├── fvp.dts ├── hifive.dts ├── hikey.dts ├── imx7sabre.dts ├── imx8mm-evk.dts ├── imx8mq-evk.dts ├── maaxboard.dts ├── mpfs_icicle.dts ├── nitrogen6sx.dts ├── odroidc2.dts ├── odroidc4.dts ├── omap3.dts ├── rocketchip.dts ├── rockpro64.dts ├── rpi3.dts ├── rpi4.dts ├── sabre.dts ├── spike.dts ├── spike32.dts ├── tk1.dts ├── tqma8xqp1gb.dts ├── tx1.dts ├── tx2.dts ├── ultra96.dts ├── ultra96v2.dts ├── update-dts.sh ├── wandq.dts ├── zynq7000.dts └── zynqmp.dts ├── flags.cmake ├── hardware.yml ├── hardware ├── __init__.py ├── config.py ├── device.py ├── fdt.py ├── irq.py ├── memory.py ├── outputs │ ├── __init__.py │ ├── c_header.py │ ├── compat_strings.py │ ├── elfloader.py │ └── yaml.py └── utils │ ├── __init__.py │ ├── cpu.py │ ├── memory.py │ └── rule.py ├── hardware_gen.py ├── hardware_schema.yml ├── helpers.cmake ├── internal.cmake ├── invocation_header_gen.py ├── kernel_pylint.sh ├── kernel_xmllint.sh ├── lex.py ├── pylintrc ├── python-deps ├── README.rst └── setup.py ├── reciprocal.py ├── syscall_header_gen.py ├── umm.py └── xmllint.sh /.github/workflows/compilation-checks.yml: -------------------------------------------------------------------------------- 1 | # Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 2 | # 3 | # SPDX-License-Identifier: BSD-2-Clause 4 | 5 | # Compilation actions to run on pull requests 6 | 7 | name: Compile 8 | 9 | on: 10 | push: 11 | branches: 12 | - master 13 | pull_request: 14 | 15 | jobs: 16 | standalone_kernel: 17 | name: kernel 18 | runs-on: ubuntu-latest 19 | strategy: 20 | fail-fast: false 21 | matrix: 22 | arch: [ARM, ARM_HYP, AARCH64, RISCV64, X64] 23 | compiler: [gcc, llvm] 24 | exclude: 25 | # llvm RISCV64 compilation is not currently supported 26 | - arch: RISCV64 27 | compiler: llvm 28 | steps: 29 | - uses: actions/checkout@v2 30 | - uses: seL4/ci-actions/standalone-kernel@master 31 | with: 32 | ARCH: ${{ matrix.arch }} 33 | COMPILER: ${{ matrix.compiler }} 34 | -------------------------------------------------------------------------------- /.github/workflows/cparser.yml: -------------------------------------------------------------------------------- 1 | # Copyright 2021, Proofcraft Pty Ltd 2 | # 3 | # SPDX-License-Identifier: BSD-2-Clause 4 | 5 | # Run the verification C parser on the main kernel configurations 6 | # 7 | # See cparser-run/builds.yml in the repo seL4/ci-actions for configs. 8 | 9 | name: C Parser 10 | 11 | on: 12 | push: 13 | branches: [master] 14 | pull_request: 15 | 16 | jobs: 17 | cparser: 18 | name: C Parser 19 | runs-on: ubuntu-latest 20 | steps: 21 | - uses: seL4/ci-actions/cparser-run@master 22 | -------------------------------------------------------------------------------- /.github/workflows/manual.yml: -------------------------------------------------------------------------------- 1 | # Copyright 2021, Proofcraft Pty Ltd 2 | # 3 | # SPDX-License-Identifier: BSD-2-Clause 4 | 5 | # Build a PDF of the seL4 reference manual 6 | name: RefMan 7 | 8 | on: 9 | push: 10 | branches: 11 | - master 12 | pull_request: 13 | 14 | jobs: 15 | manual: 16 | name: Build PDF 17 | runs-on: ubuntu-latest 18 | steps: 19 | - uses: seL4/ci-actions/seL4-manual@master 20 | - uses: actions/upload-artifact@v2 21 | with: 22 | name: PDF 23 | path: manual/manual.pdf 24 | -------------------------------------------------------------------------------- /.github/workflows/push.yml: -------------------------------------------------------------------------------- 1 | # Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 2 | # 3 | # SPDX-License-Identifier: BSD-2-Clause 4 | 5 | # Actions to run on Push and Pull Request 6 | name: CI 7 | 8 | on: 9 | push: 10 | branches: 11 | - master 12 | pull_request: 13 | 14 | jobs: 15 | check: 16 | name: License Check 17 | runs-on: ubuntu-latest 18 | steps: 19 | - uses: seL4/ci-actions/license-check@master 20 | 21 | links: 22 | name: Links 23 | runs-on: ubuntu-latest 24 | steps: 25 | - uses: seL4/ci-actions/link-check@master 26 | -------------------------------------------------------------------------------- /.github/workflows/sel4test-sim.yml: -------------------------------------------------------------------------------- 1 | # Copyright 2021, Proofcraft Pty Ltd 2 | # 3 | # SPDX-License-Identifier: BSD-2-Clause 4 | 5 | # sel4test simulation runs 6 | # 7 | # See sel4test-sim/builds.yml in the repo seL4/ci-actions for configs. 8 | 9 | name: seL4Test Sim 10 | 11 | on: 12 | pull_request: 13 | paths-ignore: 14 | - 'manual/**' 15 | - 'LICENSES/**' 16 | - '*.md' 17 | 18 | jobs: 19 | sim: 20 | name: Simulation 21 | runs-on: ubuntu-latest 22 | strategy: 23 | matrix: 24 | march: [armv7a, armv8a, nehalem, rv32imac, rv64imac] 25 | compiler: [gcc, clang] 26 | exclude: 27 | - march: rv32imac 28 | compiler: clang 29 | - march: rv64imac 30 | compiler: clang 31 | steps: 32 | - uses: seL4/ci-actions/sel4test-sim@master 33 | with: 34 | march: ${{ matrix.march }} 35 | compiler: ${{ matrix.compiler }} 36 | -------------------------------------------------------------------------------- /.github/workflows/trigger.yml: -------------------------------------------------------------------------------- 1 | # Copyright 2021, Proofcraft Pty Ltd 2 | # 3 | # SPDX-License-Identifier: BSD-2-Clause 4 | 5 | # Trigger repository dispatch on main test repos 6 | name: Trigger 7 | 8 | on: 9 | push: 10 | branches: [master] 11 | 12 | jobs: 13 | trigger: 14 | name: Repository Dispatch 15 | if: ${{ github.repository_owner == 'seL4' }} 16 | runs-on: ubuntu-latest 17 | steps: 18 | - uses: seL4/ci-actions/trigger@master 19 | with: 20 | token: ${{ secrets.PRIV_REPO_TOKEN }} 21 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2014, General Dynamics C4 Systems 3 | # 4 | # SPDX-License-Identifier: GPL-2.0-only 5 | # 6 | 7 | # generated python bytecode 8 | *.pyc 9 | 10 | # latex generated files 11 | *.aux 12 | *.log 13 | *.out 14 | *.lof 15 | *.lot 16 | *.bbl 17 | *.blg 18 | *.toc 19 | *.mpx 20 | 21 | tools/parsetab.py 22 | manual/env.tex 23 | manual/manual.pdf 24 | manual/stage 25 | manual/doxygen-output 26 | manual/generated 27 | 28 | # Emacs backups 29 | *~ 30 | -------------------------------------------------------------------------------- /.licenseignore: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Data61, CSIRO (ABN 41 687 119 230) 2 | # SPDX-License-Identifier: BSD-2-Clause 3 | 4 | VERSION 5 | configs/*/autoconf.h 6 | manual/figs/* 7 | manual/references.bib 8 | .licenseignore 9 | *.pyc 10 | .git/* 11 | *parsetab.py 12 | CHANGES 13 | .reuse/dep5 14 | -------------------------------------------------------------------------------- /.reuse/dep5: -------------------------------------------------------------------------------- 1 | Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ 2 | Upstream-Name: seL4 3 | Upstream-Contact: seL4 team 4 | Source: http://sel4.systems 5 | 6 | Files: 7 | CHANGES 8 | VERSION 9 | manual/VERSION 10 | manual/references.bib 11 | Copyright: 2020 Data61, CSIRO (ABN 41 687 119 230) 12 | License: CC-BY-SA-4.0 13 | 14 | Files: manual/export.bst 15 | Copyright: 2005/02/27 Nicolas Markey 16 | License: LPPL-1.3c 17 | 18 | Files: manual/figs/* 19 | Copyright: Copyright 2014, General Dynamics C4 Systems 20 | License: GPL-2.0-only 21 | -------------------------------------------------------------------------------- /CAVEATS-ia32.md: -------------------------------------------------------------------------------- 1 | 6 | 7 | # Caveats specific to seL4 on ia32 and ia64 8 | 9 | ## Intel VT-d (I/O MMU) support 10 | 11 | Intel VT-d support in seL4 was tested for the following chipsets: 12 | 13 | - Intel Q35 Express 14 | - Intel 5500 15 | 16 | On other chipsets with Intel VT-d support, seL4 might: 17 | 18 | - complain and disable IOMMU support 19 | - hang during bootstrapping 20 | - have some weird behaviour during runtime 21 | 22 | In any case, the workaround is to disable VT-d support, either: 23 | 24 | - in the BIOS, or 25 | - by including `disable_iommu` into the MultiBoot (e.g. GRUB) command line 26 | as described in the seL4 documentation 27 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /FindseL4.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | # 4 | # SPDX-License-Identifier: GPL-2.0-only 5 | # 6 | 7 | set(KERNEL_PATH "${CMAKE_CURRENT_LIST_DIR}" CACHE STRING "") 8 | set(KERNEL_HELPERS_PATH "${CMAKE_CURRENT_LIST_DIR}/tools/helpers.cmake" CACHE STRING "") 9 | set(KERNEL_CONFIG_PATH "${CMAKE_CURRENT_LIST_DIR}/configs/seL4Config.cmake" CACHE STRING "") 10 | mark_as_advanced(KERNEL_PATH KERNEL_HELPERS_PATH KERNEL_CONFIG_PATH) 11 | 12 | macro(sel4_import_kernel) 13 | add_subdirectory(${KERNEL_PATH} ${CMAKE_BINARY_DIR}/kernel) 14 | endmacro() 15 | 16 | macro(sel4_import_libsel4) 17 | add_subdirectory("${KERNEL_PATH}/libsel4" ${CMAKE_BINARY_DIR}/libsel4) 18 | endmacro() 19 | 20 | macro(sel4_configure_platform_settings) 21 | include(${KERNEL_CONFIG_PATH}) 22 | endmacro() 23 | 24 | include(FindPackageHandleStandardArgs) 25 | FIND_PACKAGE_HANDLE_STANDARD_ARGS( 26 | seL4 27 | DEFAULT_MSG 28 | KERNEL_PATH 29 | KERNEL_HELPERS_PATH 30 | KERNEL_CONFIG_PATH 31 | ) 32 | -------------------------------------------------------------------------------- /LICENSES/LicenseRef-Trademark.txt: -------------------------------------------------------------------------------- 1 | The files in directory `manual/logos/` are trademarks of their 2 | respective owners. 3 | 4 | For license and usage guidelines on the seL4 trademark and logo, 5 | including the seL4 Foundation logo, see 6 | https://sel4.systems/Foundation/Trademark/ 7 | 8 | No further license is granted from use in this repository. 9 | -------------------------------------------------------------------------------- /VERSION: -------------------------------------------------------------------------------- 1 | 12.1.0-dev 2 | -------------------------------------------------------------------------------- /configs/ARM_verified.cmake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env -S cmake -P 2 | # 3 | # Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 4 | # 5 | # SPDX-License-Identifier: GPL-2.0-only 6 | # 7 | 8 | # If this file is executed then build the kernel.elf and kernel_all_pp.c file 9 | include(${CMAKE_CURRENT_LIST_DIR}/../tools/helpers.cmake) 10 | cmake_script_build_kernel() 11 | 12 | set(KernelPlatform "imx6" CACHE STRING "") 13 | set(KernelVerificationBuild ON CACHE BOOL "") 14 | set(KernelIPCBufferLocation "threadID_register" CACHE STRING "") 15 | set(KernelMaxNumNodes "1" CACHE STRING "") 16 | set(KernelOptimisation "-O2" CACHE STRING "") 17 | set(KernelRetypeFanOutLimit "256" CACHE STRING "") 18 | set(KernelBenchmarks "none" CACHE STRING "") 19 | set(KernelDangerousCodeInjection OFF CACHE BOOL "") 20 | set(KernelFastpath ON CACHE BOOL "") 21 | set(KernelPrinting OFF CACHE BOOL "") 22 | set(KernelNumDomains 16 CACHE STRING "") 23 | set(KernelMaxNumBootinfoUntypedCap 166 CACHE STRING "") 24 | -------------------------------------------------------------------------------- /include/32/mode/api/ipc_buffer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | static inline time_t mode_parseTimeArg(word_t i, word_t *buffer) 14 | { 15 | return (((time_t) getSyscallArg(i + 1, buffer) << 32llu) + getSyscallArg(i, buffer)); 16 | } 17 | 18 | static inline word_t mode_setTimeArg(word_t i, time_t time, word_t *buffer, tcb_t *thread) 19 | { 20 | setMR(thread, buffer, i, (uint32_t) time); 21 | return setMR(thread, buffer, i + 1, (uint32_t)(time >> 32llu)); 22 | } 23 | 24 | -------------------------------------------------------------------------------- /include/32/mode/config.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | # 4 | # SPDX-License-Identifier: GPL-2.0-only 5 | # 6 | 7 | cmake_minimum_required(VERSION 3.7.2) 8 | 9 | add_bf_source_old("Kernel32" "shared_types.bf" "libsel4/mode_include/32" "sel4") 10 | -------------------------------------------------------------------------------- /include/32/mode/stdint.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | #pragma once 7 | 8 | #define UINTPTR_MAX UINT32_MAX 9 | 10 | -------------------------------------------------------------------------------- /include/64/mode/api/ipc_buffer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | 12 | static inline time_t mode_parseTimeArg(word_t i, word_t *buffer) 13 | { 14 | return getSyscallArg(i, buffer); 15 | } 16 | 17 | static inline word_t mode_setTimeArg(word_t i, time_t time, word_t *buffer, tcb_t *thread) 18 | { 19 | return setMR(thread, buffer, i, time); 20 | } 21 | -------------------------------------------------------------------------------- /include/64/mode/config.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | # 4 | # SPDX-License-Identifier: GPL-2.0-only 5 | # 6 | 7 | cmake_minimum_required(VERSION 3.7.2) 8 | 9 | add_bf_source_old("Kernel64" "shared_types.bf" "libsel4/mode_include/64" "sel4") 10 | -------------------------------------------------------------------------------- /include/64/mode/stdint.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #define UINTPTR_MAX UINT64_MAX 10 | 11 | -------------------------------------------------------------------------------- /include/64/mode/util.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | static inline CONST uint64_t div64(uint64_t numerator, uint32_t denominator) 14 | { 15 | return numerator / denominator; 16 | } 17 | 18 | -------------------------------------------------------------------------------- /include/api.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014, General Dynamics C4 Systems 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | #include 12 | -------------------------------------------------------------------------------- /include/api/faults.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | 12 | word_t setMRs_fault(tcb_t *sender, tcb_t *receiver, word_t *receiveIPCBuffer); 13 | word_t Arch_setMRs_fault(tcb_t *sender, tcb_t *receiver, word_t *receiveIPCBuffer, word_t faultType); 14 | 15 | bool_t handleFaultReply(tcb_t *receiver, tcb_t *sender); 16 | bool_t Arch_handleFaultReply(tcb_t *receiver, tcb_t *sender, word_t faultType); 17 | 18 | -------------------------------------------------------------------------------- /include/arch/arm/arch/32/mode/kernel/stack.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | 12 | #define KERNEL_STACK_ALIGNMENT 16 13 | 14 | -------------------------------------------------------------------------------- /include/arch/arm/arch/32/mode/smp/ipi.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #ifdef ENABLE_SMP_SUPPORT 15 | 16 | typedef enum { 17 | /* placeholder for 32-bit ARM IPI types */ 18 | IpiNumModeRemoteCall 19 | } IpiModeRemoteCall_t; 20 | 21 | #endif /* ENABLE_SMP_SUPPORT */ 22 | 23 | -------------------------------------------------------------------------------- /include/arch/arm/arch/32/mode/types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | compile_assert(long_is_32bits, sizeof(unsigned long) == 4) 12 | 13 | #define wordRadix 5 14 | #define wordBits (1 << wordRadix) 15 | 16 | typedef uint32_t timestamp_t; 17 | -------------------------------------------------------------------------------- /include/arch/arm/arch/64/mode/kernel/stack.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | 12 | #define KERNEL_STACK_ALIGNMENT 4096 13 | 14 | 15 | -------------------------------------------------------------------------------- /include/arch/arm/arch/64/mode/kernel/thread.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017, General Dynamics C4 Systems 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | static inline word_t CONST sanitiseRegister(register_t reg, word_t v, bool_t archInfo) 10 | { 11 | if (reg == SPSR_EL1) { 12 | if (archInfo) { 13 | switch (v & 0x1f) { 14 | case PMODE_EL0t: 15 | case PMODE_EL1t: 16 | case PMODE_EL1h: 17 | return v; 18 | default: 19 | break; 20 | } 21 | } 22 | return (v & 0xf0000000) | PSTATE_USER; 23 | } else { 24 | return v; 25 | } 26 | } 27 | 28 | static inline bool_t CONST Arch_getSanitiseRegisterInfo(tcb_t *thread) 29 | { 30 | #ifdef CONFIG_ARM_HYPERVISOR_SUPPORT 31 | return (thread->tcbArch.tcbVCPU != NULL); 32 | #else 33 | return 0; 34 | #endif /* CONFIG_ARM_HYPERVISOR_SUPPORT */ 35 | } 36 | 37 | -------------------------------------------------------------------------------- /include/arch/arm/arch/64/mode/machine/debug.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | 10 | -------------------------------------------------------------------------------- /include/arch/arm/arch/64/mode/machine/timer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #ifdef CONFIG_KERNEL_MCS 11 | #include 12 | #include 13 | 14 | /* timer function definitions that work for all 64 bit arm platforms */ 15 | static inline CONST ticks_t getMaxTicksToUs(void) 16 | { 17 | #if USE_KHZ 18 | return UINT64_MAX / TIMER_CLOCK_KHZ; 19 | #else 20 | return UINT64_MAX; 21 | #endif 22 | } 23 | 24 | static inline CONST time_t ticksToUs(ticks_t ticks) 25 | { 26 | #if USE_KHZ 27 | return (ticks * KHZ_IN_MHZ) / TIMER_CLOCK_KHZ; 28 | #else 29 | return ticks / TIMER_CLOCK_MHZ; 30 | #endif 31 | } 32 | #endif /* CONFIG_KERNEL_MCS */ 33 | 34 | -------------------------------------------------------------------------------- /include/arch/arm/arch/64/mode/machine_pl2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #ifdef CONFIG_ARM_HYPERVISOR_SUPPORT 10 | 11 | static inline void writeTPIDR_EL2(word_t reg) 12 | { 13 | MSR("tpidr_el2", reg); 14 | } 15 | 16 | static inline word_t readTPIDR_EL2(void) 17 | { 18 | word_t reg; 19 | MRS("tpidr_el2", reg); 20 | return reg; 21 | } 22 | 23 | #else 24 | 25 | static inline void writeTPIDR_EL2(word_t reg) {} 26 | static inline word_t readTPIDR_EL2(void) 27 | { 28 | return 0; 29 | } 30 | 31 | #endif /* End of CONFIG_ARM_HYPERVISOR_SUPPORT */ 32 | 33 | /* used in other files without guards */ 34 | static inline void setCurrentPDPL2(paddr_t pa) {} 35 | static inline void invalidateHypTLB(void) {} 36 | static inline void writeContextIDPL2(word_t pd_val) {} 37 | static inline void writeContextIDAndPD(word_t id, word_t pd_val) {} 38 | -------------------------------------------------------------------------------- /include/arch/arm/arch/64/mode/smp/ipi.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | #ifdef ENABLE_SMP_SUPPORT 14 | 15 | typedef enum { 16 | /* placeholder for 64-bit ARM IPI types */ 17 | IpiNumModeRemoteCall 18 | } IpiModeRemoteCall_t; 19 | 20 | #endif /* ENABLE_SMP_SUPPORT */ 21 | -------------------------------------------------------------------------------- /include/arch/arm/arch/64/mode/types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | compile_assert(long_is_64bits, sizeof(unsigned long) == 8) 12 | 13 | #define wordRadix 6 14 | #define wordBits (1 << wordRadix) 15 | 16 | typedef uint64_t timestamp_t; 17 | -------------------------------------------------------------------------------- /include/arch/arm/arch/api/types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014, General Dynamics C4 Systems 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | #define pageType SmallPageObject 14 | 15 | enum asidConstants { 16 | asidInvalid = 0 17 | }; 18 | 19 | #define asidMax (BIT(asidLowBits+asidHighBits)-1) 20 | 21 | typedef word_t asid_t; 22 | 23 | 24 | -------------------------------------------------------------------------------- /include/arch/arm/arch/fastpath/fastpath.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014, General Dynamics C4 Systems 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | void slowpath(syscall_t syscall) 15 | NORETURN; 16 | 17 | static inline 18 | void fastpath_call(word_t cptr, word_t r_msgInfo) 19 | NORETURN; 20 | 21 | static inline 22 | #ifdef CONFIG_KERNEL_MCS 23 | void fastpath_reply_recv(word_t cptr, word_t r_msgInfo, word_t reply) 24 | #else 25 | void fastpath_reply_recv(word_t cptr, word_t r_msgInfo) 26 | #endif 27 | NORETURN; 28 | 29 | 30 | -------------------------------------------------------------------------------- /include/arch/arm/arch/kernel/boot.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014, General Dynamics C4 Systems 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | cap_t create_unmapped_it_frame_cap(pptr_t pptr, bool_t use_large); 12 | cap_t create_mapped_it_frame_cap(cap_t pd_cap, pptr_t pptr, vptr_t vptr, asid_t asid, bool_t use_large, 13 | bool_t executable); 14 | 15 | void init_kernel( 16 | paddr_t ui_p_reg_start, 17 | paddr_t ui_p_reg_end, 18 | sword_t pv_offset, 19 | vptr_t v_entry, 20 | paddr_t dtb_addr_p, 21 | uint32_t dtb_size 22 | ); 23 | 24 | -------------------------------------------------------------------------------- /include/arch/arm/arch/kernel/thread.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014, General Dynamics C4 Systems 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | -------------------------------------------------------------------------------- /include/arch/arm/arch/linker.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | /* Place-holder for ARM-related linker definitions */ 9 | 10 | -------------------------------------------------------------------------------- /include/arch/arm/arch/machine/capdl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014, General Dynamics C4 Systems 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | 12 | #ifdef CONFIG_PRINTING 13 | 14 | #ifdef CONFIG_TK1_SMMU 15 | static inline void arm_obj_iospace_print_attrs(cap_t iospace_cap) 16 | { 17 | printf("(armiospace: %lu)\n", (long unsigned int)cap_io_space_cap_get_capModuleID(iospace_cap)); 18 | } 19 | #endif 20 | 21 | static inline void obj_asidpool_print_attrs(cap_t asid_cap) 22 | { 23 | printf("(asid_high: 0x%lx)\n", (long unsigned int)ASID_HIGH(cap_asid_pool_cap_get_capASIDBase(asid_cap))); 24 | } 25 | 26 | #endif /* CONFIG_PRINTING */ 27 | -------------------------------------------------------------------------------- /include/arch/arm/arch/machine/fpu.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | #include 9 | 10 | bool_t fpsimd_HWCapTest(void); 11 | bool_t fpsimd_init(void); 12 | 13 | 14 | -------------------------------------------------------------------------------- /include/arch/arm/arch/machine/hardware.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014, General Dynamics C4 Systems 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | 12 | #ifndef __ASSEMBLER__ 13 | enum vm_fault_type { 14 | ARMDataAbort = seL4_DataFault, 15 | ARMPrefetchAbort = seL4_InstructionFault 16 | }; 17 | typedef word_t vm_fault_type_t; 18 | 19 | #define PAGE_BASE(_p, _s) ((_p) & ~MASK(pageBitsForSize((_s)))) 20 | #define PAGE_OFFSET(_p, _s) ((_p) & MASK(pageBitsForSize((_s)))) 21 | #define IS_PAGE_ALIGNED(_p, _s) (((_p) & MASK(pageBitsForSize((_s)))) == 0) 22 | 23 | #define IPI_MEM_BARRIER \ 24 | do { \ 25 | dmb(); \ 26 | } while (0) 27 | 28 | #endif /* __ASSEMBLER__ */ 29 | 30 | #define L1_CACHE_LINE_SIZE_BITS CONFIG_L1_CACHE_LINE_SIZE_BITS 31 | #define L1_CACHE_LINE_SIZE BIT(L1_CACHE_LINE_SIZE_BITS) 32 | 33 | -------------------------------------------------------------------------------- /include/arch/arm/arch/machine/l2c_310.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014, General Dynamics C4 Systems 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | /* 8 | * ARM L2 Cache controller L2C-310 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | 15 | 16 | void initL2Cache(void); 17 | 18 | void plat_cleanInvalidateL2Cache(void); 19 | void plat_cleanCache(void); 20 | void plat_cleanL2Range(paddr_t start, paddr_t end); 21 | void plat_invalidateL2Range(paddr_t start, paddr_t end); 22 | void plat_cleanInvalidateL2Range(paddr_t start, paddr_t end); 23 | 24 | -------------------------------------------------------------------------------- /include/arch/arm/arch/machine/registerset.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014, General Dynamics C4 Systems 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | -------------------------------------------------------------------------------- /include/arch/arm/arch/object/structures.bf: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright 2014, General Dynamics C4 Systems 3 | -- 4 | -- SPDX-License-Identifier: GPL-2.0-only 5 | -- 6 | 7 | #include 8 | -------------------------------------------------------------------------------- /include/arch/arm/arch/object/structures.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014, General Dynamics C4 Systems 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | #define tcbArchCNodeEntries tcbCNodeEntries 12 | 13 | static inline bool_t CONST Arch_isCapRevocable(cap_t derivedCap, cap_t srcCap) 14 | { 15 | return false; 16 | } 17 | 18 | 19 | -------------------------------------------------------------------------------- /include/arch/arm/arch/smp/ipi.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | #ifdef ENABLE_SMP_SUPPORT 12 | typedef enum { 13 | IpiRemoteCall_Stall, 14 | IpiRemoteCall_InvalidateTranslationSingle, 15 | IpiRemoteCall_InvalidateTranslationASID, 16 | IpiRemoteCall_InvalidateTranslationAll, 17 | IpiRemoteCall_switchFpuOwner, 18 | IpiRemoteCall_MaskPrivateInterrupt, 19 | #ifdef CONFIG_ARM_HYPERVISOR_SUPPORT 20 | IpiRemoteCall_VCPUInjectInterrupt, 21 | #endif 22 | /* Add relevant calls here upon required */ 23 | IpiNumArchRemoteCall 24 | } IpiRemoteCall_t; 25 | 26 | #endif /* ENABLE_SMP_SUPPORT */ 27 | 28 | -------------------------------------------------------------------------------- /include/arch/arm/arch/types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014, General Dynamics C4 Systems 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | typedef unsigned long word_t; 14 | typedef signed long sword_t; 15 | /* for printf() formatting */ 16 | #define _seL4_word_fmt l 17 | 18 | typedef word_t vptr_t; 19 | typedef word_t paddr_t; 20 | typedef word_t pptr_t; 21 | typedef word_t cptr_t; 22 | typedef word_t node_id_t; 23 | typedef word_t cpu_id_t; 24 | typedef word_t dom_t; 25 | 26 | typedef uint8_t hw_asid_t; 27 | 28 | enum hwASIDConstants { 29 | hwASIDMax = 255, 30 | hwASIDBits = 8 31 | }; 32 | 33 | typedef struct kernel_frame { 34 | paddr_t paddr; 35 | pptr_t pptr; 36 | int armExecuteNever; 37 | int userAvailable; 38 | } kernel_frame_t; 39 | -------------------------------------------------------------------------------- /include/arch/arm/arch/user_access.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014, General Dynamics C4 Systems 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | #pragma once 7 | 8 | void armv_init_user_access(void); 9 | 10 | -------------------------------------------------------------------------------- /include/arch/arm/armv/armv7-a/armv/benchmark.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014, General Dynamics C4 Systems 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #ifdef CONFIG_ENABLE_BENCHMARKS 10 | #include 11 | 12 | #define PMCR "p15, 0, %0, c9, c12, 0" 13 | #define PMCNTENSET "p15, 0, %0, c9, c12, 1" 14 | #define PMOVSR "p15, 0, %0, c9, c12, 3" 15 | #define CCNT "p15, 0, %0, c9, c13, 0" 16 | #define PMINTENSET "p15, 0, %0, c9, c14, 1" 17 | #define CCNT_INDEX 31 18 | 19 | static inline void armv_enableOverflowIRQ(void) 20 | { 21 | word_t val; 22 | MRC(PMINTENSET, val); 23 | val |= BIT(CCNT_INDEX); 24 | MCR(PMINTENSET, val); 25 | } 26 | 27 | static inline void armv_handleOverflowIRQ(void) 28 | { 29 | word_t val = BIT(CCNT_INDEX); 30 | MCR(PMOVSR, val); 31 | } 32 | #endif /* CONFIG_ENABLE_BENCHMARKS */ 33 | 34 | -------------------------------------------------------------------------------- /include/arch/arm/armv/armv7ve: -------------------------------------------------------------------------------- 1 | armv7-a -------------------------------------------------------------------------------- /include/arch/arm/armv/armv8-a/32/armv/benchmark.h: -------------------------------------------------------------------------------- 1 | ../../../armv7-a/armv/benchmark.h -------------------------------------------------------------------------------- /include/arch/arm/armv/armv8-a/32/armv/context_switch.h: -------------------------------------------------------------------------------- 1 | ../../../armv7-a/armv/context_switch.h -------------------------------------------------------------------------------- /include/arch/arm/armv/armv8-a/32/armv/debug.h: -------------------------------------------------------------------------------- 1 | ../../../armv7-a/armv/debug.h -------------------------------------------------------------------------------- /include/arch/arm/armv/armv8-a/32/armv/machine.h: -------------------------------------------------------------------------------- 1 | ../../../armv7-a/armv/machine.h -------------------------------------------------------------------------------- /include/arch/arm/armv/armv8-a/32/armv/vcpu.h: -------------------------------------------------------------------------------- 1 | ../../../armv7-a/armv/vcpu.h -------------------------------------------------------------------------------- /include/arch/arm/armv/armv8-a/64/armv/benchmark.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #ifdef CONFIG_ENABLE_BENCHMARKS 11 | 12 | #define CCNT "PMCCNTR_EL0" 13 | #define PMCR "PMCR_EL0" 14 | #define PMCNTENSET "PMCNTENSET_EL0" 15 | #define PMINTENSET "PMINTENSET_EL1" 16 | #define PMOVSR "PMOVSCLR_EL0" 17 | #define CCNT_INDEX 31 18 | 19 | static inline void armv_enableOverflowIRQ(void) 20 | { 21 | uint32_t val; 22 | MRS(PMINTENSET, val); 23 | val |= BIT(CCNT_INDEX); 24 | MSR(PMINTENSET, val); 25 | } 26 | 27 | static inline void armv_handleOverflowIRQ(void) 28 | { 29 | uint32_t val = BIT(CCNT_INDEX); 30 | MSR(PMOVSR, val); 31 | } 32 | 33 | #endif /* CONFIG_ENABLE_BENCHMARKS */ 34 | 35 | -------------------------------------------------------------------------------- /include/arch/arm/armv/armv8-a/64/armv/context_switch.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | 12 | 13 | static inline void armv_contextSwitch_HWASID(vspace_root_t *vspace, asid_t asid) 14 | { 15 | setCurrentUserVSpaceRoot(ttbr_new(asid, pptr_to_paddr(vspace))); 16 | } 17 | 18 | /* 19 | * In AARCH64, hardware and virtual asids are the same and are written 20 | * when updating the translation table base register. 21 | */ 22 | static inline void armv_contextSwitch(vspace_root_t *vspace, asid_t asid) 23 | { 24 | #ifdef CONFIG_ARM_HYPERVISOR_SUPPORT 25 | asid = getHWASID(asid); 26 | #endif 27 | setCurrentUserVSpaceRoot(ttbr_new(asid, pptr_to_paddr(vspace))); 28 | } 29 | 30 | -------------------------------------------------------------------------------- /include/arch/arm/armv/armv8-a/64/armv/debug.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | -------------------------------------------------------------------------------- /include/arch/riscv/arch/32/mode/kernel/stack.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | 12 | #ifdef ENABLE_SMP_SUPPORT 13 | #define KERNEL_STACK_ALIGNMENT 4096 14 | #else 15 | #define KERNEL_STACK_ALIGNMENT 4 16 | #endif 17 | 18 | -------------------------------------------------------------------------------- /include/arch/riscv/arch/32/mode/object/structures.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * Copyright 2015, 2016 Hesham Almatary 4 | * 5 | * SPDX-License-Identifier: GPL-2.0-only 6 | */ 7 | 8 | #pragma once 9 | 10 | 11 | -------------------------------------------------------------------------------- /include/arch/riscv/arch/32/mode/smp/ipi.h: -------------------------------------------------------------------------------- 1 | ../../../64/mode/smp/ipi.h -------------------------------------------------------------------------------- /include/arch/riscv/arch/32/mode/types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | compile_assert(long_is_32bits, sizeof(unsigned long) == 4) 14 | 15 | #define wordRadix 5 16 | -------------------------------------------------------------------------------- /include/arch/riscv/arch/64/mode/kernel/stack.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | 12 | #ifdef ENABLE_SMP_SUPPORT 13 | #define KERNEL_STACK_ALIGNMENT 4096 14 | #else 15 | #define KERNEL_STACK_ALIGNMENT 8 16 | #endif 17 | 18 | 19 | -------------------------------------------------------------------------------- /include/arch/riscv/arch/64/mode/machine.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | static inline uint64_t riscv_read_time(void) 14 | { 15 | word_t n; 16 | asm volatile("rdtime %0" : "=r"(n)); 17 | return n; 18 | } 19 | 20 | static inline uint64_t riscv_read_cycle(void) 21 | { 22 | word_t n; 23 | asm volatile("rdcycle %0" : "=r"(n)); 24 | return n; 25 | } 26 | -------------------------------------------------------------------------------- /include/arch/riscv/arch/64/mode/object/structures.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * Copyright 2015, 2016 Hesham Almatary 4 | * 5 | * SPDX-License-Identifier: GPL-2.0-only 6 | */ 7 | 8 | #pragma once 9 | 10 | -------------------------------------------------------------------------------- /include/arch/riscv/arch/64/mode/smp/ipi.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once -------------------------------------------------------------------------------- /include/arch/riscv/arch/64/mode/types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | compile_assert(long_is_64bits, sizeof(unsigned long) == 8) 14 | 15 | #define wordRadix 6 16 | -------------------------------------------------------------------------------- /include/arch/riscv/arch/api/types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | /* 8 | * 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | 19 | #define pageType PageObject4K 20 | 21 | enum asidConstants { 22 | asidInvalid = 0 23 | }; 24 | 25 | #define asidMax (BIT(asidLowBits + asidHighBits) - 1) 26 | 27 | typedef word_t asid_t; 28 | 29 | 30 | -------------------------------------------------------------------------------- /include/arch/riscv/arch/benchmark.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * Copyright 2015, 2016 Hesham Almatary 4 | * 5 | * SPDX-License-Identifier: GPL-2.0-only 6 | */ 7 | 8 | #pragma once 9 | 10 | #include 11 | #include 12 | #include 13 | 14 | #ifdef CONFIG_ENABLE_BENCHMARKS 15 | static inline timestamp_t timestamp(void) 16 | { 17 | return riscv_read_cycle(); 18 | } 19 | 20 | static inline void benchmark_arch_utilisation_reset(void) 21 | { 22 | /* nothing here */ 23 | } 24 | 25 | #endif /* CONFIG_ENABLE_BENCHMARK */ 26 | 27 | -------------------------------------------------------------------------------- /include/arch/riscv/arch/kernel/boot.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * Copyright 2015, 2016 Hesham Almatary 4 | * 5 | * SPDX-License-Identifier: GPL-2.0-only 6 | */ 7 | 8 | #pragma once 9 | 10 | #include 11 | #include 12 | 13 | cap_t create_unmapped_it_frame_cap(pptr_t pptr, bool_t use_large); 14 | cap_t create_mapped_it_frame_cap(cap_t pd_cap, pptr_t pptr, vptr_t vptr, asid_t asid, bool_t use_large, 15 | bool_t executable); 16 | 17 | void init_kernel( 18 | paddr_t ui_p_reg_start, 19 | paddr_t ui_p_reg_end, 20 | sword_t pv_offset, 21 | vptr_t v_entry, 22 | paddr_t dtb_addr_p, 23 | uint32_t dtb_size 24 | #ifdef ENABLE_SMP_SUPPORT 25 | , 26 | word_t hart_id, 27 | word_t core_id 28 | #endif 29 | ); 30 | 31 | 32 | -------------------------------------------------------------------------------- /include/arch/riscv/arch/kernel/thread.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * Copyright 2015, 2016 Hesham Almatary 4 | * 5 | * SPDX-License-Identifier: GPL-2.0-only 6 | */ 7 | 8 | #pragma once 9 | 10 | #include 11 | 12 | static inline bool_t CONST Arch_getSanitiseRegisterInfo(tcb_t *thread) 13 | { 14 | return 0; 15 | } 16 | 17 | -------------------------------------------------------------------------------- /include/arch/riscv/arch/linker.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * Copyright 2015, 2016 Hesham Almatary 4 | * 5 | * SPDX-License-Identifier: GPL-2.0-only 6 | */ 7 | 8 | #pragma once 9 | 10 | #include 11 | 12 | 13 | -------------------------------------------------------------------------------- /include/arch/riscv/arch/machine/capdl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014, General Dynamics C4 Systems 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | -------------------------------------------------------------------------------- /include/arch/riscv/arch/object/interrupt.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014, General Dynamics C4 Systems 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | static inline void handleReservedIRQ(irq_t irq) 14 | { 15 | #ifdef CONFIG_IRQ_REPORTING 16 | printf("Received unhandled reserved IRQ: %d\n", (int)irq); 17 | #endif 18 | } 19 | 20 | exception_t Arch_decodeIRQControlInvocation(word_t invLabel, word_t length, 21 | cte_t *srcSlot, word_t *buffer); 22 | exception_t Arch_checkIRQ(word_t irq_w); 23 | 24 | -------------------------------------------------------------------------------- /include/arch/riscv/arch/object/structures.bf: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | -- Copyright 2015, 2016 Hesham Almatary 4 | -- 5 | -- SPDX-License-Identifier: GPL-2.0-only 6 | -- 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /include/arch/riscv/arch/smp/ipi.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | #ifdef ENABLE_SMP_SUPPORT 12 | typedef enum { 13 | IpiRemoteCall_Stall, 14 | IpiRemoteCall_switchFpuOwner, 15 | IpiNumArchRemoteCall 16 | } IpiRemoteCall_t; 17 | 18 | void ipi_send_target(irq_t irq, word_t cpuTargetList); 19 | irq_t ipi_get_irq(void); 20 | void ipi_clear_irq(irq_t irq); 21 | #endif 22 | 23 | -------------------------------------------------------------------------------- /include/arch/riscv/arch/smp/ipi_inline.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #ifdef ENABLE_SMP_SUPPORT 10 | 11 | static inline void doRemoteStall(word_t cpu) 12 | { 13 | doRemoteOp0Arg(IpiRemoteCall_Stall, cpu); 14 | } 15 | 16 | #ifdef CONFIG_HAVE_FPU 17 | static inline void doRemoteswitchFpuOwner(user_fpu_state_t *new_owner, word_t cpu) 18 | { 19 | doRemoteOp1Arg(IpiRemoteCall_switchFpuOwner, (word_t)new_owner, cpu); 20 | } 21 | #endif /* CONFIG_HAVE_FPU */ 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /include/arch/riscv/arch/types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * Copyright 2015, 2016 Hesham Almatary 4 | * 5 | * SPDX-License-Identifier: GPL-2.0-only 6 | */ 7 | 8 | #pragma once 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | typedef unsigned long word_t; 16 | typedef signed long sword_t; 17 | /* for printf() formatting */ 18 | #define _seL4_word_fmt l 19 | 20 | typedef word_t vptr_t; 21 | typedef word_t paddr_t; 22 | typedef word_t pptr_t; 23 | typedef word_t cptr_t; 24 | typedef word_t dev_id_t; 25 | typedef word_t cpu_id_t; 26 | typedef word_t node_id_t; 27 | typedef word_t dom_t; 28 | 29 | typedef uint64_t timestamp_t; 30 | 31 | #define wordBits BIT(wordRadix) 32 | 33 | typedef struct kernel_frame { 34 | paddr_t paddr; 35 | pptr_t pptr; 36 | int userAvailable; 37 | } kernel_frame_t; 38 | -------------------------------------------------------------------------------- /include/arch/x86/arch/32/mode/hardware.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | 10 | #include 11 | #ifndef __ASSEMBLER__ 12 | #include 13 | #include 14 | #endif 15 | #include 16 | 17 | -------------------------------------------------------------------------------- /include/arch/x86/arch/32/mode/kernel/stack.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | 10 | #include 11 | #include 12 | 13 | #ifdef ENABLE_SMP_SUPPORT 14 | #define KERNEL_STACK_ALIGNMENT 4096 15 | #else 16 | #define KERNEL_STACK_ALIGNMENT 16 17 | #endif /* ENABLE_SMP_SUPPORT */ 18 | 19 | 20 | -------------------------------------------------------------------------------- /include/arch/x86/arch/32/mode/kernel/tlb.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | 12 | static inline void invalidateTLBEntry(vptr_t vptr, word_t mask) 13 | { 14 | invalidateLocalTLBEntry(vptr); 15 | SMP_COND_STATEMENT(doRemoteInvalidateTLBEntry(vptr, mask)); 16 | } 17 | 18 | static inline void invalidatePageStructureCache(word_t mask) 19 | { 20 | invalidateLocalPageStructureCache(); 21 | SMP_COND_STATEMENT(doRemoteInvalidatePageStructureCache(mask)); 22 | } 23 | 24 | static inline void invalidateTLB(word_t mask) 25 | { 26 | invalidateLocalTLB(); 27 | SMP_COND_STATEMENT(doRemoteInvalidateTLB(mask)); 28 | } 29 | 30 | -------------------------------------------------------------------------------- /include/arch/x86/arch/32/mode/model/statedata.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014, General Dynamics C4 Systems 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | extern pde_t ia32KSGlobalPD[BIT(PD_INDEX_BITS)]; 16 | extern pte_t ia32KSGlobalPT[BIT(PT_INDEX_BITS)]; 17 | 18 | #ifdef CONFIG_KERNEL_LOG_BUFFER 19 | extern pte_t ia32KSGlobalLogPT[BIT(PT_INDEX_BITS)]; 20 | #endif /* CONFIG_KERNEL_LOG_BUFFER */ 21 | 22 | NODE_STATE_BEGIN(modeNodeState) 23 | /* Current active page directory. This is really just a shadow of CR3 */ 24 | NODE_STATE_DECLARE(paddr_t, ia32KSCurrentPD); 25 | NODE_STATE_END(modeNodeState); 26 | 27 | -------------------------------------------------------------------------------- /include/arch/x86/arch/32/mode/types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | compile_assert(long_is_32bits, sizeof(unsigned long) == 4) 12 | 13 | #define wordRadix 5 14 | #define wordBits (1 << wordRadix) 15 | -------------------------------------------------------------------------------- /include/arch/x86/arch/64/mode/hardware.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | 12 | #ifndef __ASSEMBLER__ 13 | #include 14 | #endif 15 | -------------------------------------------------------------------------------- /include/arch/x86/arch/64/mode/kernel/stack.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | 12 | #define KERNEL_STACK_ALIGNMENT 16 13 | 14 | -------------------------------------------------------------------------------- /include/arch/x86/arch/64/mode/types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | compile_assert(long_is_64bits, sizeof(unsigned long) == 8) 12 | 13 | #define wordRadix 6 14 | #define wordBits (1 << wordRadix) 15 | -------------------------------------------------------------------------------- /include/arch/x86/arch/api/types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014, General Dynamics C4 Systems 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #define pageType PageObject4K 15 | 16 | enum asidConstants { 17 | asidInvalid = 0 18 | }; 19 | 20 | #define asidMax (BIT(asidLowBits + asidHighBits) - 1) 21 | 22 | typedef word_t asid_t; 23 | -------------------------------------------------------------------------------- /include/arch/x86/arch/benchmark.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014, General Dynamics C4 Systems 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #ifdef CONFIG_ENABLE_BENCHMARKS 11 | 12 | static inline uint64_t timestamp(void) 13 | { 14 | uint32_t low, high; 15 | 16 | asm volatile( 17 | "movl $0, %%eax \n" 18 | "movl $0, %%ecx \n" 19 | "cpuid \n" 20 | "rdtsc \n" 21 | "movl %%edx, %0 \n" 22 | "movl %%eax, %1 \n" 23 | "movl $0, %%eax \n" 24 | "movl $0, %%ecx \n" 25 | "cpuid \n" 26 | : "=r"(high), "=r"(low) 27 | : /* no inputs */ 28 | : "eax", "ebx", "ecx", "edx" 29 | ); 30 | 31 | return ((uint64_t) high) << 32llu | (uint64_t) low; 32 | } 33 | 34 | static inline void benchmark_arch_utilisation_reset(void) 35 | { 36 | } 37 | 38 | #endif /* CONFIG_ENABLE_BENCHMARKS */ 39 | 40 | -------------------------------------------------------------------------------- /include/arch/x86/arch/bootinfo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #define MAX_NUM_FREEMEM_REG 16 10 | 11 | /* 12 | * The maximum number of reserved regions we have is: 13 | * - 1 for each physical memory region (MAX_NUM_FREEMEM_REG) 14 | * - 1 for each kernel device: 15 | * - ioapics (CONFIG_MAX_NUM_IOAPIC) 16 | * - iommus (MAX_NUM_DRHU) 17 | * - apic (1) 18 | * - the reserved MSI region (1) 19 | */ 20 | #define MAX_NUM_RESV_REG (MAX_NUM_FREEMEM_REG + CONFIG_MAX_NUM_IOAPIC + MAX_NUM_DRHU + 2) 21 | -------------------------------------------------------------------------------- /include/arch/x86/arch/fastpath/fastpath.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014, General Dynamics C4 Systems 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | #ifndef CONFIG_KERNEL_MCS 12 | static inline int fastpath_reply_cap_check(cap_t cap) 13 | { 14 | return cap_capType_equals(cap, cap_reply_cap); 15 | } 16 | #endif 17 | 18 | void slowpath(syscall_t syscall) 19 | NORETURN; 20 | 21 | void fastpath_call(word_t cptr, word_t r_msgInfo) 22 | NORETURN; 23 | 24 | #ifdef CONFIG_KERNEL_MCS 25 | void fastpath_reply_recv(word_t cptr, word_t r_msgInfo, word_t reply) 26 | #else 27 | void fastpath_reply_recv(word_t cptr, word_t r_msgInfo) 28 | #endif 29 | NORETURN; 30 | -------------------------------------------------------------------------------- /include/arch/x86/arch/kernel/cmdline.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014, General Dynamics C4 Systems 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | #pragma once 7 | #include 8 | 9 | typedef struct cmdline_opt { 10 | #ifdef CONFIG_PRINTING 11 | uint16_t console_port; 12 | #endif 13 | #if defined(CONFIG_PRINTING) || defined(CONFIG_DEBUG_BUILD) 14 | uint16_t debug_port; 15 | #endif 16 | bool_t disable_iommu; 17 | } cmdline_opt_t; 18 | 19 | void cmdline_parse(const char *cmdline, cmdline_opt_t *cmdline_opt); 20 | 21 | -------------------------------------------------------------------------------- /include/arch/x86/arch/kernel/elf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | 12 | /* minimal ELF functionality for loading GRUB boot module */ 13 | bool_t elf_checkFile(Elf_Header_t *elfFile); 14 | v_region_t elf_getMemoryBounds(Elf_Header_t *elfFile); 15 | void elf_load(Elf_Header_t *elfFile, seL4_Word offset); 16 | 17 | -------------------------------------------------------------------------------- /include/arch/x86/arch/kernel/smp_sys.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | /* Lower memory address to copy APs boot code in real mode. Actual memory starts at 9 | * 0x500 but we need to round up to a page aligned address in order to send the 10 | * startup IPI */ 11 | #define BOOT_NODE_PADDR 0x1000 12 | /* Limit of memory region we can copy the AP to */ 13 | #define BOOT_NODE_MAX_PADDR 0x7bff 14 | 15 | #ifdef ENABLE_SMP_SUPPORT 16 | void boot_node(void); 17 | BOOT_CODE void start_boot_aps(void); 18 | BOOT_CODE bool_t copy_boot_code_aps(uint32_t mem_lower); 19 | #endif /* ENABLE_SMP_SUPPORT */ 20 | 21 | -------------------------------------------------------------------------------- /include/arch/x86/arch/kernel/thread.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014, General Dynamics C4 Systems 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | word_t sanitiseRegister(register_t reg, word_t v, bool_t archInfo); 12 | 13 | static inline bool_t CONST Arch_getSanitiseRegisterInfo(tcb_t *thread) 14 | { 15 | return 0; 16 | } 17 | 18 | void Mode_postModifyRegisters(tcb_t *tptr); 19 | 20 | 21 | -------------------------------------------------------------------------------- /include/arch/x86/arch/linker.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | /* code that is linked to physical addresses */ 12 | #define PHYS_CODE SECTION(".phys.text") 13 | 14 | /* data that is linked to physical addresses */ 15 | #define PHYS_DATA SECTION(".phys.data") 16 | 17 | /* bss data that is linked to physical addresses */ 18 | #define PHYS_BSS SECTION(".phys.bss") 19 | 20 | -------------------------------------------------------------------------------- /include/arch/x86/arch/machine/capdl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014, General Dynamics C4 Systems 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | 12 | #ifdef CONFIG_PRINTING 13 | 14 | void x86_obj_ioports_print_attrs(cap_t ioports_cap); 15 | 16 | #ifdef CONFIG_IOMMU 17 | void x86_obj_iospace_print_attrs(cap_t iospace_cap); 18 | void x86_obj_iopt_print_attrs(cap_t iopt_cap); 19 | #endif 20 | 21 | #endif /* CONFIG_PRINTING */ 22 | -------------------------------------------------------------------------------- /include/arch/x86/arch/machine/pat.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014, General Dynamics C4 Systems 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #define IA32_PAT_MSR 0x277 10 | 11 | #define IA32_PAT_MT_UNCACHEABLE 0x00 12 | #define IA32_PAT_MT_WRITE_COMBINING 0x01 13 | #define IA32_PAT_MT_WRITE_THROUGH 0x04 14 | #define IA32_PAT_MT_WRITE_PROTECTED 0x05 15 | #define IA32_PAT_MT_WRITE_BACK 0x06 16 | #define IA32_PAT_MT_UNCACHED 0x07 17 | 18 | -------------------------------------------------------------------------------- /include/arch/x86/arch/object/interrupt.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014, General Dynamics C4 Systems 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | exception_t Arch_decodeIRQControlInvocation(word_t invLabel, word_t length, 15 | cte_t *srcSlot, word_t *buffer); 16 | void Arch_irqStateInit(void); 17 | exception_t Arch_checkIRQ(word_t irq_w); 18 | 19 | -------------------------------------------------------------------------------- /include/arch/x86/arch/object/ioport.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014, General Dynamics C4 Systems 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | #define NUM_IO_PORTS BIT(16) 14 | 15 | /* given a pointer to an 8K IO port bitmap, set a range of bits to 0 or 1 based on the `set` parameter */ 16 | void setIOPortMask(void *ioport_bitmap, uint16_t low, uint16_t high, bool_t set); 17 | 18 | exception_t decodeX86PortInvocation(word_t invLabel, word_t length, cptr_t cptr, cte_t *slot, cap_t cap, 19 | bool_t call, word_t *buffer); 20 | exception_t decodeX86PortControlInvocation(word_t invLabel, word_t length, cptr_t cptr, cte_t *slot, cap_t cap, 21 | word_t *buffer); 22 | 23 | /* used to clean up the final capability to an allocated I/O port range */ 24 | void freeIOPortRange(uint16_t first_port, uint16_t last_port); 25 | 26 | -------------------------------------------------------------------------------- /include/arch/x86/arch/object/tcb.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014, General Dynamics C4 Systems 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | #ifdef CONFIG_VTX 14 | exception_t decodeSetEPTRoot(cap_t cap); 15 | void Arch_leaveVMAsyncTransfer(tcb_t *tcb); 16 | #endif 17 | -------------------------------------------------------------------------------- /include/arch/x86/arch/smp/ipi.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | #include 9 | 10 | #ifdef ENABLE_SMP_SUPPORT 11 | typedef enum { 12 | IpiRemoteCall_Stall, 13 | #ifdef CONFIG_VTX 14 | IpiRemoteCall_ClearCurrentVCPU, 15 | IpiRemoteCall_VMCheckBoundNotification, 16 | #endif 17 | IpiRemoteCall_InvalidatePageStructureCacheASID, 18 | IpiRemoteCall_InvalidateTranslationSingle, 19 | IpiRemoteCall_InvalidateTranslationSingleASID, 20 | IpiRemoteCall_InvalidateTranslationAll, 21 | IpiRemoteCall_switchFpuOwner, 22 | IpiNumArchRemoteCall 23 | } IpiRemoteCall_t; 24 | 25 | #endif /* ENABLE_SMP_SUPPORT */ 26 | 27 | -------------------------------------------------------------------------------- /include/arch/x86/arch/types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014, General Dynamics C4 Systems 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | typedef unsigned long word_t; 14 | typedef signed long sword_t; 15 | /* for printf() formatting */ 16 | #define _seL4_word_fmt l 17 | 18 | typedef word_t vptr_t; 19 | typedef word_t paddr_t; 20 | typedef word_t pptr_t; 21 | typedef word_t cptr_t; 22 | typedef word_t dev_id_t; 23 | typedef word_t cpu_id_t; 24 | typedef uint32_t logical_id_t; 25 | typedef word_t node_id_t; 26 | typedef word_t dom_t; 27 | 28 | typedef uint64_t timestamp_t; 29 | -------------------------------------------------------------------------------- /include/benchmark/benchmark_utilisation_.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | 12 | #ifdef CONFIG_BENCHMARK_TRACK_UTILISATION 13 | typedef struct { 14 | timestamp_t schedule_start_time; 15 | uint64_t utilisation; 16 | uint64_t number_schedules; 17 | uint64_t kernel_utilisation; 18 | uint64_t number_kernel_entries; 19 | 20 | } benchmark_util_t; 21 | #endif /* CONFIG_BENCHMARK_TRACK_UTILISATION */ 22 | 23 | -------------------------------------------------------------------------------- /include/bootinfo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014, General Dynamics C4 Systems 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | /* declare object-specific macros to hide the casting */ 14 | #define BI_PTR(r) ((seL4_BootInfo*)(r)) 15 | #define BI_REF(p) ((word_t)(p)) 16 | 17 | #define S_REG_EMPTY (seL4_SlotRegion){ .start = 0, .end = 0 } 18 | 19 | /* The boot info frame takes at least one page, it must be big enough to hold 20 | * the seL4_BootInfo data structure. Due to internal restrictions, the boot info 21 | * frame size must be of the form 2^n. Furthermore, there might still be code 22 | * that makes the hard-coded assumption the boot info frame is always one page. 23 | */ 24 | #define BI_FRAME_SIZE_BITS PAGE_BITS 25 | compile_assert(bi_size, sizeof(seL4_BootInfo) <= BIT(BI_FRAME_SIZE_BITS)) 26 | -------------------------------------------------------------------------------- /include/compound_types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014, General Dynamics C4 Systems 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | struct pde_range { 15 | pde_t *base; 16 | word_t length; 17 | }; 18 | typedef struct pde_range pde_range_t; 19 | 20 | struct pte_range { 21 | pte_t *base; 22 | word_t length; 23 | }; 24 | typedef struct pte_range pte_range_t; 25 | 26 | typedef cte_t *cte_ptr_t; 27 | 28 | struct extra_caps { 29 | cte_ptr_t excaprefs[seL4_MsgMaxExtraCaps]; 30 | }; 31 | typedef struct extra_caps extra_caps_t; 32 | -------------------------------------------------------------------------------- /include/config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | /* Set ENABLE_SMP_SUPPORT for kernel source files */ 12 | #ifdef CONFIG_ENABLE_SMP_SUPPORT 13 | #define ENABLE_SMP_SUPPORT 14 | #endif 15 | 16 | #ifdef CONFIG_ARM_HYPERVISOR_SUPPORT 17 | #ifdef CONFIG_ARM_PA_SIZE_BITS_40 18 | #define AARCH64_VSPACE_S2_START_L1 19 | #endif 20 | #endif 21 | -------------------------------------------------------------------------------- /include/drivers/timer/arm_priv.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #define TMR_INTS_EVENT BIT(0) 10 | 11 | /* 32 bit down counter */ 12 | struct timer { 13 | uint32_t load; 14 | uint32_t count; 15 | uint32_t ctrl; 16 | uint32_t ints; 17 | }; 18 | typedef volatile struct timer timer_t; 19 | extern timer_t *const priv_timer; 20 | 21 | static inline void resetTimer(void) 22 | { 23 | priv_timer->ints = TMR_INTS_EVENT; 24 | } 25 | 26 | -------------------------------------------------------------------------------- /include/drivers/uart.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021, Axel Heider 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | #pragma once 8 | 9 | #ifdef CONFIG_PRINTING 10 | 11 | void uart_drv_putchar(unsigned char c); 12 | 13 | static inline void uart_console_putchar( 14 | unsigned char c) 15 | { 16 | /* UART console requires printing a '\r' (CR) before any '\n' (LF) */ 17 | if (c == '\n') { 18 | uart_drv_putchar('\r'); 19 | } 20 | uart_drv_putchar(c); 21 | } 22 | 23 | #endif /* CONFIG_PRINTING */ 24 | 25 | #ifdef CONFIG_DEBUG_BUILD 26 | unsigned char uart_drv_getchar(void); 27 | #endif 28 | -------------------------------------------------------------------------------- /include/kernel/faulthandler.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014, General Dynamics C4 Systems 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | #ifdef CONFIG_KERNEL_MCS 12 | static inline bool_t validTimeoutHandler(tcb_t *tptr) 13 | { 14 | return cap_get_capType(TCB_PTR_CTE_PTR(tptr, tcbTimeoutHandler)->cap) == cap_endpoint_cap; 15 | } 16 | 17 | void handleTimeout(tcb_t *tptr); 18 | void handleNoFaultHandler(tcb_t *tptr); 19 | bool_t sendFaultIPC(tcb_t *tptr, cap_t handlerCap, bool_t can_donate); 20 | #else 21 | exception_t sendFaultIPC(tcb_t *tptr); 22 | void handleDoubleFault(tcb_t *tptr, seL4_Fault_t ex1); 23 | #endif 24 | void handleFault(tcb_t *tptr); 25 | 26 | -------------------------------------------------------------------------------- /include/kernel/stack.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | /* These are the stacks used in kernel, shared between architectures/modes. 14 | * CONFIG_KERNEL_STACK_BITS is defined in kernel/Kconfig. The physical/offset 15 | * address of the stack is per-arch-mode aligned. KERNEL_STACK_ALIGNMENT is 16 | * defined for each arch/mode in 17 | */ 18 | extern char kernel_stack_alloc[CONFIG_MAX_NUM_NODES][BIT(CONFIG_KERNEL_STACK_BITS)]; 19 | 20 | -------------------------------------------------------------------------------- /include/kernel/vspace.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014, General Dynamics C4 Systems 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | #pragma once 7 | 8 | #include 9 | #include 10 | 11 | #ifdef CONFIG_KERNEL_LOG_BUFFER 12 | exception_t benchmark_arch_map_logBuffer(word_t frame_cptr); 13 | #endif /* CONFIG_KERNEL_LOG_BUFFER */ 14 | 15 | -------------------------------------------------------------------------------- /include/machine/assembler.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014, General Dynamics C4 Systems 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | /* This file contains useful macros for assembly code. */ 10 | 11 | #ifdef __ASSEMBLER__ 12 | 13 | /* 14 | * Use BEGIN_FUNC(), END_FUNC() around assembly functions to annotate them 15 | * correctly to the assembler. 16 | */ 17 | #define BEGIN_FUNC(_name) \ 18 | .global _name ; \ 19 | .type _name, %function ; \ 20 | _name: 21 | 22 | #define END_FUNC(_name) \ 23 | .size _name, .-_name 24 | 25 | /* 26 | * BEGIN_FUNC_STATIC() and END_FUNC_STATIC() do as above, but without making a 27 | * global declaration. (c.f. static functions in C). 28 | */ 29 | #define BEGIN_FUNC_STATIC(_name) \ 30 | .type _name, %function ; \ 31 | _name: 32 | 33 | #define END_FUNC_STATIC(_name) \ 34 | .size _name, .-_name 35 | 36 | #else /* !__ASSEMBLER__ */ 37 | #warning "Including assembly-specific header in C code" 38 | #endif 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /include/machine/timer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | 12 | #ifdef CONFIG_KERNEL_MCS 13 | #include 14 | #include 15 | 16 | /* Read the current time from the timer. */ 17 | /** MODIFIES: [*] */ 18 | static inline ticks_t getCurrentTime(void); 19 | /* set the next deadline irq - deadline is absolute */ 20 | /** MODIFIES: [*] */ 21 | static inline void setDeadline(ticks_t deadline); 22 | /* ack previous deadline irq */ 23 | /** MODIFIES: [*] */ 24 | static inline void ackDeadlineIRQ(void); 25 | 26 | /* get the expected wcet of the kernel for this platform */ 27 | static PURE inline ticks_t getKernelWcetTicks(void) 28 | { 29 | return usToTicks(getKernelWcetUs()); 30 | } 31 | #else /* CONFIG_KERNEL_MCS */ 32 | static inline void resetTimer(void); 33 | #endif /* !CONFIG_KERNEL_MCS */ 34 | 35 | -------------------------------------------------------------------------------- /include/model/preemption.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014, General Dynamics C4 Systems 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | exception_t preemptionPoint(void); 12 | 13 | -------------------------------------------------------------------------------- /include/model/smp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #ifdef ENABLE_SMP_SUPPORT 15 | 16 | typedef struct smpStatedata { 17 | archNodeState_t cpu; 18 | nodeState_t system; 19 | PAD_TO_NEXT_CACHE_LN(sizeof(archNodeState_t) + sizeof(nodeState_t)); 20 | } smpStatedata_t; 21 | 22 | extern smpStatedata_t ksSMP[CONFIG_MAX_NUM_NODES]; 23 | 24 | void migrateTCB(tcb_t *tcb, word_t new_core); 25 | 26 | #endif /* ENABLE_SMP_SUPPORT */ 27 | 28 | -------------------------------------------------------------------------------- /include/object.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014, General Dynamics C4 Systems 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | -------------------------------------------------------------------------------- /include/object/cap.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | struct deriveCap_ret { 10 | exception_t status; 11 | cap_t cap; 12 | }; 13 | typedef struct deriveCap_ret deriveCap_ret_t; 14 | 15 | struct finaliseCap_ret { 16 | cap_t remainder; 17 | /* potential cap holding information for cleanup that needs to be happen *after* a 18 | * cap has been deleted. Where deleted here means been removed from the slot in emptySlot */ 19 | cap_t cleanupInfo; 20 | }; 21 | typedef struct finaliseCap_ret finaliseCap_ret_t; 22 | 23 | -------------------------------------------------------------------------------- /include/object/interrupt.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014, General Dynamics C4 Systems 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | exception_t decodeIRQControlInvocation(word_t invLabel, word_t length, 16 | cte_t *srcSlot, word_t *buffer); 17 | exception_t invokeIRQControl(irq_t irq, cte_t *handlerSlot, cte_t *controlSlot); 18 | exception_t decodeIRQHandlerInvocation(word_t invLabel, irq_t irq); 19 | void invokeIRQHandler_AckIRQ(irq_t irq); 20 | void invokeIRQHandler_SetIRQHandler(irq_t irq, cap_t cap, cte_t *slot); 21 | void invokeIRQHandler_ClearIRQHandler(irq_t irq); 22 | void deletingIRQHandler(irq_t irq); 23 | void deletedIRQHandler(irq_t irq); 24 | void handleInterrupt(irq_t irq); 25 | bool_t isIRQActive(irq_t irq); 26 | void setIRQState(irq_state_t irqState, irq_t irq); 27 | 28 | -------------------------------------------------------------------------------- /include/object/schedcontrol.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | exception_t decodeSchedControlInvocation(word_t label, cap_t cap, word_t length, word_t *buffer); 14 | 15 | -------------------------------------------------------------------------------- /include/plat/default/plat/machine.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #include 8 | #include -------------------------------------------------------------------------------- /include/plat/default/plat/machine/hardware.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | -------------------------------------------------------------------------------- /include/plat/pc99/plat/machine/devices.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014, General Dynamics C4 Systems 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | #define PPTR_APIC KDEV_BASE 12 | 13 | #define PPTR_IOAPIC_START (PPTR_APIC + BIT(PAGE_BITS)) 14 | #define PPTR_DRHU_START (PPTR_IOAPIC_START + BIT(PAGE_BITS) * CONFIG_MAX_NUM_IOAPIC) 15 | 16 | #define MAX_NUM_DRHU ((-PPTR_DRHU_START) >> PAGE_BITS) 17 | 18 | -------------------------------------------------------------------------------- /include/plat/pc99/plat/machine/hardware.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014, General Dynamics C4 Systems 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | bool_t platAddDevices(void); 15 | 16 | 17 | -------------------------------------------------------------------------------- /include/plat/pc99/plat/machine/intel-vtd.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014, General Dynamics C4 Systems 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | #ifdef CONFIG_IOMMU 12 | 13 | void invalidate_iotlb(void); 14 | void invalidate_context_cache(void); 15 | void vtd_handle_fault(void); 16 | /* calculate the number of IOPTs needed to map the rmrr regions */ 17 | word_t vtd_get_n_paging(acpi_rmrr_list_t *rmrr_list); 18 | /* initialise the number of IOPTs */ 19 | bool_t vtd_init_num_iopts(uint32_t num_drhu); 20 | bool_t vtd_init(cpu_id_t cpu_id, acpi_rmrr_list_t *rmrr_list); 21 | 22 | #endif /* CONFIG_IOMMU */ 23 | -------------------------------------------------------------------------------- /include/plat/pc99/plat/machine/io.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014, General Dynamics C4 Systems 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | /** MODIFIES: phantom_machine_state */ 14 | void out8(uint16_t port, uint8_t value); 15 | /** MODIFIES: phantom_machine_state */ 16 | void out16(uint16_t port, uint16_t value); 17 | /** MODIFIES: phantom_machine_state */ 18 | void out32(uint16_t port, uint32_t value); 19 | /** MODIFIES: */ 20 | uint8_t in8(uint16_t port); 21 | /** MODIFIES: */ 22 | uint16_t in16(uint16_t port); 23 | /** MODIFIES: */ 24 | uint32_t in32(uint16_t port); 25 | 26 | #if defined(CONFIG_DEBUG_BUILD) || defined(CONFIG_PRINTING) 27 | void serial_init(uint16_t port); 28 | #endif 29 | 30 | -------------------------------------------------------------------------------- /include/plat/pc99/plat/machine/ioapic.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014, General Dynamics C4 Systems 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | void ioapic_init(uint32_t num_nodes, cpu_id_t *cpu_list, uint32_t num_ioapic); 14 | void ioapic_mask(bool_t mask, uint32_t ioapic, uint32_t pin); 15 | 16 | /* Checks if a pin can be mapped to an interrupt vector, returning 17 | * a suitable exception */ 18 | exception_t ioapic_decode_map_pin_to_vector(word_t ioapic, word_t pin, word_t level, word_t polarity, word_t vector); 19 | /* The function maps a pin to an interrupt vector, does not perform 20 | * any checks, use ioapic_decode_map_pin_to_vector first */ 21 | void ioapic_map_pin_to_vector(word_t ioapic, word_t pin, word_t level, word_t polarity, word_t vector); 22 | 23 | -------------------------------------------------------------------------------- /include/plat/pc99/plat/machine/pci.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014, General Dynamics C4 Systems 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #define get_pci_bus(x) (((x)>>8u) & 0xffu) 10 | #define get_pci_dev(x) (((x)>>3u) & 0x1fu) 11 | #define get_pci_fun(x) ((x) & 0x7u) 12 | #define get_dev_id(bus, dev, fun) (((bus) << 8u) | ((dev) << 3u) | (fun)) 13 | 14 | #define PCI_BUS_MAX 255 15 | #define PCI_DEV_MAX 31 16 | #define PCI_FUNC_MAX 7 17 | 18 | 19 | -------------------------------------------------------------------------------- /include/plat/pc99/plat/machine/pic.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014, General Dynamics C4 Systems 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | 12 | /* Even if not using the PIC as the main interrupt controller we still 13 | * need to interact with it to remap and disable it */ 14 | void pic_remap_irqs(interrupt_t vector); 15 | void pic_disable(void); 16 | 17 | void pic_mask_irq(bool_t mask, irq_t irq); 18 | bool_t pic_is_irq_pending(void); 19 | void pic_ack_active_irq(void); 20 | 21 | -------------------------------------------------------------------------------- /include/plat/pc99/plat/machine/pit.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014, General Dynamics C4 Systems 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | /* ms after which a wraparound occurs (max. 54) */ 10 | #define PIT_WRAPAROUND_MS 50 11 | 12 | void pit_init(void); 13 | void pit_wait_wraparound(void); 14 | 15 | -------------------------------------------------------------------------------- /include/stdarg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014, General Dynamics C4 Systems 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #define va_start(v,l) __builtin_va_start(v,l) 10 | #define va_copy(d,s) __builtin_va_copy(d,s) 11 | #define va_end(v) __builtin_va_end(v) 12 | #define va_arg(v,l) __builtin_va_arg(v,l) 13 | typedef __builtin_va_list va_list; 14 | -------------------------------------------------------------------------------- /include/stdint.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014, General Dynamics C4 Systems 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | typedef unsigned char uint8_t; 12 | typedef unsigned short uint16_t; 13 | typedef unsigned int uint32_t; 14 | typedef unsigned long long uint64_t; 15 | 16 | typedef signed char int8_t; 17 | typedef signed short int16_t; 18 | typedef signed int int32_t; 19 | typedef signed long long int64_t; 20 | 21 | #define UINT64_MAX (0xFFFFFFFFFFFFFFFF) 22 | #define UINT32_MAX (0xFFFFFFFF) 23 | #define INT64_MAX (0x7FFFFFFFFFFFFFFF) 24 | #define INT32_MAX (0x7FFFFFFF) 25 | 26 | typedef uint64_t uintmax_t; 27 | typedef int64_t intmax_t; 28 | 29 | #define INTMAX_MAX UINT64_MAX 30 | #define UINTMAX_MAX INT64_MAX 31 | 32 | #define PRId64 "lld" 33 | #define PRIi64 "lli" 34 | #define PRIu64 "llu" 35 | #define PRIx64 "llx" 36 | -------------------------------------------------------------------------------- /include/string.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014, General Dynamics C4 Systems 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | word_t strnlen(const char *s, word_t maxlen); 12 | word_t strlcpy(char *dest, const char *src, word_t size); 13 | word_t strlcat(char *dest, const char *src, word_t size); 14 | -------------------------------------------------------------------------------- /include/types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014, General Dynamics C4 Systems 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | -------------------------------------------------------------------------------- /libsel4/arch_include/arm/sel4/arch/constants.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | -------------------------------------------------------------------------------- /libsel4/arch_include/arm/sel4/arch/constants_cortex_a15.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | #if !defined(CONFIG_ARM_CORTEX_A15) 12 | #error CONFIG_ARM_CORTEX_A15 is not defined 13 | #endif 14 | 15 | /* Cortex-A15 Manual, Section 10.2.2 */ 16 | #define seL4_NumHWBreakpoints 10 17 | #define seL4_NumExclusiveBreakpoints 6 18 | #define seL4_NumExclusiveWatchpoints 4 19 | 20 | #ifdef CONFIG_HARDWARE_DEBUG_API 21 | 22 | #define seL4_FirstBreakpoint 0 23 | #define seL4_FirstWatchpoint 6 24 | 25 | #define seL4_NumDualFunctionMonitors 0 26 | #define seL4_FirstDualFunctionMonitor (-1) 27 | 28 | #endif /* CONFIG_HARDWARE_DEBUG_API */ 29 | -------------------------------------------------------------------------------- /libsel4/arch_include/arm/sel4/arch/constants_cortex_a35.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | #if !defined(CONFIG_ARM_CORTEX_A35) 12 | #error CONFIG_ARM_CORTEX_A35 is not defined 13 | #endif 14 | 15 | /* Cortex-A35 Manual, Table C7.1 */ 16 | #define seL4_NumHWBreakpoints 6 17 | #define seL4_NumExclusiveBreakpoints 6 18 | #define seL4_NumExclusiveWatchpoints 4 19 | 20 | #ifdef CONFIG_HARDWARE_DEBUG_API 21 | 22 | #define seL4_FirstBreakpoint 0 23 | #define seL4_FirstWatchpoint 6 24 | 25 | #define seL4_NumDualFunctionMonitors 0 26 | #define seL4_FirstDualFunctionMonitor (-1) 27 | 28 | #endif /* CONFIG_HARDWARE_DEBUG_API */ 29 | -------------------------------------------------------------------------------- /libsel4/arch_include/arm/sel4/arch/constants_cortex_a53.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | #if !defined(CONFIG_ARM_CORTEX_A53) 12 | #error CONFIG_ARM_CORTEX_A53 is not defined 13 | #endif 14 | 15 | /* Cortex-A53 Manual, Section 11.6.1 */ 16 | #define seL4_NumHWBreakpoints 10 17 | #define seL4_NumExclusiveBreakpoints 6 18 | #define seL4_NumExclusiveWatchpoints 4 19 | 20 | #ifdef CONFIG_HARDWARE_DEBUG_API 21 | 22 | #define seL4_FirstBreakpoint 0 23 | #define seL4_FirstWatchpoint 6 24 | 25 | #define seL4_NumDualFunctionMonitors 0 26 | #define seL4_FirstDualFunctionMonitor (-1) 27 | 28 | #endif /* CONFIG_HARDWARE_DEBUG_API */ 29 | -------------------------------------------------------------------------------- /libsel4/arch_include/arm/sel4/arch/constants_cortex_a55.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | #if !defined(CONFIG_ARM_CORTEX_A55) 12 | #error CONFIG_ARM_CORTEX_A55 is not defined 13 | #endif 14 | 15 | /* Cortex-A55 Manual */ 16 | #define seL4_NumHWBreakpoints 10 17 | #define seL4_NumExclusiveBreakpoints 6 18 | #define seL4_NumExclusiveWatchpoints 4 19 | 20 | #ifdef CONFIG_HARDWARE_DEBUG_API 21 | 22 | #define seL4_FirstBreakpoint 0 23 | #define seL4_FirstWatchpoint 6 24 | 25 | #define seL4_NumDualFunctionMonitors 0 26 | #define seL4_FirstDualFunctionMonitor (-1) 27 | 28 | #endif /* CONFIG_HARDWARE_DEBUG_API */ 29 | -------------------------------------------------------------------------------- /libsel4/arch_include/arm/sel4/arch/constants_cortex_a57.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | #if !defined(CONFIG_ARM_CORTEX_A57) 12 | #error CONFIG_ARM_CORTEX_A57 is not defined 13 | #endif 14 | 15 | /* Cortex-A57 Manual, Section 10.6.1 */ 16 | #define seL4_NumHWBreakpoints 10 17 | #define seL4_NumExclusiveBreakpoints 6 18 | #define seL4_NumExclusiveWatchpoints 4 19 | 20 | #ifdef CONFIG_HARDWARE_DEBUG_API 21 | 22 | #define seL4_FirstBreakpoint 0 23 | #define seL4_FirstWatchpoint 6 24 | 25 | #define seL4_NumDualFunctionMonitors 0 26 | #define seL4_FirstDualFunctionMonitor (-1) 27 | 28 | #endif /* CONFIG_HARDWARE_DEBUG_API */ 29 | -------------------------------------------------------------------------------- /libsel4/arch_include/arm/sel4/arch/constants_cortex_a7.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | #if !defined(CONFIG_ARM_CORTEX_A7) 12 | #error CONFIG_ARM_CORTEX_A7 is not defined 13 | #endif 14 | 15 | /* Cortex-A7 Manual, Table 10-2 */ 16 | #define seL4_NumHWBreakpoints 10 17 | #define seL4_NumExclusiveBreakpoints 6 18 | #define seL4_NumExclusiveWatchpoints 4 19 | 20 | #ifdef CONFIG_HARDWARE_DEBUG_API 21 | 22 | #define seL4_FirstBreakpoint 0 23 | #define seL4_FirstWatchpoint 6 24 | 25 | #define seL4_NumDualFunctionMonitors 0 26 | #define seL4_FirstDualFunctionMonitor (-1) 27 | 28 | #endif /* CONFIG_HARDWARE_DEBUG_API */ 29 | -------------------------------------------------------------------------------- /libsel4/arch_include/arm/sel4/arch/constants_cortex_a72.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | #if !defined(CONFIG_ARM_CORTEX_A72) 12 | #error CONFIG_ARM_CORTEX_A72 is not defined 13 | #endif 14 | 15 | /* Cortex-A72 Manual, Section 10.3 */ 16 | #define seL4_NumHWBreakpoints 10 17 | #define seL4_NumExclusiveBreakpoints 6 18 | #define seL4_NumExclusiveWatchpoints 4 19 | 20 | #ifdef CONFIG_HARDWARE_DEBUG_API 21 | 22 | #define seL4_FirstBreakpoint 0 23 | #define seL4_FirstWatchpoint 6 24 | 25 | #define seL4_NumDualFunctionMonitors 0 26 | #define seL4_FirstDualFunctionMonitor (-1) 27 | 28 | #endif /* CONFIG_HARDWARE_DEBUG_API */ 29 | -------------------------------------------------------------------------------- /libsel4/arch_include/arm/sel4/arch/constants_cortex_a8.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | #if !defined(CONFIG_ARM_CORTEX_A8) 12 | #error CONFIG_ARM_CORTEX_A8 is not defined 13 | #endif 14 | 15 | /* Cortex-A8 Manual, Table 12-11 */ 16 | #define seL4_NumHWBreakpoints 8 17 | #define seL4_NumExclusiveBreakpoints 6 18 | #define seL4_NumExclusiveWatchpoints 2 19 | 20 | #ifdef CONFIG_HARDWARE_DEBUG_API 21 | 22 | #define seL4_FirstBreakpoint 0 23 | #define seL4_FirstWatchpoint 6 24 | 25 | #define seL4_NumDualFunctionMonitors 0 26 | #define seL4_FirstDualFunctionMonitor (-1) 27 | 28 | #endif /* CONFIG_HARDWARE_DEBUG_API */ 29 | -------------------------------------------------------------------------------- /libsel4/arch_include/arm/sel4/arch/constants_cortex_a9.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | #if !defined(CONFIG_ARM_CORTEX_A9) 12 | #error CONFIG_ARM_CORTEX_A9 is not defined 13 | #endif 14 | 15 | /* Cortex-A9 Manual, Section 10.1.2 */ 16 | #define seL4_NumHWBreakpoints 10 17 | #define seL4_NumExclusiveBreakpoints 6 18 | #define seL4_NumExclusiveWatchpoints 4 19 | 20 | #ifdef CONFIG_HARDWARE_DEBUG_API 21 | 22 | #define seL4_FirstBreakpoint 0 23 | #define seL4_FirstWatchpoint 6 24 | 25 | #define seL4_NumDualFunctionMonitors 0 26 | #define seL4_FirstDualFunctionMonitor (-1) 27 | 28 | #endif /* CONFIG_HARDWARE_DEBUG_API */ 29 | -------------------------------------------------------------------------------- /libsel4/arch_include/arm/sel4/arch/deprecated.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | 14 | -------------------------------------------------------------------------------- /libsel4/arch_include/arm/sel4/arch/mapping.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | 12 | -------------------------------------------------------------------------------- /libsel4/arch_include/arm/sel4/arch/objecttype.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | typedef enum _object { 12 | seL4_ARM_SmallPageObject = seL4_ModeObjectTypeCount, 13 | seL4_ARM_LargePageObject, 14 | #ifdef CONFIG_ARCH_AARCH32 15 | seL4_ARM_SectionObject, 16 | seL4_ARM_SuperSectionObject, 17 | #endif 18 | seL4_ARM_PageTableObject, 19 | seL4_ARM_PageDirectoryObject, 20 | #ifdef CONFIG_ARM_HYPERVISOR_SUPPORT 21 | seL4_ARM_VCPUObject, 22 | #endif 23 | #ifdef CONFIG_TK1_SMMU 24 | seL4_ARM_IOPageTableObject, 25 | #endif 26 | seL4_ObjectTypeCount 27 | } seL4_ArchObjectType; 28 | 29 | typedef seL4_Word object_t; 30 | 31 | #ifndef CONFIG_ARM_HYPERVISOR_SUPPORT 32 | #define seL4_ARM_VCPUObject 0xfffe 33 | #endif 34 | 35 | #ifndef CONFIG_TK1_SMMU 36 | #define seL4_ARM_IOPageTableObject 0xffff 37 | #endif 38 | -------------------------------------------------------------------------------- /libsel4/arch_include/arm/sel4/arch/pfIPC.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #include 8 | -------------------------------------------------------------------------------- /libsel4/arch_include/arm/sel4/arch/shared_types.bf: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | -- 4 | -- SPDX-License-Identifier: BSD-2-Clause 5 | -- 6 | 7 | -- this file contains types shared between libsel4 and the kernel 8 | 9 | tagged_union seL4_Fault seL4_FaultType { 10 | -- generic faults 11 | tag NullFault 0 12 | tag CapFault 1 13 | tag UnknownSyscall 2 14 | tag UserException 3 15 | #ifdef CONFIG_HARDWARE_DEBUG_API 16 | tag DebugException 4 17 | #endif 18 | #ifdef CONFIG_KERNEL_MCS 19 | tag Timeout 5 20 | 21 | -- arch specific faults 22 | tag VMFault 6 23 | 24 | #ifdef CONFIG_ARM_HYPERVISOR_SUPPORT 25 | tag VGICMaintenance 7 26 | tag VCPUFault 8 27 | tag VPPIEvent 9 28 | #endif 29 | #else 30 | -- arch specific faults 31 | tag VMFault 5 32 | 33 | #ifdef CONFIG_ARM_HYPERVISOR_SUPPORT 34 | tag VGICMaintenance 6 35 | tag VCPUFault 7 36 | tag VPPIEvent 8 37 | #endif 38 | #endif 39 | 40 | } 41 | -------------------------------------------------------------------------------- /libsel4/arch_include/arm/sel4/arch/shared_types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | #include 12 | #include 13 | 14 | -------------------------------------------------------------------------------- /libsel4/arch_include/arm/sel4/arch/simple_types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | -------------------------------------------------------------------------------- /libsel4/arch_include/riscv/sel4/arch/constants.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | -------------------------------------------------------------------------------- /libsel4/arch_include/riscv/sel4/arch/deprecated.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | -------------------------------------------------------------------------------- /libsel4/arch_include/riscv/sel4/arch/exIPC.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once -------------------------------------------------------------------------------- /libsel4/arch_include/riscv/sel4/arch/mapping.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once -------------------------------------------------------------------------------- /libsel4/arch_include/riscv/sel4/arch/objecttype.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * Copyright 2015, 2016 Hesham Almatary 4 | * 5 | * SPDX-License-Identifier: BSD-2-Clause 6 | */ 7 | 8 | #pragma once 9 | 10 | #include 11 | 12 | typedef enum _object { 13 | seL4_RISCV_4K_Page = seL4_ModeObjectTypeCount, 14 | seL4_RISCV_Mega_Page, 15 | seL4_RISCV_PageTableObject, 16 | seL4_ObjectTypeCount 17 | } seL4_ArchObjectType; 18 | 19 | typedef seL4_Word object_t; 20 | -------------------------------------------------------------------------------- /libsel4/arch_include/riscv/sel4/arch/pfIPC.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | -------------------------------------------------------------------------------- /libsel4/arch_include/riscv/sel4/arch/shared_types.bf: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | -- 4 | -- SPDX-License-Identifier: BSD-2-Clause 5 | -- 6 | 7 | -- this file contains sel4arch specific types shared between libsel4 and the kernel 8 | 9 | tagged_union seL4_Fault seL4_FaultType { 10 | -- generic faults 11 | tag NullFault 0 12 | tag CapFault 1 13 | tag UnknownSyscall 2 14 | tag UserException 3 15 | #ifdef CONFIG_KERNEL_MCS 16 | tag Timeout 5 17 | 18 | -- arch specific faults 19 | tag VMFault 6 20 | #else 21 | -- arch specific faults 22 | tag VMFault 5 23 | #endif 24 | } 25 | -------------------------------------------------------------------------------- /libsel4/arch_include/riscv/sel4/arch/shared_types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | #include 12 | #include 13 | 14 | -------------------------------------------------------------------------------- /libsel4/arch_include/riscv/sel4/arch/simple_types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | -------------------------------------------------------------------------------- /libsel4/arch_include/x86/sel4/arch/deprecated.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | -------------------------------------------------------------------------------- /libsel4/arch_include/x86/sel4/arch/exIPC.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #include 8 | -------------------------------------------------------------------------------- /libsel4/arch_include/x86/sel4/arch/mapping.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | #define SEL4_MAPPING_LOOKUP_NO_EPTPDPT 39 12 | #define SEL4_MAPPING_LOOKUP_NO_EPTPD 30 13 | #define SEL4_MAPPING_LOOKUP_NO_EPTPT 21 14 | 15 | -------------------------------------------------------------------------------- /libsel4/arch_include/x86/sel4/arch/pfIPC.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #include 8 | -------------------------------------------------------------------------------- /libsel4/arch_include/x86/sel4/arch/shared_types.bf: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | -- 4 | -- SPDX-License-Identifier: BSD-2-Clause 5 | -- 6 | 7 | -- this file contains sel4arch specific types shared between libsel4 and the kernel 8 | 9 | tagged_union seL4_Fault seL4_FaultType { 10 | -- generic faults 11 | tag NullFault 0 12 | tag CapFault 1 13 | tag UnknownSyscall 2 14 | tag UserException 3 15 | #ifdef CONFIG_HARDWARE_DEBUG_API 16 | tag DebugException 4 17 | #endif 18 | #ifdef CONFIG_KERNEL_MCS 19 | tag Timeout 5 20 | 21 | -- arch specific faults 22 | tag VMFault 6 23 | #else 24 | -- arch specific faults 25 | tag VMFault 5 26 | #endif 27 | } 28 | -------------------------------------------------------------------------------- /libsel4/arch_include/x86/sel4/arch/simple_types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | -------------------------------------------------------------------------------- /libsel4/arch_include/x86/sel4/arch/syscalls.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #ifdef CONFIG_KERNEL_MCS 15 | LIBSEL4_INLINE_FUNC seL4_MessageInfo_t seL4_Poll(seL4_CPtr src, seL4_Word *sender) 16 | { 17 | return seL4_NBWait(src, sender); 18 | } 19 | #else /* CONFIG_KERNEL_MCS */ 20 | LIBSEL4_INLINE_FUNC void seL4_Wait(seL4_CPtr src, seL4_Word *sender) 21 | { 22 | seL4_Recv(src, sender); 23 | } 24 | LIBSEL4_INLINE_FUNC seL4_MessageInfo_t seL4_Poll(seL4_CPtr src, seL4_Word *sender) 25 | { 26 | return seL4_NBRecv(src, sender); 27 | } 28 | #endif /* !CONFIG_KERNEL_MCS */ 29 | -------------------------------------------------------------------------------- /libsel4/include/sel4/benchmark_tracepoints_types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | #ifdef CONFIG_BENCHMARK_TRACEPOINTS 12 | typedef struct benchmark_tracepoint_log_entry { 13 | seL4_Word id; 14 | seL4_Word duration; 15 | } benchmark_tracepoint_log_entry_t; 16 | #endif /* CONFIG_BENCHMARK_TRACEPOINTS */ 17 | -------------------------------------------------------------------------------- /libsel4/include/sel4/bootinfo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | void seL4_InitBootInfo(seL4_BootInfo *bi) 14 | SEL4_DEPRECATED("libsel4 management of bootinfo is deprecated, see the BootInfo Frame section of the manual"); 15 | seL4_BootInfo *seL4_GetBootInfo(void) 16 | SEL4_DEPRECATED("libsel4 management of bootinfo is deprecated, see the BootInfo Frame section of the manual"); 17 | 18 | -------------------------------------------------------------------------------- /libsel4/include/sel4/config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014, General Dynamics C4 Systems 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | /* Compile-time configuration parameters. Might be set by the build system. */ 10 | 11 | #include 12 | -------------------------------------------------------------------------------- /libsel4/include/sel4/debug_assert.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | /** 8 | * Declares macros and methods which are conditional based 9 | * on NDEBUG. If NDEBUG is defined then seL4_DebugAssert 10 | * is a NOP, otherwise it invokes the unconditional version 11 | * in sel4/assert.h. 12 | */ 13 | #pragma once 14 | 15 | #ifdef NDEBUG 16 | 17 | /** NDEBUG is defined do nothing */ 18 | #define seL4_DebugAssert(expr) ((void)(0)) 19 | 20 | #else // NDEBUG is not defined 21 | 22 | #include 23 | 24 | /** 25 | * NDEBUG is not defined invoke seL4_Assert(expr). 26 | */ 27 | #define seL4_DebugAssert(expr) seL4_Assert(expr) 28 | 29 | #endif // NDEBUG 30 | 31 | -------------------------------------------------------------------------------- /libsel4/include/sel4/errors.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | typedef enum { 10 | seL4_NoError = 0, 11 | seL4_InvalidArgument, 12 | seL4_InvalidCapability, 13 | seL4_IllegalOperation, 14 | seL4_RangeError, 15 | seL4_AlignmentError, 16 | seL4_FailedLookup, 17 | seL4_TruncatedMessage, 18 | seL4_DeleteFirst, 19 | seL4_RevokeFirst, 20 | seL4_NotEnoughMemory, 21 | 22 | /* This should always be the last item in the list 23 | * so it gives a count of the number of errors in the 24 | * enum. 25 | */ 26 | seL4_NumErrors 27 | } seL4_Error; 28 | -------------------------------------------------------------------------------- /libsel4/include/sel4/messages.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #include 8 | -------------------------------------------------------------------------------- /libsel4/include/sel4/objecttype.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | typedef enum api_object { 9 | seL4_UntypedObject, 10 | seL4_TCBObject, 11 | seL4_EndpointObject, 12 | seL4_NotificationObject, 13 | seL4_CapTableObject, 14 | #ifdef CONFIG_KERNEL_MCS 15 | seL4_SchedContextObject, 16 | seL4_ReplyObject, 17 | #endif 18 | seL4_NonArchObjectTypeCount, 19 | } seL4_ObjectType; 20 | 21 | __attribute__((deprecated("use seL4_NotificationObject"))) static const seL4_ObjectType seL4_AsyncEndpointObject = 22 | seL4_NotificationObject; 23 | 24 | typedef seL4_Word api_object_t; 25 | 26 | -------------------------------------------------------------------------------- /libsel4/include/sel4/sel4.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | #include 9 | #include 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | #include 16 | #include 17 | #include 18 | 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | 28 | -------------------------------------------------------------------------------- /libsel4/include/sel4/virtual_client.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | /* 16 | * This file specifies virtual implementations of older invocations 17 | * that can be aliased directly to new invocations. 18 | */ 19 | 20 | #ifdef CONFIG_KERNEL_MCS 21 | LIBSEL4_INLINE seL4_Error seL4_SchedControl_Configure(seL4_SchedControl _service, seL4_SchedContext schedcontext, 22 | seL4_Time budget, seL4_Time period, seL4_Word extra_refills, seL4_Word badge) 23 | { 24 | return seL4_SchedControl_ConfigureFlags(_service, schedcontext, budget, period, extra_refills, badge, 25 | seL4_SchedContext_NoFlag); 26 | } 27 | #endif 28 | -------------------------------------------------------------------------------- /libsel4/mode_include/32/sel4/mode/types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #define seL4_GuardSizeBits 5 10 | #define seL4_GuardBits 18 11 | #define seL4_BadgeBits 28 12 | 13 | -------------------------------------------------------------------------------- /libsel4/mode_include/32/sel4/shared_types.bf: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | -- 4 | -- SPDX-License-Identifier: BSD-2-Clause 5 | -- 6 | 7 | -- this file contains types shared between libsel4 and the kernel 8 | 9 | base 32 10 | 11 | block seL4_MessageInfo { 12 | field label 20 13 | field capsUnwrapped 3 14 | field extraCaps 2 15 | field length 7 16 | } 17 | 18 | -- Cap rights 19 | block seL4_CapRights { 20 | padding 28 21 | field capAllowGrantReply 1 22 | field capAllowGrant 1 23 | field capAllowRead 1 24 | field capAllowWrite 1 25 | } 26 | 27 | -- CNode cap data 28 | block seL4_CNode_CapData { 29 | padding 6 30 | field guard 18 31 | field guardSize 5 32 | padding 3 33 | } 34 | -------------------------------------------------------------------------------- /libsel4/mode_include/64/sel4/mode/types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #define seL4_GuardSizeBits 6 10 | #define seL4_GuardBits 58 11 | #define seL4_BadgeBits 64 12 | -------------------------------------------------------------------------------- /libsel4/mode_include/64/sel4/shared_types.bf: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | -- 4 | -- SPDX-License-Identifier: BSD-2-Clause 5 | -- 6 | 7 | -- this file contains types shared between libsel4 and the kernel 8 | 9 | base 64 10 | 11 | block seL4_MessageInfo { 12 | field label 52 13 | field capsUnwrapped 3 14 | field extraCaps 2 15 | field length 7 16 | } 17 | 18 | block seL4_CapRights { 19 | padding 32 20 | 21 | padding 28 22 | field capAllowGrantReply 1 23 | field capAllowGrant 1 24 | field capAllowRead 1 25 | field capAllowWrite 1 26 | } 27 | 28 | -- CNode cap data 29 | block seL4_CNode_CapData { 30 | field guard 58 31 | field guardSize 6 32 | } 33 | -------------------------------------------------------------------------------- /libsel4/sel4_arch_include/aarch32/sel4/sel4_arch/exIPC.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #include 8 | -------------------------------------------------------------------------------- /libsel4/sel4_arch_include/aarch32/sel4/sel4_arch/mapping.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | #define SEL4_MAPPING_LOOKUP_LEVEL 2 12 | 13 | #ifdef CONFIG_ARM_HYPERVISOR_SUPPORT 14 | #define SEL4_MAPPING_LOOKUP_NO_PT 21 15 | #else 16 | #define SEL4_MAPPING_LOOKUP_NO_PT 20 17 | #endif 18 | 19 | LIBSEL4_INLINE_FUNC seL4_Word seL4_MappingFailedLookupLevel(void) 20 | { 21 | return seL4_GetMR(SEL4_MAPPING_LOOKUP_LEVEL); 22 | } 23 | -------------------------------------------------------------------------------- /libsel4/sel4_arch_include/aarch32/sel4/sel4_arch/objecttype.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | typedef enum _mode_object { 10 | seL4_ModeObjectTypeCount = seL4_NonArchObjectTypeCount, 11 | } seL4_ModeObjectType; 12 | -------------------------------------------------------------------------------- /libsel4/sel4_arch_include/aarch32/sel4/sel4_arch/pfIPC.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #include 8 | -------------------------------------------------------------------------------- /libsel4/sel4_arch_include/aarch32/sel4/sel4_arch/simple_types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #define SEL4_WORD_IS_UINT32 10 | #define SEL4_INT64_IS_LONG_LONG 11 | -------------------------------------------------------------------------------- /libsel4/sel4_arch_include/aarch32/sel4/sel4_arch/types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | typedef struct seL4_UserContext_ { 12 | /* frame registers */ 13 | seL4_Word pc, sp, cpsr, r0, r1, r8, r9, r10, r11, r12; 14 | /* other integer registers */ 15 | seL4_Word r2, r3, r4, r5, r6, r7, r14; 16 | /* Thread ID registers */ 17 | seL4_Word tpidrurw, tpidruro; 18 | } seL4_UserContext; 19 | -------------------------------------------------------------------------------- /libsel4/sel4_arch_include/aarch64/sel4/sel4_arch/deprecated.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once -------------------------------------------------------------------------------- /libsel4/sel4_arch_include/aarch64/sel4/sel4_arch/exIPC.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #include 8 | -------------------------------------------------------------------------------- /libsel4/sel4_arch_include/aarch64/sel4/sel4_arch/mapping.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #define SEL4_MAPPING_LOOKUP_LEVEL 2 10 | #define SEL4_MAPPING_LOOKUP_NO_PT 21 11 | #define SEL4_MAPPING_LOOKUP_NO_PD 30 12 | #define SEL4_MAPPING_LOOKUP_NO_PUD 39 13 | 14 | LIBSEL4_INLINE_FUNC seL4_Word seL4_MappingFailedLookupLevel(void) 15 | { 16 | return seL4_GetMR(SEL4_MAPPING_LOOKUP_LEVEL); 17 | } 18 | -------------------------------------------------------------------------------- /libsel4/sel4_arch_include/aarch64/sel4/sel4_arch/objecttype.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | typedef enum _mode_object { 10 | seL4_ARM_HugePageObject = seL4_NonArchObjectTypeCount, 11 | seL4_ARM_PageUpperDirectoryObject, 12 | seL4_ARM_PageGlobalDirectoryObject, 13 | seL4_ModeObjectTypeCount 14 | } seL4_ModeObjectType; 15 | -------------------------------------------------------------------------------- /libsel4/sel4_arch_include/aarch64/sel4/sel4_arch/pfIPC.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | -------------------------------------------------------------------------------- /libsel4/sel4_arch_include/aarch64/sel4/sel4_arch/simple_types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #define SEL4_WORD_IS_UINT64 10 | #define SEL4_INT64_IS_LONG 11 | -------------------------------------------------------------------------------- /libsel4/sel4_arch_include/aarch64/sel4/sel4_arch/types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | typedef seL4_CPtr seL4_ARM_PageUpperDirectory; 12 | typedef seL4_CPtr seL4_ARM_PageGlobalDirectory; 13 | /* whether the VSpace refers to a PageUpperDirectory or PageGlobalDirectory directly 14 | * depends on the physical address size */ 15 | typedef seL4_CPtr seL4_ARM_VSpace; 16 | 17 | typedef struct seL4_UserContext_ { 18 | /* frame registers */ 19 | seL4_Word pc, sp, spsr, x0, x1, x2, x3, x4, x5, x6, x7, x8, x16, x17, x18, x29, x30; 20 | /* other integer registers */ 21 | seL4_Word x9, x10, x11, x12, x13, x14, x15, x19, x20, x21, x22, x23, x24, x25, x26, x27, x28; 22 | /* Thread ID registers */ 23 | seL4_Word tpidr_el0, tpidrro_el0; 24 | } seL4_UserContext; 25 | -------------------------------------------------------------------------------- /libsel4/sel4_arch_include/arm_hyp: -------------------------------------------------------------------------------- 1 | aarch32 -------------------------------------------------------------------------------- /libsel4/sel4_arch_include/ia32/interfaces/sel4arch.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /libsel4/sel4_arch_include/ia32/sel4/sel4_arch/exIPC.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #include 8 | -------------------------------------------------------------------------------- /libsel4/sel4_arch_include/ia32/sel4/sel4_arch/mapping.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | #include 9 | 10 | #define SEL4_MAPPING_LOOKUP_LEVEL 2 11 | #define SEL4_MAPPING_LOOKUP_NO_PT 22 12 | 13 | LIBSEL4_INLINE_FUNC seL4_Word seL4_MappingFailedLookupLevel(void) 14 | { 15 | return seL4_GetMR(SEL4_MAPPING_LOOKUP_LEVEL); 16 | } 17 | 18 | 19 | -------------------------------------------------------------------------------- /libsel4/sel4_arch_include/ia32/sel4/sel4_arch/objecttype.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | typedef enum _mode_object { 12 | seL4_ModeObjectTypeCount = seL4_NonArchObjectTypeCount, 13 | } seL4_ModeObjectType; 14 | 15 | #define seL4_IA32_PDPTObject 0xffffffff 16 | -------------------------------------------------------------------------------- /libsel4/sel4_arch_include/ia32/sel4/sel4_arch/pfIPC.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #include 8 | -------------------------------------------------------------------------------- /libsel4/sel4_arch_include/ia32/sel4/sel4_arch/simple_types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #define SEL4_WORD_IS_UINT32 10 | #define SEL4_INT64_IS_LONG_LONG 11 | -------------------------------------------------------------------------------- /libsel4/sel4_arch_include/ia32/sel4/sel4_arch/types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | 12 | /* User context as used by seL4_TCB_ReadRegisters / seL4_TCB_WriteRegisters */ 13 | typedef struct seL4_UserContext_ { 14 | /* frameRegisters */ 15 | seL4_Word eip, esp, eflags, eax, ebx, ecx, edx, esi, edi, ebp; 16 | /* gpRegisters */ 17 | seL4_Word fs_base, gs_base; 18 | } seL4_UserContext; 19 | -------------------------------------------------------------------------------- /libsel4/sel4_arch_include/riscv32/interfaces/sel4arch.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /libsel4/sel4_arch_include/riscv32/sel4/sel4_arch/deprecated.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | #pragma once -------------------------------------------------------------------------------- /libsel4/sel4_arch_include/riscv32/sel4/sel4_arch/mapping.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | #include 12 | 13 | #define SEL4_MAPPING_LOOKUP_LEVEL 2 14 | 15 | LIBSEL4_INLINE_FUNC seL4_Word seL4_MappingFailedLookupLevel() 16 | { 17 | return seL4_GetMR(SEL4_MAPPING_LOOKUP_LEVEL); 18 | } 19 | 20 | #if CONFIG_PT_LEVELS == 2 21 | #define SEL4_MAPPING_LOOKUP_NO_PT 22 22 | #else 23 | #error "Only 2-level PTs are supported for RV32" 24 | #endif 25 | -------------------------------------------------------------------------------- /libsel4/sel4_arch_include/riscv32/sel4/sel4_arch/objecttype.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | typedef enum _mode_object { 12 | seL4_ModeObjectTypeCount = seL4_NonArchObjectTypeCount 13 | } seL4_ModeObjectType; 14 | -------------------------------------------------------------------------------- /libsel4/sel4_arch_include/riscv32/sel4/sel4_arch/simple_types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #define SEL4_WORD_IS_UINT32 10 | #define SEL4_INT64_IS_LONG_LONG 11 | -------------------------------------------------------------------------------- /libsel4/sel4_arch_include/riscv32/sel4/sel4_arch/syscalls.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | -------------------------------------------------------------------------------- /libsel4/sel4_arch_include/riscv32/sel4/sel4_arch/types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * Copyright 2015, 2016 Hesham Almatary 4 | * 5 | * SPDX-License-Identifier: BSD-2-Clause 6 | */ 7 | 8 | #pragma once 9 | 10 | #include 11 | #include 12 | -------------------------------------------------------------------------------- /libsel4/sel4_arch_include/riscv64/interfaces/sel4arch.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /libsel4/sel4_arch_include/riscv64/sel4/sel4_arch/deprecated.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | -------------------------------------------------------------------------------- /libsel4/sel4_arch_include/riscv64/sel4/sel4_arch/mapping.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * Copyright 2015, 2016 Hesham Almatary 4 | * 5 | * SPDX-License-Identifier: BSD-2-Clause 6 | */ 7 | 8 | #pragma once 9 | #include 10 | 11 | #include 12 | 13 | #define SEL4_MAPPING_LOOKUP_LEVEL 2 14 | 15 | LIBSEL4_INLINE_FUNC seL4_Word seL4_MappingFailedLookupLevel() 16 | { 17 | return seL4_GetMR(SEL4_MAPPING_LOOKUP_LEVEL); 18 | } 19 | 20 | #define SEL4_MAPPING_LOOKUP_NO_PT 21 21 | -------------------------------------------------------------------------------- /libsel4/sel4_arch_include/riscv64/sel4/sel4_arch/objecttype.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * Copyright 2015, 2016 Hesham Almatary 4 | * 5 | * SPDX-License-Identifier: BSD-2-Clause 6 | */ 7 | 8 | #pragma once 9 | 10 | #include 11 | 12 | typedef enum _mode_object { 13 | seL4_RISCV_Giga_Page = seL4_NonArchObjectTypeCount, 14 | #if CONFIG_PT_LEVELS > 3 15 | seL4_RISCV_Tera_Page, 16 | #endif 17 | seL4_ModeObjectTypeCount 18 | } seL4_ModeObjectType; 19 | 20 | #if CONFIG_PT_LEVELS <= 3 21 | #define seL4_RISCV_Tera_Page 0xffffffff 22 | #endif 23 | -------------------------------------------------------------------------------- /libsel4/sel4_arch_include/riscv64/sel4/sel4_arch/simple_types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #define SEL4_WORD_IS_UINT64 10 | #define SEL4_INT64_IS_LONG 11 | -------------------------------------------------------------------------------- /libsel4/sel4_arch_include/riscv64/sel4/sel4_arch/syscalls.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | -------------------------------------------------------------------------------- /libsel4/sel4_arch_include/riscv64/sel4/sel4_arch/types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | -------------------------------------------------------------------------------- /libsel4/sel4_arch_include/x86_64/sel4/sel4_arch/deprecated.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | -------------------------------------------------------------------------------- /libsel4/sel4_arch_include/x86_64/sel4/sel4_arch/exIPC.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #include 8 | 9 | -------------------------------------------------------------------------------- /libsel4/sel4_arch_include/x86_64/sel4/sel4_arch/mapping.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | #define SEL4_MAPPING_LOOKUP_LEVEL 2 9 | #define SEL4_MAPPING_LOOKUP_NO_PT 21 10 | #define SEL4_MAPPING_LOOKUP_NO_PD 30 11 | #define SEL4_MAPPING_LOOKUP_NO_PDPT 39 12 | 13 | LIBSEL4_INLINE_FUNC seL4_Word seL4_MappingFailedLookupLevel(void) 14 | { 15 | return seL4_GetMR(SEL4_MAPPING_LOOKUP_LEVEL); 16 | } 17 | 18 | 19 | -------------------------------------------------------------------------------- /libsel4/sel4_arch_include/x86_64/sel4/sel4_arch/objecttype.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | typedef enum _mode_object { 12 | seL4_X86_PDPTObject = seL4_NonArchObjectTypeCount, 13 | seL4_X64_PML4Object, 14 | #ifdef CONFIG_HUGE_PAGE 15 | seL4_X64_HugePageObject, 16 | #endif 17 | seL4_ModeObjectTypeCount 18 | } seL4_seL4ArchObjectType; 19 | 20 | /* allow seL4_X86_PDPTObject and seL4_IA32_PDPTObject to be used interchangeable */ 21 | #define seL4_IA32_PDPTObject seL4_X86_PDPTObject 22 | 23 | #ifndef CONFIG_HUGE_PAGE 24 | #define seL4_X64_HugePageObject 0xfffffffe 25 | #endif 26 | -------------------------------------------------------------------------------- /libsel4/sel4_arch_include/x86_64/sel4/sel4_arch/pfIPC.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #ifndef __LIBSEL4_SEL4_SEL4_ARCH_PFIPC_H_ 8 | #define __LIBSEL4_SEL4_SEL4_ARCH_PFIPC_H_ 9 | 10 | #endif /* __LIBSEL4_SEL4_SEL4_ARCH_PFIPC_H_ */ 11 | -------------------------------------------------------------------------------- /libsel4/sel4_arch_include/x86_64/sel4/sel4_arch/simple_types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #define SEL4_WORD_IS_UINT64 10 | #define SEL4_INT64_IS_LONG 11 | -------------------------------------------------------------------------------- /libsel4/sel4_arch_include/x86_64/sel4/sel4_arch/types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | 12 | typedef seL4_CPtr seL4_X64_PML4; 13 | 14 | /* User context as used by seL4_TCB_ReadRegisters / seL4_TCB_WriteRegisters */ 15 | 16 | typedef struct seL4_UserContext_ { 17 | seL4_Word rip, rsp, rflags, rax, rbx, rcx, rdx, rsi, rdi, rbp, 18 | r8, r9, r10, r11, r12, r13, r14, r15; 19 | seL4_Word fs_base, gs_base; 20 | } seL4_UserContext; 21 | -------------------------------------------------------------------------------- /libsel4/sel4_plat_include/allwinnerA20/sel4/plat/api/constants.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | 12 | /* First address in the virtual address space that is not accessible to user level */ 13 | #define seL4_UserTop 0xa0000000 14 | -------------------------------------------------------------------------------- /libsel4/sel4_plat_include/am335x/sel4/plat/api/constants.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | 12 | /* First address in the virtual address space that is not accessible to user level */ 13 | #define seL4_UserTop 0xe0000000 14 | -------------------------------------------------------------------------------- /libsel4/sel4_plat_include/apq8064/sel4/plat/api/constants.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | 12 | /* First address in the virtual address space that is not accessible to user level */ 13 | #define seL4_UserTop 0xe0000000 14 | 15 | -------------------------------------------------------------------------------- /libsel4/sel4_plat_include/ariane/sel4/plat/api/constants.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | -------------------------------------------------------------------------------- /libsel4/sel4_plat_include/bcm2711/sel4/plat/api/constants.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * Copyright (C) 2021, Hensoldt Cyber GmbH 4 | * 5 | * SPDX-License-Identifier: BSD-2-Clause 6 | */ 7 | #pragma once 8 | 9 | #include 10 | /* RasPi4 uses a BCM2711 SoC with 4x Cortex-A72. */ 11 | #include 12 | 13 | #if CONFIG_WORD_SIZE == 32 14 | /* First address in the virtual address space that is not accessible to user level */ 15 | #define seL4_UserTop 0xe0000000 16 | #else 17 | /* otherwise this is defined at the arch level */ 18 | #endif 19 | -------------------------------------------------------------------------------- /libsel4/sel4_plat_include/bcm2837/sel4/plat/api/constants.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | /* RasPi3 uses a BCM2837 SoC with 4x Cortex-A53. */ 11 | #include 12 | 13 | #if CONFIG_WORD_SIZE == 32 14 | /* First address in the virtual address space that is not accessible to user level */ 15 | #define seL4_UserTop 0xe0000000 16 | #else 17 | /* otherwise this is defined at the arch level */ 18 | #endif 19 | -------------------------------------------------------------------------------- /libsel4/sel4_plat_include/exynos4/sel4/plat/api/constants.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | 12 | /* First address in the virtual address space that is not accessible to user level */ 13 | #define seL4_UserTop 0xe0000000 14 | -------------------------------------------------------------------------------- /libsel4/sel4_plat_include/exynos5/sel4/plat/api/constants.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | #pragma once 7 | 8 | #include 9 | 10 | /* This is used for multiple SOCs: 11 | * - Exynos5250 (A15) 12 | * - Exynos5410 (A7/A15) 13 | * - Exynos5422 (A7/A15) 14 | * Since the A7 was designed as big.LITTLE companion for the A15, their settings 15 | * are identical. 16 | */ 17 | #if defined(CONFIG_ARM_CORTEX_A7) 18 | #include 19 | #elif defined(CONFIG_ARM_CORTEX_A15) 20 | #include 21 | #else 22 | #error "unsupported core" 23 | #endif 24 | 25 | /* First address in the virtual address space that is not accessible to user level */ 26 | #define seL4_UserTop 0xe0000000 27 | -------------------------------------------------------------------------------- /libsel4/sel4_plat_include/exynos_common/sel4/plat/api/constants.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | -------------------------------------------------------------------------------- /libsel4/sel4_plat_include/fvp/sel4/plat/api/constants.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | /* The FVP can emulate various cores */ 12 | #if defined(CONFIG_ARM_CORTEX_A57) 13 | #include 14 | #else 15 | #error "unsupported core" 16 | #endif 17 | -------------------------------------------------------------------------------- /libsel4/sel4_plat_include/hifive/sel4/plat/api/constants.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | -------------------------------------------------------------------------------- /libsel4/sel4_plat_include/hikey/sel4/plat/api/constants.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | /* HiKey uses a HiSilicon Kirin620 SoC with 2 clusters of 4 Cortex-A53 each. */ 11 | #include 12 | 13 | #if CONFIG_WORD_SIZE == 32 14 | /* First address in the virtual address space that is not accessible to user level */ 15 | #define seL4_UserTop 0xe0000000 16 | #else 17 | /* otherwise this is defined at the arch level */ 18 | #endif 19 | -------------------------------------------------------------------------------- /libsel4/sel4_plat_include/imx6/sel4/plat/api/constants.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | 12 | /* First address in the virtual address space that is not accessible to user level */ 13 | #define seL4_UserTop 0xe0000000 14 | -------------------------------------------------------------------------------- /libsel4/sel4_plat_include/imx7/sel4/plat/api/constants.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | 12 | /* First address in the virtual address space that is not accessible to user level */ 13 | #define seL4_UserTop 0xe0000000 14 | -------------------------------------------------------------------------------- /libsel4/sel4_plat_include/imx8mm-evk/sel4/plat/api/constants.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | 12 | #if CONFIG_WORD_SIZE == 32 13 | /* First address in the virtual address space that is not accessible to user level */ 14 | #define seL4_UserTop 0xe0000000 15 | #else 16 | /* otherwise this is defined at the arch level */ 17 | #endif 18 | -------------------------------------------------------------------------------- /libsel4/sel4_plat_include/imx8mq-evk/sel4/plat/api/constants.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | 12 | #if CONFIG_WORD_SIZE == 32 13 | /* First address in the virtual address space that is not accessible to user level */ 14 | #define seL4_UserTop 0xe0000000 15 | #else 16 | /* otherwise this is defined at the arch level */ 17 | #endif 18 | -------------------------------------------------------------------------------- /libsel4/sel4_plat_include/maaxboard/sel4/plat/api/constants.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * Copyright 2022, Capgemini Engineering 4 | * 5 | * SPDX-License-Identifier: BSD-2-Clause 6 | */ 7 | 8 | #pragma once 9 | 10 | #include 11 | #include 12 | 13 | #if CONFIG_WORD_SIZE == 32 14 | /* First address in the virtual address space that is not accessible to user level */ 15 | #define seL4_UserTop 0xe0000000 16 | #else 17 | /* otherwise this is defined at the arch level */ 18 | #endif 19 | -------------------------------------------------------------------------------- /libsel4/sel4_plat_include/odroidc2/sel4/plat/api/constants.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | -------------------------------------------------------------------------------- /libsel4/sel4_plat_include/odroidc4/sel4/plat/api/constants.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | -------------------------------------------------------------------------------- /libsel4/sel4_plat_include/omap3/sel4/plat/api/constants.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | 12 | /* First address in the virtual address space that is not accessible to user level */ 13 | #define seL4_UserTop 0xf0000000 14 | -------------------------------------------------------------------------------- /libsel4/sel4_plat_include/pc99/sel4/plat/api/constants.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | /* Defined for each architecture: the number of hardware breakpoints 12 | * available. 13 | */ 14 | #ifdef CONFIG_HARDWARE_DEBUG_API 15 | #define seL4_NumHWBreakpoints (4) 16 | #define seL4_FirstBreakpoint (-1) 17 | #define seL4_NumExclusiveBreakpoints (0) 18 | #define seL4_FirstWatchpoint (-1) 19 | #define seL4_NumExclusiveWatchpoints (0) 20 | #define seL4_FirstDualFunctionMonitor (0) 21 | #define seL4_NumDualFunctionMonitors (4) 22 | #endif 23 | -------------------------------------------------------------------------------- /libsel4/sel4_plat_include/polarfire/sel4/plat/api/constants.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, DornerWorks 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | -------------------------------------------------------------------------------- /libsel4/sel4_plat_include/qemu-arm-virt/sel4/plat/api/constants.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | /* The QEMU virt platform can emulate various cores */ 12 | #if defined(CONFIG_ARM_CORTEX_A15) 13 | #include 14 | #elif defined(CONFIG_ARM_CORTEX_A53) 15 | #include 16 | #elif defined(CONFIG_ARM_CORTEX_A57) 17 | #include 18 | #else 19 | #error "unsupported core" 20 | #endif 21 | 22 | /* First address in the virtual address space that is not accessible to user level */ 23 | 24 | #if CONFIG_WORD_SIZE == 32 25 | 26 | #define seL4_UserTop CONFIG_USER_TOP 27 | #endif 28 | -------------------------------------------------------------------------------- /libsel4/sel4_plat_include/rocketchip/sel4/plat/api/constants.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | -------------------------------------------------------------------------------- /libsel4/sel4_plat_include/rockpro64/sel4/plat/api/constants.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | /* The ROCKPro64 uses a RK3399 SOC with a A53/A72 big.LITTLE design. Both cores 12 | * are designed to be identical 13 | */ 14 | #if defined(CONFIG_ARM_CORTEX_A53) 15 | #include 16 | #elif defined(CONFIG_ARM_CORTEX_A72) 17 | #include 18 | #else 19 | #error "unsupported core" 20 | #endif 21 | -------------------------------------------------------------------------------- /libsel4/sel4_plat_include/spike/sel4/plat/api/constants.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | -------------------------------------------------------------------------------- /libsel4/sel4_plat_include/tk1/sel4/plat/api/constants.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | 12 | /* First address in the virtual address space that is not accessible to user level */ 13 | #define seL4_UserTop 0xe0000000 14 | -------------------------------------------------------------------------------- /libsel4/sel4_plat_include/tqma8xqp1gb/sel4/plat/api/constants.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021, Breakaway Consulting Pty. Ltd. 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | 12 | #ifdef CONFIG_ARCH_AARCH32 13 | /* Platform support for tqma8xqp1gb is provided for AARCH64 only, even if the 14 | * Cortex-A35 supports AARCH32 also. Keep this as a build blocker as long as 15 | * AARCH32 remains untested. 16 | */ 17 | #error "AARCH32 is unsupported" 18 | #endif /* CONFIG_ARCH_AARCH32 */ 19 | -------------------------------------------------------------------------------- /libsel4/sel4_plat_include/tx1/sel4/plat/api/constants.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | -------------------------------------------------------------------------------- /libsel4/sel4_plat_include/tx2/sel4/plat/api/constants.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | /* Actually, it's a NVIDIA-Denver2/A57 HMP big.LITTLE system */ 12 | #if defined(CONFIG_ARM_CORTEX_A57) 13 | #include 14 | #else 15 | #error "unsupported core" 16 | #endif 17 | -------------------------------------------------------------------------------- /libsel4/sel4_plat_include/zynq7000/sel4/plat/api/constants.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | 12 | /* First address in the virtual address space that is not accessible to user level */ 13 | #define seL4_UserTop 0xe0000000 14 | -------------------------------------------------------------------------------- /libsel4/sel4_plat_include/zynqmp/sel4/plat/api/constants.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | #if !defined(CONFIG_PLAT_ZYNQMP) && !defined(PLAT_ZYNQMP_ZCU102) 12 | #error "unknown platform" 13 | #endif 14 | 15 | #include 16 | 17 | #if CONFIG_WORD_SIZE == 32 18 | /* First address in the virtual address space that is not accessible to user level */ 19 | #define seL4_UserTop 0xe0000000 20 | #else 21 | /* otherwise this is defined at the architecture level */ 22 | #endif 23 | -------------------------------------------------------------------------------- /libsel4/src/sel4_bootinfo.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #include 8 | 9 | #ifdef CONFIG_KERNEL_INVOCATION_REPORT_ERROR_IPC 10 | __thread char __sel4_print_error = CONFIG_LIB_SEL4_PRINT_INVOCATION_ERRORS; 11 | #endif 12 | 13 | /** Userland per-thread IPC buffer address **/ 14 | __thread seL4_IPCBuffer *__sel4_ipc_buffer; 15 | 16 | /** Consider moving bootinfo into libsel4_startup */ 17 | seL4_BootInfo *bootinfo; 18 | 19 | /** Consider moving seL4_InitBootInfo into libsel4_startup */ 20 | void seL4_InitBootInfo(seL4_BootInfo *bi) 21 | { 22 | bootinfo = bi; 23 | } 24 | 25 | seL4_BootInfo *seL4_GetBootInfo() 26 | { 27 | return bootinfo; 28 | } 29 | -------------------------------------------------------------------------------- /libsel4/tools/bitfield_gen.py: -------------------------------------------------------------------------------- 1 | ../../tools/bitfield_gen.py -------------------------------------------------------------------------------- /libsel4/tools/changed.sh: -------------------------------------------------------------------------------- 1 | ../../tools/changed.sh -------------------------------------------------------------------------------- /libsel4/tools/condition.py: -------------------------------------------------------------------------------- 1 | ../../tools/condition.py -------------------------------------------------------------------------------- /libsel4/tools/invocation_header_gen.py: -------------------------------------------------------------------------------- 1 | ../../tools/invocation_header_gen.py -------------------------------------------------------------------------------- /libsel4/tools/loader/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright 2022, seL4 Project a Series of LF Projects, LLC 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause or GPL-2.0-only 5 | 6 | import os 7 | import sys 8 | import pathlib 9 | 10 | # Add the parent module to the sys.path, do so in this __init__.py 11 | # so that the code producing the side-effect can occur after import 12 | # statements. Otherwise autopep8 would want to reformat this code 13 | # so the side-effect occurs after all import statements. 14 | sys.path.append(str(pathlib.Path(os.path.dirname(os.path.realpath(__file__))).parent)) 15 | -------------------------------------------------------------------------------- /libsel4/tools/syscall_header_gen.py: -------------------------------------------------------------------------------- 1 | ../../tools/syscall_header_gen.py -------------------------------------------------------------------------------- /libsel4/tools/xmllint.sh: -------------------------------------------------------------------------------- 1 | ../../tools/xmllint.sh -------------------------------------------------------------------------------- /manual/README.md: -------------------------------------------------------------------------------- 1 | 6 | 7 | seL4 Reference Manual 8 | ===================== 9 | 10 | To build a PDF use 11 | 12 | make 13 | 14 | You will need recent version of `LaTeX` and `doxygen`. 15 | 16 | The main source file is `manual.tex`, most of the text is in `parts/`, 17 | and most of the API reference is generated with `doxygen`. 18 | -------------------------------------------------------------------------------- /manual/VERSION: -------------------------------------------------------------------------------- 1 | ../VERSION -------------------------------------------------------------------------------- /manual/figs/CDT.graffle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmbiML/sparrow-kernel/d84f3fcb4a2b2d040c68c16306d60101c7547ce3/manual/figs/CDT.graffle -------------------------------------------------------------------------------- /manual/figs/CDT.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmbiML/sparrow-kernel/d84f3fcb4a2b2d040c68c16306d60101c7547ce3/manual/figs/CDT.pdf -------------------------------------------------------------------------------- /manual/figs/fig1-1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmbiML/sparrow-kernel/d84f3fcb4a2b2d040c68c16306d60101c7547ce3/manual/figs/fig1-1.pdf -------------------------------------------------------------------------------- /manual/figs/fig1-2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmbiML/sparrow-kernel/d84f3fcb4a2b2d040c68c16306d60101c7547ce3/manual/figs/fig1-2.pdf -------------------------------------------------------------------------------- /manual/figs/fig1-3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmbiML/sparrow-kernel/d84f3fcb4a2b2d040c68c16306d60101c7547ce3/manual/figs/fig1-3.pdf -------------------------------------------------------------------------------- /manual/figs/fig1-4.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmbiML/sparrow-kernel/d84f3fcb4a2b2d040c68c16306d60101c7547ce3/manual/figs/fig1-4.pdf -------------------------------------------------------------------------------- /manual/figs/fig2-1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmbiML/sparrow-kernel/d84f3fcb4a2b2d040c68c16306d60101c7547ce3/manual/figs/fig2-1.pdf -------------------------------------------------------------------------------- /manual/logos/blacktriangle.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmbiML/sparrow-kernel/d84f3fcb4a2b2d040c68c16306d60101c7547ce3/manual/logos/blacktriangle.pdf -------------------------------------------------------------------------------- /manual/logos/blacktriangle.pdf.license: -------------------------------------------------------------------------------- 1 | Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 2 | SPDX-License-Identifier: CC-BY-SA-4.0 3 | -------------------------------------------------------------------------------- /manual/logos/seL4-Foundation-logo.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmbiML/sparrow-kernel/d84f3fcb4a2b2d040c68c16306d60101c7547ce3/manual/logos/seL4-Foundation-logo.pdf -------------------------------------------------------------------------------- /manual/logos/seL4-Foundation-logo.pdf.license: -------------------------------------------------------------------------------- 1 | Copyright seL4 Project a Series of LF Projects, LLC 2 | SPDX-License-Identifier: LicenseRef-Trademark 3 | -------------------------------------------------------------------------------- /manual/parts/api/debug_halt.tex: -------------------------------------------------------------------------------- 1 | % 2 | % Copyright 2014, General Dynamics C4 Systems 3 | % 4 | % SPDX-License-Identifier: GPL-2.0-only 5 | % 6 | 7 | \apidoc 8 | {debug_halt} 9 | {Debug - Halt} 10 | {Halt the system} 11 | {static inline void seL4\_DebugHalt} 12 | { 13 | \param{void}{}{} 14 | } 15 | {\noret} 16 | {Halts the system, if debugging is turned on.} 17 | -------------------------------------------------------------------------------- /manual/parts/api/debug_putchar.tex: -------------------------------------------------------------------------------- 1 | % 2 | % Copyright 2014, General Dynamics C4 Systems 3 | % 4 | % SPDX-License-Identifier: GPL-2.0-only 5 | % 6 | 7 | \apidoc 8 | {debug_putchar} 9 | {Debug - Put Character} 10 | {Print a character to the console} 11 | {static inline void seL4\_DebugPutChar} 12 | { 13 | \param{char}{c}{The character to print.} 14 | } 15 | {\noret} 16 | {Prints a character to the serial port, if debugging is turned on.} 17 | -------------------------------------------------------------------------------- /manual/tools/libsel4_tools: -------------------------------------------------------------------------------- 1 | ../../libsel4/tools -------------------------------------------------------------------------------- /src/arch/arm/32/config.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | # 4 | # SPDX-License-Identifier: GPL-2.0-only 5 | # 6 | 7 | cmake_minimum_required(VERSION 3.7.2) 8 | 9 | add_sources( 10 | DEP "KernelSel4ArchAarch32" 11 | PREFIX src/arch/arm/32 12 | CFILES 13 | object/objecttype.c 14 | machine/capdl.c 15 | machine/registerset.c 16 | machine/fpu.c 17 | model/statedata.c 18 | c_traps.c 19 | idle.c 20 | kernel/thread.c 21 | kernel/vspace.c 22 | ASMFILES head.S traps.S hyp_traps.S 23 | ) 24 | -------------------------------------------------------------------------------- /src/arch/arm/64/config.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | # 4 | # SPDX-License-Identifier: GPL-2.0-only 5 | # 6 | 7 | cmake_minimum_required(VERSION 3.7.2) 8 | 9 | add_sources( 10 | DEP "KernelSel4ArchAarch64" 11 | PREFIX src/arch/arm/64 12 | CFILES 13 | object/objecttype.c 14 | machine/capdl.c 15 | machine/registerset.c 16 | machine/fpu.c 17 | model/statedata.c 18 | c_traps.c 19 | idle.c 20 | kernel/thread.c 21 | kernel/vspace.c 22 | ASMFILES head.S traps.S 23 | ) 24 | -------------------------------------------------------------------------------- /src/arch/arm/64/idle.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | void idle_thread(void) 12 | { 13 | while (1) { 14 | wfi(); 15 | } 16 | } 17 | 18 | /** DONT_TRANSLATE */ 19 | void NORETURN NO_INLINE VISIBLE halt(void) 20 | { 21 | /* halt is actually, idle thread without the interrupts */ 22 | MSR("daif", (DAIF_DEBUG | DAIF_SERROR | DAIF_IRQ | DAIF_FIRQ)); 23 | 24 | #ifdef CONFIG_PRINTING 25 | printf("halting..."); 26 | #ifdef CONFIG_DEBUG_BUILD 27 | debug_printKernelEntryReason(); 28 | #endif 29 | #endif 30 | idle_thread(); 31 | UNREACHABLE(); 32 | } 33 | -------------------------------------------------------------------------------- /src/arch/arm/armv/armv7-a/config.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | # 4 | # SPDX-License-Identifier: GPL-2.0-only 5 | # 6 | 7 | cmake_minimum_required(VERSION 3.7.2) 8 | 9 | add_sources( 10 | DEP "KernelArchArmV7a" 11 | PREFIX src/arch/arm/armv/armv7-a 12 | CFILES cache.c user_access.c tlb.c 13 | ASMFILES machine_asm.S 14 | ) 15 | -------------------------------------------------------------------------------- /src/arch/arm/armv/armv8-a/32/cache.c: -------------------------------------------------------------------------------- 1 | ../../armv7-a/cache.c -------------------------------------------------------------------------------- /src/arch/arm/armv/armv8-a/32/machine_asm.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014, General Dynamics C4 Systems 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #include 8 | #include 9 | 10 | #if defined(CONFIG_ARM_CORTEX_A53) 11 | 12 | /* A53 hardware does not support TLB locking */ 13 | BEGIN_FUNC(lockTLBEntry) 14 | bx lr 15 | END_FUNC(lockTLBEntry) 16 | 17 | #endif 18 | 19 | -------------------------------------------------------------------------------- /src/arch/arm/armv/armv8-a/32/user_access.c: -------------------------------------------------------------------------------- 1 | ../../armv7-a/user_access.c -------------------------------------------------------------------------------- /src/arch/arm/armv/armv8-a/64/machine_asm.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 8 | 9 | BEGIN_FUNC(lockTLBEntry) 10 | ret 11 | END_FUNC(lockTLBEntry) 12 | -------------------------------------------------------------------------------- /src/arch/arm/armv/armv8-a/config.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | # 4 | # SPDX-License-Identifier: GPL-2.0-only 5 | # 6 | 7 | cmake_minimum_required(VERSION 3.7.2) 8 | 9 | add_sources( 10 | DEP "KernelArchArmV8a" 11 | PREFIX src/arch/arm/armv/armv8-a/${KernelWordSize} 12 | CFILES cache.c user_access.c 13 | ASMFILES machine_asm.S 14 | ) 15 | -------------------------------------------------------------------------------- /src/arch/arm/kernel/thread.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #include 8 | 9 | void Arch_postModifyRegisters(tcb_t *tptr) 10 | { 11 | /* Nothing to do */ 12 | } 13 | -------------------------------------------------------------------------------- /src/arch/arm/machine/io.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021, Axel Heider 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | #ifdef CONFIG_PRINTING 12 | void kernel_putDebugChar(unsigned char c) 13 | { 14 | uart_console_putchar(c); 15 | } 16 | #endif /* CONFIG_PRINTING */ 17 | 18 | #ifdef CONFIG_DEBUG_BUILD 19 | unsigned char kernel_getDebugChar(void) 20 | { 21 | return uart_drv_getchar(); 22 | } 23 | #endif /* CONFIG_DEBUG_BUILD */ 24 | -------------------------------------------------------------------------------- /src/arch/arm/machine/l2c_nop.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | void initL2Cache(void) {} 13 | void plat_cleanL2Range(paddr_t start, paddr_t end) {} 14 | void plat_invalidateL2Range(paddr_t start, paddr_t end) {} 15 | void plat_cleanInvalidateL2Range(paddr_t start, paddr_t end) {} 16 | void plat_cleanInvalidateL2Cache(void) {} 17 | -------------------------------------------------------------------------------- /src/arch/arm/object/tcb.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014, General Dynamics C4 Systems 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | word_t CONST Arch_decodeTransfer(word_t flags) 16 | { 17 | return 0; 18 | } 19 | 20 | exception_t CONST Arch_performTransfer(word_t arch, tcb_t *tcb_src, tcb_t *tcb_dest) 21 | { 22 | return EXCEPTION_NONE; 23 | } 24 | 25 | #ifdef ENABLE_SMP_SUPPORT 26 | void Arch_migrateTCB(tcb_t *thread) 27 | { 28 | #ifdef CONFIG_HAVE_FPU 29 | /* check if thread own its current core FPU */ 30 | if (nativeThreadUsingFPU(thread)) { 31 | switchFpuOwner(NULL, thread->tcbAffinity); 32 | } 33 | #endif /* CONFIG_HAVE_FPU */ 34 | } 35 | #endif /* ENABLE_SMP_SUPPORT */ 36 | -------------------------------------------------------------------------------- /src/arch/riscv/api/benchmark.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #ifdef CONFIG_ENABLE_BENCHMARK 8 | 9 | #endif /* CONFIG_ENABLE_BENCHMARK */ 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/arch/riscv/idle.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * Copyright 2015, 2016 Hesham Almatary 4 | * 5 | * SPDX-License-Identifier: GPL-2.0-only 6 | */ 7 | 8 | #include 9 | #include 10 | 11 | void idle_thread(void) 12 | { 13 | while (1) { 14 | asm volatile("wfi"); 15 | } 16 | } 17 | 18 | /** DONT_TRANSLATE */ 19 | void VISIBLE NO_INLINE halt(void) 20 | { 21 | #ifdef CONFIG_PRINTING 22 | printf("halting..."); 23 | #ifdef CONFIG_DEBUG_BUILD 24 | debug_printKernelEntryReason(); 25 | #endif /* CONFIG_DEBUG_BUILD */ 26 | #endif /* CONFIG_PRINTING */ 27 | 28 | sbi_shutdown(); 29 | 30 | UNREACHABLE(); 31 | } 32 | -------------------------------------------------------------------------------- /src/arch/riscv/machine/fpu.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #ifdef CONFIG_HAVE_FPU 8 | #include 9 | 10 | bool_t isFPUEnabledCached[CONFIG_MAX_NUM_NODES]; 11 | #endif 12 | -------------------------------------------------------------------------------- /src/arch/riscv/object/tcb.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * Copyright 2015, 2016 Hesham Almatary 4 | * 5 | * SPDX-License-Identifier: GPL-2.0-only 6 | */ 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | word_t CONST Arch_decodeTransfer(word_t flags) 16 | { 17 | return 0; 18 | } 19 | 20 | exception_t CONST Arch_performTransfer(word_t arch, tcb_t *tcb_src, tcb_t *tcb_dest) 21 | { 22 | return EXCEPTION_NONE; 23 | } 24 | 25 | #ifdef ENABLE_SMP_SUPPORT 26 | void Arch_migrateTCB(tcb_t *thread) 27 | { 28 | #ifdef CONFIG_HAVE_FPU 29 | if (nativeThreadUsingFPU(thread)) { 30 | switchFpuOwner(NULL, thread->tcbAffinity); 31 | } 32 | #endif 33 | } 34 | #endif 35 | -------------------------------------------------------------------------------- /src/arch/x86/32/config.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | # 4 | # SPDX-License-Identifier: GPL-2.0-only 5 | # 6 | 7 | cmake_minimum_required(VERSION 3.7.2) 8 | 9 | add_sources( 10 | DEP "KernelSel4ArchIA32" 11 | PREFIX src/arch/x86/32 12 | CFILES 13 | c_traps.c 14 | object/objecttype.c 15 | kernel/thread.c 16 | kernel/vspace.c 17 | kernel/vspace_32paging.c 18 | kernel/elf.c 19 | model/statedata.c 20 | machine/registerset.c 21 | machine/capdl.c 22 | smp/ipi.c 23 | ASMFILES machine_asm.S traps.S head.S 24 | ) 25 | -------------------------------------------------------------------------------- /src/arch/x86/32/model/statedata.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014, General Dynamics C4 Systems 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #include 8 | #include 9 | 10 | /* Current active page directory. This is really just a shadow of CR3 */ 11 | UP_STATE_DEFINE(paddr_t, ia32KSCurrentPD VISIBLE); 12 | 13 | /* The privileged kernel mapping PD & PT */ 14 | pde_t ia32KSGlobalPD[BIT(PD_INDEX_BITS)] ALIGN(BIT(seL4_PageDirBits)); 15 | pte_t ia32KSGlobalPT[BIT(PT_INDEX_BITS)] ALIGN(BIT(seL4_PageTableBits)); 16 | 17 | #ifdef CONFIG_KERNEL_LOG_BUFFER 18 | pte_t ia32KSGlobalLogPT[BIT(PT_INDEX_BITS)] ALIGN(BIT(seL4_PageTableBits)); 19 | #endif /* CONFIG_KERNEL_LOG_BUFFER */ 20 | -------------------------------------------------------------------------------- /src/arch/x86/32/smp/ipi.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #include 8 | #include 9 | 10 | #ifdef ENABLE_SMP_SUPPORT 11 | 12 | void Mode_handleRemoteCall(IpiModeRemoteCall_t call, word_t arg0, word_t arg1, word_t arg2) 13 | { 14 | switch (call) { 15 | case IpiRemoteCall_InvalidateTLBEntry: 16 | invalidateLocalTLBEntry(arg0); 17 | break; 18 | 19 | case IpiRemoteCall_InvalidatePageStructureCache: 20 | invalidateLocalPageStructureCache(); 21 | break; 22 | 23 | case IpiRemoteCall_InvalidateTLB: 24 | invalidateLocalTLB(); 25 | break; 26 | 27 | default: 28 | fail("Invalid remote call"); 29 | } 30 | } 31 | 32 | #endif /* ENABLE_SMP_SUPPORT */ 33 | -------------------------------------------------------------------------------- /src/arch/x86/64/config.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | # 4 | # SPDX-License-Identifier: GPL-2.0-only 5 | # 6 | 7 | cmake_minimum_required(VERSION 3.7.2) 8 | 9 | add_sources( 10 | DEP "KernelSel4ArchX86_64" 11 | PREFIX src/arch/x86/64 12 | CFILES 13 | c_traps.c 14 | object/objecttype.c 15 | kernel/thread.c 16 | kernel/vspace.c 17 | kernel/elf.c 18 | model/statedata.c 19 | model/smp.c 20 | machine/capdl.c 21 | machine/registerset.c 22 | smp/ipi.c 23 | ASMFILES machine_asm.S traps.S head.S 24 | ) 25 | -------------------------------------------------------------------------------- /src/arch/x86/64/model/smp.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #include 8 | #include 9 | 10 | #ifdef ENABLE_SMP_SUPPORT 11 | 12 | nodeInfo_t node_info[CONFIG_MAX_NUM_NODES] ALIGN(L1_CACHE_LINE_SIZE) VISIBLE; 13 | char nodeSkimScratch[CONFIG_MAX_NUM_NODES][sizeof(nodeInfo_t)] ALIGN(L1_CACHE_LINE_SIZE); 14 | extern char kernel_stack_alloc[CONFIG_MAX_NUM_NODES][BIT(CONFIG_KERNEL_STACK_BITS)]; 15 | 16 | BOOT_CODE void mode_init_tls(cpu_id_t cpu_index) 17 | { 18 | node_info[cpu_index].stackTop = kernel_stack_alloc[cpu_index + 1]; 19 | node_info[cpu_index].irqStack = &x64KSIRQStack[cpu_index][0]; 20 | node_info[cpu_index].index = cpu_index; 21 | x86_wrmsr(IA32_KERNEL_GS_BASE_MSR, (word_t)&node_info[cpu_index]); 22 | swapgs(); 23 | } 24 | 25 | #endif /* ENABLE_SMP_SUPPORT */ 26 | -------------------------------------------------------------------------------- /src/arch/x86/64/smp/ipi.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | #ifdef ENABLE_SMP_SUPPORT 12 | 13 | void Mode_handleRemoteCall(IpiModeRemoteCall_t call, word_t arg0, word_t arg1, word_t arg2) 14 | { 15 | switch (call) { 16 | case IpiRemoteCall_InvalidatePCID: 17 | invalidateLocalPCID(arg0, (void *)arg1, arg2); 18 | break; 19 | 20 | case IpiRemoteCall_InvalidateASID: 21 | invalidateLocalASID((vspace_root_t *)arg0, arg1); 22 | break; 23 | 24 | default: 25 | fail("Invalid remote call"); 26 | } 27 | } 28 | 29 | #endif /* ENABLE_SMP_SUPPORT */ 30 | -------------------------------------------------------------------------------- /src/arch/x86/benchmark/benchmark.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014, General Dynamics C4 Systems 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #if CONFIG_MAX_NUM_TRACE_POINTS > 0 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | timestamp_t ksEntries[CONFIG_MAX_NUM_TRACE_POINTS]; 14 | bool_t ksStarted[CONFIG_MAX_NUM_TRACE_POINTS]; 15 | timestamp_t ksExit; 16 | seL4_Word ksLogIndex = 0; 17 | seL4_Word ksLogIndexFinalized = 0; 18 | 19 | #endif /* CONFIG_MAX_NUM_TRACE_POINTS > 0 */ 20 | -------------------------------------------------------------------------------- /src/arch/x86/kernel/thread.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #include 8 | #include 9 | 10 | void Arch_postModifyRegisters(tcb_t *tptr) 11 | { 12 | Mode_postModifyRegisters(tptr); 13 | } 14 | -------------------------------------------------------------------------------- /src/assert.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014, General Dynamics C4 Systems 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #include 8 | #include 9 | 10 | #ifdef CONFIG_DEBUG_BUILD 11 | 12 | void _fail( 13 | const char *s, 14 | const char *file, 15 | unsigned int line, 16 | const char *function) 17 | { 18 | printf( 19 | "seL4 called fail at %s:%u in function %s, saying \"%s\"\n", 20 | file, 21 | line, 22 | function, 23 | s 24 | ); 25 | halt(); 26 | } 27 | 28 | void _assert_fail( 29 | const char *assertion, 30 | const char *file, 31 | unsigned int line, 32 | const char *function) 33 | { 34 | printf("seL4 failed assertion '%s' at %s:%u in function %s\n", 35 | assertion, 36 | file, 37 | line, 38 | function 39 | ); 40 | halt(); 41 | } 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /src/config/default_domain.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014, General Dynamics C4 Systems 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #include 8 | #include 9 | 10 | /* Default schedule. */ 11 | const dschedule_t ksDomSchedule[] = { 12 | { .domain = 0, .length = 1 }, 13 | }; 14 | 15 | const word_t ksDomScheduleLength = sizeof(ksDomSchedule) / sizeof(dschedule_t); 16 | 17 | -------------------------------------------------------------------------------- /src/drivers/config.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | # 4 | # SPDX-License-Identifier: GPL-2.0-only 5 | # 6 | 7 | cmake_minimum_required(VERSION 3.7.2) 8 | 9 | macro(register_driver compatibility_strings match_strings) 10 | foreach(match_string IN ITEMS ${match_strings}) 11 | list(FIND ${compatibility_strings} ${match_string} res) 12 | if(NOT (res EQUAL -1)) 13 | add_sources(${ARGN}) 14 | break() 15 | endif() 16 | endforeach() 17 | endmacro() 18 | 19 | include(src/drivers/serial/config.cmake) 20 | include(src/drivers/smmu/config.cmake) 21 | include(src/drivers/timer/config.cmake) 22 | -------------------------------------------------------------------------------- /src/drivers/serial/pl011.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, General Dynamics C4 Systems 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | #define UARTDR 0x000 14 | #define UARTFR 0x018 15 | 16 | #define PL011_UARTFR_TXFF BIT(5) 17 | #define PL011_UARTFR_RXFE BIT(4) 18 | 19 | #define UART_REG(x) ((volatile uint32_t *)(UART_PPTR + (x))) 20 | 21 | #ifdef CONFIG_PRINTING 22 | void uart_drv_putchar(unsigned char c) 23 | { 24 | while ((*UART_REG(UARTFR) & PL011_UARTFR_TXFF) != 0); 25 | 26 | *UART_REG(UARTDR) = c; 27 | } 28 | #endif /* CONFIG_PRINTING */ 29 | 30 | #ifdef CONFIG_DEBUG_BUILD 31 | unsigned char uart_drv_getchar(void) 32 | { 33 | while ((*UART_REG(UARTFR) & PL011_UARTFR_RXFE) != 0); 34 | 35 | return *UART_REG(UARTDR); 36 | } 37 | #endif /* CONFIG_DEBUG_BUILD */ 38 | -------------------------------------------------------------------------------- /src/drivers/serial/tegra_omap3_dwapb.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, General Dynamics C4 Systems 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | #define UTHR 0x0 14 | #define ULSR 0x14 15 | 16 | #define ULSR_THRE BIT(5) 17 | #define ULSR_RDR BIT(0) 18 | 19 | #define UART_REG(x) ((volatile uint32_t *)(UART_PPTR + (x))) 20 | 21 | #ifdef CONFIG_PRINTING 22 | void uart_drv_putchar(unsigned char c) 23 | { 24 | while ((*UART_REG(ULSR) & ULSR_THRE) == 0); 25 | 26 | *UART_REG(UTHR) = c; 27 | } 28 | #endif /* CONFIG_PRINTING */ 29 | 30 | #ifdef CONFIG_DEBUG_BUILD 31 | unsigned char uart_drv_getchar(void) 32 | { 33 | while ((*UART_REG(ULSR) & ULSR_RDR) == 0); 34 | 35 | return *UART_REG(UTHR); 36 | } 37 | #endif /* CONFIG_DEBUG_BUILD */ 38 | -------------------------------------------------------------------------------- /src/drivers/smmu/config.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | # 4 | # SPDX-License-Identifier: GPL-2.0-only 5 | # 6 | 7 | cmake_minimum_required(VERSION 3.7.2) 8 | 9 | register_driver(compatibility_strings "arm,mmu-500" PREFIX src/drivers/smmu CFILES "smmuv2.c") 10 | -------------------------------------------------------------------------------- /src/drivers/timer/exynos4210-mct.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014, General Dynamics C4 Systems 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | 20 | timer_t *mct = (timer_t *) EXYNOS_MCT_PPTR; 21 | 22 | BOOT_CODE void initTimer(void) 23 | { 24 | mct_clear_write_status(); 25 | 26 | /* use the arm generic timer, backed by the mct */ 27 | /* enable the timer */ 28 | mct->global.tcon = GTCON_EN; 29 | while (mct->global.wstat != GWSTAT_TCON); 30 | mct->global.wstat = GWSTAT_TCON; 31 | 32 | initGenericTimer(); 33 | } 34 | 35 | -------------------------------------------------------------------------------- /src/drivers/timer/global_timer.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #include 8 | 9 | timer_t *const globalTimer = (timer_t *) TIMER_PPTR; 10 | 11 | /** DONT_TRANSLATE */ 12 | BOOT_CODE void initTimer(void) 13 | { 14 | /* disable the timer */ 15 | globalTimer->control = 0; 16 | /* zero the timer */ 17 | globalTimer->countLower = 0; 18 | globalTimer->countUpper = 0; 19 | /* turn it on again, wih interrupts on, comparator register off, 20 | * in one-shot mode, with standard prescaler */ 21 | globalTimer->control = BIT(ENABLE) | BIT(IRQ_ENABLE); 22 | 23 | /* this timer will overflow in about 1000 years */ 24 | } 25 | -------------------------------------------------------------------------------- /src/inlines.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014, General Dynamics C4 Systems 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #include 8 | #include 9 | 10 | lookup_fault_t current_lookup_fault; 11 | seL4_Fault_t current_fault; 12 | syscall_error_t current_syscall_error; 13 | #ifdef CONFIG_KERNEL_INVOCATION_REPORT_ERROR_IPC 14 | debug_syscall_error_t current_debug_error; 15 | #endif 16 | 17 | -------------------------------------------------------------------------------- /src/kernel/stack.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #include 8 | 9 | VISIBLE ALIGN(KERNEL_STACK_ALIGNMENT) 10 | char kernel_stack_alloc[CONFIG_MAX_NUM_NODES][BIT(CONFIG_KERNEL_STACK_BITS)]; 11 | -------------------------------------------------------------------------------- /src/machine/registerset.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #include 8 | 9 | const register_t fault_messages[][MAX_MSG_SIZE] = { 10 | [MessageID_Syscall] = SYSCALL_MESSAGE, 11 | [MessageID_Exception] = EXCEPTION_MESSAGE, 12 | #ifdef CONFIG_KERNEL_MCS 13 | [MessageID_TimeoutReply] = TIMEOUT_REPLY_MESSAGE, 14 | #endif 15 | }; 16 | -------------------------------------------------------------------------------- /src/model/smp.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | #ifdef ENABLE_SMP_SUPPORT 12 | 13 | void migrateTCB(tcb_t *tcb, word_t new_core) 14 | { 15 | #ifdef CONFIG_DEBUG_BUILD 16 | tcbDebugRemove(tcb); 17 | #endif 18 | Arch_migrateTCB(tcb); 19 | tcb->tcbAffinity = new_core; 20 | #ifdef CONFIG_DEBUG_BUILD 21 | tcbDebugAppend(tcb); 22 | #endif 23 | } 24 | 25 | #endif /* ENABLE_SMP_SUPPORT */ 26 | -------------------------------------------------------------------------------- /src/plat/allwinnerA20/overlay-allwinnerA20.dts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | / { 8 | chosen { 9 | seL4,elfloader-devices = 10 | "serial0"; 11 | 12 | seL4,kernel-devices = 13 | "serial0", 14 | &{/soc@1c00000/interrupt-controller@1c81000}, 15 | &{/timer}; 16 | }; 17 | }; 18 | -------------------------------------------------------------------------------- /src/plat/am335x/machine/hardware.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014, General Dynamics C4 Systems 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | BOOT_CODE void initIRQController(void) 12 | { 13 | intc->intcps_sysconfig = INTCPS_SYSCONFIG_SOFTRESET; 14 | while (!(intc->intcps_sysstatus & INTCPS_SYSSTATUS_RESETDONE)) ; 15 | } 16 | 17 | BOOT_CODE void cpu_initLocalIRQController(void) {} 18 | -------------------------------------------------------------------------------- /src/plat/am335x/overlay-am335x-boneblack.dts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | / { 8 | /* BeagleBone Black has 512MiB memory */ 9 | memory@80000000 { 10 | reg = < 0x80000000 0x20000000 >; 11 | }; 12 | }; 13 | -------------------------------------------------------------------------------- /src/plat/am335x/overlay-am335x.dts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | / { 8 | chosen { 9 | seL4,elfloader-devices = 10 | "serial0"; 11 | seL4,kernel-devices = 12 | "serial0", 13 | &{/ocp/interrupt-controller@48200000}, 14 | /* The following devices are used to support the timer used by the kernel */ 15 | /* dmtimer4, OMAP Dual-Mode timer */ 16 | &{/ocp/timer@48044000}, 17 | &{/ocp/l4_wkup@44c00000/prcm@200000}, /* Power reset and clock manager */ 18 | &{/ocp/wdt@44e35000}; /* Watchdog timer */ 19 | }; 20 | }; 21 | -------------------------------------------------------------------------------- /src/plat/apq8064/overlay-apq8064.dts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | / { 8 | chosen { 9 | seL4,elfloader-devices = 10 | "serial0"; 11 | seL4,kernel-devices = 12 | "serial0", 13 | &{/soc/interrupt-controller@2000000}, 14 | &{/soc/timer@200a000}; 15 | }; 16 | 17 | memory@80000000 { 18 | device_type = "memory"; 19 | /* skip one page to avoid overflow */ 20 | reg = <0x80000000 0x7ffff000>; 21 | }; 22 | }; 23 | -------------------------------------------------------------------------------- /src/plat/ariane/overlay-ariane.dts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | / { 8 | chosen { 9 | seL4,kernel-devices = 10 | &{/soc/interrupt-controller@c000000}; 11 | }; 12 | }; 13 | -------------------------------------------------------------------------------- /src/plat/bcm2711/overlay-rpi4.dts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * Copyright (C) 2021, Hensoldt Cyber GmbH 4 | * 5 | * SPDX-License-Identifier: GPL-2.0-only 6 | */ 7 | 8 | / { 9 | chosen { 10 | seL4,elfloader-devices = 11 | "serial1"; 12 | 13 | seL4,kernel-devices = 14 | "serial1", 15 | &{/soc/interrupt-controller@40041000}, 16 | &{/soc/local_intc@40000000}, 17 | &{/timer}; 18 | }; 19 | 20 | memory@0 { 21 | /* This is configurable in the Pi's config.txt, but we use 128MiB of RAM by default. */ 22 | reg = <0x00 0x00000000 0x08000000>; 23 | }; 24 | }; 25 | -------------------------------------------------------------------------------- /src/plat/exynos4/overlay-exynos4.dts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | / { 8 | chosen { 9 | seL4,elfloader-devices = 10 | "serial1"; 11 | 12 | seL4,kernel-devices = 13 | "serial1", 14 | &{/soc/interrupt-controller@10490000}, 15 | &{/soc/l2-cache-controller@10502000}, 16 | &{/soc/mct@10050000}; 17 | }; 18 | 19 | /delete-node/ memory; 20 | memory@40000000 { 21 | device_type = "memory"; 22 | }; 23 | 24 | /* HACK: 0xe0000000..0xff000000 is the largest contiguous region 25 | * in the kernel window; we clamp to that and discard memory 26 | * after the ASID PD hole (0xff200000..0xfff00000). This is a 27 | * workaround for userspace tools (hardware_gen, elfloader, etc) 28 | * which are not yet aware of the memory hole. */ 29 | memory@40000000 { 30 | device_type = "memory"; 31 | reg = < 0x40000000 0x1f000000 >; 32 | }; 33 | }; 34 | -------------------------------------------------------------------------------- /src/plat/exynos5/overlay-exynos5250.dts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | / { 8 | /* Pick serial console */ 9 | chosen { 10 | stdout-path = "serial2:115200n8"; 11 | seL4,elfloader-devices = 12 | "serial2"; 13 | seL4,kernel-devices = 14 | "serial2", 15 | &{/soc/interrupt-controller@10481000}, 16 | &{/soc/mct@101c0000}, 17 | &{/soc/timer}; 18 | }; 19 | 20 | /* HACK: 0xe0000000..0xff000000 is the largest contiguous region 21 | * in the kernel window; we clamp to that and discard memory 22 | * after the ASID PD hole (0xff200000..0xfff00000). This is a 23 | * workaround for userspace tools (hardware_gen, elfloader, etc) 24 | * which are not yet aware of the memory hole. */ 25 | memory@40000000 { 26 | reg = <0x60000000 0x1f000000>; 27 | }; 28 | 29 | vm-memory@40000000 { 30 | reg = <0x40000000 0x20000000>; 31 | }; 32 | 33 | }; 34 | -------------------------------------------------------------------------------- /src/plat/fvp/config.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | # 4 | # SPDX-License-Identifier: GPL-2.0-only 5 | # 6 | 7 | cmake_minimum_required(VERSION 3.7.2) 8 | 9 | declare_platform(fvp KernelPlatformFVP PLAT_FVP KernelSel4ArchAarch64) 10 | 11 | if(KernelPlatformFVP) 12 | declare_seL4_arch(aarch64) 13 | set(KernelArmCortexA57 ON) 14 | set(KernelArchArmV8a ON) 15 | set(KernelArmGicV3 ON) 16 | config_set(KernelARMPlatform ARM_PLAT "fvp") 17 | list(APPEND KernelDTSList "tools/dts/fvp.dts") 18 | list(APPEND KernelDTSList "src/plat/fvp/overlay-fvp.dts") 19 | declare_default_headers( 20 | TIMER_FREQUENCY 100000000 21 | MAX_IRQ 207 22 | INTERRUPT_CONTROLLER arch/machine/gic_v3.h 23 | TIMER drivers/timer/arm_generic.h 24 | ) 25 | endif() 26 | 27 | add_sources( 28 | DEP "KernelPlatformFVP" 29 | CFILES src/arch/arm/machine/l2c_nop.c src/arch/arm/machine/gic_v3.c 30 | ) 31 | -------------------------------------------------------------------------------- /src/plat/fvp/overlay-fvp.dts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | / { 8 | chosen { 9 | seL4,elfloader-devices = 10 | "serial0", 11 | &{/psci}; 12 | 13 | seL4,kernel-devices = 14 | "serial0", 15 | &{/interrupt-controller@2f000000}, 16 | &{/timer}; 17 | }; 18 | }; 19 | -------------------------------------------------------------------------------- /src/plat/hifive/config.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2020, DornerWorks 3 | # Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 4 | # 5 | # SPDX-License-Identifier: GPL-2.0-only 6 | # 7 | 8 | cmake_minimum_required(VERSION 3.7.2) 9 | 10 | declare_platform(hifive KernelPlatformHifive PLAT_HIFIVE KernelSel4ArchRiscV64) 11 | 12 | if(KernelPlatformHifive) 13 | declare_seL4_arch(riscv64) 14 | config_set(KernelRiscVPlatform RISCV_PLAT "hifive") 15 | config_set(KernelPlatformFirstHartID FIRST_HART_ID 1) 16 | config_set(KernelOpenSBIPlatform OPENSBI_PLATFORM "sifive/fu540") 17 | list(APPEND KernelDTSList "tools/dts/hifive.dts") 18 | list(APPEND KernelDTSList "src/plat/hifive/overlay-hifive.dts") 19 | declare_default_headers( 20 | TIMER_FREQUENCY 1000000 PLIC_MAX_NUM_INT 53 21 | INTERRUPT_CONTROLLER drivers/irq/riscv_plic0.h 22 | ) 23 | else() 24 | unset(KernelPlatformFirstHartID CACHE) 25 | endif() 26 | -------------------------------------------------------------------------------- /src/plat/hifive/overlay-hifive.dts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | / { 8 | chosen { 9 | seL4,kernel-devices = 10 | &{/soc/interrupt-controller@c000000}; 11 | }; 12 | }; 13 | -------------------------------------------------------------------------------- /src/plat/hikey/overlay-hikey.dts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | / { 8 | chosen { 9 | stdout-path = "serial0:115200n8"; 10 | 11 | seL4,elfloader-devices = 12 | "serial0", 13 | &{/psci}; 14 | 15 | seL4,kernel-devices = 16 | "serial0", 17 | &{/interrupt-controller@f6801000}, 18 | &{/timer}; 19 | }; 20 | 21 | pmu { 22 | compatible = "arm,armv8-pmuv3"; 23 | interrupts = <0x00 0x63 0x04>; 24 | }; 25 | 26 | memory@0 { 27 | /* 28 | * Ignore the first 512MB of RAM (0x0-0x1fffffff), to match what was hardcoded in the kernel 29 | * before the switch to DTS. If we try and use all of RAM, in 32-bit mode the ELF loader 30 | * gets loaded where the kernel wants to be loaded. 31 | * The last 16MB of RAM (0x3f000000-0x3fffffff) are reserved for OP-TEE. 32 | */ 33 | reg = <0x00 0x20000000 0x00 0x1f000000>; 34 | }; 35 | }; 36 | -------------------------------------------------------------------------------- /src/plat/imx6/mcs-overlay-imx6.dts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | / { 8 | 9 | soc { 10 | timer@a00200 { 11 | compatible = "arm,cortex-a9-global-timer"; 12 | reg = < 0xa00200 0x300 >; 13 | interrupts = < 0x01 0x0b 0xf01 >; 14 | interrupt-parent = < 0x16 >; 15 | clocks = < 0x04 0x0f >; 16 | }; 17 | }; 18 | 19 | chosen { 20 | seL4,kernel-devices = 21 | "serial1", 22 | &{/soc/interrupt-controller@a01000}, 23 | &{/soc/l2-cache@a02000}, 24 | &{/soc/timer@a00200}; 25 | }; 26 | }; 27 | -------------------------------------------------------------------------------- /src/plat/imx6/mcs-overlay-nitrogen6sx.dts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021, Kry10 Limited. 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | / { 8 | 9 | soc { 10 | timer@a00200 { 11 | compatible = "arm,cortex-a9-global-timer"; 12 | reg = < 0xa00200 0x300 >; 13 | interrupts = < 0x01 0x0b 0xf01 >; 14 | interrupt-parent = < 0x16 >; 15 | clocks = < 0x04 0x0f >; 16 | }; 17 | }; 18 | 19 | chosen { 20 | seL4,kernel-devices = 21 | "serial0", 22 | &{/soc/interrupt-controller@a01000}, 23 | &{/soc/l2-cache@a02000}, 24 | &{/soc/timer@a00200}; 25 | }; 26 | }; 27 | -------------------------------------------------------------------------------- /src/plat/imx6/overlay-nitrogen6sx.dts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Hensoldt Cyber 3 | * 4 | * SPDX-License-Identifier: BSD-3-Clause 5 | * 6 | */ 7 | 8 | / { 9 | chosen { 10 | seL4,elfloader-devices = 11 | "serial0", 12 | &{/soc/aips-bus@2000000/src@20d8000}; 13 | 14 | seL4,kernel-devices = 15 | "serial0", 16 | &{/soc/interrupt-controller@a01000}, 17 | &{/soc/l2-cache@a02000}, 18 | &{/soc/timer@a00600}; 19 | }; 20 | 21 | /* Upstream bug: the memory node doesn't have a device_type, 22 | * but there is an empty memory node with a device_type. 23 | */ 24 | /delete-node/ memory; 25 | memory@80000000 { 26 | device_type = "memory"; 27 | reg = <0x80000000 0x40000000>; 28 | }; 29 | }; 30 | -------------------------------------------------------------------------------- /src/plat/imx6/overlay-sabre.dts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | / { 8 | chosen { 9 | seL4,elfloader-devices = 10 | "serial1", 11 | &{/soc/aips-bus@2000000/src@20d8000}; 12 | 13 | seL4,kernel-devices = 14 | "serial1", 15 | &{/soc/interrupt-controller@a01000}, 16 | &{/soc/l2-cache@a02000}, 17 | &{/soc/timer@a00600}; 18 | }; 19 | /* Upstream bug: the memory node doesn't have a device_type, 20 | * but there is an empty memory node with a device_type. */ 21 | /delete-node/ memory; 22 | memory@10000000 { 23 | device_type = "memory"; 24 | reg = <0x10000000 0x1ff00000>; 25 | }; 26 | }; 27 | -------------------------------------------------------------------------------- /src/plat/imx6/overlay-wandq.dts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | / { 8 | chosen { 9 | seL4,elfloader-devices = 10 | "serial0", 11 | &{/soc/aips-bus@2000000/src@20d8000}; 12 | 13 | seL4,kernel-devices = 14 | "serial0", 15 | &{/soc/interrupt-controller@a01000}, 16 | &{/soc/l2-cache@a02000}, 17 | &{/soc/timer@a00600}; 18 | }; 19 | /* Upstream bug: the memory node doesn't have a device_type, 20 | * but there is an empty memory node with a device_type. */ 21 | /delete-node/ memory; 22 | memory@10000000 { 23 | device_type = "memory"; 24 | }; 25 | }; 26 | -------------------------------------------------------------------------------- /src/plat/imx7/overlay-imx7sabre.dts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | / { 8 | chosen { 9 | seL4,elfloader-devices = 10 | "serial0"; 11 | seL4,kernel-devices = 12 | "serial0", 13 | &{/soc/interrupt-controller@31001000}, 14 | &{/timer}; 15 | }; 16 | /* Upstream bug: the memory node doesn't have a device_type, 17 | * but there is an empty memory node with a device_type. */ 18 | /delete-node/ memory; 19 | memory@80000000 { 20 | device_type = "memory"; 21 | /* seL4 only uses the first gigabyte? */ 22 | reg = < 0x80000000 0x40000000 >; 23 | }; 24 | }; 25 | -------------------------------------------------------------------------------- /src/plat/imx8m-evk/overlay-imx8m-32bit.dts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | / { 8 | 9 | /* 32-bit kernel platforms require memory to be clamped to the top of 10 | * the kernel window. 11 | */ 12 | memory@40000000 { 13 | device_type = "memory"; 14 | reg = < 0x00 0x40000000 0x00 0x1f000000 >; 15 | }; 16 | 17 | /* This device extends out of the 32-bit memory range.*/ 18 | /delete-node/gpu@38000000; 19 | }; 20 | -------------------------------------------------------------------------------- /src/plat/imx8m-evk/overlay-imx8mq-evk.dts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | / { 8 | chosen { 9 | seL4,elfloader-devices = 10 | "serial0", 11 | &{/psci}; 12 | 13 | seL4,kernel-devices = 14 | "serial0", 15 | &{/interrupt-controller@38800000}, 16 | &{/timer}; 17 | }; 18 | 19 | /* This device exists in the SOC documentation, but not in the DTS from Linux */ 20 | gpt@302e0000 { 21 | compatible = "fsl,imx8mq-gpt\0fsl,imx7d-gpt"; 22 | reg = < 0x00 0x302e0000 0x00 0x10000 >; 23 | interrupts = < 0x00 0x36 0x04 >; 24 | clocks = < 0x04 0xc5 0x04 0xc5 0x04 0xf9 >; 25 | clock-names = "ipg\0per\0osc_per"; 26 | status = "disabled"; 27 | }; 28 | 29 | }; 30 | -------------------------------------------------------------------------------- /src/plat/maaxboard/overlay-maaxboard-32bit.dts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * Copyright 2022, Capgemini Engineering 4 | * 5 | * SPDX-License-Identifier: GPL-2.0-only 6 | */ 7 | 8 | / { 9 | 10 | /* 32-bit kernel platforms require memory to be clamped to the top of 11 | * the kernel window. 12 | */ 13 | memory@40000000 { 14 | device_type = "memory"; 15 | reg = < 0x00 0x40000000 0x00 0x1f000000 >; 16 | }; 17 | 18 | /* These devices extend out of the 32-bit memory range.*/ 19 | /delete-node/gpu@38000000; 20 | /delete-node/gpu3d@38000000; 21 | }; 22 | -------------------------------------------------------------------------------- /src/plat/odroidc2/overlay-odroidc2.dts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | / { 8 | chosen { 9 | seL4,elfloader-devices = 10 | "serial0", 11 | &{/psci}; 12 | 13 | seL4,kernel-devices = 14 | "serial0", 15 | &{/soc/interrupt-controller@c4301000}, 16 | &{/timer}; 17 | }; 18 | }; 19 | -------------------------------------------------------------------------------- /src/plat/odroidc4/overlay-odroidc4.dts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | / { 8 | chosen { 9 | seL4,elfloader-devices = 10 | "serial0", 11 | &{/psci}; 12 | 13 | seL4,kernel-devices = 14 | "serial0", 15 | &{/soc/interrupt-controller@ffc01000}, 16 | &{/timer}; 17 | }; 18 | }; 19 | -------------------------------------------------------------------------------- /src/plat/omap3/machine/hardware.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014, General Dynamics C4 Systems 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | #define INTCPS_SYSCONFIG_SOFTRESET BIT(1) 19 | #define INTCPS_SYSSTATUS_RESETDONE BIT(0) 20 | 21 | BOOT_CODE void initIRQController(void) 22 | { 23 | intc->intcps_sysconfig = INTCPS_SYSCONFIG_SOFTRESET; 24 | while (!(intc->intcps_sysstatus & INTCPS_SYSSTATUS_RESETDONE)) ; 25 | } 26 | 27 | BOOT_CODE void cpu_initLocalIRQController(void) {} 28 | -------------------------------------------------------------------------------- /src/plat/omap3/overlay-omap3.dts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | / { 8 | chosen { 9 | stdout-path = "serial2"; 10 | seL4,elfloader-devices = 11 | "serial2"; 12 | seL4,kernel-devices = 13 | "serial2", 14 | &{/ocp@68000000/interrupt-controller@48200000}, 15 | &{/ocp@68000000/timer@49040000}; 16 | }; 17 | }; 18 | -------------------------------------------------------------------------------- /src/plat/polarfire/config.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2020, DornerWorks 3 | # 4 | # SPDX-License-Identifier: GPL-2.0-only 5 | # 6 | 7 | cmake_minimum_required(VERSION 3.7.2) 8 | 9 | declare_platform(polarfire KernelPlatformPolarfire PLAT_POLARFIRE KernelSel4ArchRiscV64) 10 | 11 | if(KernelPlatformPolarfire) 12 | declare_seL4_arch(riscv64) 13 | config_set(KernelRiscVPlatform RISCV_PLAT "polarfire") 14 | config_set(KernelOpenSBIPlatform OPENSBI_PLATFORM "generic") 15 | config_set(KernelPlatformFirstHartID FIRST_HART_ID 1) 16 | list(APPEND KernelDTSList "tools/dts/mpfs_icicle.dts") 17 | list(APPEND KernelDTSList "src/plat/polarfire/overlay-polarfire.dts") 18 | declare_default_headers( 19 | TIMER_FREQUENCY 10000000 PLIC_MAX_NUM_INT 186 20 | INTERRUPT_CONTROLLER drivers/irq/riscv_plic0.h 21 | ) 22 | else() 23 | unset(KernelPlatformFirstHartID CACHE) 24 | endif() 25 | -------------------------------------------------------------------------------- /src/plat/polarfire/overlay-polarfire.dts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, DornerWorks 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | / { 8 | chosen { 9 | seL4,kernel-devices = 10 | &{/soc/interrupt-controller@c000000}; 11 | }; 12 | }; 13 | -------------------------------------------------------------------------------- /src/plat/qemu-arm-virt/overlay-qemu-arm-virt.dts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | / { 8 | chosen { 9 | seL4,elfloader-devices = 10 | &{/pl011@9000000}, 11 | &{/psci}; 12 | seL4,kernel-devices = 13 | &{/pl011@9000000}, 14 | &{/intc@8000000}, 15 | &{/timer}; /* Watchdog timer */ 16 | }; 17 | 18 | }; 19 | -------------------------------------------------------------------------------- /src/plat/qemu-arm-virt/overlay-reserve-vm-memory.dts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | / { 8 | 9 | 10 | reserved-memory { 11 | #address-cells = < 0x02 >; 12 | #size-cells = < 0x02 >; 13 | ranges; 14 | 15 | vm-memory@40000000 { 16 | reg = <0x0 0x40000000 0x0 0x20000000>; 17 | no-map; 18 | }; 19 | }; 20 | 21 | 22 | }; 23 | -------------------------------------------------------------------------------- /src/plat/rockpro64/overlay-rockpro64.dts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | / { 8 | chosen { 9 | seL4,elfloader-devices = 10 | "serial2", 11 | &{/psci}; 12 | seL4,kernel-devices = 13 | "serial2", 14 | &{/interrupt-controller@fee00000}, 15 | &{/timer}; 16 | }; 17 | }; 18 | -------------------------------------------------------------------------------- /src/plat/tk1/overlay-tk1.dts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | / { 8 | chosen { 9 | seL4,elfloader-devices = 10 | "serial0"; 11 | seL4,kernel-devices = 12 | "serial0", 13 | &{/interrupt-controller@50041000}, 14 | &{/memory-controller@70019000}, /* SMMU */ 15 | &{/timer}; 16 | }; 17 | 18 | memory@80000000 { 19 | /* 1MiB carveout at 0xa7f00000 for the elfloader's monitor mode hooks */ 20 | reg = <0x0 0x80000000 0x0 0x27f00000>; 21 | }; 22 | 23 | vm-memory { 24 | /* Expose the second gigabyte of RAM as a device untyped. */ 25 | reg = <0x0 0xb0000000 0x0 0x40000000>; 26 | }; 27 | }; 28 | -------------------------------------------------------------------------------- /src/plat/tqma8xqp1gb/overlay-tqma8xqp1gb.dts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021, Breakaway Consulting Pty. Ltd. 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | / { 8 | chosen { 9 | seL4,elfloader-devices = 10 | "serial1", 11 | &{/psci}; 12 | 13 | seL4,kernel-devices = 14 | "serial1", 15 | &{/interrupt-controller@51a00000}, 16 | &{/timer}; 17 | }; 18 | 19 | /* 20 | * The GPT is not defined in the standard Linux device tree, so it is added explicitly 21 | * here, based on chipset documentation. 22 | */ 23 | gpt@0x5d140000 { 24 | compatible = "fsl,imx8mq-gpt\0fsl,imx7d-gpt"; 25 | reg = < 0x00 0x5d140000 0x00 0x10000 >; 26 | interrupts = < 0x00 0x50 0x04 >; 27 | status = "disabled"; 28 | }; 29 | reserved-memory { 30 | /* The following normal memory regions are Linux specific. */ 31 | /delete-node/ dsp@92400000; 32 | /delete-node/ linux,cma; 33 | }; 34 | }; 35 | -------------------------------------------------------------------------------- /src/plat/zynq7000/mcs-overlay-zynq7000.dts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | / { 8 | chosen { 9 | seL4,kernel-devices = 10 | "serial0", 11 | &{/amba/interrupt-controller@f8f01000}, 12 | &{/amba/cache-controller@f8f02000}, 13 | &{/amba/timer@f8f00200}; 14 | }; 15 | }; 16 | -------------------------------------------------------------------------------- /src/plat/zynq7000/overlay-zynq7000.dts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | / { 8 | chosen { 9 | seL4,elfloader-devices = 10 | "serial0", 11 | &{/amba/slcr@f8000000/rstc@200}; 12 | seL4,kernel-devices = 13 | "serial0", 14 | &{/amba/interrupt-controller@f8f01000}, 15 | &{/amba/cache-controller@f8f02000}, 16 | &{/amba/timer@f8f00600}; 17 | }; 18 | }; 19 | -------------------------------------------------------------------------------- /src/plat/zynqmp/overlay-hs-zynqmp.dts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019, DornerWorks 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | / { 8 | amba { 9 | /* bug: pcie node generates untyped objects too large for hypervisor mode */ 10 | /delete-node/ pcie@fd0e0000; 11 | }; 12 | }; 13 | -------------------------------------------------------------------------------- /src/plat/zynqmp/overlay-zynqmp.dts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | / { 8 | amba { 9 | /* These blocks remove the duplicate interrupt which causes issues 10 | * in the low-level drivers 11 | */ 12 | ethernet@ff0b0000 { 13 | interrupts = < 0x00 0x39 0x04 >; 14 | }; 15 | 16 | ethernet@ff0c0000 { 17 | interrupts = < 0x00 0x3b 0x04 >; 18 | }; 19 | 20 | ethernet@ff0d0000 { 21 | interrupts = < 0x00 0x3d 0x04 >; 22 | }; 23 | 24 | ethernet@ff0e0000 { 25 | interrupts = < 0x00 0x3f 0x04 >; 26 | }; 27 | }; 28 | 29 | chosen { 30 | seL4,elfloader-devices = 31 | "serial0", 32 | &{/psci}; 33 | seL4,kernel-devices = 34 | "serial0", 35 | &{/amba_apu@0/interrupt-controller@f9010000}, 36 | &{/timer}, 37 | &{/amba/smmu@fd800000}; 38 | }; 39 | }; 40 | -------------------------------------------------------------------------------- /src/plat/zynqmp/overlay-zynqmp32.dts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | / { 8 | amba { 9 | /* These blocks remove the duplicate interrupt which causes issues 10 | * in the low-level drivers 11 | */ 12 | ethernet@ff0b0000 { 13 | interrupts = < 0x00 0x39 0x04 >; 14 | }; 15 | 16 | ethernet@ff0c0000 { 17 | interrupts = < 0x00 0x3b 0x04 >; 18 | }; 19 | 20 | ethernet@ff0d0000 { 21 | interrupts = < 0x00 0x3d 0x04 >; 22 | }; 23 | 24 | ethernet@ff0e0000 { 25 | interrupts = < 0x00 0x3f 0x04 >; 26 | }; 27 | }; 28 | 29 | chosen { 30 | seL4,elfloader-devices = 31 | "serial0", 32 | &{/psci}; 33 | seL4,kernel-devices = 34 | "serial0", 35 | &{/amba_apu@0/interrupt-controller@f9010000}, 36 | &{/timer}; 37 | }; 38 | 39 | memory@0 { 40 | device_type = "memory"; 41 | reg = < 0x00 0x00 0x00 0x80000000 >; 42 | }; 43 | }; 44 | -------------------------------------------------------------------------------- /src/smp/lock.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-only 5 | */ 6 | 7 | #include 8 | #include 9 | 10 | #ifdef ENABLE_SMP_SUPPORT 11 | 12 | clh_lock_t big_kernel_lock ALIGN(L1_CACHE_LINE_SIZE); 13 | 14 | BOOT_CODE void clh_lock_init(void) 15 | { 16 | for (int i = 0; i < CONFIG_MAX_NUM_NODES; i++) { 17 | big_kernel_lock.node_owners[i].node = &big_kernel_lock.nodes[i]; 18 | } 19 | 20 | /* Initialize the CLH head */ 21 | big_kernel_lock.nodes[CONFIG_MAX_NUM_NODES].value = CLHState_Granted; 22 | big_kernel_lock.head = &big_kernel_lock.nodes[CONFIG_MAX_NUM_NODES]; 23 | } 24 | 25 | #endif /* ENABLE_SMP_SUPPORT */ 26 | -------------------------------------------------------------------------------- /tools/bf.vim: -------------------------------------------------------------------------------- 1 | " 2 | " Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | " 4 | " SPDX-License-Identifier: BSD-2-Clause 5 | " 6 | 7 | " Vim syntax for .bf/.pbf files. Where relevant, comments below refer to the 8 | " bitfield generator's source. 9 | 10 | syn match BFComment "\(#\( .*\)\?\|--.*\)$" 11 | syn match BFCPP "[ \t]*#[^ ].*$" 12 | 13 | " reserved_map.keys() 14 | syn keyword BFKeyword base block field field_high mask padding tag tagged_union 15 | 16 | " Tweaked t_INTLIT 17 | syn match BFLiteral "[ \t]\([1-9][0-9]*\|0[oO]\?[0-7]\+\|0[xX][0-9a-fA-F]\+\|0[bB][01]\+\|0\)[lL]\?" 18 | 19 | hi def link BFComment Comment 20 | hi def link BFCPP PreProc 21 | hi def link BFKeyword Type 22 | hi def link BFLiteral Constant 23 | -------------------------------------------------------------------------------- /tools/cpp_gen.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 4 | # 5 | # SPDX-License-Identifier: BSD-2-Clause 6 | # 7 | 8 | # 9 | # Concatinate files together, adding in appropriate "#line" directives. 10 | # 11 | 12 | while [ $# -ge 1 ]; do 13 | echo "#line 1 \"$1\"" 14 | cat "$1" 15 | shift 16 | done 17 | 18 | -------------------------------------------------------------------------------- /tools/flags.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | # 4 | # SPDX-License-Identifier: GPL-2.0-only 5 | # 6 | 7 | cmake_minimum_required(VERSION 3.7.2) 8 | 9 | # Set the cmake compilation flags with kernel base flags 10 | # This allows, for example, user compilation to ensure they are building for the same 11 | # architecture / cpu as the kernel was compiled for 12 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${BASE_C_FLAGS}") 13 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${BASE_CXX_FLAGS}") 14 | set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} ${BASE_ASM_FLAGS}") 15 | set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${BASE_EXE_LINKER_FLAGS}") 16 | -------------------------------------------------------------------------------- /tools/hardware/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | # 4 | # SPDX-License-Identifier: GPL-2.0-only 5 | # 6 | -------------------------------------------------------------------------------- /tools/hardware/outputs/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | # 4 | # SPDX-License-Identifier: GPL-2.0-only 5 | # 6 | -------------------------------------------------------------------------------- /tools/hardware/utils/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | # 4 | # SPDX-License-Identifier: GPL-2.0-only 5 | # 6 | 7 | 8 | def align_up(num, bits): 9 | ''' align a number up to a bit-boundary ''' 10 | boundary = 1 << bits 11 | return (num + (boundary - 1)) & ~(boundary - 1) 12 | 13 | 14 | def align_down(num, bits): 15 | ''' align a number down to a bit-boundary ''' 16 | boundary = 1 << bits 17 | return num & ~(boundary - 1) 18 | -------------------------------------------------------------------------------- /tools/hardware/utils/cpu.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | # 4 | # SPDX-License-Identifier: GPL-2.0-only 5 | # 6 | 7 | from typing import List 8 | 9 | from hardware.device import WrappedNode 10 | from hardware.fdt import FdtParser 11 | 12 | # documentation for CPU bindings: 13 | # https://www.kernel.org/doc/Documentation/devicetree/bindings/arm/cpus.yaml 14 | 15 | 16 | def get_cpus(tree: FdtParser) -> List[WrappedNode]: 17 | ' Return a list of all the CPUs described in this device tree. ' 18 | cpus_node = tree.get_path('/cpus') 19 | 20 | found_cpus = [] 21 | for node in cpus_node: 22 | if node.has_prop('device_type') and node.get_prop('device_type').strings[0] == 'cpu': 23 | found_cpus.append(node) 24 | 25 | return found_cpus 26 | -------------------------------------------------------------------------------- /tools/kernel_pylint.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 4 | # 5 | # SPDX-License-Identifier: BSD-2-Clause 6 | # 7 | 8 | python_sources=$(find ../tools ../manual/tools ../libsel4/tools -name '*.py') 9 | if [ -z "$python_sources" ]; then 10 | echo "Unable to find python source files" 11 | exit 1 12 | fi 13 | pylintrc=$(find . -name 'pylintrc') 14 | if [ -z "$pylintrc" ]; then 15 | echo "Unable to find pylintrc" 16 | exit 1 17 | fi 18 | 19 | pylint --errors-only --rcfile=${pylintrc} ${python_sources} 20 | -------------------------------------------------------------------------------- /tools/kernel_xmllint.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 4 | # 5 | # SPDX-License-Identifier: BSD-2-Clause 6 | # 7 | 8 | xml_sources=$(find ../libsel4/arch_include/*/interfaces ../libsel4/sel4_arch_include/*/interfaces -name 'sel4arch.xml') 9 | if [ -z "$xml_sources" ]; then 10 | echo "Unable to find sel4arch.xml files" 11 | exit 1 12 | fi 13 | 14 | idl_source=$(find ../libsel4/tools -name 'sel4_idl.dtd') 15 | if [ -z "$idl_source" ]; then 16 | echo "Unable to find sel4_idl.dtd" 17 | exit 1 18 | fi 19 | 20 | xmllint --dtdvalid ${idl_source} --noout ${xml_sources} 21 | -------------------------------------------------------------------------------- /tools/pylintrc: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | [MASTER] 8 | extension-pkg-whitelist=lxml 9 | -------------------------------------------------------------------------------- /tools/python-deps/README.rst: -------------------------------------------------------------------------------- 1 | .. 2 | .. Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 | .. 4 | .. SPDX-License-Identifier: GPL-2.0-only 5 | .. 6 | 7 | seL4 Python Dependency Metapackage 8 | ################################## 9 | 10 | An empty package depending on all the python packages required to build the seL4 11 | microkernel, its manual, and proofs. 12 | -------------------------------------------------------------------------------- /tools/xmllint.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 4 | # 5 | # SPDX-License-Identifier: BSD-2-Clause 6 | # 7 | 8 | if [ 0$V -ge 3 ]; then 9 | set -x 10 | fi 11 | 12 | set -e 13 | 14 | xmllint "$@" 2> >(grep -v --regexp='validates$' 1>&2) 15 | --------------------------------------------------------------------------------