Commit graph

262 commits

Author SHA1 Message Date
Julia Vassiliki
90b5159800 debug: add get thread affinity syscall
This is useful for sel4test et al for testing that a certain
PD has been succesfully migrated between cores, or that it
is running on a particular core.

Signed-off-by: Julia Vassiliki <julia.vassiliki@unsw.edu.au>
2026-06-22 18:06:26 +10:00
Julia Vassiliki
4ee903cf50 syscall xml: only define DebugSendIPI when SMP
The actual libsel4 wrappers and kernel code only ever exists
when CONFIG_ENABLE_SMP_SUPPORT exists, so there's no point
also defining the syscall code as well.

Signed-off-by: Julia Vassiliki <julia.vassiliki@unsw.edu.au>
2026-06-22 18:06:26 +10:00
Indan Zupancic
27a52ddd4c Runtime Domain Schedules
Implementation of RFC-20.

Signed-off-by: Indan Zupancic <indan@nul.nu>
2026-03-24 15:03:39 +11:00
Julia Vassiliki
b5cc70d753 libsel4: make thread-local ipc buffer optional
At the moment, the seL4 microkit does not setup TLS variable
support. The workaround has been to `#define __thread` (blank)
before including `<sel4/sel4.h>` in `<microkit.h>`, which causes
issues if `<microkit.h>` is included *after* `<sel4/sel4.h>`,
often with obscure linker errors to `__emutls_**` symbols.

Instead we add a libsel4 config option that allows us to build
it with __thread copied out. We introduce an LIBSEL4_THREAD_LOCAL
macro in a similar way to the existing LIBSEL4_INLINE macro.

Signed-off-by: Julia Vassiliki <julia.vassiliki@unsw.edu.au>
2026-02-25 11:46:23 +00:00
Julia Vassiliki
c55f50b6e5 manual: correct alignment of IPC buffer
Not all platforms are 512-byte aligned. Specifically, 64-bit
platforms are 1024-byte byte aligned.

Signed-off-by: Julia Vassiliki <julia.vassiliki@unsw.edu.au>
2026-01-30 12:13:59 +00:00
Bill Nguyen
704f80b9be libsel4: fix incorrect seL4_VMEnter() description
SEL4_VMENTER_CALL_CONTROL_ENTRY_MR refers to the
VM Entry Interruption-Information Field of the VMCS [1].
Not the VM-Entry Controls, which are two different things.

[1]: src/arch/x86/object/vcpu.c: vcpu_update_state_sysvmenter()

Signed-off-by: Bill Nguyen <bill.nguyen@student.unsw.edu.au>
2025-12-08 23:09:51 +00:00
julia
09e6c3f5e2 debug: invalidate ksKernelEntry on kernel exit
There's a few cases in the kernel where the ksKernelEntry tracking
is not perfect, such as in SError reporting, and (I believe) a few
other places which I haven't tracked down to a cause - but some of
e.g. the RISC-V trap code where the first entry faults and the 2nd
proceeds can report stale information.

In these cases, the kernel says that the entry was via a certain
syscall or interrupt (etc), even though that was clearly not the
case because we know the kernel exited. Now we will print out this:

    halting...
    Kernel entry via Unknown (0)

The changes:

- When exiting the kernel, via `c_exit_hook()`, reset
  `ksKernelEntry.path` to "Unknown".

  An alternative here would have been add a global "valid" boolean
  to the kernel state, but this requires modifying every site where
  we set the ksKernelEntry.path to also set valid = true, which is
  ugly.

- Remove Entry_UnimplementedDevice from entry_type_t as it is never
  used, to leave enough room to add Entry_Unknown.

- Switch out the CONFIG_DEBUG_BUILD || BENCHMARK TRACK ENTRIES #if
  in the x86 breakpoint code with the more concise
  `TRACK_KERNEL_ENTRIES` define used elsewhere.

Signed-off-by: julia <git.ts@trainwit.ch>
2025-08-20 15:57:58 +01:00
Indan Zupancic
1415cac443 Add seL4_TCB_SetFlags Syscall
Add flags to tcb_t and the seL4_TCBFlag_fpuDisabled flag.

