Print this page
OS-2366 ddi_periodic_add(9F) is entirely rubbish


   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
  23  */



  24 
  25 #ifndef _SYS_APIC_COMMON_H
  26 #define _SYS_APIC_COMMON_H
  27 
  28 #include <sys/psm_types.h>
  29 #include <sys/avintr.h>
  30 #include <sys/privregs.h>
  31 #include <sys/pci.h>

  32 
  33 #ifdef  __cplusplus
  34 extern "C" {
  35 #endif
  36 
  37 /*
  38  * Functions & Variables common to pcplusmp & apix
  39  */
  40 
  41 #include <sys/psm_common.h>
  42 
  43 /* Methods for multiple IOAPIC */
  44 enum apic_ioapic_method_type {
  45         APIC_MUL_IOAPIC_NONE,           /* use to disable pcplusmp fallback */
  46         APIC_MUL_IOAPIC_MASK,           /* Set RT Entry Mask bit before EOI */
  47         APIC_MUL_IOAPIC_DEOI,           /* Directed EOI */
  48         APIC_MUL_IOAPIC_IOXAPIC,        /* IOxAPIC */
  49         APIC_MUL_IOAPIC_IIR,            /* IOMMU interrup remapping */
  50         APIC_MUL_IOAPIC_PCPLUSMP        /* Fall back to old pcplusmp */
  51 };


 142 
 143 extern int      apic_error;
 144 
 145 /* use to make sure only one cpu handles the nmi */
 146 extern lock_t   apic_nmi_lock;
 147 /* use to make sure only one cpu handles the error interrupt */
 148 extern lock_t   apic_error_lock;
 149 
 150 /* Patchable global variables. */
 151 extern int      apic_kmdb_on_nmi;       /* 0 - no, 1 - yes enter kmdb */
 152 extern uint32_t apic_divide_reg_init;   /* 0 - divide by 2 */
 153 
 154 extern apic_intrmap_ops_t *apic_vt_ops;
 155 
 156 #ifdef  DEBUG
 157 extern int      apic_break_on_cpu;
 158 extern int      apic_stretch_interrupts;
 159 extern int      apic_stretch_ISR;       /* IPL of 3 matches nothing now */
 160 #endif
 161 
 162 extern ddi_periodic_t apic_periodic_id;
 163 
 164 extern void apic_nmi_intr(caddr_t arg, struct regs *rp);
 165 extern int      apic_clkinit();
 166 extern hrtime_t apic_gettime();
 167 extern hrtime_t apic_gethrtime();
 168 extern int      apic_cpu_start(processorid_t cpuid, caddr_t ctx);
 169 extern int      apic_cpu_stop(processorid_t cpuid, caddr_t ctx);
 170 extern int      apic_cpu_add(psm_cpu_request_t *reqp);
 171 extern int      apic_cpu_remove(psm_cpu_request_t *reqp);
 172 extern int      apic_cpu_ops(psm_cpu_request_t *reqp);
 173 extern void     apic_switch_ipi_callback(boolean_t enter);
 174 extern void     apic_send_ipi(int cpun, int ipl);
 175 extern void     apic_set_idlecpu(processorid_t cpun);
 176 extern void     apic_unset_idlecpu(processorid_t cpun);
 177 extern void     apic_shutdown(int cmd, int fcn);
 178 extern void     apic_preshutdown(int cmd, int fcn);
 179 extern processorid_t    apic_get_next_processorid(processorid_t cpun);
 180 extern uint_t   apic_calibrate(volatile uint32_t *, uint16_t *);
 181 
 182 extern int apic_error_intr();


   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
  23  */
  24 /*
  25  * Copyright (c) 2013, Joyent, Inc.  All rights reserved.
  26  */
  27 
  28 #ifndef _SYS_APIC_COMMON_H
  29 #define _SYS_APIC_COMMON_H
  30 
  31 #include <sys/psm_types.h>
  32 #include <sys/avintr.h>
  33 #include <sys/privregs.h>
  34 #include <sys/pci.h>
  35 #include <sys/cyclic.h>
  36 
  37 #ifdef  __cplusplus
  38 extern "C" {
  39 #endif
  40 
  41 /*
  42  * Functions & Variables common to pcplusmp & apix
  43  */
  44 
  45 #include <sys/psm_common.h>
  46 
  47 /* Methods for multiple IOAPIC */
  48 enum apic_ioapic_method_type {
  49         APIC_MUL_IOAPIC_NONE,           /* use to disable pcplusmp fallback */
  50         APIC_MUL_IOAPIC_MASK,           /* Set RT Entry Mask bit before EOI */
  51         APIC_MUL_IOAPIC_DEOI,           /* Directed EOI */
  52         APIC_MUL_IOAPIC_IOXAPIC,        /* IOxAPIC */
  53         APIC_MUL_IOAPIC_IIR,            /* IOMMU interrup remapping */
  54         APIC_MUL_IOAPIC_PCPLUSMP        /* Fall back to old pcplusmp */
  55 };


 146 
 147 extern int      apic_error;
 148 
 149 /* use to make sure only one cpu handles the nmi */
 150 extern lock_t   apic_nmi_lock;
 151 /* use to make sure only one cpu handles the error interrupt */
 152 extern lock_t   apic_error_lock;
 153 
 154 /* Patchable global variables. */
 155 extern int      apic_kmdb_on_nmi;       /* 0 - no, 1 - yes enter kmdb */
 156 extern uint32_t apic_divide_reg_init;   /* 0 - divide by 2 */
 157 
 158 extern apic_intrmap_ops_t *apic_vt_ops;
 159 
 160 #ifdef  DEBUG
 161 extern int      apic_break_on_cpu;
 162 extern int      apic_stretch_interrupts;
 163 extern int      apic_stretch_ISR;       /* IPL of 3 matches nothing now */
 164 #endif
 165 
 166 extern cyclic_id_t apic_cyclic_id;
 167 
 168 extern void apic_nmi_intr(caddr_t arg, struct regs *rp);
 169 extern int      apic_clkinit();
 170 extern hrtime_t apic_gettime();
 171 extern hrtime_t apic_gethrtime();
 172 extern int      apic_cpu_start(processorid_t cpuid, caddr_t ctx);
 173 extern int      apic_cpu_stop(processorid_t cpuid, caddr_t ctx);
 174 extern int      apic_cpu_add(psm_cpu_request_t *reqp);
 175 extern int      apic_cpu_remove(psm_cpu_request_t *reqp);
 176 extern int      apic_cpu_ops(psm_cpu_request_t *reqp);
 177 extern void     apic_switch_ipi_callback(boolean_t enter);
 178 extern void     apic_send_ipi(int cpun, int ipl);
 179 extern void     apic_set_idlecpu(processorid_t cpun);
 180 extern void     apic_unset_idlecpu(processorid_t cpun);
 181 extern void     apic_shutdown(int cmd, int fcn);
 182 extern void     apic_preshutdown(int cmd, int fcn);
 183 extern processorid_t    apic_get_next_processorid(processorid_t cpun);
 184 extern uint_t   apic_calibrate(volatile uint32_t *, uint16_t *);
 185 
 186 extern int apic_error_intr();