MFamd64: Add a new macro PCPU_XEN_FIELDS to hold XEN-specific per-CPU

fields that is always included in PCPU_MD_FIELDS.  The macro is empty for
non-XEN kernels.  This avoids duplicating non-XEN per-CPU fields in two
places.  While here, remove several unused fields from the XEN-specific
structure.

Reviewed by:	kmacy, gibbs
MFC after:	1 month
This commit is contained in:
John Baldwin 2010-06-02 15:09:36 +00:00
parent 5619a3e4bf
commit 9c72429312

View File

@ -62,36 +62,20 @@ struct shadow_time_info {
uint32_t version;
};
#define PCPU_MD_FIELDS \
char pc_monitorbuf[128] __aligned(128); /* cache line */ \
struct pcpu *pc_prvspace; /* Self-reference */ \
struct pmap *pc_curpmap; \
struct i386tss pc_common_tss; \
struct segment_descriptor pc_common_tssd; \
struct segment_descriptor *pc_tss_gdt; \
struct segment_descriptor *pc_fsgs_gdt; \
vm_paddr_t *pc_pdir_shadow; \
int pc_currentldt; \
u_int pc_acpi_id; /* ACPI CPU id */ \
u_int pc_apic_id; \
int pc_private_tss; /* Flag indicating private tss*/\
u_int pc_cmci_mask; /* MCx banks for CMCI */ \
u_int pc_cr3; /* track cr3 for R1/R3*/ \
u_int pc_pdir; \
u_int pc_lazypmap; \
u_int pc_rendezvous; \
u_int pc_cpuast; \
uint64_t pc_processed_system_time; \
#define PCPU_XEN_FIELDS \
; \
u_int pc_cr3; /* track cr3 for R1/R3*/ \
vm_paddr_t *pc_pdir_shadow; \
uint64_t pc_processed_system_time; \
struct shadow_time_info pc_shadow_time; \
int pc_resched_irq; \
int pc_callfunc_irq; \
int pc_virq_to_irq[NR_VIRQS]; \
int pc_ipi_to_irq[NR_IPIS]
int pc_virq_to_irq[NR_VIRQS]; \
int pc_ipi_to_irq[NR_IPIS]
#else
#define PCPU_XEN_FIELDS
#endif
#define PCPU_MD_FIELDS \
char pc_monitorbuf[128] __aligned(128); /* cache line */ \
struct pcpu *pc_prvspace; /* Self-reference */ \
@ -105,8 +89,7 @@ struct shadow_time_info {
u_int pc_apic_id; \
int pc_private_tss; /* Flag indicating private tss*/\
u_int pc_cmci_mask /* MCx banks for CMCI */ \
#endif
PCPU_XEN_FIELDS
#ifdef _KERNEL