while(cursor) {
tmp = cursor;
cursor = cursor->next;
- VMMFree(tmp);
+ V3_Free(tmp);
}
- VMMFree(map);
+ V3_Free(map);
}
}
+host_region_type_t get_shadow_addr_type(struct guest_info * info, addr_t guest_addr) {
+ shadow_region_t * reg = get_shadow_region_by_addr(&(info->mem_map), guest_addr);
+
+ if (!reg) {
+ return HOST_REGION_INVALID;
+ } else {
+ return reg->host_type;
+ }
+}
+
+addr_t get_shadow_addr(struct guest_info * info, addr_t guest_addr) {
+ shadow_region_t * reg = get_shadow_region_by_addr(&(info->mem_map), guest_addr);
+
+ if (!reg) {
+ return 0;
+ } else {
+ return (guest_addr - reg->guest_start) + reg->host_addr.phys_addr.host_start;
+ }
+}
+
host_region_type_t lookup_shadow_map_addr(struct shadow_map * map, addr_t guest_addr, addr_t * host_addr) {
shadow_region_t * reg = get_shadow_region_by_addr(map, guest_addr);