AArch64 EL2 hypervisor for QEMU virt that boots at EL2
1

Configure Feed

Select the types of activity you want to include in your feed.

ariel / include / hv / interval.h
696 B 30 lines
1#ifndef HV_INTERVAL_H 2#define HV_INTERVAL_H 3 4#include "hv/types.h" 5 6struct hv_interval { 7 uint64_t base; 8 uint64_t size; 9}; 10 11static inline bool hv_interval_end(struct hv_interval interval, uint64_t *out) 12{ 13 if (interval.size == 0u || out == (uint64_t *)0) { 14 return false; 15 } 16 return !hv_add_overflow_u64(interval.base, interval.size, out); 17} 18 19static inline bool hv_interval_contains(struct hv_interval outer, struct hv_interval inner) 20{ 21 uint64_t outer_end; 22 uint64_t inner_end; 23 24 if (!hv_interval_end(outer, &outer_end) || !hv_interval_end(inner, &inner_end)) { 25 return false; 26 } 27 return inner.base >= outer.base && inner_end <= outer_end; 28} 29 30#endif