linux/include/xen/interface/physdev.h

/* SPDX-License-Identifier: MIT */

#ifndef __XEN_PUBLIC_PHYSDEV_H__
#define __XEN_PUBLIC_PHYSDEV_H__

/*
 * Prototype for this hypercall is:
 *  int physdev_op(int cmd, void *args)
 * @cmd	 == PHYSDEVOP_??? (physdev operation).
 * @args == Operation-specific extra arguments (NULL if none).
 */

/*
 * Notify end-of-interrupt (EOI) for the specified IRQ.
 * @arg == pointer to physdev_eoi structure.
 */
#define PHYSDEVOP_eoi
struct physdev_eoi {};

/*
 * Register a shared page for the hypervisor to indicate whether the guest
 * must issue PHYSDEVOP_eoi. The semantics of PHYSDEVOP_eoi change slightly
 * once the guest used this function in that the associated event channel
 * will automatically get unmasked. The page registered is used as a bit
 * array indexed by Xen's PIRQ value.
 */
#define PHYSDEVOP_pirq_eoi_gmfn_v1
/*
 * Register a shared page for the hypervisor to indicate whether the
 * guest must issue PHYSDEVOP_eoi. This hypercall is very similar to
 * PHYSDEVOP_pirq_eoi_gmfn_v1 but it doesn't change the semantics of
 * PHYSDEVOP_eoi. The page registered is used as a bit array indexed by
 * Xen's PIRQ value.
 */
#define PHYSDEVOP_pirq_eoi_gmfn_v2
struct physdev_pirq_eoi_gmfn {};

/*
 * Query the status of an IRQ line.
 * @arg == pointer to physdev_irq_status_query structure.
 */
#define PHYSDEVOP_irq_status_query
struct physdev_irq_status_query {};

/* Need to call PHYSDEVOP_eoi when the IRQ has been serviced? */
#define _XENIRQSTAT_needs_eoi
#define XENIRQSTAT_needs_eoi

/* IRQ shared by multiple guests? */
#define _XENIRQSTAT_shared
#define XENIRQSTAT_shared

/*
 * Set the current VCPU's I/O privilege level.
 * @arg == pointer to physdev_set_iopl structure.
 */
#define PHYSDEVOP_set_iopl
struct physdev_set_iopl {};

/*
 * Set the current VCPU's I/O-port permissions bitmap.
 * @arg == pointer to physdev_set_iobitmap structure.
 */
#define PHYSDEVOP_set_iobitmap
struct physdev_set_iobitmap {};

/*
 * Read or write an IO-APIC register.
 * @arg == pointer to physdev_apic structure.
 */
#define PHYSDEVOP_apic_read
#define PHYSDEVOP_apic_write
struct physdev_apic {};

/*
 * Allocate or free a physical upcall vector for the specified IRQ line.
 * @arg == pointer to physdev_irq structure.
 */
#define PHYSDEVOP_alloc_irq_vector
#define PHYSDEVOP_free_irq_vector
struct physdev_irq {};

#define MAP_PIRQ_TYPE_MSI
#define MAP_PIRQ_TYPE_GSI
#define MAP_PIRQ_TYPE_UNKNOWN
#define MAP_PIRQ_TYPE_MSI_SEG
#define MAP_PIRQ_TYPE_MULTI_MSI

#define PHYSDEVOP_map_pirq
struct physdev_map_pirq {};

#define PHYSDEVOP_unmap_pirq
struct physdev_unmap_pirq {};

#define PHYSDEVOP_manage_pci_add
#define PHYSDEVOP_manage_pci_remove
struct physdev_manage_pci {};

#define PHYSDEVOP_restore_msi
struct physdev_restore_msi {};

#define PHYSDEVOP_manage_pci_add_ext
struct physdev_manage_pci_ext {};

/*
 * Argument to physdev_op_compat() hypercall. Superceded by new physdev_op()
 * hypercall since 0x00030202.
 */
struct physdev_op {};

#define PHYSDEVOP_setup_gsi
struct physdev_setup_gsi {};

#define PHYSDEVOP_get_nr_pirqs
struct physdev_nr_pirqs {};

/* type is MAP_PIRQ_TYPE_GSI or MAP_PIRQ_TYPE_MSI
 * the hypercall returns a free pirq */
#define PHYSDEVOP_get_free_pirq
struct physdev_get_free_pirq {};

#define XEN_PCI_DEV_EXTFN
#define XEN_PCI_DEV_VIRTFN
#define XEN_PCI_DEV_PXM

#define XEN_PCI_MMCFG_RESERVED

#define PHYSDEVOP_pci_mmcfg_reserved
struct physdev_pci_mmcfg_reserved {};

#define PHYSDEVOP_pci_device_add
struct physdev_pci_device_add {};

#define PHYSDEVOP_pci_device_remove
#define PHYSDEVOP_restore_msi_ext
/*
 * Dom0 should use these two to announce MMIO resources assigned to
 * MSI-X capable devices won't (prepare) or may (release) change.
 */
#define PHYSDEVOP_prepare_msix
#define PHYSDEVOP_release_msix
struct physdev_pci_device {};

#define PHYSDEVOP_DBGP_RESET_PREPARE
#define PHYSDEVOP_DBGP_RESET_DONE

#define PHYSDEVOP_DBGP_BUS_UNKNOWN
#define PHYSDEVOP_DBGP_BUS_PCI

#define PHYSDEVOP_dbgp_op
struct physdev_dbgp_op {};

/*
 * Notify that some PIRQ-bound event channels have been unmasked.
 * ** This command is obsolete since interface version 0x00030202 and is **
 * ** unsupported by newer versions of Xen.				 **
 */
#define PHYSDEVOP_IRQ_UNMASK_NOTIFY

/*
 * These all-capitals physdev operation names are superceded by the new names
 * (defined above) since interface version 0x00030202.
 */
#define PHYSDEVOP_IRQ_STATUS_QUERY
#define PHYSDEVOP_SET_IOPL
#define PHYSDEVOP_SET_IOBITMAP
#define PHYSDEVOP_APIC_READ
#define PHYSDEVOP_APIC_WRITE
#define PHYSDEVOP_ASSIGN_VECTOR
#define PHYSDEVOP_FREE_VECTOR
#define PHYSDEVOP_IRQ_NEEDS_UNMASK_NOTIFY
#define PHYSDEVOP_IRQ_SHARED

#endif /* __XEN_PUBLIC_PHYSDEV_H__ */