Deleted Added
full compact
pcpu.h (178471) pcpu.h (181775)
1/*-
2 * Copyright (c) Peter Wemm
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
1/*-
2 * Copyright (c) Peter Wemm
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 * $FreeBSD: head/sys/i386/include/pcpu.h 178471 2008-04-25 05:18:50Z jeff $
26 * $FreeBSD: head/sys/i386/include/pcpu.h 181775 2008-08-15 20:51:31Z kmacy $
27 */
28
29#ifndef _MACHINE_PCPU_H_
30#define _MACHINE_PCPU_H_
31
32#ifndef _SYS_CDEFS_H_
33#error "sys/cdefs.h is a prerequisite for this file"
34#endif

--- 5 unchanged lines hidden (view full) ---

40
41/*
42 * The SMP parts are setup in pmap.c and locore.s for the BSP, and
43 * mp_machdep.c sets up the data for the AP's to "see" when they awake.
44 * The reason for doing it via a struct is so that an array of pointers
45 * to each CPU's data can be set up for things like "check curproc on all
46 * other processors"
47 */
27 */
28
29#ifndef _MACHINE_PCPU_H_
30#define _MACHINE_PCPU_H_
31
32#ifndef _SYS_CDEFS_H_
33#error "sys/cdefs.h is a prerequisite for this file"
34#endif

--- 5 unchanged lines hidden (view full) ---

40
41/*
42 * The SMP parts are setup in pmap.c and locore.s for the BSP, and
43 * mp_machdep.c sets up the data for the AP's to "see" when they awake.
44 * The reason for doing it via a struct is so that an array of pointers
45 * to each CPU's data can be set up for things like "check curproc on all
46 * other processors"
47 */
48
49#ifdef XEN
48#define PCPU_MD_FIELDS \
49 char pc_monitorbuf[128] __aligned(128); /* cache line */ \
50 struct pcpu *pc_prvspace; /* Self-reference */ \
51 struct pmap *pc_curpmap; \
52 struct i386tss pc_common_tss; \
53 struct segment_descriptor pc_common_tssd; \
54 struct segment_descriptor *pc_tss_gdt; \
55 struct segment_descriptor *pc_fsgs_gdt; \
50#define PCPU_MD_FIELDS \
51 char pc_monitorbuf[128] __aligned(128); /* cache line */ \
52 struct pcpu *pc_prvspace; /* Self-reference */ \
53 struct pmap *pc_curpmap; \
54 struct i386tss pc_common_tss; \
55 struct segment_descriptor pc_common_tssd; \
56 struct segment_descriptor *pc_tss_gdt; \
57 struct segment_descriptor *pc_fsgs_gdt; \
58 vm_paddr_t *pc_pdir_shadow; \
56 int pc_currentldt; \
57 u_int pc_acpi_id; /* ACPI CPU id */ \
58 u_int pc_apic_id; \
59 int pc_currentldt; \
60 u_int pc_acpi_id; /* ACPI CPU id */ \
61 u_int pc_apic_id; \
62 int pc_private_tss; /* Flag indicating private tss*/\
63 u_int pc_cr3; /* track cr3 for R1/R3*/ \
64 u_int pc_pdir; \
65 u_int pc_lazypmap; \
66 u_int pc_rendezvous; \
67 u_int pc_cpuast
68
69
70#else
71#define PCPU_MD_FIELDS \
72 char pc_monitorbuf[128] __aligned(128); /* cache line */ \
73 struct pcpu *pc_prvspace; /* Self-reference */ \
74 struct pmap *pc_curpmap; \
75 struct i386tss pc_common_tss; \
76 struct segment_descriptor pc_common_tssd; \
77 struct segment_descriptor *pc_tss_gdt; \
78 struct segment_descriptor *pc_fsgs_gdt; \
79 int pc_currentldt; \
80 u_int pc_acpi_id; /* ACPI CPU id */ \
81 u_int pc_apic_id; \
59 int pc_private_tss /* Flag indicating private tss */
60
82 int pc_private_tss /* Flag indicating private tss */
83
84#endif
61#ifdef lint
62
63extern struct pcpu *pcpup;
64
65#define PCPU_GET(member) (pcpup->pc_ ## member)
66#define PCPU_ADD(member, val) (pcpu->pc_ ## member += (val))
67#define PCPU_INC(member) PCPU_ADD(member, 1)
68#define PCPU_PTR(member) (&pcpup->pc_ ## member)

--- 141 unchanged lines hidden ---
85#ifdef lint
86
87extern struct pcpu *pcpup;
88
89#define PCPU_GET(member) (pcpup->pc_ ## member)
90#define PCPU_ADD(member, val) (pcpu->pc_ ## member += (val))
91#define PCPU_INC(member) PCPU_ADD(member, 1)
92#define PCPU_PTR(member) (&pcpup->pc_ ## member)

--- 141 unchanged lines hidden ---