Enums are signed, make TCB flags word_t to make it unsigned.

Signed-off-by: Indan Zupancic <indan@nul.nu>
Signed-off-by: Corey Lewis <corey.lewis@proofcraft.systems>
2025-07-24 16:44:08 +10:00
Kent McLeod
34725d060b arm: Add new APIs for generating SGIs
Allow SGIs to be generated from non-SMP kernels.

Signed-off-by: Kent McLeod <kent@kry10.com>
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2025-07-07 08:50:47 +10:00
julia
eca86cff19 treewide: typo fixes
Signed-off-by: julia <git.ts@trainwit.ch>
2025-04-14 12:05:16 +10:00
Alwin Joshy
1253115999 hw debug api: aarch64 port
Adding support for the hardware debug API to
aarch64.

Signed-off-by: Alwin Joshy <joshyalwin@gmail.com>
2024-07-18 16:09:52 +10:00
Nick Spinale
a3f6be3c7c libsel4: add links in place of renamed XML files
This commit's parent renames the interface XML files.

The symlinks added in this commit serve to ease the transition to the
new names for downstream projects.

These links are added:

- include/interfaces/{sel4.xml -> object-api.xml}
- arch_include/*/interfaces/{sel4arch.xml -> object-api-arch.xml}
- sel4_arch_include/*/interfaces/{
    sel4arch.xml -> object-api-sel4-arch.xml
  }

Signed-off-by: Nick Spinale <nick@nickspinale.com>
2024-06-30 18:28:12 +10:00
Nick Spinale
dbd6efc507 libsel4: rename interface XML files
Before, some object API XML files conflicted when the include,
arch_include, and sel4_arch_include directories were combined:

- include/interfaces/sel4.xml
- arch_include/*/interfaces/sel4arch.xml
- sel4_arch_include/*/interfaces/sel4arch.xml

This commit renames them to:

- include/interfaces/object-api.xml
- arch_include/*/interfaces/object-api-arch.xml
- sel4_arch_include/*/interfaces/object-api-sel4-arch.xml

Now, when the include, arch_include, and sel4_arch_include directories
are combined, we are left with:

- interfaces/object-api.xml
- interfaces/object-api-arch.xml
- interfaces/object-api-sel4-arch.xml

Signed-off-by: Nick Spinale <nick@nickspinale.com>
2024-06-30 18:28:12 +10:00
hexcoder
15fa2cf9c2 manual: typos and style/grammar corrections
Co-authored-by: Gerwin Klein <gerwin.klein@proofcraft.systems>

Signed-off-by: hexcoder <heiko@hexco.de>
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2024-06-17 19:24:20 +10:00
Axel Heider
a58480425c make SMP conditional check more general
Check for CONFIG_ENABLE_SMP_SUPPORT instead of checking for the
number in CONFIG_MAX_NUM_NODES. This allows enabling SMP support
with just one node also.

Signed-off-by: Axel Heider <axel.heider@codasip.com>
2024-04-11 09:20:00 +01:00
Birgit Brecknell
43690234f1 fix white spaces in <docref> tags
Signed-off-by: Birgit Brecknell <bbrcknl@gmail.com>
2024-03-22 09:02:23 +00:00
Birgit Brecknell
31e82e81da wrap docref references in <docref> tag
Signed-off-by: Birgit Brecknell <bbrcknl@gmail.com>
2024-03-22 09:02:23 +00:00
Birgit Brecknell
f6656e2c78 Add a glossary to the manual
Add a glossary with seL4-specific terms and their
definitions.
Remove chapter number from bibliography
Tweak Makefile for glossary

