Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Oct 2013 16:31:48 +0000 (UTC)
From:      "Cherry G. Mathew" <cherry@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r256277 - projects/amd64_xen_pv/sys/amd64/include/xen
Message-ID:  <201310101631.r9AGVmIx030159@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: cherry
Date: Thu Oct 10 16:31:47 2013
New Revision: 256277
URL: http://svnweb.freebsd.org/changeset/base/256277

Log:
  Cosmetic changes to make this closer to i386/include/xen/xen-os.h
  
  Approved by: gibbs (implicit)

Modified:
  projects/amd64_xen_pv/sys/amd64/include/xen/xen-os.h

Modified: projects/amd64_xen_pv/sys/amd64/include/xen/xen-os.h
==============================================================================
--- projects/amd64_xen_pv/sys/amd64/include/xen/xen-os.h	Thu Oct 10 16:25:53 2013	(r256276)
+++ projects/amd64_xen_pv/sys/amd64/include/xen/xen-os.h	Thu Oct 10 16:31:47 2013	(r256277)
@@ -43,7 +43,9 @@
 static inline int 
 smp_processor_id(void)  
 {
+    if (__predict_true(gdtset))
 	return PCPU_GET(cpuid);
+    return 0;
 }
 
 #else
@@ -92,7 +94,7 @@ void trap_init(void);
 #define __cli()                                                         \
 do {                                                                    \
         vcpu_info_t *_vcpu;                                             \
-        _vcpu = &HYPERVISOR_shared_info->vcpu_info[PCPU_GET(cpuid)];	\
+        _vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()];	\
         _vcpu->evtchn_upcall_mask = 1;                                  \
         barrier();                                                      \
 } while (0)
@@ -101,7 +103,7 @@ do {                                    
 do {                                                                    \
         vcpu_info_t *_vcpu;                                             \
         barrier();                                                      \
-        _vcpu = &HYPERVISOR_shared_info->vcpu_info[PCPU_GET(cpuid)];	\
+        _vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()];	\
         _vcpu->evtchn_upcall_mask = 0;                                  \
         barrier(); /* unmask then check (avoid races) */                \
         if ( unlikely(_vcpu->evtchn_upcall_pending) )                   \
@@ -112,7 +114,7 @@ do {                                    
 do {                                                                    \
         vcpu_info_t *_vcpu;                                             \
         barrier();                                                      \
-        _vcpu = &HYPERVISOR_shared_info->vcpu_info[PCPU_GET(cpuid)];	\
+        _vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()];	\
         if ((_vcpu->evtchn_upcall_mask = (x)) == 0) {                   \
                 barrier(); /* unmask then check (avoid races) */        \
                 if ( unlikely(_vcpu->evtchn_upcall_pending) )           \
@@ -127,7 +129,7 @@ do {                                    
 #define __save_and_cli(x)                                               \
 do {                                                                    \
         vcpu_info_t *_vcpu;                                             \
-        _vcpu = &HYPERVISOR_shared_info->vcpu_info[PCPU_GET(cpuid)];	\
+        _vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()];	\
         (x) = _vcpu->evtchn_upcall_mask;                                \
         _vcpu->evtchn_upcall_mask = 1;                                  \
         barrier();                                                      \



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201310101631.r9AGVmIx030159>