Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions drivers/xen/dom0/domctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,21 @@ int xen_domctl_assign_dt_device(int domid, char *dtdev_path)

}

int xen_domctl_deassign_dt_device(int domid, char *dtdev_path)
{
xen_domctl_t domctl = {
.domain = domid,
.cmd = XEN_DOMCTL_deassign_device,
.u.assign_device.flags = 0,
.u.assign_device.dev = XEN_DOMCTL_DEV_DT,
.u.assign_device.u.dt.size = strlen(dtdev_path),
};

set_xen_guest_handle(domctl.u.assign_device.u.dt.path, dtdev_path);

return do_domctl(&domctl);
}

int xen_domctl_bind_pt_irq(int domid, uint32_t machine_irq, uint8_t irq_type,
uint8_t bus, uint8_t device, uint8_t intx, uint8_t isa_irq,
uint16_t spi)
Expand Down
10 changes: 10 additions & 0 deletions include/zephyr/xen/dom0/domctl.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,16 @@ int xen_domctl_memory_mapping(int domid, uint64_t first_gfn, uint64_t first_mfn,
*/
int xen_domctl_assign_dt_device(int domid, char *dtdev_path);

/**
* @brief Deassign a device from a guest domain.
*
* @param domid The ID of the domain from which the device should be deassigned.
* @param dtdev_path The path of the device tree device to be deassigned.
* @retval 0 on success.
* @retval -errno on failure.
*/
int xen_domctl_deassign_dt_device(int domid, char *dtdev_path);

/**
* @brief Binds a physical IRQ to a specified domain.
*
Expand Down