8 #include "v3_user_host_dev.h"
11 int v3_user_host_dev_rendezvous(char *vmdev, char *url)
21 if ((vmfd=open(vmdev,O_RDWR))<0) {
25 devfd = ioctl(vmfd,V3_VM_HOST_DEV_CONNECT,buf);
32 int v3_user_host_dev_depart(int devfd)
38 int v3_user_host_dev_have_request(int devfd)
42 int rc=ioctl(devfd,V3_HOST_DEV_HOST_REQUEST_SIZE_IOCTL,&len);
47 int v3_user_host_dev_pull_request(int devfd, struct palacios_host_dev_host_request_response **req)
52 rc=ioctl(devfd,V3_HOST_DEV_HOST_REQUEST_SIZE_IOCTL,&len);
57 struct palacios_host_dev_host_request_response *r = malloc(len);
63 rc=ioctl(devfd, V3_HOST_DEV_HOST_REQUEST_PULL_IOCTL,r);
76 int v3_user_host_dev_push_response(int devfd, struct palacios_host_dev_host_request_response *resp)
80 rc=ioctl(devfd, V3_HOST_DEV_USER_RESPONSE_PUSH_IOCTL,resp);
91 static uint64_t do_user(int devfd, struct palacios_host_dev_user_op *op)
93 return ioctl(devfd, V3_HOST_DEV_USER_REQUEST_PUSH_IOCTL,op);
96 uint64_t v3_user_host_dev_read_guest_mem(int devfd, void *gpa, void *dest, uint64_t len)
98 struct palacios_host_dev_user_op op;
100 op.type= PALACIOS_HOST_DEV_USER_REQUEST_READ_GUEST;
106 return do_user(devfd,&op);
109 uint64_t v3_user_host_dev_write_guest_mem(int devfd, void *gpa, void *src, uint64_t len)
111 struct palacios_host_dev_user_op op;
113 op.type= PALACIOS_HOST_DEV_USER_REQUEST_WRITE_GUEST;
119 return do_user(devfd,&op);
122 int v3_user_host_dev_inject_irq(int devfd, uint8_t irq)
124 struct palacios_host_dev_user_op op;
126 op.type= PALACIOS_HOST_DEV_USER_REQUEST_IRQ_GUEST;
132 return do_user(devfd,&op);