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.


Extensions to HVM ROS userspace library corresponding to HVM enhancements
[palacios.git] / guest / linux / hvm-ros / v3_hvm_ros_user.h
1 #ifndef __v3_hvm_ros_user
2 #define __v3_hvm_ros_user
3
4 /*
5   Copyright (c) 2015 Peter Dinda
6 */
7
8
9
10 // setup and teardown
11 // note that there is ONE HRT hence  no naming
12 int v3_hvm_ros_user_init();
13 int v3_hvm_ros_user_deinit();
14
15 // by default, debugging and other log output goes to STDERR
16 // you can change this here
17 int v3_hvm_ros_user_set_log(FILE *log);
18
19 // Establish function to be invoked by the VMM
20 // to signal activity (basically an interrupt handler)
21 // The handler can use the GPRs, but must save/restore
22 // any other registers it needs itself.  If it goes
23 // out of its stack, it's out of luck
24 int v3_hvm_ros_register_signal(void (*handler)(uint64_t), void *stack, uint64_t stack_size); 
25 int v3_hvm_ros_unregister_signal();
26
27 // Replace the existing HRT with a new one
28 //  - this does not boot the new HRT
29 //  - the intial image is the one given in the .pal config
30 int v3_hvm_ros_install_hrt_image(void *image, uint64_t size);
31
32 // Reset diffent components of the HVM
33 // or the entire HVM.  The component immediatly reboots
34 typedef enum {RESET_HRT, RESET_ROS, RESET_BOTH} reset_type;
35 int v3_hvm_ros_reset(reset_type what);
36
37 // Merge address spaces between
38 // this ROS process and a compatible HRT
39 int v3_hvm_ros_merge_address_spaces();
40 int v3_hvm_ros_unmerge_address_spaces();
41
42 // Reflect this ROS process's GDT into a compatible
43 // HRT.  This is typically necessary to run
44 // code out of the ROS address space in the HRT
45 int v3_hvm_ros_mirror_gdt(uint64_t fsbase, uint64_t cpu);
46 int v3_hvm_ros_unmiror_gdt();
47
48 // Asynchronosus invocation of the HRT using an
49 // opaque pointer (typically this is a pointer
50 // to a structure containing a function pointer and
51 // arguments.  The parallel flag indicates that
52 // that it will be invoked simulatneously on all
53 // cores.  
54 int v3_hvm_ros_invoke_hrt_async(void *p, int parallel);
55 int v3_hvm_ros_invoke_hrt_async_nowait(void *buf, int par);
56
57
58 // synchronize with HRT via shared location
59 // allow synchronous invokcations.  Note that
60 // any parallelism is done internal to the HRT. 
61 // Also the synchronous invocation always waits
62 int  v3_hvm_ros_synchronize();   
63 int  v3_hvm_ros_invoke_hrt_sync(void *p, int handle_ros_events);
64 int  v3_hvm_ros_desynchronize();
65
66 // Handle events occuring within the HRT
67 // that need to be be handled within the ROS
68 struct v3_ros_event;
69 int v3_hvm_handle_ros_event(struct v3_ros_event * event);
70 int v3_hvm_handle_ros_event_nohcall(struct v3_ros_event * event);
71
72 // Signal the ROS process from the ROS process
73 // These signals usually are generated by the HRT, but
74 // The ROS can also signal itself using the same mechanism
75 int  v3_hvm_hrt_signal_ros(uint64_t code);
76
77 #endif