7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayases * CDDL HEADER START
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayases * The contents of this file are subject to the terms of the
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayases * Common Development and Distribution License (the "License").
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayases * You may not use this file except in compliance with the License.
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayases * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayases * or http://www.opensolaris.org/os/licensing.
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayases * See the License for the specific language governing permissions
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayases * and limitations under the License.
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayases * When distributing Covered Code, include this CDDL HEADER in each
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayases * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayases * If applicable, add the following below this CDDL HEADER, with the
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayases * fields enclosed by brackets "[]" replaced with your own identifying
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayases * information: Portions Copyright [yyyy] [name of copyright owner]
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayases * CDDL HEADER END
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayases * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
a288e5a9793fdffe5e842d7e61ab45263e75eacaJoshua M. Clulow * Copyright (c) 2013, Joyent, Inc. All rights reserved.
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayases * Functions & Variables common to pcplusmp & apix
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayases/* Methods for multiple IOAPIC */
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayases APIC_MUL_IOAPIC_NONE, /* use to disable pcplusmp fallback */
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayases APIC_MUL_IOAPIC_MASK, /* Set RT Entry Mask bit before EOI */
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayases APIC_MUL_IOAPIC_IIR, /* IOMMU interrup remapping */
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayases APIC_MUL_IOAPIC_PCPLUSMP /* Fall back to old pcplusmp */
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayases ((type) == APIC_MUL_IOAPIC_DEOI || (type) == APIC_MUL_IOAPIC_IIR)
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayases ((type) == APIC_MUL_IOAPIC_NONE || (type) == APIC_MUL_IOAPIC_MASK)
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayasesextern int apix_loaded(void);
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayasesextern enum apic_ioapic_method_type apix_mul_ioapic_method;
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayases/* to allow disabling one-shot capability */
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayases/* Now the ones for Dynamic Interrupt distribution */
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayases * These variables are frequently accessed in apic_intr_enter(),
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayases * apic_intr_exit and apic_setspl, so group them together
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayasesextern volatile uint32_t *apicadr; /* virtual addr of local APIC */
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayasesextern uchar_t apic_io_vectbase[MAX_IO_APIC];
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayasesextern int apic_setspl_delay; /* apic_setspl - delay enable */
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayases/* vector at which error interrupts come in */
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayases/* vector at which performance counter overflow interrupts come in */
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayases/* vector at which CMCI interrupts come in */
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayasesextern void cmi_cmci_trap(void);
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayasesextern kmutex_t cmci_cpu_setup_lock; /* protects cmci_cpu_setup_registered */
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayasesextern int apic_coarse_hrtime; /* 0 - use accurate slow gethrtime() */
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayases /* 1 - use gettime() for performance */
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayasesextern int apic_flat_model; /* 0 - clustered. 1 - flat */
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayasesextern int apic_debug_msgbuf[APIC_DEBUG_MSGBUFSIZE];
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayases#endif /* DEBUG */
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayasesextern volatile int apic_hrtime_stamp;
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayasesextern volatile hrtime_t apic_nsec_since_boot;
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayasesextern uint64_t apic_ticks_per_SFnsecs; /* # of ticks in SF nsecs */
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayases/* use to make sure only one cpu handles the nmi */
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayases/* use to make sure only one cpu handles the error interrupt */
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayases/* Patchable global variables. */
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayasesextern int apic_kmdb_on_nmi; /* 0 - no, 1 - yes enter kmdb */
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayasesextern uint32_t apic_divide_reg_init; /* 0 - divide by 2 */
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayasesextern int apic_stretch_ISR; /* IPL of 3 matches nothing now */
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayasesextern void apic_nmi_intr(caddr_t arg, struct regs *rp);
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayasesextern int apic_cpu_start(processorid_t cpuid, caddr_t ctx);
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayasesextern int apic_cpu_stop(processorid_t cpuid, caddr_t ctx);
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayasesextern int apic_cpu_add(psm_cpu_request_t *reqp);
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayasesextern int apic_cpu_remove(psm_cpu_request_t *reqp);
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayasesextern int apic_cpu_ops(psm_cpu_request_t *reqp);
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayasesextern void apic_switch_ipi_callback(boolean_t enter);
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayasesextern void apic_send_ipi(int cpun, int ipl);
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayasesextern void apic_set_idlecpu(processorid_t cpun);
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayasesextern void apic_unset_idlecpu(processorid_t cpun);
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayasesextern void apic_preshutdown(int cmd, int fcn);
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayasesextern processorid_t apic_get_next_processorid(processorid_t cpun);
41afdfa77f9af46beb3aaab2eccc0d9afe660d31Krishnendu Sadhukhan - Sun Microsystemsextern uint_t apic_calibrate(volatile uint32_t *, uint16_t *);
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayasesextern int cmci_cpu_setup(cpu_setup_t what, int cpuid, void *arg);
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayasesextern void apic_intrmap_init(int apic_mode);
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayasesextern processorid_t apic_find_cpu(int flag);
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayasesextern processorid_t apic_get_next_bind_cpu(void);
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayasesextern uint32_t apic_get_localapicid(uint32_t cpuid);
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayasesextern uchar_t apic_get_ioapicid(uchar_t ioapicindex);
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayases#endif /* _SYS_APIC_COMMON_H */