Files
seL4/libsel4/arch_include/riscv/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

372 lines
18 KiB
XML

<?xml version="1.0" ?>
<!--
Copyright 2020, Data61, CSIRO (ABN 41 687 119 230)
Copyright 2015, 2016 Hesham Almatary <heshamelmatary@gmail.com>
SPDX-License-Identifier: BSD-2-Clause
-->
<api name="ObjectApiRISCV" label_prefix="riscv_">
<struct name="seL4_UserContext">
<member name="pc"/>
<member name="ra"/>
<member name="sp"/>
<member name="gp"/>
<member name="s0"/>
<member name="s1"/>
<member name="s2"/>
<member name="s3"/>
<member name="s4"/>
<member name="s5"/>
<member name="s6"/>
<member name="s7"/>
<member name="s8"/>
<member name="s9"/>
<member name="s10"/>
<member name="s11"/>
<member name="a0"/>
<member name="a1"/>
<member name="a2"/>
<member name="a3"/>
<member name="a4"/>
<member name="a5"/>
<member name="a6"/>
<member name="a7"/>
<member name="t0"/>
<member name="t1"/>
<member name="t2"/>
<member name="t3"/>
<member name="t4"/>
<member name="t5"/>
<member name="t6"/>
<member name="tp"/>
</struct>
<interface name="seL4_RISCV_PageTable" manual_name="Page Table" cap_description="Capability to the page table to invoke.">
<method id="RISCVPageTableMap" name="Map" manual_label="pagetable_map">
<brief>
Map a page table at a specific virtual address.
</brief>
<description>
Starting from the VSpace, map the page table object at any unpopulated level for the provided virtual address. If all paging structures and mappings are present for this virtual address, return an seL4_DeleteFirst error.
</description>
<param dir="in" name="vspace" type="seL4_RISCV_PageTable">
<description>VSpace to map the lower-level page table into.</description>
</param>
<param dir="in" name="vaddr" type="seL4_Word">
<description>Virtual address at which to map the page table.</description>
</param>
<param dir="in" name="attr" type="seL4_RISCV_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 page is mapped in <texttt text="vspace"/> at <texttt text="vaddr"/>.
Or, all required page tables are already mapped in <texttt text="vspace"/> at <texttt text="vaddr"/>.
</description>
</error>
<error name="seL4_FailedLookup">
<description>
The <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="RISCVPageTableUnmap" name="Unmap" manual_label="pagetable_unmap">
<brief>
Unmap a 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>
The <texttt text="_service"/> is the root of a VSpace.
Or, a copy of the <texttt text="_service"/> capability exists.
</description>
</error>
</method>
</interface>
<interface name="seL4_RISCV_Page" manual_name="Page" cap_description="Capability to the page to invoke.">
<method id="RISCVPageMap" name="Map">
<brief>
Map a page into a page table.
</brief>
<description>
Takes a VSpace, or top-level <texttt text="Page Table"/>,
capability as an argument and installs a reference
to the given <texttt text="Page"/> in the page table slot corresponding to the given address. If a page is already mapped at the same virtual address, update the mapping attributes.
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_RISCV_PageTable">
<description>VSpace to map the page into.</description>
</param>
<param dir="in" name="vaddr" type="seL4_Word">
<description>Virtual address at which to map the page.</description>
</param>
<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_RISCV_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_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 the root of a VSpace.
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="RISCVPageUnmap" name="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="RISCVPageGetAddress" name="GetAddress" manual_name="Get Address">
<brief>
Get the physical address of a page.
</brief>
<description>
<docref>See <autoref label="ch:vspace"/>.</docref>
</description>
<return>
A <texttt text='seL4_RISCV_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>
</interface>
<interface name="seL4_RISCV_ASIDControl" manual_name="ASID Control"
cap_description="The master ASIDControl capability to invoke.">
<method id="RISCVASIDControlMakePool" name="MakePool" manual_name="Make Pool">
<brief>
Create an 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>
<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 of 32."/>
<param dir="in" name="index" type="seL4_Word"
description="CPtr to the CNode that forms the root of the destination CSpace. Must be at a depth of 32."/>
<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_RISCV_ASIDPool" manual_name="ASID Pool"
cap_description="The ASID Pool capability to invoke, which must be to an ASID pool that is not full.">
<method id="RISCVASIDPoolAssign" name="Assign">
<brief>
Assign an ASID Pool.
</brief>
<description>
Assigns an ASID to the VSpace passed in as an argument.
</description>
<param dir="in" name="vspace" type="seL4_CPtr">
<description>
The top-level <texttt text="PageTable" /> that is being assigned to an ASID pool. Must not already be assigned
to an ASID pool.
</description>
</param>
<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.
Or, <texttt text="vspace"/> is mapped in a VSpace.
</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="RISCVIRQIssueIRQHandlerTrigger" name="GetTrigger" manual_name="Get IRQ Handler with Trigger Type"
manual_label="irq_controlgettrigger">
<brief>
Create an IRQ handler capability and specify the trigger method (edge or level).
</brief>
<description>
<docref>See <autoref label="sec:interrupts"/>.</docref>
</description>
<param dir="in" name="irq" type="seL4_Word" description="The IRQ that you want this capability to handle."/>
<param dir="in" name="trigger" type="seL4_Word" description="Indicates whether this IRQ is edge (1) or level (0) triggered."/>
<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.
</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, the platform does not support setting the IRQ trigger.
</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="irq"/> is invalid.
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="irq"/> has already been created.
</description>
</error>
</method>
</interface>
</api>