1 #ifndef __v3_hvm_ros_user
2 #define __v3_hvm_ros_user
5 Copyright (c) 2015 Peter Dinda
11 // note that there is ONE HRT hence no naming
12 int v3_hvm_ros_user_init();
13 int v3_hvm_ros_user_deinit();
15 // Establish function to be invoked by the VMM
16 // to signal activity (basically an interrupt handler)
17 // The handler can use the GPRs, but must save/restore
18 // any other registers it needs itself. If it goes
19 // out of its stack, it's out of luck
20 int v3_hvm_ros_register_signal(void (*handler)(uint64_t), void *stack, uint64_t stack_size);
21 int v3_hvm_ros_unregister_signal();
23 // Replace the existing HRT with a new one
24 // - this does not boot the new HRT
25 // - the intial image is the one given in the .pal config
26 int v3_hvm_ros_install_hrt_image(void *image, uint64_t size);
28 typedef enum {RESET_HRT, RESET_ROS, RESET_BOTH} reset_type;
30 int v3_hvm_ros_reset(reset_type what);
32 int v3_hvm_ros_merge_address_spaces();
33 int v3_hvm_ros_unmerge_address_spaces();
36 // Asynchronosus invocation of the HRT using an
37 // opaque pointer (typically this is a pointer
38 // to a structure containing a function pointer and
39 // arguments. The parallel flag indicates that
40 // that it will be invoked simulatneously on all
42 int v3_hvm_ros_invoke_hrt_async(void *p, int parallel);
45 // synchronize with HRT via shared location
46 // allow synchronous invokcations. Note that
47 // any parallelism is done internal to the HRT.
48 // Also the synchronous invocation always waits
49 int v3_hvm_ros_synchronize();
50 int v3_hvm_ros_invoke_hrt_sync(void *p, int handle_ros_events);
51 int v3_hvm_ros_desynchronize();
53 // Signal the HRT from the ROS
54 // The ROS can call this too, but it shouldn't be necesary
55 int v3_hvm_hrt_signal_ros(uint64_t code);