Signed-off-by: Birgit Brecknell <bbrcknl@gmail.com>
2024-03-20 14:54:06 +11:00
Nick Spinale
9bac64c6ce libsel4: Eliminate unnamed enums
Signed-off-by: Nick Spinale <nick@nickspinale.com>
2024-02-08 15:34:14 +11:00
bbrcknl
cbf25791b7
make method names consistent (#1144)
* make method names consistent; delete duplicates

Signed-off-by: Birg <bbrcknl@github.com>
2024-01-19 14:25:02 +11:00
Birg
9a532efc15 change CPTR to CPtr
Signed-off-by: Birg <bbrcknl@github.com>
2023-12-06 10:41:28 +00:00
Birg
391bfb15f8 update some manual todos
Signed-off-by: Birg <bbrcknl@github.com>
2023-11-29 10:21:32 +00:00
Axel Heider
7d93471e9c debug: use c99 standard instead of gcc extensions
Signed-off-by: Axel Heider <axelheider@gmx.de>
2023-11-16 12:09:52 +00:00
Gerwin Klein
355f9abc15
sel4.xml: mark Set Space as MCS in the manual
Disambiguate (for the reader) between normal and mcs versions of
SetSpace in the manual. This does not yet solve doxygen confusion.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-11-07 16:13:28 +11:00
Alex Pavey
e62bc9bba3 smc_cap: Add SMC Capability with Call method
See PR at https://github.com/seL4/seL4/pull/701

Signed-off-by: Robbie VanVossen <robert.vanvossen@dornerworks.com>
2023-08-27 11:44:51 +10:00
Axel Heider
b8c0b1cb02 boot: introduce seL4_BootInfoFrameSize
Provide seL4_BootInfoFrameSize (and seL4_BootInfoFrameBits) for
userland, to there is no longer a need to hard-code the 4 KiByte
assumption.

Signed-off-by: Axel Heider <axelheider@gmx.de>
2023-08-23 15:10:32 +02:00
Robbie VanVossen
e25d9c90e1 libsel4: Make bootinfo consistent
Some slot positions in the rootnode would depend on configuration.
However that makes it difficult to add new root caps, especially if
multiple caps only exist based on configuration. Make all caps always
there, but null if not configured.

Signed-off-by: Robbie VanVossen <robert.vanvossen@dornerworks.com>
2023-08-12 14:41:52 +10:00
Gerwin Klein
35c41a822f macros: avoid breaking C subset
__builtin_offsetof is not part of the verification C subset -- avoid
accidental use by not declaring a macro for it and filter out the
single use by explicitly marking it as invisible to verification.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-05-31 14:55:57 +10:00
Axel Heider
4d1da1002b libsel4: use sel4/config.h instead of autoconf.h
Make sel4/config.h the only file to eventually include autoconf.h

Signed-off-by: Axel Heider <axelheider@gmx.de>
2023-04-24 23:02:12 +10:00
Axel Heider
675604e3b6 add compile assert for seL4_UntypedDesc size
This header file is shared by kernel and userland. We can control the
kernel compiler setting, but userland might use an arbitrary setup.
Put a safeguard in place that things works as expected.

Signed-off-by: Axel Heider <axelheider@gmx.de>
2023-03-28 13:34:35 +11:00
Gerwin Klein
ecbeacb3ab constants.h: explain seL4_CoreSchedContextBytes
The "excluding extra refills" was confusing. seL4_CoreSchedContextBytes
is the size of sched_context_t + minimum refills, excluding any extra
refills.

We'd write it that way, but sched_context_t is not in scope in this
file.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-03-06 21:54:08 +11:00
Michael McInerney
bb6a00ffe2 mcs: correct MinSchedContextBits
This also adds a compile assert for checking that MinSchedContextBits
is the correct size in relation to seL4_CoreSchedContextBytes.

Signed-off-by: Michael McInerney <michael.mcinerney@proofcraft.systems>
2022-11-04 13:39:02 +11:00
Axel Heider
6e1bb9d2a8 cleanup deprecated.h header files
Add a comment that they are empty on purpose. They are not removed to
keep the infrastructure in case there will be deprecated items in the
future.

Signed-off-by: Axel Heider <axelheider@gmx.de>
2022-10-04 10:48:50 +11:00
Axel Heider
481ce9d5ed remove deprecated header files
Signed-off-by: Axel Heider <axelheider@gmx.de>
2022-10-04 10:48:50 +11:00
Ivan Velickovic
8fad907adc docs: clarify arch_flags in TCB register syscalls
For writing/reading/copying TCB registers, the
arch_flags parameter is not used on RISC-V (in
addition to x86 and ARM).

Signed-off-by: Ivan Velickovic <i.velickovic@unsw.edu.au>
2022-05-19 19:09:47 +10:00
matt rice
97610e1249 xml: remove condition attribute
Signed-off-by: matt rice <ratmice@gmail.com>
2022-03-22 18:33:38 +11:00
matt rice
accccf3dbb add condition elem, test it against condition attr
Signed-off-by: matt rice <ratmice@gmail.com>
2022-03-22 18:33:38 +11:00
matt rice
6bc6b31816 add optional condition element to xsd
The condition element currently exists parallel
to the condition attribute.  The condition attribute
should be removed in a subsequent patch.

Signed-off-by: matt rice <ratmice@gmail.com>
2022-03-22 18:33:38 +11:00
Axel Heider
0218cf086d simplify macro seL4_CompileTimeAssert()
Signed-off-by: Axel Heider <axelheider@gmx.de>
2022-01-24 22:24:03 +11:00
Axel Heider
649b63d32f align conditional syntax in xml
Use the same style everywhere to simplify parsing.

Signed-off-by: Axel Heider <axelheider@gmx.de>
2022-01-19 09:32:01 +11:00
Gerwin Klein
0cd8906dd7
keep seL4_Word for seL4_BootInfoID (#739)
This reverts a small part of 1596aa5857 which unexpectedly broke the
binary verification frontend, because the verification tool chain
forces the enum to `int` instead of `long`.

See also seL4 issue #738 -- when that issue is solved, we may be
able to go back to the more specific type.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2022-01-08 09:24:28 +11:00
Axel Heider
1596aa5857
use enum for SEL4_BOOTINFO_HEADER_xxx (#724)
* use enum for SEL4_BOOTINFO_HEADER_xxx

Also add more comments and use seL4_BootInfoID in seL4_BootInfoHeader.

Signed-off-by: Axel Heider <axelheider@gmx.de>
2022-01-06 08:45:47 +11:00
Kent McLeod
ac32eba15d Remove userError from seL4_ReplyRecv path
Remove a userError that is present on mainline kernel but not on MCS.

seL4_ReplyRecv is often used in a loop to create an event handler. When
first entering this loop, or when handling signals from notifications,
there won't already be a pending caller blocked on the reply object. In
this case the kernel doesn't perform a reply transfer and continues with
the receive operation. This is a common operation and shouldn't result
in a userError being printed by the kernel each time the reply phase
ends up as a no-op.

Signed-off-by: Kent McLeod <kent@kry10.com>
2021-11-30 15:24:15 +11:00
Axel Heider
d278b68ee2 align include guards for seL4_DebugSendIPI()
Align the API wrapper guards with the kernel syscall implementation,
the function is available if CONFIG_ENABLE_SMP_SUPPORT is set instead
of depending on CONFIG_MAX_NUM_NODES.

Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-11-30 10:02:54 +11:00
Gerwin Klein
51d3b824b8 manual: fix explanation of CNode_Mutate
Mutate cannot be used to badge endpoints (many years ago, before the
first public release, this was possible, but was removed).

Also explain why Mutate is not always replaceable with Mint+Delete.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2021-10-19 15:50:47 +11:00
Gerwin Klein
526206aabe libsel4 idl: error conditions of SchedContext bind
Add error conditions for the lazy bind of SchedContexts to
notifications or TCBs (introduced in e18e32e28e).

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2021-10-18 18:08:32 +11:00
Jimmy Brush
45344a9503 libsel4: idl: Fix more punctuation in errors
Signed-off-by: Jimmy Brush <code@jimmah.com>
2021-10-17 15:02:45 +11:00
Jimmy Brush
062eb3cb45 libsel4: idl: Fix punctuation in errors
Signed-off-by: Jimmy Brush <code@jimmah.com>
2021-10-17 15:02:45 +11:00
Jimmy Brush
33212ab556 libsel4: idl: Fix incorrect errors
Signed-off-by: Jimmy Brush <code@jimmah.com>
2021-10-17 15:02:45 +11:00
Jimmy Brush
73180e0e8d libsel4: Document errors in IDL
Also, remove any detailed discussion of error codes from method
descriptions.

Fixes #499

Signed-off-by: Jimmy Brush <code@jimmah.com>
2021-10-17 15:02:45 +11:00