]> 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>
Sat, 3 Oct 2015 18:37:26 +0000 (19:37 +0100)
sys/amd64/include/xen/xen-os.h
sys/i386/include/xen/xen-os.h

index cffc213cd59167d7e9ff9b489553ecaa138a03f1..e4f5ad0d5c5a8c6830d8735567d1346cbf112c33 100644 (file)
@@ -131,6 +131,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 cbb09f633ae7a30afcc37de126339d4c952337e0..0af67ea8a6dafb7c0b7f178b3b07481f736a7704 100644 (file)
@@ -187,6 +187,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_ */