The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/i386/include/apicreg.h

Version: -  FREEBSD  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-2  -  FREEBSD-11-1  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-4  -  FREEBSD-10-3  -  FREEBSD-10-2  -  FREEBSD-10-1  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-3  -  FREEBSD-9-2  -  FREEBSD-9-1  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-4  -  FREEBSD-8-3  -  FREEBSD-8-2  -  FREEBSD-8-1  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-4  -  FREEBSD-7-3  -  FREEBSD-7-2  -  FREEBSD-7-1  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-4  -  FREEBSD-6-3  -  FREEBSD-6-2  -  FREEBSD-6-1  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-5  -  FREEBSD-5-4  -  FREEBSD-5-3  -  FREEBSD-5-2  -  FREEBSD-5-1  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  linux-2.6  -  linux-2.4.22  -  MK83  -  MK84  -  PLAN9  -  DFBSD  -  NETBSD  -  NETBSD5  -  NETBSD4  -  NETBSD3  -  NETBSD20  -  OPENBSD  -  xnu-517  -  xnu-792  -  xnu-792.6.70  -  xnu-1228  -  xnu-1456.1.26  -  xnu-1699.24.8  -  xnu-2050.18.24  -  OPENSOLARIS  -  minix-3-1-1 
SearchContext: -  none  -  3  -  10 

    1 /*-
    2  * Copyright (c) 1996, by Peter Wemm and Steve Passe
    3  * All rights reserved.
    4  *
    5  * Redistribution and use in source and binary forms, with or without
    6  * modification, are permitted provided that the following conditions
    7  * are met:
    8  * 1. Redistributions of source code must retain the above copyright
    9  *    notice, this list of conditions and the following disclaimer.
   10  * 2. The name of the developer may NOT be used to endorse or promote products
   11  *    derived from this software without specific prior written permission.
   12  *
   13  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
   14  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   15  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   16  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
   17  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   18  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   19  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   20  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   21  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   22  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   23  * SUCH DAMAGE.
   24  *
   25  * $FreeBSD: releng/6.0/sys/i386/include/apicreg.h 139790 2005-01-06 22:18:23Z imp $
   26  */
   27 
   28 #ifndef _MACHINE_APICREG_H_
   29 #define _MACHINE_APICREG_H_
   30 
   31 /*
   32  * Local && I/O APIC definitions.
   33  */
   34 
   35 /*
   36  * Pentium P54C+ Built-in APIC
   37  * (Advanced programmable Interrupt Controller)
   38  * 
   39  * Base Address of Built-in APIC in memory location
   40  * is 0xfee00000.
   41  * 
   42  * Map of APIC Registers:
   43  * 
   44  * Offset (hex)    Description                     Read/Write state
   45  * 000             Reserved
   46  * 010             Reserved
   47  * 020 ID          Local APIC ID                   R/W
   48  * 030 VER         Local APIC Version              R
   49  * 040             Reserved
   50  * 050             Reserved
   51  * 060             Reserved
   52  * 070             Reserved
   53  * 080             Task Priority Register          R/W
   54  * 090             Arbitration Priority Register   R
   55  * 0A0             Processor Priority Register     R
   56  * 0B0             EOI Register                    W
   57  * 0C0 RRR         Remote read                     R
   58  * 0D0             Logical Destination             R/W
   59  * 0E0             Destination Format Register     0..27 R;  28..31 R/W
   60  * 0F0 SVR         Spurious Interrupt Vector Reg.  0..3  R;  4..9   R/W
   61  * 100             ISR  000-031                    R
   62  * 110             ISR  032-063                    R
   63  * 120             ISR  064-095                    R
   64  * 130             ISR  095-128                    R
   65  * 140             ISR  128-159                    R
   66  * 150             ISR  160-191                    R
   67  * 160             ISR  192-223                    R
   68  * 170             ISR  224-255                    R
   69  * 180             TMR  000-031                    R
   70  * 190             TMR  032-063                    R
   71  * 1A0             TMR  064-095                    R
   72  * 1B0             TMR  095-128                    R
   73  * 1C0             TMR  128-159                    R
   74  * 1D0             TMR  160-191                    R
   75  * 1E0             TMR  192-223                    R
   76  * 1F0             TMR  224-255                    R
   77  * 200             IRR  000-031                    R
   78  * 210             IRR  032-063                    R
   79  * 220             IRR  064-095                    R
   80  * 230             IRR  095-128                    R
   81  * 240             IRR  128-159                    R
   82  * 250             IRR  160-191                    R
   83  * 260             IRR  192-223                    R
   84  * 270             IRR  224-255                    R
   85  * 280             Error Status Register           R
   86  * 290             Reserved
   87  * 2A0             Reserved
   88  * 2B0             Reserved
   89  * 2C0             Reserved
   90  * 2D0             Reserved
   91  * 2E0             Reserved
   92  * 2F0             Reserved
   93  * 300 ICR_LOW     Interrupt Command Reg. (0-31)   R/W
   94  * 310 ICR_HI      Interrupt Command Reg. (32-63)  R/W
   95  * 320             Local Vector Table (Timer)      R/W
   96  * 330             Local Vector Table (Thermal)    R/W (PIV+)
   97  * 340             Local Vector Table (Performance) R/W (P6+)
   98  * 350 LVT1        Local Vector Table (LINT0)      R/W
   99  * 360 LVT2        Local Vector Table (LINT1)      R/W
  100  * 370 LVT3        Local Vector Table (ERROR)      R/W
  101  * 380             Initial Count Reg. for Timer    R/W
  102  * 390             Current Count of Timer          R
  103  * 3A0             Reserved
  104  * 3B0             Reserved
  105  * 3C0             Reserved
  106  * 3D0             Reserved
  107  * 3E0             Timer Divide Configuration Reg. R/W
  108  * 3F0             Reserved
  109  */
  110 
  111 
  112 /******************************************************************************
  113  * global defines, etc.
  114  */
  115 
  116 
  117 /******************************************************************************
  118  * LOCAL APIC structure
  119  */
  120 
  121 #ifndef LOCORE
  122 #include <sys/types.h>
  123 
  124 #define PAD3    int : 32; int : 32; int : 32
  125 #define PAD4    int : 32; int : 32; int : 32; int : 32
  126 
  127 struct LAPIC {
  128         /* reserved */          PAD4;
  129         /* reserved */          PAD4;
  130         u_int32_t id;           PAD3;
  131         u_int32_t version;      PAD3;
  132         /* reserved */          PAD4;
  133         /* reserved */          PAD4;
  134         /* reserved */          PAD4;
  135         /* reserved */          PAD4;
  136         u_int32_t tpr;          PAD3;
  137         u_int32_t apr;          PAD3;
  138         u_int32_t ppr;          PAD3;
  139         u_int32_t eoi;          PAD3;
  140         /* reserved */          PAD4;
  141         u_int32_t ldr;          PAD3;
  142         u_int32_t dfr;          PAD3;
  143         u_int32_t svr;          PAD3;
  144         u_int32_t isr0;         PAD3;
  145         u_int32_t isr1;         PAD3;
  146         u_int32_t isr2;         PAD3;
  147         u_int32_t isr3;         PAD3;
  148         u_int32_t isr4;         PAD3;
  149         u_int32_t isr5;         PAD3;
  150         u_int32_t isr6;         PAD3;
  151         u_int32_t isr7;         PAD3;
  152         u_int32_t tmr0;         PAD3;
  153         u_int32_t tmr1;         PAD3;
  154         u_int32_t tmr2;         PAD3;
  155         u_int32_t tmr3;         PAD3;
  156         u_int32_t tmr4;         PAD3;
  157         u_int32_t tmr5;         PAD3;
  158         u_int32_t tmr6;         PAD3;
  159         u_int32_t tmr7;         PAD3;
  160         u_int32_t irr0;         PAD3;
  161         u_int32_t irr1;         PAD3;
  162         u_int32_t irr2;         PAD3;
  163         u_int32_t irr3;         PAD3;
  164         u_int32_t irr4;         PAD3;
  165         u_int32_t irr5;         PAD3;
  166         u_int32_t irr6;         PAD3;
  167         u_int32_t irr7;         PAD3;
  168         u_int32_t esr;          PAD3;
  169         /* reserved */          PAD4;
  170         /* reserved */          PAD4;
  171         /* reserved */          PAD4;
  172         /* reserved */          PAD4;
  173         /* reserved */          PAD4;
  174         /* reserved */          PAD4;
  175         /* reserved */          PAD4;
  176         u_int32_t icr_lo;       PAD3;
  177         u_int32_t icr_hi;       PAD3;
  178         u_int32_t lvt_timer;    PAD3;
  179         u_int32_t lvt_thermal;  PAD3;
  180         u_int32_t lvt_pcint;    PAD3;
  181         u_int32_t lvt_lint0;    PAD3;
  182         u_int32_t lvt_lint1;    PAD3;
  183         u_int32_t lvt_error;    PAD3;
  184         u_int32_t icr_timer;    PAD3;
  185         u_int32_t ccr_timer;    PAD3;
  186         /* reserved */          PAD4;
  187         /* reserved */          PAD4;
  188         /* reserved */          PAD4;
  189         /* reserved */          PAD4;
  190         u_int32_t dcr_timer;    PAD3;
  191         /* reserved */          PAD4;
  192 };
  193 
  194 typedef struct LAPIC lapic_t;
  195 
  196 /******************************************************************************
  197  * I/O APIC structure
  198  */
  199 
  200 struct IOAPIC {
  201         u_int32_t ioregsel;     PAD3;
  202         u_int32_t iowin;        PAD3;
  203 };
  204 
  205 typedef struct IOAPIC ioapic_t;
  206 
  207 #undef PAD4
  208 #undef PAD3
  209 
  210 #endif  /* !LOCORE */
  211 
  212 
  213 /******************************************************************************
  214  * various code 'logical' values
  215  */
  216 
  217 /******************************************************************************
  218  * LOCAL APIC defines
  219  */
  220 
  221 /* default physical locations of LOCAL (CPU) APICs */
  222 #define DEFAULT_APIC_BASE       0xfee00000
  223 
  224 /* constants relating to APIC ID registers */
  225 #define APIC_ID_MASK            0xff000000
  226 #define APIC_ID_SHIFT           24
  227 #define APIC_ID_CLUSTER         0xf0
  228 #define APIC_ID_CLUSTER_ID      0x0f
  229 #define APIC_MAX_CLUSTER        0xe
  230 #define APIC_MAX_INTRACLUSTER_ID 3
  231 #define APIC_ID_CLUSTER_SHIFT   4
  232 
  233 /* fields in VER */
  234 #define APIC_VER_VERSION        0x000000ff
  235 #define APIC_VER_MAXLVT         0x00ff0000
  236 #define MAXLVTSHIFT             16
  237 
  238 /* fields in LDR */
  239 #define APIC_LDR_RESERVED       0x00ffffff
  240 
  241 /* fields in DFR */
  242 #define APIC_DFR_RESERVED       0x0fffffff
  243 #define APIC_DFR_MODEL_MASK     0xf0000000
  244 #define APIC_DFR_MODEL_FLAT     0xf0000000
  245 #define APIC_DFR_MODEL_CLUSTER  0x00000000
  246 
  247 /* fields in SVR */
  248 #define APIC_SVR_VECTOR         0x000000ff
  249 #define APIC_SVR_VEC_PROG       0x000000f0
  250 #define APIC_SVR_VEC_FIX        0x0000000f
  251 #define APIC_SVR_ENABLE         0x00000100
  252 # define APIC_SVR_SWDIS         0x00000000
  253 # define APIC_SVR_SWEN          0x00000100
  254 #define APIC_SVR_FOCUS          0x00000200
  255 # define APIC_SVR_FEN           0x00000000
  256 # define APIC_SVR_FDIS          0x00000200
  257 
  258 /* fields in TPR */
  259 #define APIC_TPR_PRIO           0x000000ff
  260 # define APIC_TPR_INT           0x000000f0
  261 # define APIC_TPR_SUB           0x0000000f
  262 
  263 
  264 /* fields in ICR_LOW */
  265 #define APIC_VECTOR_MASK        0x000000ff
  266 
  267 #define APIC_DELMODE_MASK       0x00000700
  268 # define APIC_DELMODE_FIXED     0x00000000
  269 # define APIC_DELMODE_LOWPRIO   0x00000100
  270 # define APIC_DELMODE_SMI       0x00000200
  271 # define APIC_DELMODE_RR        0x00000300
  272 # define APIC_DELMODE_NMI       0x00000400
  273 # define APIC_DELMODE_INIT      0x00000500
  274 # define APIC_DELMODE_STARTUP   0x00000600
  275 # define APIC_DELMODE_RESV      0x00000700
  276 
  277 #define APIC_DESTMODE_MASK      0x00000800
  278 # define APIC_DESTMODE_PHY      0x00000000
  279 # define APIC_DESTMODE_LOG      0x00000800
  280 
  281 #define APIC_DELSTAT_MASK       0x00001000
  282 # define APIC_DELSTAT_IDLE      0x00000000
  283 # define APIC_DELSTAT_PEND      0x00001000
  284 
  285 #define APIC_RESV1_MASK         0x00002000
  286 
  287 #define APIC_LEVEL_MASK         0x00004000
  288 # define APIC_LEVEL_DEASSERT    0x00000000
  289 # define APIC_LEVEL_ASSERT      0x00004000
  290 
  291 #define APIC_TRIGMOD_MASK       0x00008000
  292 # define APIC_TRIGMOD_EDGE      0x00000000
  293 # define APIC_TRIGMOD_LEVEL     0x00008000
  294 
  295 #define APIC_RRSTAT_MASK        0x00030000
  296 # define APIC_RRSTAT_INVALID    0x00000000
  297 # define APIC_RRSTAT_INPROG     0x00010000
  298 # define APIC_RRSTAT_VALID      0x00020000
  299 # define APIC_RRSTAT_RESV       0x00030000
  300 
  301 #define APIC_DEST_MASK          0x000c0000
  302 # define APIC_DEST_DESTFLD      0x00000000
  303 # define APIC_DEST_SELF         0x00040000
  304 # define APIC_DEST_ALLISELF     0x00080000
  305 # define APIC_DEST_ALLESELF     0x000c0000
  306 
  307 #define APIC_RESV2_MASK         0xfff00000
  308 
  309 #define APIC_ICRLO_RESV_MASK    (APIC_RESV1_MASK | APIC_RESV2_MASK)
  310 
  311 /* fields in LVT1/2 */
  312 #define APIC_LVT_VECTOR         0x000000ff
  313 #define APIC_LVT_DM             0x00000700
  314 # define APIC_LVT_DM_FIXED      0x00000000
  315 # define APIC_LVT_DM_SMI        0x00000200
  316 # define APIC_LVT_DM_NMI        0x00000400
  317 # define APIC_LVT_DM_INIT       0x00000500
  318 # define APIC_LVT_DM_EXTINT     0x00000700
  319 #define APIC_LVT_DS             0x00001000
  320 #define APIC_LVT_IIPP           0x00002000
  321 #define APIC_LVT_IIPP_INTALO    0x00002000
  322 #define APIC_LVT_IIPP_INTAHI    0x00000000
  323 #define APIC_LVT_RIRR           0x00004000
  324 #define APIC_LVT_TM             0x00008000
  325 #define APIC_LVT_M              0x00010000
  326 
  327 
  328 /* fields in LVT Timer */
  329 #define APIC_LVTT_VECTOR        0x000000ff
  330 #define APIC_LVTT_DS            0x00001000
  331 #define APIC_LVTT_M             0x00010000
  332 #define APIC_LVTT_TM            0x00020000
  333 # define APIC_LVTT_TM_ONE_SHOT  0x00000000
  334 # define APIC_LVTT_TM_PERIODIC  0x00020000
  335 
  336 
  337 /* APIC timer current count */
  338 #define APIC_TIMER_MAX_COUNT    0xffffffff
  339 
  340 /* fields in TDCR */
  341 #define APIC_TDCR_2             0x00
  342 #define APIC_TDCR_4             0x01
  343 #define APIC_TDCR_8             0x02
  344 #define APIC_TDCR_16            0x03
  345 #define APIC_TDCR_32            0x08
  346 #define APIC_TDCR_64            0x09
  347 #define APIC_TDCR_128           0x0a
  348 #define APIC_TDCR_1             0x0b
  349 
  350 /******************************************************************************
  351  * I/O APIC defines
  352  */
  353 
  354 /* default physical locations of an IO APIC */
  355 #define DEFAULT_IO_APIC_BASE    0xfec00000
  356 
  357 /* window register offset */
  358 #define IOAPIC_WINDOW           0x10
  359 
  360 /* indexes into IO APIC */
  361 #define IOAPIC_ID               0x00
  362 #define IOAPIC_VER              0x01
  363 #define IOAPIC_ARB              0x02
  364 #define IOAPIC_REDTBL           0x10
  365 #define IOAPIC_REDTBL0          IOAPIC_REDTBL
  366 #define IOAPIC_REDTBL1          (IOAPIC_REDTBL+0x02)
  367 #define IOAPIC_REDTBL2          (IOAPIC_REDTBL+0x04)
  368 #define IOAPIC_REDTBL3          (IOAPIC_REDTBL+0x06)
  369 #define IOAPIC_REDTBL4          (IOAPIC_REDTBL+0x08)
  370 #define IOAPIC_REDTBL5          (IOAPIC_REDTBL+0x0a)
  371 #define IOAPIC_REDTBL6          (IOAPIC_REDTBL+0x0c)
  372 #define IOAPIC_REDTBL7          (IOAPIC_REDTBL+0x0e)
  373 #define IOAPIC_REDTBL8          (IOAPIC_REDTBL+0x10)
  374 #define IOAPIC_REDTBL9          (IOAPIC_REDTBL+0x12)
  375 #define IOAPIC_REDTBL10         (IOAPIC_REDTBL+0x14)
  376 #define IOAPIC_REDTBL11         (IOAPIC_REDTBL+0x16)
  377 #define IOAPIC_REDTBL12         (IOAPIC_REDTBL+0x18)
  378 #define IOAPIC_REDTBL13         (IOAPIC_REDTBL+0x1a)
  379 #define IOAPIC_REDTBL14         (IOAPIC_REDTBL+0x1c)
  380 #define IOAPIC_REDTBL15         (IOAPIC_REDTBL+0x1e)
  381 #define IOAPIC_REDTBL16         (IOAPIC_REDTBL+0x20)
  382 #define IOAPIC_REDTBL17         (IOAPIC_REDTBL+0x22)
  383 #define IOAPIC_REDTBL18         (IOAPIC_REDTBL+0x24)
  384 #define IOAPIC_REDTBL19         (IOAPIC_REDTBL+0x26)
  385 #define IOAPIC_REDTBL20         (IOAPIC_REDTBL+0x28)
  386 #define IOAPIC_REDTBL21         (IOAPIC_REDTBL+0x2a)
  387 #define IOAPIC_REDTBL22         (IOAPIC_REDTBL+0x2c)
  388 #define IOAPIC_REDTBL23         (IOAPIC_REDTBL+0x2e)
  389 
  390 /* fields in VER */
  391 #define IOART_VER_VERSION       0x000000ff
  392 #define IOART_VER_MAXREDIR      0x00ff0000
  393 #define MAXREDIRSHIFT           16
  394 
  395 /*
  396  * fields in the IO APIC's redirection table entries
  397  */
  398 #define IOART_DEST      APIC_ID_MASK    /* broadcast addr: all APICs */
  399 
  400 #define IOART_RESV      0x00fe0000      /* reserved */
  401 
  402 #define IOART_INTMASK   0x00010000      /* R/W: INTerrupt mask */
  403 # define IOART_INTMCLR  0x00000000      /*       clear, allow INTs */
  404 # define IOART_INTMSET  0x00010000      /*       set, inhibit INTs */
  405 
  406 #define IOART_TRGRMOD   0x00008000      /* R/W: trigger mode */
  407 # define IOART_TRGREDG  0x00000000      /*       edge */
  408 # define IOART_TRGRLVL  0x00008000      /*       level */
  409 
  410 #define IOART_REM_IRR   0x00004000      /* RO: remote IRR */
  411 
  412 #define IOART_INTPOL    0x00002000      /* R/W: INT input pin polarity */
  413 # define IOART_INTAHI   0x00000000      /*      active high */
  414 # define IOART_INTALO   0x00002000      /*      active low */
  415 
  416 #define IOART_DELIVS    0x00001000      /* RO: delivery status */
  417 
  418 #define IOART_DESTMOD   0x00000800      /* R/W: destination mode */
  419 # define IOART_DESTPHY  0x00000000      /*      physical */
  420 # define IOART_DESTLOG  0x00000800      /*      logical */
  421 
  422 #define IOART_DELMOD    0x00000700      /* R/W: delivery mode */
  423 # define IOART_DELFIXED 0x00000000      /*       fixed */
  424 # define IOART_DELLOPRI 0x00000100      /*       lowest priority */
  425 # define IOART_DELSMI   0x00000200      /*       System Management INT */
  426 # define IOART_DELRSV1  0x00000300      /*       reserved */
  427 # define IOART_DELNMI   0x00000400      /*       NMI signal */
  428 # define IOART_DELINIT  0x00000500      /*       INIT signal */
  429 # define IOART_DELRSV2  0x00000600      /*       reserved */
  430 # define IOART_DELEXINT 0x00000700      /*       External INTerrupt */
  431 
  432 #define IOART_INTVEC    0x000000ff      /* R/W: INTerrupt vector field */
  433 
  434 #endif /* _MACHINE_APICREG_H_ */

Cache object: 7622ed198a1260f6573171ee8d3ea201


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.