From 9c724293126e75af03ff24374c907c51536c70d6 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Wed, 2 Jun 2010 15:09:36 +0000 Subject: [PATCH] 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 --- sys/i386/include/pcpu.h | 39 +++++++++++---------------------------- 1 file changed, 11 insertions(+), 28 deletions(-) diff --git a/sys/i386/include/pcpu.h b/sys/i386/include/pcpu.h index 5345eb61a4bf..d80f8e16ac2c 100644 --- a/sys/i386/include/pcpu.h +++ b/sys/i386/include/pcpu.h @@ -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