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);
59 rc=ioctl(devfd, V3_HOST_DEV_HOST_REQUEST_PULL_IOCTL,r);
72 int v3_user_host_dev_push_response(int devfd, struct palacios_host_dev_host_request_response *resp)
76 rc=ioctl(devfd, V3_HOST_DEV_USER_RESPONSE_PUSH_IOCTL,resp);
87 static uint64_t do_user(int devfd, struct palacios_host_dev_user_op *op)
89 return ioctl(devfd, V3_HOST_DEV_USER_REQUEST_PUSH_IOCTL,op);
92 uint64_t v3_user_host_dev_read_guest_mem(int devfd, void *gpa, void *dest, uint64_t len)
94 struct palacios_host_dev_user_op op;
96 op.type= PALACIOS_HOST_DEV_USER_REQUEST_READ_GUEST;
102 return do_user(devfd,&op);
105 uint64_t v3_user_host_dev_write_guest_mem(int devfd, void *gpa, void *src, uint64_t len)
107 struct palacios_host_dev_user_op op;
109 op.type= PALACIOS_HOST_DEV_USER_REQUEST_WRITE_GUEST;
115 return do_user(devfd,&op);
118 int v3_user_host_dev_inject_irq(int devfd, uint8_t irq)
120 struct palacios_host_dev_user_op op;
122 op.type= PALACIOS_HOST_DEV_USER_REQUEST_IRQ_GUEST;
128 return do_user(devfd,&op);