Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Protection Domain Declarations

ProtectionDomainDecl ::= 'ProtectionDomain' ident '(' priority (',' irq?)? (',' budget?)? (',' period?)? ')' ';'
priority             ::= integer_literal       // 0 ≤ p ≤ 254, enforced
irq                  ::= integer_literal       // fits u16; range not enforced
budget               ::= integer_literal       // microseconds, default 1000
period               ::= integer_literal       // microseconds, default = budget

A protection-domain declaration introduces one named seL4 Microkit protection domain (PD): an isolated thread of execution with its own address space, scheduling parameters, and (optionally) one IRQ binding. Each ProtectionDomain listed in a .fis system file pairs with one .fi program file, <name>.fi beside the .fis.

Fields

  • Name — snake_case identifier. The matching <name>.fi file holds the PD’s mappings, events, and processes.
  • Priority — required, range 0..=254 (it is read as a u8 below 255). Out-of-range values are rejected with a parse-time error. Higher numbers run first under the Microkit fixed-priority scheduler.
  • IRQ — optional; any value fitting a u16 parses (no range check is enforced by the compiler — pick a number the target board’s IRQ controller actually has), but one IRQ may be claimed by only one PD. When present, the PD is wired to receive that hardware interrupt on the reserved irq channel and can observe it via irq?N / irq!N events.
  • Budget — optional, microseconds; defaults to 1000. Microkit schedules the PD for at most budget microseconds out of every period.
  • Period — optional, microseconds; defaults to whatever budget was set to. Setting period > budget produces a sub-rate scheduling policy.

The trailing fields are positional, and any of them may be left empty to set a later one: ProtectionDomain pd(100, , 500); sets the budget with no IRQ, and ProtectionDomain pd(100, , , 2000); the period alone.

Validation

  • priority must be in 0..=254.
  • A PD name is unique within the system file; a second declaration is an error at the later one.
  • An IRQ number belongs to one PD.
  • A PD that is referenced from a Channel or from the System = composition must be declared.
  • A PD without a <name>.fi beside the .fis is an error when the project is loaded, not when the .fis is parsed. A .fi that no PD names is only a warning, and the file is never opened.

Examples

// Three PDs with distinct priorities; IRQ on the outer driver only.
ProtectionDomain eth_outer(99, 159);
ProtectionDomain dd(150);
ProtectionDomain eth_inner(199, 155);

// A simulator with a low priority and no IRQ binding.
ProtectionDomain simulate(50);

// Explicit budget / period pair (sub-rate scheduling).
ProtectionDomain monitor(120, 0, 200, 1000);  // priority 120, IRQ 0, 200 µs / 1 ms

System composition

A .fis file may hold a System = ... clause that names its PDs, joined by the interleave operator |||, the only composition. The clause is optional, and every PD it names must be declared:

System = eth_outer ||| dd ||| eth_inner ||| simulate;

The clause is checked for undeclared names only: every declared PD is built, whether or not System lists it.