]> xenbits.xensource.com Git - people/julieng/freebsd.git/commitdiff
x86/xen: Add cpu_to_vcpu_id macro
authorJulien Grall <julien.grall@linaro.org>
Sat, 19 Apr 2014 15:57:40 +0000 (16:57 +0100)
committerJulien Grall <julien.grall@citrix.com>
Mon, 5 Oct 2015 17:55:04 +0000 (18:55 +0100)
sys/amd64/include/xen/xen-os.h
sys/i386/include/xen/xen-os.h

index 8fe5b8d8c822a8fdba37bda84b0b1823752d2526..4313662cdaba9a6ced800b2eafa22809613c2cce 100644 (file)
@@ -127,6 +127,9 @@ extern start_info_t *xen_start_info;
 
 #define xen_pmap(pa, size)     pmap_mapdev((pa), (size))
 
+#define cpu_to_vcpu_id(cpu) pcpu_find(cpu)->pc_vcpu_id
+
+
 #endif /* !__ASSEMBLY__ */
 
 #endif /* _MACHINE_XEN_XEN_OS_H_ */
index c89a8ee9cb160380201b1473de39baa88d398120..ad04b23566719ead4cf27add4c5ac91cad91e82c 100644 (file)
@@ -183,6 +183,8 @@ static __inline__ void atomic_inc(atomic_t *v)
 
 #define xen_pmap(pa, size)     pmap_mapdev((pa), (size))
 
+#define cpu_to_vcpu_id(cpu) pcpu_find(cpu)->pc_vcpu_id
+
 #endif /* !__ASSEMBLY__ */
 
 #endif /* _MACHINE_XEN_XEN_OS_H_ */