Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


Avoid strict-aliasing related issues when compiling with optimization
[palacios.git] / linux_usr / v3_io_chan.c
1 #define __V3_PAL_SIDE__
2 #include <stdio.h>
3 #include <stdlib.h>
4 #include <stdint.h>
5 #include <fcntl.h>
6 #include <linux/errno.h>
7 #include <linux/poll.h>
8 #include <sys/ioctl.h>
9
10 #define __V3_PAL_SIDE__
11
12 // These two will be included in the library 
13 #include "v3_io_chan.h"
14 #include "v3_user_host_dev.h"
15
16
17 int
18 v3_get_ioreq (v3_io_chan_handle_t chan, pal_ioreq_t ** req)
19 {
20     return v3_user_host_dev_pull_request(chan, req);
21 }
22
23
24 int
25 v3_push_ioresp (v3_io_chan_handle_t chan, pal_ioresp_t * resp)
26 {
27     return v3_user_host_dev_push_response(chan, resp);
28 }
29
30
31 v3_io_chan_handle_t
32 v3_io_chan_open (char * url, char * vmdev)
33 {
34     return v3_user_host_dev_rendezvous(vmdev, url);
35 }
36
37
38 void 
39 v3_io_chan_close (v3_io_chan_handle_t chan)
40 {
41     v3_user_host_dev_depart(chan);
42 }
43
44
45 int
46 v3_raise_pal_irq (v3_io_chan_handle_t chan, uint8_t irq)
47 {
48     return v3_user_host_dev_raise_irq(chan, irq);
49 }
50
51
52 int 
53 v3_lower_pal_irq (v3_io_chan_handle_t chan, uint8_t irq)
54 {
55     return v3_user_host_dev_lower_irq(chan, irq);
56 }
57
58
59 uint64_t 
60 v3_read_guest_mem (v3_io_chan_handle_t chan, void *gpa, void * dest, uint64_t len){
61     return v3_user_host_dev_read_guest_mem(chan, gpa, dest, len);
62 }
63
64
65 uint64_t 
66 v3_write_guest_mem (v3_io_chan_handle_t chan, void *gpa, void *src, uint64_t len)
67 {
68     return v3_user_host_dev_write_guest_mem(chan, gpa, src, len);
69 }
70
71
72 int
73 v3_has_ioreq (v3_io_chan_handle_t chan)
74 {
75     return v3_user_host_dev_have_request(chan);
76 }
77
78
79 void
80 v3_free_req_resp (pal_ioreq_t * reqresp)
81 {
82     free(reqresp);
83 }
84