From: Peter Dinda Date: Wed, 9 Sep 2015 20:14:04 +0000 (-0500) Subject: Added missing HVM reset function to Linux library... X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=commitdiff_plain;h=0205b0a0d6ad39a783330299f8afca735cf9a459;p=palacios.git Added missing HVM reset function to Linux library... --- diff --git a/guest/linux/hvm-ros/v3_hvm_ros_user.c b/guest/linux/hvm-ros/v3_hvm_ros_user.c index f292626..74e6a5a 100644 --- a/guest/linux/hvm-ros/v3_hvm_ros_user.c +++ b/guest/linux/hvm-ros/v3_hvm_ros_user.c @@ -239,6 +239,35 @@ static void wait_for_completion() } } +int v3_hvm_ros_reset(reset_type what) +{ + unsigned long long num, a1=0, a2=0, a3=0, a4=0, a5=0, a6=0, a7=0, a8=0; + unsigned long long rc; + + num=0xf00d; + switch (what) { + case RESET_ROS: + a1 = 0x1; + break; + case RESET_HRT: + a1 = 0x2; + break; + case RESET_BOTH: + a1 = 0x3; + break; + } + + HCALL(rc,num,a1,a2,a3,a4,a5,a6,a7,a8); + + if (rc) { + INFO("Error in request to reset rc=0x%llx\n",rc); + return -1; + } else { + // no waiting for completion here + return 0; + } +} + int v3_hvm_ros_merge_address_spaces() { diff --git a/guest/linux/hvm-ros/v3_hvm_ros_user.h b/guest/linux/hvm-ros/v3_hvm_ros_user.h index 94858f4..2101108 100644 --- a/guest/linux/hvm-ros/v3_hvm_ros_user.h +++ b/guest/linux/hvm-ros/v3_hvm_ros_user.h @@ -13,6 +13,10 @@ int v3_hvm_ros_user_init(); int v3_hvm_ros_user_deinit(); +typedef enum {RESET_HRT, RESET_ROS, RESET_BOTH} reset_type; + +int v3_hvm_ros_reset(reset_type what); + int v3_hvm_ros_merge_address_spaces(); int v3_hvm_ros_unmerge_address_spaces();