feat(kernel): SystemControl cap for halt, board device table + boot caps to init, RegionAddress syscall, idle loop services irqs
This commit is contained in:
@@ -30,6 +30,11 @@ impl IrqRoutingTable {
|
||||
}
|
||||
}
|
||||
|
||||
/// Whether `irq` is a line this table can route.
|
||||
pub fn is_valid(&self, irq: IrqId) -> bool {
|
||||
(irq.raw() as usize) < MAX_IRQS
|
||||
}
|
||||
|
||||
/// Routes `irq`, replacing any previous route. Fails for lines beyond
|
||||
/// the table.
|
||||
pub fn set(&mut self, irq: IrqId, route: IrqRoute) -> bool {
|
||||
|
||||
@@ -8,4 +8,6 @@ pub enum Resource {
|
||||
Process(ProcessId),
|
||||
Interrupt(IrqId),
|
||||
ProcessCreate,
|
||||
/// Machine-wide controls such as halting; given only to init at boot.
|
||||
SystemControl,
|
||||
}
|
||||
|
||||
@@ -84,6 +84,11 @@ pub enum Syscall {
|
||||
va: VirtualAddress,
|
||||
perms: PagePerms,
|
||||
},
|
||||
/// The physical base of the region named by `region`, so a driver can
|
||||
/// point a device's DMA at memory it has mapped.
|
||||
RegionAddress {
|
||||
region: CapSlot,
|
||||
},
|
||||
/// Removes a capability from the caller's own table.
|
||||
DropCap {
|
||||
slot: CapSlot,
|
||||
@@ -104,7 +109,10 @@ pub enum Syscall {
|
||||
GetProcessId,
|
||||
Yield,
|
||||
Exit,
|
||||
Halt,
|
||||
/// Stops the machine; needs a SystemControl capability.
|
||||
Halt {
|
||||
control: CapSlot,
|
||||
},
|
||||
CreateEndpoint,
|
||||
DebugPutchar {
|
||||
byte: u8,
|
||||
|
||||
Reference in New Issue
Block a user