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.


Cleanup based on cppcheck pass (GEARS)
[palacios.git] / gears / services / devfile / devfile_hc.c
1 /* 
2    Device File Virtualization Guest Preload Library Helpers
3
4    (c) Akhil Guliani and William Gross, 2015
5      
6    Adapted from MPI module (c) 2012 Peter Dinda
7
8 */
9
10 #ifndef __x86_64__
11 #define __x86_64__
12 #endif 
13
14 #include <stdio.h>
15 #include "hcall.h"
16 #include "devfile_hc.h"
17
18
19 #include "sys_point_arr.h"
20
21 int dev_file_syscall_hcall(long long sys_code,
22                            long long a1, long long a2, long long a3, long long a4, 
23                            long long a5, long long a6, long long *sys_errno)
24 {
25     long long rc;
26     long long cmd = DEV_FILE_HCALL;
27     long long bit_vec = sys_pointer_arr[sys_code];
28     // Here, IOCTL needs to be handled specially because what 
29     // arguments are pointes, etc, depends on the device
30     DEBUG_PRINT("Initiate syscall hypercall, code: %llx\n",sys_code);
31     HCALL(rc,cmd,sys_code,a1,a2,a3,a4,a5,a6,bit_vec);
32     *sys_errno = cmd;
33     DEBUG_PRINT("Syscall Hypercall done: rc = %llx errno = %llx\n",rc, *sys_errno);
34     return rc;
35 }