diff options
author | royger <royger@FreeBSD.org> | 2014-03-11 10:07:55 +0000 |
---|---|---|
committer | royger <royger@FreeBSD.org> | 2014-03-11 10:07:55 +0000 |
commit | 57a42c756398e8543cdfb5f911e9e1a9a54145ec (patch) | |
tree | df32f34312cccca9645eeb3c79e89b68002da4e3 /sys/xen | |
parent | 5dd05db7ff9533415fbe0d4aedbadb5b115d9509 (diff) | |
download | FreeBSD-src-57a42c756398e8543cdfb5f911e9e1a9a54145ec.zip FreeBSD-src-57a42c756398e8543cdfb5f911e9e1a9a54145ec.tar.gz |
xen: add macro to detect if running as Dom0
Approved by: gibbs
Sponsored by: Citrix Systems R&D
xen/xen-os.h:
- Add macro to detect if running as Dom0.
Diffstat (limited to 'sys/xen')
-rw-r--r-- | sys/xen/xen-os.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/xen/xen-os.h b/sys/xen/xen-os.h index c7474d8..62b5bf6 100644 --- a/sys/xen/xen-os.h +++ b/sys/xen/xen-os.h @@ -82,6 +82,13 @@ xen_hvm_domain(void) return (xen_domain_type == XEN_HVM_DOMAIN); } +static inline bool +xen_initial_domain(void) +{ + return (xen_domain() && HYPERVISOR_start_info != NULL && + (HYPERVISOR_start_info->flags & SIF_INITDOMAIN) != 0); +} + #ifndef xen_mb #define xen_mb() mb() #endif |