drivers/virt/acrn/hypercall.h
Source file repositories/reference/linux-study-clean/drivers/virt/acrn/hypercall.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/virt/acrn/hypercall.h- Extension
.h- Size
- 8192 bytes
- Lines
- 307
- Domain
- Driver Families
- Bucket
- drivers/virt
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
asm/acrn.h
Detected Declarations
function hcall_sos_remove_cpufunction hcall_create_vmfunction hcall_start_vmfunction hcall_pause_vmfunction hcall_destroy_vmfunction hcall_reset_vmfunction hcall_set_vcpu_regsfunction hcall_inject_msifunction hcall_vm_intr_monitorfunction hcall_set_irqlinefunction hcall_set_ioreq_bufferfunction hcall_notify_req_finishfunction hcall_set_memory_regionsfunction hcall_create_vdevfunction hcall_destroy_vdevfunction hcall_assign_mmiodevfunction hcall_deassign_mmiodevfunction hcall_assign_pcidevfunction hcall_deassign_pcidevfunction hcall_set_ptdev_intrfunction hcall_reset_ptdev_intrfunction hcall_get_cpu_state
Annotated Snippet
#ifndef __ACRN_HSM_HYPERCALL_H
#define __ACRN_HSM_HYPERCALL_H
#include <asm/acrn.h>
/*
* Hypercall IDs of the ACRN Hypervisor
*/
#define _HC_ID(x, y) (((x) << 24) | (y))
#define HC_ID 0x80UL
#define HC_ID_GEN_BASE 0x0UL
#define HC_SOS_REMOVE_CPU _HC_ID(HC_ID, HC_ID_GEN_BASE + 0x01)
#define HC_ID_VM_BASE 0x10UL
#define HC_CREATE_VM _HC_ID(HC_ID, HC_ID_VM_BASE + 0x00)
#define HC_DESTROY_VM _HC_ID(HC_ID, HC_ID_VM_BASE + 0x01)
#define HC_START_VM _HC_ID(HC_ID, HC_ID_VM_BASE + 0x02)
#define HC_PAUSE_VM _HC_ID(HC_ID, HC_ID_VM_BASE + 0x03)
#define HC_RESET_VM _HC_ID(HC_ID, HC_ID_VM_BASE + 0x05)
#define HC_SET_VCPU_REGS _HC_ID(HC_ID, HC_ID_VM_BASE + 0x06)
#define HC_ID_IRQ_BASE 0x20UL
#define HC_INJECT_MSI _HC_ID(HC_ID, HC_ID_IRQ_BASE + 0x03)
#define HC_VM_INTR_MONITOR _HC_ID(HC_ID, HC_ID_IRQ_BASE + 0x04)
#define HC_SET_IRQLINE _HC_ID(HC_ID, HC_ID_IRQ_BASE + 0x05)
#define HC_ID_IOREQ_BASE 0x30UL
#define HC_SET_IOREQ_BUFFER _HC_ID(HC_ID, HC_ID_IOREQ_BASE + 0x00)
#define HC_NOTIFY_REQUEST_FINISH _HC_ID(HC_ID, HC_ID_IOREQ_BASE + 0x01)
#define HC_ID_MEM_BASE 0x40UL
#define HC_VM_SET_MEMORY_REGIONS _HC_ID(HC_ID, HC_ID_MEM_BASE + 0x02)
#define HC_ID_PCI_BASE 0x50UL
#define HC_SET_PTDEV_INTR _HC_ID(HC_ID, HC_ID_PCI_BASE + 0x03)
#define HC_RESET_PTDEV_INTR _HC_ID(HC_ID, HC_ID_PCI_BASE + 0x04)
#define HC_ASSIGN_PCIDEV _HC_ID(HC_ID, HC_ID_PCI_BASE + 0x05)
#define HC_DEASSIGN_PCIDEV _HC_ID(HC_ID, HC_ID_PCI_BASE + 0x06)
#define HC_ASSIGN_MMIODEV _HC_ID(HC_ID, HC_ID_PCI_BASE + 0x07)
#define HC_DEASSIGN_MMIODEV _HC_ID(HC_ID, HC_ID_PCI_BASE + 0x08)
#define HC_CREATE_VDEV _HC_ID(HC_ID, HC_ID_PCI_BASE + 0x09)
#define HC_DESTROY_VDEV _HC_ID(HC_ID, HC_ID_PCI_BASE + 0x0A)
#define HC_ID_PM_BASE 0x80UL
#define HC_PM_GET_CPU_STATE _HC_ID(HC_ID, HC_ID_PM_BASE + 0x00)
/**
* hcall_sos_remove_cpu() - Remove a vCPU of Service VM
* @cpu: The vCPU to be removed
*
* Return: 0 on success, <0 on failure
*/
static inline long hcall_sos_remove_cpu(u64 cpu)
{
return acrn_hypercall1(HC_SOS_REMOVE_CPU, cpu);
}
/**
* hcall_create_vm() - Create a User VM
* @vminfo: Service VM GPA of info of User VM creation
*
* Return: 0 on success, <0 on failure
*/
static inline long hcall_create_vm(u64 vminfo)
{
return acrn_hypercall1(HC_CREATE_VM, vminfo);
}
/**
* hcall_start_vm() - Start a User VM
* @vmid: User VM ID
*
* Return: 0 on success, <0 on failure
*/
static inline long hcall_start_vm(u64 vmid)
{
return acrn_hypercall1(HC_START_VM, vmid);
}
/**
* hcall_pause_vm() - Pause a User VM
* @vmid: User VM ID
*
* Return: 0 on success, <0 on failure
*/
static inline long hcall_pause_vm(u64 vmid)
{
return acrn_hypercall1(HC_PAUSE_VM, vmid);
}
Annotation
- Immediate include surface: `asm/acrn.h`.
- Detected declarations: `function hcall_sos_remove_cpu`, `function hcall_create_vm`, `function hcall_start_vm`, `function hcall_pause_vm`, `function hcall_destroy_vm`, `function hcall_reset_vm`, `function hcall_set_vcpu_regs`, `function hcall_inject_msi`, `function hcall_vm_intr_monitor`, `function hcall_set_irqline`.
- Atlas domain: Driver Families / drivers/virt.
- Implementation status: source implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.