xref: /titanic_50/usr/src/uts/i86pc/sys/machcpuvar.h (revision e8031f0a8ed0e45c6d8847c5e09424e66fd34a4b)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef	_SYS_MACHCPUVAR_H
28 #define	_SYS_MACHCPUVAR_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #ifdef	__cplusplus
33 extern "C" {
34 #endif
35 
36 #include <sys/inttypes.h>
37 #include <sys/xc_levels.h>
38 #include <sys/tss.h>
39 #include <sys/segments.h>
40 #include <sys/rm_platter.h>
41 #include <sys/avintr.h>
42 #include <sys/mmu.h>
43 #include <sys/pte.h>
44 
45 #ifndef	_ASM
46 /*
47  * Machine specific fields of the cpu struct
48  * defined in common/sys/cpuvar.h.
49  *
50  * Note:  This is kinda kludgy but seems to be the best
51  * of our alternatives.
52  */
53 typedef void *cpu_pri_lev_t;
54 
55 struct cpuid_info;			/* (deliberately not visible here) */
56 
57 struct	machcpu {
58 	/* define all the x_call stuff */
59 	volatile int	xc_pend[X_CALL_LEVELS];
60 	volatile int	xc_wait[X_CALL_LEVELS];
61 	volatile int	xc_ack[X_CALL_LEVELS];
62 	volatile int	xc_state[X_CALL_LEVELS];
63 	volatile int	xc_retval[X_CALL_LEVELS];
64 
65 	int		mcpu_nodeid;		/* node-id */
66 	int		mcpu_pri;		/* CPU priority */
67 	cpu_pri_lev_t	mcpu_pri_data;		/* ptr to machine dependent */
68 						/* data for setting priority */
69 						/* level */
70 
71 	uint_t		mcpu_mask;	/* bitmask for this cpu (1<<cpu_id) */
72 	struct hat	*mcpu_current_hat; /* cpu's current hat */
73 
74 	struct hat_cpu_info	*mcpu_hat_info;
75 
76 	/* i86 hardware table addresses that cannot be shared */
77 	user_desc_t	*mcpu_gdt;	/* GDT */
78 	gate_desc_t	*mcpu_idt;	/* IDT */
79 	struct tss	*mcpu_tss;	/* TSS */
80 
81 	struct	cpu_tables *mcpu_cp_tables;	/* pointer to space acquired */
82 						/* while starting up */
83 						/* auxillary processors */
84 	kmutex_t	mcpu_ppaddr_mutex;
85 
86 	caddr_t		mcpu_caddr1;	/* per cpu CADDR1 */
87 	caddr_t		mcpu_caddr2;	/* per cpu CADDR2 */
88 	void		*mcpu_caddr1pte;
89 	void		*mcpu_caddr2pte;
90 	struct softint mcpu_softinfo;
91 	uint64_t	pil_high_start[HIGH_LEVELS];
92 	uint64_t	intrstat[PIL_MAX + 1][2];
93 	struct cpuid_info	 *mcpu_cpi;
94 #if defined(__amd64)
95 	greg_t	mcpu_rtmp_rsp;		/* syscall: temporary %rsp stash */
96 	greg_t	mcpu_rtmp_r15;		/* syscall: temporary %r15 stash */
97 #endif
98 };
99 
100 #endif	/* _ASM */
101 
102 #define	cpu_nodeid cpu_m.mcpu_nodeid
103 #define	cpu_pri cpu_m.mcpu_pri
104 #define	cpu_pri_data cpu_m.mcpu_pri_data
105 #define	cpu_mask cpu_m.mcpu_mask
106 #define	cpu_current_hat cpu_m.mcpu_current_hat
107 #define	cpu_hat_info cpu_m.mcpu_hat_info
108 #define	cpu_ppaddr_mutex cpu_m.mcpu_ppaddr_mutex
109 #define	cpu_gdt cpu_m.mcpu_gdt
110 #define	cpu_idt cpu_m.mcpu_idt
111 #define	cpu_tss cpu_m.mcpu_tss
112 #define	cpu_ldt cpu_m.mcpu_ldt
113 #define	cpu_caddr1 cpu_m.mcpu_caddr1
114 #define	cpu_caddr2 cpu_m.mcpu_caddr2
115 #define	cpu_softinfo cpu_m.mcpu_softinfo
116 #define	cpu_caddr1pte cpu_m.mcpu_caddr1pte
117 #define	cpu_caddr2pte cpu_m.mcpu_caddr2pte
118 
119 #ifdef	__cplusplus
120 }
121 #endif
122 
123 #endif	/* _SYS_MACHCPUVAR_H */
124