Files
seL4/libsel4/arch_include/x86/interfaces/object-api-arch.xml
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

1265 lines
64 KiB
XML

<?xml version="1.0" ?>
<!--
Copyright 2020, Data61, CSIRO (ABN 41 687 119 230)
SPDX-License-Identifier: BSD-2-Clause
-->
<api name="ObjectApiX86" label_prefix="x86_">
<struct name="seL4_VCPUContext">
<member name="eax"/>
<member name="ebx"/>
<member name="ecx"/>
<member name="edx"/>
<member name="esi"/>
<member name="edi"/>
<member name="ebp"/>
<!--
The following 8 members are only conditionally selected
based on VTX configuration.
-->
<member name="r8"/>
<member name="r9"/>
<member name="r10"/>
<member name="r11"/>
<member name="r12"/>
<member name="r13"/>
<member name="r14"/>
<member name="r15"/>
</struct>
<interface name="seL4_X86_PageDirectory" manual_name="Page Directory"
cap_description="Capability to the page directory being operated on.">
<method id="X86PageDirectoryMap" name="Map">
<brief>
Map a page directory.
</brief>
<description>
<docref>See <autoref label="ch:vspace"/></docref>
</description>
<param dir="in" name="vspace" type="seL4_CPtr"
description='Capability to the VSpace which will contain the mapping'/>
<param dir="in" name="vaddr" type="seL4_Word"
description='Virtual address to map the page into.'/>
<param dir="in" name="attr" type="seL4_X86_VMAttributes">
<description>
VM attributes for the mapping. <docref>Possible values for this type are given in <autoref label='ch:vspace'/></docref>
</description>
</param>
<error name="seL4_DeleteFirst">
<description>
A mapping already exists for this level in <texttt text="vspace"/> at <texttt text="vaddr"/>.
</description>
</error>
<error name="seL4_FailedLookup">
<description>
The <texttt text="vspace"/> does not have a PDPT mapped at <texttt text="vaddr"/>.
Or, <texttt text="vspace"/> is not assigned to an ASID pool.
</description>
</error>
<error name="seL4_IllegalOperation">
<description>
The <texttt text="_service"/> is a CPtr to a capability of the wrong type.
</description>
</error>
<error name="seL4_InvalidArgument">
<description>
The <texttt text="vaddr"/> is in the kernel virtual address range.
</description>
</error>
<error name="seL4_InvalidCapability">
<description>
The <texttt text="_service"/> or <texttt text="vspace"/> is a CPtr to a capability of the wrong type.
Or, <texttt text="vspace"/> is not assigned to an ASID pool.
Or, <texttt text="_service"/> is already mapped in a VSpace.
</description>
</error>
</method>
<method id="X86PageDirectoryUnmap" name="Unmap">
<brief>
Unmap a page directory.
</brief>
<description>
<docref>See <autoref label="ch:vspace"/></docref>
</description>
<error name="seL4_IllegalOperation">
<description>
The <texttt text="_service"/> is a CPtr to a capability of the wrong type.
</description>
</error>
<error name="seL4_InvalidCapability">
<description>
The <texttt text="_service"/> is a CPtr to a capability of the wrong type.
</description>
</error>
<error name="seL4_RevokeFirst">
<description>
A copy of the <texttt text="_service"/> capability exists.
</description>
</error>
</method>
<method id="X86PageDirectoryGetStatusBits" name="GetStatusBits" manual_name="Get Status Bits">
<condition><config var="CONFIG_ARCH_IA32"/></condition>
<brief>
Retrieve the accessed and dirty bits of a page mapped into an address space.
</brief>
<description>
<docref>See <autoref label="ch:vspace"/></docref>
</description>
<return>
A <texttt text='seL4_X86_PageDirectory_GetStatusBits_t'/> structure.
</return>
<cap_param append_description='Capability to the address space to query.'/>
<param dir="in" name="vaddr" type="seL4_Word" description='Virtual address of the page to query'/>
<param dir="out" name="accessed" type="seL4_Word"/>
<param dir="out" name="dirty" type="seL4_Word"/>
<error name="seL4_IllegalOperation">
<description>
The <texttt text="_service"/> is a CPtr to a capability of the wrong type.
</description>
</error>
<error name="seL4_InvalidArgument">
<description>
The <texttt text="_service"/> does not have a mapping at <texttt text="vaddr"/>.
Or, <texttt text="vaddr"/> is in the kernel virtual address range.
</description>
</error>
<error name="seL4_InvalidCapability">
<description>
The <texttt text="_service"/> is a CPtr to a capability of the wrong type.
</description>
</error>
</method>
</interface>
<interface name="seL4_X86_PageTable" manual_name="Page Table"
cap_description="Capability to the page table being operated on.">
<method id="X86PageTableMap" name="Map" manual_label="pagetable_map">
<brief>
Map a page table into an address space.
</brief>
<description>
Takes a <texttt text='PageDirectory'/> capability as an argument,
and installs a reference to the invoked
<texttt text='PageTable'/> in a specified slot in the <texttt text="PageDirectory"/>.
</description>
<param dir="in" name="vspace" type="seL4_CPtr"
description='Capability to the VSpace which will contain the mapping'/>
<param dir="in" name="vaddr" type="seL4_Word"
description='Virtual address to map the page into.'/>
<param dir="in" name="attr" type="seL4_X86_VMAttributes">
<description>
VM attributes for the mapping. <docref>Possible values for this type are given in <autoref label='ch:vspace'/></docref>
</description>
</param>
<error name="seL4_DeleteFirst">
<description>
A mapping already exists for this level in <texttt text="vspace"/> at <texttt text="vaddr"/>.
</description>
</error>
<error name="seL4_FailedLookup">
<description>
The <texttt text="vspace"/> does not have a Page Directory mapped at <texttt text="vaddr"/>.
Or, <texttt text="vspace"/> is not assigned to an ASID pool.
</description>
</error>
<error name="seL4_IllegalOperation">
<description>
The <texttt text="_service"/> is a CPtr to a capability of the wrong type.
</description>
</error>
<error name="seL4_InvalidArgument">
<description>
The <texttt text="vaddr"/> is in the kernel virtual address range.
</description>
</error>
<error name="seL4_InvalidCapability">
<description>
The <texttt text="_service"/> or <texttt text="vspace"/> is a CPtr to a capability of the wrong type.
Or, <texttt text="vspace"/> is not assigned to an ASID pool.
Or, <texttt text="_service"/> is already mapped in a VSpace.
</description>
</error>
</method>
<method id="X86PageTableUnmap" name="Unmap" manual_label="pagetable_unmap">
<brief>
Unmap a page table from its address space and zero it out.
</brief>
<description>
Removes the reference to the invoked <texttt text="PageTable"/> from its containing
<texttt text="PageDirectory"/>.
<docref>See <autoref label="ch:vspace"/></docref>
</description>
<error name="seL4_IllegalOperation">
<description>
The <texttt text="_service"/> is a CPtr to a capability of the wrong type.
</description>
</error>
<error name="seL4_InvalidCapability">
<description>
The <texttt text="_service"/> is a CPtr to a capability of the wrong type.
</description>
</error>
<error name="seL4_RevokeFirst">
<description>
A copy of the <texttt text="_service"/> capability exists.
</description>
</error>
</method>
</interface>
<interface name="seL4_X86_IOPageTable" manual_name="I/O Page Table"
cap_description="Capability to the I/O page table being operated on.">
<method id="X86IOPageTableMap" name="Map">
<condition><config var="CONFIG_IOMMU"/></condition>
<brief>
Map an IO page table into an IOSpace.
</brief>
<description>
<docref>See <autoref label="sec:iospace"/></docref>
</description>
<param dir="in" name="iospace" type="seL4_X86_IOSpace"
description='The IOSpace to map the page table into.'/>
<param dir="in" name="ioaddr" type="seL4_Word"
description='The address to map the page table at.'/>
<error name="seL4_DeleteFirst">
<description>
All required page tables are already mapped in <texttt text="iospace"/> at <texttt text="ioaddr"/>.
</description>
</error>
<error name="seL4_FailedLookup">
<description>
The <texttt text="iospace"/> does not have a paging structure at the required level mapped at <texttt text="ioaddr"/>.
</description>
</error>
<error name="seL4_IllegalOperation">
<description>
The <texttt text="_service"/> is a CPtr to a capability of the wrong type.
</description>
</error>
<error name="seL4_InvalidCapability">
<description>
The <texttt text="_service"/> or <texttt text="iospace"/> is a CPtr to a capability of the wrong type.
Or, <texttt text="iospace"/> is not assigned to a PCI device.
Or, <texttt text="_service"/> is already mapped in an IOSpace.
</description>
</error>
</method>
<method id="X86IOPageTableUnmap" name="Unmap">
<condition><config var="CONFIG_IOMMU"/></condition>
<brief>
Unmap an IO page table from an IOSpace.
</brief>
<description>
<docref>See <autoref label="sec:iospace"/></docref>
</description>
<cap_param append_description='The page table to unmap.'/>
<error name="seL4_IllegalOperation">
<description>
The <texttt text="_service"/> is a CPtr to a capability of the wrong type.
</description>
</error>
<error name="seL4_InvalidCapability">
<description>
The <texttt text="_service"/> is a CPtr to a capability of the wrong type.
</description>
</error>
</method>
</interface>
<interface name="seL4_X86_Page" manual_name="Page" cap_description="Capability to the page being operated on.">
<method id="X86PageMap" name="Map" manual_label='page_map'>
<brief>
Map a page into an address space or update the mapping attributes.
</brief>
<description>
Takes a VSpace capability, as an
argument and installs a reference
to the given <texttt text="Page"/> in the lowest-level unmapped paging structure
corresponding to the given address, or updates the mapping attributes if the page is already mapped at this address. If the required paging structures are not present
this operation will fail, returning a seL4_FailedLookup error.
</description>
<param dir="in" name="vspace" type="seL4_CPtr"
description='Capability to the VSpace which will contain the mapping'/>
<param dir="in" name="vaddr" type="seL4_Word"
description='Virtual address to map the page into.'/>
<param dir="in" name="rights" type="seL4_CapRights_t">
<description>
Rights for the mapping. <docref>Possible values for this type are given in <autoref label='sec:cap_rights'/></docref>
</description>
</param>
<param dir="in" name="attr" type="seL4_X86_VMAttributes">
<description>
VM attributes for the mapping. <docref>Possible values for this type are given in <autoref label='ch:vspace'/></docref>
</description>
</param>
<error name="seL4_AlignmentError">
<description>
The <texttt text="vaddr"/> is not aligned to the page size of <texttt text="_service"/>.
</description>
</error>
<error name="seL4_DeleteFirst">
<description>
A mapping already exists in <texttt text="vspace"/> at <texttt text="vaddr"/>.
</description>
</error>
<error name="seL4_FailedLookup">
<description>
The <texttt text="vspace"/> does not have a paging structure at the required level mapped at <texttt text="vaddr"/>.
Or, <texttt text="vspace"/> is not assigned to an ASID pool.
</description>
</error>
<error name="seL4_IllegalOperation">
<description>
The <texttt text="_service"/> is a CPtr to a capability of the wrong type.
Or, <texttt text="_service"/> is already mapped in an IOSpace.
</description>
</error>
<error name="seL4_InvalidArgument">
<description>
The <texttt text="_service"/> is already mapped in <texttt text="vspace"/> at a different virtual address.
Or, <texttt text="vaddr"/> is in the kernel virtual address range.
</description>
</error>
<error name="seL4_InvalidCapability">
<description>
The <texttt text="_service"/> or <texttt text="vspace"/> is a CPtr to a capability of the wrong type.
Or, <texttt text="vspace"/> is not assigned to an ASID pool.
Or, <texttt text="_service"/> is already mapped in a different VSpace.
</description>
</error>
</method>
<method id="X86PageUnmap" name="Unmap" manual_label='page_unmap'>
<brief>
Unmap a page.
</brief>
<description>
Removes an existing mapping.
</description>
<error name="seL4_IllegalOperation">
<description>
The <texttt text="_service"/> is a CPtr to a capability of the wrong type.
</description>
</error>
<error name="seL4_InvalidCapability">
<description>
The <texttt text="_service"/> is a CPtr to a capability of the wrong type.
</description>
</error>
</method>
<method id="X86PageMapIO" name="MapIO" manual_name="Map I/O" manual_label='page_map_io'>
<condition><config var="CONFIG_IOMMU"/></condition>
<brief>
Map a page into an IOSpace.
</brief>
<description>
<docref>See <autoref label="ch:vspace"/></docref>
</description>
<param dir="in" name="iospace" type="seL4_X86_IOSpace"
description='The IOSpace that the frame is being mapped into'/>
<param dir="in" name="rights" type="seL4_CapRights_t">
<description>
Rights for the mapping. <docref>Possible values for this type are given in <autoref label='sec:cap_rights'/></docref>
</description>
</param>
<param dir="in" name="ioaddr" type="seL4_Word"
description='The address that the frame is being mapped at.'/>
<error name="seL4_DeleteFirst">
<description>
A mapping already exists in <texttt text="iospace"/> at <texttt text="ioaddr"/>.
</description>
</error>
<error name="seL4_FailedLookup">
<description>
The <texttt text="iospace"/> does not have a sufficient number of IO Page Tables mapped at <texttt text="ioaddr"/>.
</description>
</error>
<error name="seL4_IllegalOperation">
<description>
The <texttt text="_service"/> is a CPtr to a capability of the wrong type.
</description>
</error>
<error name="seL4_InvalidArgument">
<description>
No rights were specified in <texttt text="rights"/>.
Or, the rights in the <texttt text="_service"/> capability do not include <texttt text="rights"/>.
</description>
</error>
<error name="seL4_InvalidCapability">
<description>
The <texttt text="_service"/> or <texttt text="iospace"/> is a CPtr to a capability of the wrong type.
Or, <texttt text="_service"/> is already mapped.
Or, <texttt text="_service"/> is not a page of size 4 KiB.
Or, <texttt text="iospace"/> is not assigned to a PCI device.
</description>
</error>
</method>
<method id="X86PageGetAddress" name="GetAddress" manual_name="Get Address"
manual_label='page_getaddress'>
<brief>
Get the physical address of the underlying frame.
</brief>
<description>
<docref>See <autoref label="ch:vspace"/></docref>
</description>
<return>
A <texttt text='seL4_IA32_Page_GetAddress_t'/> struct that contains a
<texttt text='seL4_Word paddr'/>, which holds the physical address of the page,
and <texttt text='int error'/>. <docref>See <autoref label='sec:errors'/> for a description
of the message register and tag contents upon error.</docref>
</return>
<param dir="out" name="paddr" type="seL4_Word"/>
<error name="seL4_IllegalOperation">
<description>
The <texttt text="_service"/> is a CPtr to a capability of the wrong type.
</description>
</error>
<error name="seL4_InvalidCapability">
<description>
The <texttt text="_service"/> is a CPtr to a capability of the wrong type.
</description>
</error>
</method>
<method id="X86PageMapEPT" name="MapEPT" manual_name="Map EPT">
<condition><config var="CONFIG_VTX"/></condition>
<brief>
Map an extended page table.
</brief>
<description>
<docref>See <autoref label="ch:vspace"/></docref>
</description>
<param dir="in" name="vspace" type="seL4_X86_EPTPML4" description="Capability to the VSpace which will
contain the mapping"/>
<param dir="in" name="vaddr" type="seL4_Word" description="Virtual address at which to map page."/>
<param dir="in" name="rights" type="seL4_CapRights_t">
<description>
Rights for the mapping. <docref>Possible values for this type are given in <autoref label='sec:cap_rights'/>.</docref>
</description>
</param>
<param dir="in" name="attr" type="seL4_X86_VMAttributes">
<description>
VM attributes for the mapping.<docref> Possible values for this type are given in <autoref label='ch:vspace'/>.</docref>
</description>
</param>
<error name="seL4_AlignmentError">
<description>
The <texttt text="vaddr"/> is not aligned to the page size of <texttt text="_service"/>.
</description>
</error>
<error name="seL4_DeleteFirst">
<description>
A mapping already exists in <texttt text="vspace"/> at <texttt text="vaddr"/>.
</description>
</error>
<error name="seL4_FailedLookup">
<description>
The <texttt text="vspace"/> does not have a paging structure at the required level mapped at <texttt text="vaddr"/>.
Or, <texttt text="vspace"/> is not assigned to an ASID pool.
</description>
</error>
<error name="seL4_IllegalOperation">
<description>
The <texttt text="_service"/> is a CPtr to a capability of the wrong type.
</description>
</error>
<error name="seL4_InvalidCapability">
<description>
The <texttt text="_service"/> or <texttt text="vspace"/> is a CPtr to a capability of the wrong type.
Or, <texttt text="vspace"/> is not assigned to an ASID pool.
Or, <texttt text="_service"/> is already mapped.
Or, <texttt text="_service"/> has an unsupported page size.
</description>
</error>
</method>
</interface>
<interface name="seL4_X86_ASIDControl" manual_name="ASID Control">
<method id="X86ASIDControlMakePool" name="MakePool" manual_name="Make Pool"
manual_label='ASID_controlmakepool'>
<brief>
Create an X86 ASID pool.
</brief>
<description>
Together with a capability to <texttt text="Untyped Memory"/>, which is passed as an argument,
create an <texttt text="ASID Pool"/>. The untyped capability must represent a
4K memory object. This will create an ASID pool with enough space for 1024 VSpaces.
</description>
<cap_param append_description='The master ASIDControl capability.'/>
<param dir="in" name="untyped" type="seL4_Untyped"
description='Capability to an untyped memory object that will become the pool. Must be 4K bytes.'/>
<param dir="in" name="root" type="seL4_CNode"
description='CPtr to the CNode that forms the root of the destination CSpace. Must be at a depth equivalent to the wordsize.'/>
<param dir="in" name="index" type="seL4_Word"
description='CPtr to the destination slot. Resolved from the root of the destination CSpace.'/>
<param dir="in" name="depth" type="seL4_Uint8"
description='Number of bits of index to resolve to find the destination slot.'/>
<error name="seL4_DeleteFirst">
<description>
The destination slot contains a capability.
Or, there are no more ASID pools available.
</description>
</error>
<error name="seL4_FailedLookup">
<description>
The <texttt text="index"/> or <texttt text="depth"/> is invalid <docref>(see <autoref label="s:cspace-addressing"/>)</docref>.
Or, <texttt text="root"/> is a CPtr to a capability of the wrong type.
</description>
</error>
<error name="seL4_IllegalOperation">
<description>
The <texttt text="_service"/> is a CPtr to a capability of the wrong type.
</description>
</error>
<error name="seL4_InvalidCapability">
<description>
The <texttt text="_service"/> or <texttt text="untyped"/> is a CPtr to a capability of the wrong type.
Or, <texttt text="untyped"/> is not the exact size of an ASID pool object.
Or, <texttt text="untyped"/> is a device untyped <docref>(see <autoref label="sec:kernmemalloc"/>)</docref>.
</description>
</error>
<error name="seL4_RangeError">
<description>
The <texttt text="depth"/> is invalid <docref>(see <autoref label="s:cspace-addressing"/>)</docref>.
</description>
</error>
<error name="seL4_RevokeFirst">
<description>
The <texttt text="untyped"/> has been used to retype an object.
Or, a copy of the <texttt text="untyped"/> capability exists.
</description>
</error>
</method>
</interface>
<interface name="seL4_X86_ASIDPool" manual_name="ASID Pool">
<method id="X86ASIDPoolAssign" name="Assign" manual_label='asidpool_assign'>
<brief>
Assign an ASID pool.
</brief>
<description>
Assigns an ASID to the VSpace associated with the <texttt text="Page Directory"/> passed in as an argument.
</description>
<cap_param append_description='The ASID pool which is being assigned to. Must not be full. Each ASID pool can contain 1024 entries.'/>
<param dir="in" name="vspace" type="seL4_CPtr" description='The page directory that is being assigned to an ASID pool. Must not already be assigned to an ASID pool.'/>
<error name="seL4_DeleteFirst">
<description>
There are no more ASIDs available in <texttt text="_service"/>.
</description>
</error>
<error name="seL4_IllegalOperation">
<description>
The <texttt text="_service"/> is a CPtr to a capability of the wrong type.
</description>
</error>
<error name="seL4_InvalidCapability">
<description>
The <texttt text="_service"/> or <texttt text="vspace"/> is a CPtr to a capability of the wrong type.
Or, <texttt text="vspace"/> is already assigned to an ASID pool.
</description>
</error>
</method>
</interface>
<interface name="seL4_X86_IOPortControl" manual_name="I/O Port Control" cap_description='Control capability for I/O ports.'>
<method id="X86IOPortControlIssue" name="Issue" manual_label="ioport_issue">
<brief>
Issue an IO port sub range.
</brief>
<description>
<docref>See <autoref label='sec:ioports'/></docref>
</description>
<param dir="in" name="first_port" type="seL4_Word" description="First port of the range of the issued capability."/>
<param dir="in" name="last_port" type="seL4_Word" description="Last port of the range of the issued capability."/>
<param dir="in" name="root" type="seL4_CNode" description="CPtr to the CNode that forms the root of the destination CSpace."/>
<param dir="in" name="index" type="seL4_Word" description="CPtr to the destination slot. Resolved from the root of the destination CSpace."/>
<param dir="in" name="depth" type="seL4_Uint8" description="Number of bits of index to resolve to find the destination slot."/>
<error name="seL4_DeleteFirst">
<description>
The destination slot contains a capability.
</description>
</error>
<error name="seL4_FailedLookup">
<description>
The <texttt text="index"/> or <texttt text="depth"/> is invalid <docref>(see <autoref label="s:cspace-addressing"/>)</docref>.
Or, <texttt text="root"/> is a CPtr to a capability of the wrong type.
</description>
</error>
<error name="seL4_IllegalOperation">
<description>
The <texttt text="_service"/> is a CPtr to a capability of the wrong type.
</description>
</error>
<error name="seL4_InvalidArgument">
<description>
The <texttt text="last_port"/> is less than <texttt text="first_port"/>.
</description>
</error>
<error name="seL4_InvalidCapability">
<description>
The <texttt text="_service"/> is a CPtr to a capability of the wrong type.
</description>
</error>
<error name="seL4_RangeError">
<description>
The <texttt text="depth"/> is invalid <docref>(see <autoref label="s:cspace-addressing"/>)</docref>.
</description>
</error>
<error name="seL4_RevokeFirst">
<description>
One or more ports in the requested range have already been issued.
</description>
</error>
</method>
</interface>
<interface name="seL4_X86_IOPort" manual_name="I/O Port" cap_description='An I/O Port capability.'>
<method id="X86IOPortIn8" name="In8">
<brief>
Read 8 bits from an IO port.
</brief>
<description>
<docref>See <autoref label='sec:ioports'/></docref>
</description>
<return>
A <texttt text='seL4_X86_IOPort_In8_t'/> structure <docref>as described in <autoref label='sec:ioports'/>.</docref>
</return>
<param dir="out" name="result" type="seL4_Uint8" />
<param dir="in" name="port" type="seL4_Uint16" description='The port to read from.'/>
<error name="seL4_IllegalOperation">
<description>
The <texttt text="_service"/> is a CPtr to a capability of the wrong type.
Or, reading from <texttt text="port"/> is not authorized by the capability.
</description>
</error>
<error name="seL4_InvalidCapability">
<description>
The <texttt text="_service"/> is a CPtr to a capability of the wrong type.
</description>
</error>
</method>
<method id="X86IOPortIn16" name="In16">
<brief>
Read 16 bits from an IO port.
</brief>
<description>
<docref>See <autoref label='sec:ioports'/></docref>
</description>
<return>
A <texttt text='seL4_X86_IOPort_In16_t'/> structure <docref>as described in <autoref label='sec:ioports'/>.</docref>
</return>
<param dir="out" name="result" type="seL4_Uint16"/>
<param dir="in" name="port" type="seL4_Uint16" description='The port to read from.'/>
<error name="seL4_IllegalOperation">
<description>
The <texttt text="_service"/> is a CPtr to a capability of the wrong type.
Or, reading from <texttt text="port"/> and <texttt text="port+1"/> is not authorized by the capability.
</description>
</error>
<error name="seL4_InvalidCapability">
<description>
The <texttt text="_service"/> is a CPtr to a capability of the wrong type.
</description>
</error>
</method>
<method id="X86IOPortIn32" name="In32">
<brief>
Read 32 bits from an IO port.
</brief>
<description>
<docref>See <autoref label='sec:ioports'/></docref>
</description>
<return>
A <texttt text='seL4_X86_IOPort_In32_t'/> structure <docref>as described in <autoref label='sec:ioports'/>.</docref>
</return>
<param dir="out" name="result" type="seL4_Uint32"/>
<param dir="in" name="port" type="seL4_Uint16" description='The port to read from.'/>
<error name="seL4_IllegalOperation">
<description>
The <texttt text="_service"/> is a CPtr to a capability of the wrong type.
Or, reading from ports <texttt text="port"/> through <texttt text="port+3"/> is not authorized by the capability.
</description>
</error>
<error name="seL4_InvalidCapability">
<description>
The <texttt text="_service"/> is a CPtr to a capability of the wrong type.
</description>
</error>
</method>
<method id="X86IOPortOut8" name="Out8">
<brief>
Write 8 bits to an IO port.
</brief>
<description>
<docref>See <autoref label='sec:ioports'/></docref>
</description>
<param dir="in" name="port" type="seL4_Word" description='The port to write to.'/>
<param dir="in" name="data" type="seL4_Word" description='Data to write to the IO port.'/>
<error name="seL4_IllegalOperation">
<description>
The <texttt text="_service"/> is a CPtr to a capability of the wrong type.
Or, writing to <texttt text="port"/> is not authorized by the capability.
</description>
</error>
<error name="seL4_InvalidCapability">
<description>
The <texttt text="_service"/> is a CPtr to a capability of the wrong type.
</description>
</error>
</method>
<method id="X86IOPortOut16" name="Out16">
<brief>
Write 16 bits to an IO port.
</brief>
<description>
<docref>See <autoref label='sec:ioports'/></docref>
</description>
<param dir="in" name="port" type="seL4_Word" description='The port to write to.'/>
<param dir="in" name="data" type="seL4_Word" description='Data to write to the IO port.'/>
<error name="seL4_IllegalOperation">
<description>
The <texttt text="_service"/> is a CPtr to a capability of the wrong type.
Or, writing to <texttt text="port"/> and <texttt text="port+1"/> is not authorized by the capability.
</description>
</error>
<error name="seL4_InvalidCapability">
<description>
The <texttt text="_service"/> is a CPtr to a capability of the wrong type.
</description>
</error>
</method>
<method id="X86IOPortOut32" name="Out32">
<brief>
Write 32 bits to an IO port.
</brief>
<description>
<docref>See <autoref label='sec:ioports'/></docref>
</description>
<param dir="in" name="port" type="seL4_Word" description='The port to write to.'/>
<param dir="in" name="data" type="seL4_Word" description='Data to write to the IO port.'/>
<error name="seL4_IllegalOperation">
<description>
The <texttt text="_service"/> is a CPtr to a capability of the wrong type.
Or, writing to ports <texttt text="port"/> through <texttt text="port+3"/> is not authorized by the capability.
</description>
</error>
<error name="seL4_InvalidCapability">
<description>
The <texttt text="_service"/> is a CPtr to a capability of the wrong type.
</description>
</error>
</method>
</interface>
<interface name="seL4_IRQControl" manual_name="IRQ Control" cap_description='An IRQControl capability. This gives you the authority to make this call.'>
<method id="X86IRQIssueIRQHandlerIOAPIC" name="GetIOAPIC" manual_name="Get I/O APIC Handler">
<brief>
Create an IRQ handler capability for an interrupt from an IOAPIC.
</brief>
<description>
<docref>See <autoref label='sec:interrupts'/> and <autoref label='sec:x86_interrupts'/>.</docref>
</description>
<param dir="in" name="root" type="seL4_CNode"
description='CPtr to the CNode that forms the root of the destination CSpace. Must be at a depth equivalent to the wordsize.'/>
<param dir="in" name="index" type="seL4_Word"
description='CPtr to the destination slot. Resolved from the root of the destination CSpace.'/>
<param dir="in" name="depth" type="seL4_Uint8"
description='Number of bits of index to resolve to find the destination slot.'/>
<param dir="in" name="ioapic" type="seL4_Word"
description='Zero based index of IOAPIC to get interrupt from,
ordered the same as in ACPI tables'/>
<param dir="in" name="pin" type="seL4_Word" description='IOAPIC pin that generates the interrupt.'/>
<param dir="in" name="level" type="seL4_Word" description='Indicates whether the IOAPIC should be programmed to treat this interrupt as level triggered.'/>
<param dir="in" name="polarity" type="seL4_Word" description='Indicates whether the IOAPIC should be programmed to treat this interrupt as high or
low triggered'/>
<param dir="in" name="vector" type="seL4_Word" description='CPU vector to deliver the interrupt to.'/>
<error name="seL4_DeleteFirst">
<description>
The destination slot contains a capability.
</description>
</error>
<error name="seL4_FailedLookup">
<description>
The <texttt text="index"/> or <texttt text="depth"/> is invalid <docref>(see <autoref label="s:cspace-addressing"/>)</docref>.
Or, <texttt text="root"/> is a CPtr to a capability of the wrong type.
</description>
</error>
<error name="seL4_IllegalOperation">
<description>
The <texttt text="_service"/> is a CPtr to a capability of the wrong type.
Or, an IOAPIC is not in use.
</description>
</error>
<error name="seL4_InvalidCapability">
<description>
The <texttt text="_service"/> is a CPtr to a capability of the wrong type.
</description>
</error>
<error name="seL4_RangeError">
<description>
The <texttt text="vector"/>, <texttt text="ioapic"/>, or <texttt text="pin"/> is invalid.
Or, <texttt text="level"/> or <texttt text="polarity"/> is not 0 or 1.
Or, <texttt text="depth"/> is invalid <docref>(see <autoref label="s:cspace-addressing"/>)</docref>.
</description>
</error>
<error name="seL4_RevokeFirst">
<description>
An IRQ handler capability for <texttt text="vector"/> has already been created.
</description>
</error>
</method>
<method id="X86IRQIssueIRQHandlerMSI" name="GetMSI" manual_name="Get MSI Handler">
<brief>
Create an IRQ handler capability for an interrupt from an MSI.
</brief>
<description>
<docref>See <autoref label='sec:interrupts'/> and <autoref label='sec:x86_interrupts'/>.</docref>
</description>
<param dir="in" name="root" type="seL4_CNode"
description='CPtr to the CNode that forms the root of the destination CSpace. Must be at a depth equivalent to the wordsize.'/>
<param dir="in" name="index" type="seL4_Word"
description='CPtr to the destination slot. Resolved from the root of the destination CSpace.'/>
<param dir="in" name="depth" type="seL4_Uint8"
description='Number of bits of index to resolve to find the destination slot.'/>
<param dir="in" name="pci_bus" type="seL4_Word" description='PCI bus ID of the device that will generate the interrupt.'/>
<param dir="in" name="pci_dev" type="seL4_Word" description='PCI device ID of the device that will generate the interrupt.'/>
<param dir="in" name="pci_func" type="seL4_Word" description='PCI function ID of the device that will generate the interrupt.'/>
<param dir="in" name="handle" type="seL4_Word" description='Value of the handle programmed into the data portion of the MSI.'/>
<param dir="in" name="vector" type="seL4_Word" description='CPU vector to deliver the interrupt to.'/>
<error name="seL4_DeleteFirst">
<description>
The destination slot contains a capability.
</description>
</error>
<error name="seL4_FailedLookup">
<description>
The <texttt text="index"/> or <texttt text="depth"/> is invalid <docref>(see <autoref label="s:cspace-addressing"/>)</docref>.
Or, <texttt text="root"/> is a CPtr to a capability of the wrong type.
</description>
</error>
<error name="seL4_IllegalOperation">
<description>
The <texttt text="_service"/> is a CPtr to a capability of the wrong type.
Or, an IOAPIC is not in use.
</description>
</error>
<error name="seL4_InvalidCapability">
<description>
The <texttt text="_service"/> is a CPtr to a capability of the wrong type.
</description>
</error>
<error name="seL4_RangeError">
<description>
The <texttt text="vector"/>, <texttt text="pic_bus"/>, <texttt text="pci_dev"/>, or <texttt text="pci_func"/> is invalid.
Or, the <texttt text="depth"/> is invalid <docref>(see <autoref label="s:cspace-addressing"/>)</docref>.
</description>
</error>
<error name="seL4_RevokeFirst">
<description>
An IRQ handler capability for <texttt text="vector"/> has already been created.
</description>
</error>
</method>
</interface>
<interface name="seL4_TCB" manual_name="TCB" cap_description="Capability to the TCB which is being operated on.">
<method id="TCBSetEPTRoot" name="SetEPTRoot" manual_name="Set EPT Root" manual_label="set_eptroot">
<condition><config var="CONFIG_VTX"/></condition>
<brief>
Set the EPT root of a thread
</brief>
<description>
<docref>See <autoref label='sec:virt'/>.</docref>
</description>
<param dir="in" name="eptpml4" type="seL4_X86_EPTPML4"
description='CPtr to an EPT PML4 object to act as the guest mode vspace root'/>
<error name="seL4_IllegalOperation">
<description>
The <texttt text="_service"/> or <texttt text="eptpml4"/> is a CPtr to a capability of the wrong type.
Or, <texttt text="eptpml4"/> is not assigned to an ASID pool.
</description>
</error>
<error name="seL4_InvalidCapability">
<description>
The <texttt text="_service"/> is a CPtr to a capability of the wrong type.
</description>
</error>
</method>
</interface>
<interface name="seL4_X86_VCPU" manual_name="VCPU" cap_description='VCPU object to operate on'>
<method id="X86VCPUSetTCB" name="SetTCB" manual_name="Set TCB">
<condition><config var="CONFIG_VTX"/></condition>
<brief>
Bind TCB to VCPU
</brief>
<description>
Configures the one-to-one binding of a VCPU and TCB, overwriting any previous binding
in both. <docref>See <autoref label='sec:virt'/>.</docref>
</description>
<param dir="in" name="tcb" type="seL4_TCB" description='CPtr of the TCB to bind to'/>
<error name="seL4_IllegalOperation">
<description>
The <texttt text="_service"/> or <texttt text="tcb"/> is a CPtr to a capability of the wrong type.
</description>
</error>
<error name="seL4_InvalidCapability">
<description>
The <texttt text="_service"/> is a CPtr to a capability of the wrong type.
</description>
</error>
</method>
<method id="X86VCPUReadVMCS" name="ReadVMCS" manual_name="Read VMCS" manual_label="vcpu_readvmcs">
<condition><config var="CONFIG_VTX"/></condition>
<brief>
Read VMCS field from the hardware
</brief>
<description>
Thin wrapper around the <texttt text='vmread'/> instruction that is performed on the
VMCS region that is part of the VCPU object. After validating that a legal
field is requested the value of `vmread` is returned directly in the result.
</description>
<return>
A <texttt text='seL4_X86_VCPU_ReadVMCS_t'/> struct that contains a
<texttt text='seL4_Word value'/>, which holds the return result of the <texttt text='vmread'/> instruction,
and <texttt text='int error'/>. <docref>See <autoref label='sec:errors'/> for a description
of the message register and tag contents upon error.</docref>
</return>
<param dir="in" name="field" type="seL4_Word"
description='Field to give to `vmread` instruction'/>
<param dir="out" name="value" type="seL4_Word"
description='Value returned by `vmread` instruction'/>
<error name="seL4_IllegalOperation">
<description>
The <texttt text="_service"/> is a CPtr to a capability of the wrong type.
Or, <texttt text="field"/> is invalid or unsupported.
</description>
</error>
<error name="seL4_InvalidCapability">
<description>
The <texttt text="_service"/> is a CPtr to a capability of the wrong type.
</description>
</error>
</method>
<method id="X86VCPUWriteVMCS" name="WriteVMCS" manual_name="Write VMCS" manual_label="vcpu_writevmcs">
<condition><config var="CONFIG_VTX"/></condition>
<brief>
Write VMCS field to the hardware
</brief>
<description>
Thin wrapper around the `vmwrite` instruction that is performed on the
VMCS region that is part of the VCPU object. As well as validating that
a legal field is requested, the value may be modified to ensure any
bits that are fixed in the hardware are correct, and that any features
required for kernel correctness are not disabled <docref>(see <autoref label='sec:virt'/>)</docref>.
The final value written to the hardware is returned and can be compared
to the input parameter to determine what bits the kernel changed.
</description>
<return>
A <texttt text='seL4_X86_VCPU_WriteVMCS_t'/> struct that contains a
<texttt text='seL4_Word writen'/>, which holds the final value written with the <texttt text='vmwrite'/> instruction,
and <texttt text='int error'/>. <docref>See <autoref label='sec:errors'/> for a description
of the message register and tag contents upon error.</docref>
</return>
<param dir="in" name="field" type="seL4_Word"
description='Field to give to `vmwrite` instruction'/>
<param dir="in" name="value" type="seL4_Word"
description='Value to write using `vmwrite` instruction'/>
<param dir="out" name="written" type="seL4_Word"
description='Final value written using `vmwrite` after kernel validation'/>
<error name="seL4_IllegalOperation">
<description>
The <texttt text="_service"/> is a CPtr to a capability of the wrong type.
Or, <texttt text="field"/> is invalid or unsupported.
</description>
</error>
<error name="seL4_InvalidCapability">
<description>
The <texttt text="_service"/> is a CPtr to a capability of the wrong type.
</description>
</error>
</method>
<method id="X86VCPUEnableIOPort" name="EnableIOPort" manual_name="Enable I/O Port" manual_label="vcpu_enableioport">
<condition><config var="CONFIG_VTX"/></condition>
<brief>
Enable I/O port range in guest execution
</brief>
<description>
Enables a range of I/O ports for direct access by the execution mode in
the <texttt text='VCPU'/>. The requested port range must be a sub range
of the provided I/O port capability.
This also establishes a link between the provided I/O port capability and
the <texttt text='VCPU'/><docref>, see <autoref label='sec:virt'/> for details.</docref>
</description>
<param dir="in" name="ioPort" type="seL4_X86_IOPort"
description='I/O port capability whose authority is being delegating'/>
<param dir="in" name="low" type="seL4_Word"
description='Start of the I/O port range to enable'/>
<param dir="in" name="high" type="seL4_Word"
description='Last I/O port in the range to enable'/>
<error name="seL4_IllegalOperation">
<description>
The <texttt text="_service"/> or <texttt text="ioPort"/> is a CPtr to a capability of the wrong type.
</description>
</error>
<error name="seL4_InvalidArgument">
<description>
The <texttt text="low"/> or <texttt text="high"/> IO port exceeds the range authorized by <texttt text="ioPort"/>.
</description>
</error>
<error name="seL4_InvalidCapability">
<description>
The <texttt text="_service"/> is a CPtr to a capability of the wrong type.
</description>
</error>
</method>
<method id="X86VCPUDisableIOPort" name="DisableIOPort" manual_name="Disable I/O Port">
<condition><config var="CONFIG_VTX"/></condition>
<brief>
Disable I/O port range in privileged execution
</brief>
<description>
Disable a range of I/O ports for direct access by the execution mode in
the <texttt text='VCPU'/>.
</description>
<param dir="in" name="low" type="seL4_Word"
description='Start of the I/O port range to disable'/>
<param dir="in" name="high" type="seL4_Word"
description='Last I/O port in the range to disable'/>
<error name="seL4_IllegalOperation">
<description>
The <texttt text="_service"/> is a CPtr to a capability of the wrong type.
</description>
</error>
<error name="seL4_InvalidCapability">
<description>
The <texttt text="_service"/> is a CPtr to a capability of the wrong type.
</description>
</error>
</method>
<method id="X86VCPUWriteRegisters" name="WriteRegisters" manual_name="Write Registers">
<condition><config var="CONFIG_VTX"/></condition>
<brief>
Set guest mode registers to the fields of a given <texttt text="seL4_VCPUContext"/>
</brief>
<description>
Sets the guest mode registers, which is any registers not already part of the VMCS.
</description>
<param dir="in" name="regs" type="seL4_VCPUContext"
description='Data structure containing the new register values.'/>
<error name="seL4_IllegalOperation">
<description>
The <texttt text="_service"/> is a CPtr to a capability of the wrong type.
</description>
</error>
<error name="seL4_InvalidCapability">
<description>
The <texttt text="_service"/> is a CPtr to a capability of the wrong type.
</description>
</error>
</method>
</interface>
<interface name="seL4_X86_EPTPDPT" manual_name="Extended Page Table Page Directory Page Table"
cap_description="Capability to the EPT PDPT being operated on.">
<method id="X86EPTPDPTMap" name="Map">
<condition><config var="CONFIG_VTX"/></condition>
<brief>
Map an EPT page directory page table.
</brief>
<description>
<docref>See <autoref label="ch:vspace"/></docref>
</description>
<param dir="in" name="eptpml4" type="seL4_X86_EPTPML4"
description='Capability to the EPT root which will contain the mapping'/>
<param dir="in" name="gpa" type="seL4_Word"
description='Guest physical address to map the page into.'/>
<param dir="in" name="attr" type="seL4_X86_VMAttributes">
<description>
VM attributes for the mapping. <docref>Possible values for this type are given in <autoref label='ch:vspace'/></docref>
</description>
</param>
<error name="seL4_DeleteFirst">
<description>
A mapping already exists for this level in <texttt text="eptpml4"/> at <texttt text="gpa"/>.
</description>
</error>
<error name="seL4_FailedLookup">
<description>
The <texttt text="eptpml4"/> is not assigned to an ASID pool.
</description>
</error>
<error name="seL4_IllegalOperation">
<description>
The <texttt text="_service"/> is a CPtr to a capability of the wrong type.
</description>
</error>
<error name="seL4_InvalidCapability">
<description>
The <texttt text="_service"/> or <texttt text="eptpml4"/> is a CPtr to a capability of the wrong type.
Or, <texttt text="_service"/> is already mapped in a VSpace.
Or, <texttt text="eptpml4"/> is not assigned to an ASID pool.
</description>
</error>
</method>
<method id="X86EPTPDPTUnmap" name="Unmap">
<condition><config var="CONFIG_VTX"/></condition>
<brief>
Unmap an EPT page directory page table.
</brief>
<description>
<docref>See <autoref label="ch:vspace"/></docref>
</description>
<error name="seL4_IllegalOperation">
<description>
The <texttt text="_service"/> is a CPtr to a capability of the wrong type.
</description>
</error>
<error name="seL4_InvalidCapability">
<description>
The <texttt text="_service"/> is a CPtr to a capability of the wrong type.
</description>
</error>
<error name="seL4_RevokeFirst">
<description>
A copy of the <texttt text="_service"/> capability exists.
</description>
</error>
</method>
</interface>
<interface name="seL4_X86_EPTPD" manual_name="Extended Page Table Page Directory"
cap_description="Capability to the EPT PD being operated on.">
<method id="X86EPTPDMap" name="Map">
<condition><config var="CONFIG_VTX"/></condition>
<brief>
Map an EPT page directory.
</brief>
<description>
<docref>See <autoref label="ch:vspace"/></docref>
</description>
<param dir="in" name="eptpml4" type="seL4_X86_EPTPML4"
description='Capability to the EPT root which will contain the mapping'/>
<param dir="in" name="gpa" type="seL4_Word"
description='Guest physical address to map the page into.'/>
<param dir="in" name="attr" type="seL4_X86_VMAttributes">
<description>
VM attributes for the mapping. <docref>Possible values for this type are given in <autoref label='ch:vspace'/></docref>
</description>
</param>
<error name="seL4_DeleteFirst">
<description>
A mapping already exists for this level in <texttt text="eptpml4"/> at <texttt text="gpa"/>.
</description>
</error>
<error name="seL4_FailedLookup">
<description>
The <texttt text="eptpml4"/> is not assigned to an ASID pool.
Or, <texttt text="eptpml4"/> does not have an EPTPDPT mapped at <texttt text="gpa"/>.
</description>
</error>
<error name="seL4_IllegalOperation">
<description>
The <texttt text="_service"/> is a CPtr to a capability of the wrong type.
</description>
</error>
<error name="seL4_InvalidCapability">
<description>
The <texttt text="_service"/> or <texttt text="eptpml4"/> is a CPtr to a capability of the wrong type.
Or, <texttt text="_service"/> is already mapped in a VSpace.
Or, <texttt text="eptpml4"/> is not assigned to an ASID pool.
</description>
</error>
</method>
<method id="X86EPTPDUnmap" name="Unmap">
<condition><config var="CONFIG_VTX"/></condition>
<brief>
Unmap an EPT page directory.
</brief>
<description>
<docref>See <autoref label="ch:vspace"/></docref>
</description>
<error name="seL4_IllegalOperation">
<description>
The <texttt text="_service"/> is a CPtr to a capability of the wrong type.
</description>
</error>
<error name="seL4_InvalidCapability">
<description>
The <texttt text="_service"/> is a CPtr to a capability of the wrong type.
</description>
</error>
<error name="seL4_RevokeFirst">
<description>
A copy of the <texttt text="_service"/> capability exists.
</description>
</error>
</method>
</interface>
<interface name="seL4_X86_EPTPT" manual_name="Extended Page Table Page Table"
cap_description="Capability to the EPT PT being operated on.">
<method id="X86EPTPTMap" name="Map">
<condition><config var="CONFIG_VTX"/></condition>
<brief>
Map an EPT page table.
</brief>
<description>
<docref>See <autoref label="ch:vspace"/></docref>
</description>
<param dir="in" name="eptpml4" type="seL4_X86_EPTPML4"
description='Capability to the EPT root which will contain the mapping'/>
<param dir="in" name="gpa" type="seL4_Word"
description='Guest physical address to map the page into.'/>
<param dir="in" name="attr" type="seL4_X86_VMAttributes">
<description>
VM attributes for the mapping. <docref>Possible values for this type are given in <autoref label='ch:vspace'/></docref>
</description>
</param>
<error name="seL4_DeleteFirst">
<description>
A mapping already exists for this level in <texttt text="eptpml4"/> at <texttt text="gpa"/>.
</description>
</error>
<error name="seL4_FailedLookup">
<description>
The <texttt text="eptpml4"/> is not assigned to an ASID pool.
Or, <texttt text="eptpml4"/> does not have an EPTPD mapped at <texttt text="gpa"/>.
</description>
</error>
<error name="seL4_IllegalOperation">
<description>
The <texttt text="_service"/> is a CPtr to a capability of the wrong type.
</description>
</error>
<error name="seL4_InvalidCapability">
<description>
The <texttt text="_service"/> or <texttt text="eptpml4"/> is a CPtr to a capability of the wrong type.
Or, <texttt text="_service"/> is already mapped in a VSpace.
Or, <texttt text="eptpml4"/> is not assigned to an ASID pool.
</description>
</error>
</method>
<method id="X86EPTPTUnmap" name="Unmap">
<condition><config var="CONFIG_VTX"/></condition>
<brief>
Unmap an EPT page table.
</brief>
<description>
<docref>See <autoref label="ch:vspace"/></docref>
</description>
<error name="seL4_IllegalOperation">
<description>
The <texttt text="_service"/> is a CPtr to a capability of the wrong type.
</description>
</error>
<error name="seL4_InvalidCapability">
<description>
The <texttt text="_service"/> is a CPtr to a capability of the wrong type.
</description>
</error>
<error name="seL4_RevokeFirst">
<description>
A copy of the <texttt text="_service"/> capability exists.
</description>
</error>
</method>
</interface>
</api>