Skip to content
Snippets Groups Projects
Commit 25155caf authored by Thomas Sewell's avatar Thomas Sewell
Browse files

haskell: Add assertion about IRQ handler cap.

Once again, we know in the abstract invariants that these must be
async endpoint caps or null caps, but this is only knowable in
haskell by asserting it.
parent 9001e413
No related branches found
No related tags found
No related merge requests found
......@@ -131,6 +131,9 @@ When the last IRQ handler capability for a given IRQ is deleted, the capability
> deletingIRQHandler :: IRQ -> Kernel ()
> deletingIRQHandler irq = do
> slot <- getIRQSlot irq
> cap <- getSlotCap slot
> assert (isAsyncEndpointCap cap || isNullCap cap)
> "Cap in IRQ handler slot should be AsyncEP or Null."
> cteDeleteOne slot
> deletedIRQHandler :: IRQ -> Kernel ()
......
......@@ -101,6 +101,10 @@ This is the type used to represent a capability.
> isUntypedCap (UntypedCap {}) = True
> isUntypedCap _ = False
> isAsyncEndpointCap :: Capability -> Bool
> isAsyncEndpointCap (AsyncEndpointCap {}) = True
> isAsyncEndpointCap _ = False
\subsection{Kernel Objects}
When stored in the physical memory model (described in \autoref{sec:model.pspace}), kernel objects must be encapsulated in "KernelObject", so the stored type is independent of the real type of the object.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment