17c478bd9Sstevel@tonic-gate /* 27c478bd9Sstevel@tonic-gate * CDDL HEADER START 37c478bd9Sstevel@tonic-gate * 47c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 57c478bd9Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only 67c478bd9Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance 77c478bd9Sstevel@tonic-gate * with the License. 87c478bd9Sstevel@tonic-gate * 97c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 107c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 117c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 127c478bd9Sstevel@tonic-gate * and limitations under the License. 137c478bd9Sstevel@tonic-gate * 147c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 157c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 167c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 177c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 187c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 197c478bd9Sstevel@tonic-gate * 207c478bd9Sstevel@tonic-gate * CDDL HEADER END 217c478bd9Sstevel@tonic-gate */ 227c478bd9Sstevel@tonic-gate /* 2327423228Ssherrym * Copyright 2005 Sun Microsystems, Inc. All rights reserved. 247c478bd9Sstevel@tonic-gate * Use is subject to license terms. 257c478bd9Sstevel@tonic-gate */ 267c478bd9Sstevel@tonic-gate 277c478bd9Sstevel@tonic-gate #ifndef _SYS_MACHCPUVAR_H 287c478bd9Sstevel@tonic-gate #define _SYS_MACHCPUVAR_H 297c478bd9Sstevel@tonic-gate 307c478bd9Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 317c478bd9Sstevel@tonic-gate 327c478bd9Sstevel@tonic-gate #ifdef __cplusplus 337c478bd9Sstevel@tonic-gate extern "C" { 347c478bd9Sstevel@tonic-gate #endif 357c478bd9Sstevel@tonic-gate 367c478bd9Sstevel@tonic-gate #include <sys/inttypes.h> 377c478bd9Sstevel@tonic-gate #include <sys/xc_levels.h> 387c478bd9Sstevel@tonic-gate #include <sys/tss.h> 397c478bd9Sstevel@tonic-gate #include <sys/segments.h> 407c478bd9Sstevel@tonic-gate #include <sys/rm_platter.h> 417c478bd9Sstevel@tonic-gate #include <sys/avintr.h> 427c478bd9Sstevel@tonic-gate #include <sys/mmu.h> 437c478bd9Sstevel@tonic-gate #include <sys/pte.h> 447c478bd9Sstevel@tonic-gate 457c478bd9Sstevel@tonic-gate #ifndef _ASM 467c478bd9Sstevel@tonic-gate /* 477c478bd9Sstevel@tonic-gate * Machine specific fields of the cpu struct 487c478bd9Sstevel@tonic-gate * defined in common/sys/cpuvar.h. 497c478bd9Sstevel@tonic-gate * 507c478bd9Sstevel@tonic-gate * Note: This is kinda kludgy but seems to be the best 517c478bd9Sstevel@tonic-gate * of our alternatives. 527c478bd9Sstevel@tonic-gate */ 537c478bd9Sstevel@tonic-gate typedef void *cpu_pri_lev_t; 547c478bd9Sstevel@tonic-gate 557c478bd9Sstevel@tonic-gate struct cpuid_info; /* (deliberately not visible here) */ 567c478bd9Sstevel@tonic-gate 577c478bd9Sstevel@tonic-gate struct machcpu { 587c478bd9Sstevel@tonic-gate /* define all the x_call stuff */ 5927423228Ssherrym volatile int xc_pend[X_CALL_LEVELS]; 6027423228Ssherrym volatile int xc_wait[X_CALL_LEVELS]; 6127423228Ssherrym volatile int xc_ack[X_CALL_LEVELS]; 6227423228Ssherrym volatile int xc_state[X_CALL_LEVELS]; 6327423228Ssherrym volatile int xc_retval[X_CALL_LEVELS]; 647c478bd9Sstevel@tonic-gate 657c478bd9Sstevel@tonic-gate int mcpu_nodeid; /* node-id */ 667c478bd9Sstevel@tonic-gate int mcpu_pri; /* CPU priority */ 677c478bd9Sstevel@tonic-gate cpu_pri_lev_t mcpu_pri_data; /* ptr to machine dependent */ 687c478bd9Sstevel@tonic-gate /* data for setting priority */ 697c478bd9Sstevel@tonic-gate /* level */ 707c478bd9Sstevel@tonic-gate 717c478bd9Sstevel@tonic-gate uint_t mcpu_mask; /* bitmask for this cpu (1<<cpu_id) */ 727c478bd9Sstevel@tonic-gate struct hat *mcpu_current_hat; /* cpu's current hat */ 737c478bd9Sstevel@tonic-gate 747c478bd9Sstevel@tonic-gate struct hat_cpu_info *mcpu_hat_info; 757c478bd9Sstevel@tonic-gate 767c478bd9Sstevel@tonic-gate /* i86 hardware table addresses that cannot be shared */ 777c478bd9Sstevel@tonic-gate user_desc_t *mcpu_gdt; /* GDT */ 787c478bd9Sstevel@tonic-gate gate_desc_t *mcpu_idt; /* IDT */ 797c478bd9Sstevel@tonic-gate 807c478bd9Sstevel@tonic-gate struct tss *mcpu_tss; /* TSS */ 817c478bd9Sstevel@tonic-gate 827c478bd9Sstevel@tonic-gate user_desc_t *mcpu_ldt; /* LDT XXX - needed? */ 837c478bd9Sstevel@tonic-gate struct cpu_tables *mcpu_cp_tables; /* pointer to space acquired */ 847c478bd9Sstevel@tonic-gate /* while starting up */ 857c478bd9Sstevel@tonic-gate /* auxillary processors */ 867c478bd9Sstevel@tonic-gate kmutex_t mcpu_ppaddr_mutex; 877c478bd9Sstevel@tonic-gate 887c478bd9Sstevel@tonic-gate caddr_t mcpu_caddr1; /* per cpu CADDR1 */ 897c478bd9Sstevel@tonic-gate caddr_t mcpu_caddr2; /* per cpu CADDR2 */ 907c478bd9Sstevel@tonic-gate void *mcpu_caddr1pte; 917c478bd9Sstevel@tonic-gate void *mcpu_caddr2pte; 927c478bd9Sstevel@tonic-gate struct softint mcpu_softinfo; 937c478bd9Sstevel@tonic-gate uint64_t pil_high_start[HIGH_LEVELS]; 94*7a364d25Sschwartz uint64_t intrstat[PIL_MAX + 1][2]; 957c478bd9Sstevel@tonic-gate struct cpuid_info *mcpu_cpi; 967c478bd9Sstevel@tonic-gate #if defined(__amd64) 977c478bd9Sstevel@tonic-gate greg_t mcpu_rtmp_rsp; /* syscall: temporary %rsp stash */ 987c478bd9Sstevel@tonic-gate greg_t mcpu_rtmp_r15; /* syscall: temporary %r15 stash */ 997c478bd9Sstevel@tonic-gate #endif 1007c478bd9Sstevel@tonic-gate }; 1017c478bd9Sstevel@tonic-gate 1027c478bd9Sstevel@tonic-gate #endif /* _ASM */ 1037c478bd9Sstevel@tonic-gate 1047c478bd9Sstevel@tonic-gate #define cpu_nodeid cpu_m.mcpu_nodeid 1057c478bd9Sstevel@tonic-gate #define cpu_pri cpu_m.mcpu_pri 1067c478bd9Sstevel@tonic-gate #define cpu_pri_data cpu_m.mcpu_pri_data 1077c478bd9Sstevel@tonic-gate #define cpu_mask cpu_m.mcpu_mask 1087c478bd9Sstevel@tonic-gate #define cpu_current_hat cpu_m.mcpu_current_hat 1097c478bd9Sstevel@tonic-gate #define cpu_hat_info cpu_m.mcpu_hat_info 1107c478bd9Sstevel@tonic-gate #define cpu_ppaddr_mutex cpu_m.mcpu_ppaddr_mutex 1117c478bd9Sstevel@tonic-gate #define cpu_gdt cpu_m.mcpu_gdt 1127c478bd9Sstevel@tonic-gate #define cpu_idt cpu_m.mcpu_idt 1137c478bd9Sstevel@tonic-gate #define cpu_tss cpu_m.mcpu_tss 1147c478bd9Sstevel@tonic-gate #define cpu_ldt cpu_m.mcpu_ldt 1157c478bd9Sstevel@tonic-gate #define cpu_caddr1 cpu_m.mcpu_caddr1 1167c478bd9Sstevel@tonic-gate #define cpu_caddr2 cpu_m.mcpu_caddr2 1177c478bd9Sstevel@tonic-gate #define cpu_softinfo cpu_m.mcpu_softinfo 1187c478bd9Sstevel@tonic-gate #define cpu_caddr1pte cpu_m.mcpu_caddr1pte 1197c478bd9Sstevel@tonic-gate #define cpu_caddr2pte cpu_m.mcpu_caddr2pte 1207c478bd9Sstevel@tonic-gate 1217c478bd9Sstevel@tonic-gate #ifdef __cplusplus 1227c478bd9Sstevel@tonic-gate } 1237c478bd9Sstevel@tonic-gate #endif 1247c478bd9Sstevel@tonic-gate 1257c478bd9Sstevel@tonic-gate #endif /* _SYS_MACHCPUVAR_H */ 126