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