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/idt.s

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /* 
    2  * Mach Operating System
    3  * Copyright (c) 1991,1990 Carnegie Mellon University
    4  * All Rights Reserved.
    5  * 
    6  * Permission to use, copy, modify and distribute this software and its
    7  * documentation is hereby granted, provided that both the copyright
    8  * notice and this permission notice appear in all copies of the
    9  * software, derivative works or modified versions, and any portions
   10  * thereof, and that both notices appear in supporting documentation.
   11  * 
   12  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
   13  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
   14  * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
   15  * 
   16  * Carnegie Mellon requests users of this software to return to
   17  * 
   18  *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
   19  *  School of Computer Science
   20  *  Carnegie Mellon University
   21  *  Pittsburgh PA 15213-3890
   22  * 
   23  * any improvements or extensions that they make and grant Carnegie Mellon
   24  * the rights to redistribute these changes.
   25  */
   26 /*
   27  * HISTORY
   28  * $Log:        idt.s,v $
   29  * Revision 2.8  92/04/01  19:32:10  rpd
   30  *      Changed $0 to $(0) for ANSI cpp.
   31  *      [92/03/25            jvh]
   32  * 
   33  * Revision 2.7  92/01/03  20:06:22  dbg
   34  *      Segment-not-present fault may occur during kernel exit sequence.
   35  *      [91/10/29            dbg]
   36  * 
   37  * Revision 2.6  91/07/31  17:37:02  dbg
   38  *      Save fewer registers on interrupt entry.
   39  *      [91/07/30  16:51:33  dbg]
   40  * 
   41  * Revision 2.5  91/05/14  16:08:54  mrt
   42  *      Correcting copyright
   43  * 
   44  * Revision 2.4  91/05/08  12:38:06  dbg
   45  *      Put parentheses around substituted immediate expressions, so
   46  *      that they will pass through the GNU preprocessor.
   47  *      [91/04/26  14:35:28  dbg]
   48  * 
   49  * Revision 2.3  91/02/05  17:12:12  mrt
   50  *      Changed to new Mach copyright
   51  *      [91/02/01  17:34:44  mrt]
   52  * 
   53  * Revision 2.2  90/08/27  21:56:52  dbg
   54  *      Created.
   55  *      [90/07/25            dbg]
   56  * 
   57  */
   58 #include <machine/asm.h>
   59 #include <assym.s>
   60 
   61 /*
   62  * Interrupt descriptor table and code vectors for it.
   63  */
   64 #define IDT_ENTRY(vec,type) \
   65         .data   2               ;\
   66         .long   vec             ;\
   67         .word   KERNEL_CS       ;\
   68         .byte   0               ;\
   69         .byte   type            ;\
   70         .text
   71 
   72 /*
   73  * No error code.  Clear error code and push trap number.
   74  */
   75 #define EXCEPTION(n,name) \
   76         IDT_ENTRY(EXT(name),K_TRAP_GATE);\
   77 ENTRY(name)                             ;\
   78         pushl   $(0)                    ;\
   79         pushl   $(n)                    ;\
   80         jmp     _alltraps
   81 
   82 /*
   83  * Interrupt from user.  Clear error code and push trap number.
   84  */
   85 #define EXCEP_USR(n,name) \
   86         IDT_ENTRY(EXT(name),U_TRAP_GATE);\
   87 ENTRY(name)                             ;\
   88         pushl   $(0)                    ;\
   89         pushl   $(n)                    ;\
   90         jmp     _alltraps
   91 
   92 /*
   93  * Special interrupt code.
   94  */
   95 #define EXCEP_SPC(n,name)  \
   96         IDT_ENTRY(EXT(name),K_TRAP_GATE)
   97 
   98 /*
   99  * Error code has been pushed.  Push trap number.
  100  */
  101 #define EXCEP_ERR(n,name) \
  102         IDT_ENTRY(EXT(name),K_TRAP_GATE);\
  103 ENTRY(name)                             ;\
  104         pushl   $(n)                    ;\
  105         jmp     _alltraps
  106 
  107 /*
  108  * Interrupt.
  109  */
  110 #define INTERRUPT(n) \
  111         IDT_ENTRY(0f,K_INTR_GATE)       ;\
  112 0:                                      ;\
  113         pushl   %eax                    ;\
  114         movl    $(n),%eax               ;\
  115         jmp     _all_intrs
  116 
  117         .data   2
  118 ENTRY(idt)
  119         .text
  120 
  121 EXCEPTION(0x00,t_zero_div)
  122 EXCEP_SPC(0x01,t_debug)
  123 INTERRUPT(0x02)                 /* NMI */
  124 EXCEP_USR(0x03,t_int3)
  125 EXCEP_USR(0x04,t_into)
  126 EXCEP_USR(0x05,t_bounds)
  127 EXCEPTION(0x06,t_invop)
  128 EXCEPTION(0x07,t_nofpu)
  129 EXCEPTION(0x08,a_dbl_fault)
  130 EXCEPTION(0x09,a_fpu_over)
  131 EXCEPTION(0x0a,a_inv_tss)
  132 EXCEP_SPC(0x0b,t_segnp)
  133 EXCEP_ERR(0x0c,t_stack_fault)
  134 EXCEP_SPC(0x0d,t_gen_prot)
  135 EXCEP_SPC(0x0e,t_page_fault)
  136 EXCEPTION(0x0f,t_trap_0f)
  137 EXCEPTION(0x10,t_fpu_err)
  138 EXCEPTION(0x11,t_trap_11)
  139 EXCEPTION(0x12,t_trap_12)
  140 EXCEPTION(0x13,t_trap_13)
  141 EXCEPTION(0x14,t_trap_14)
  142 EXCEPTION(0x15,t_trap_15)
  143 EXCEPTION(0x16,t_trap_16)
  144 EXCEPTION(0x17,t_trap_17)
  145 EXCEPTION(0x18,t_trap_18)
  146 EXCEPTION(0x19,t_trap_19)
  147 EXCEPTION(0x1a,t_trap_1a)
  148 EXCEPTION(0x1b,t_trap_1b)
  149 EXCEPTION(0x1c,t_trap_1c)
  150 EXCEPTION(0x1d,t_trap_1d)
  151 EXCEPTION(0x1e,t_trap_1e)
  152 EXCEPTION(0x1f,t_trap_1f)
  153 
  154 INTERRUPT(0x20)
  155 INTERRUPT(0x21)
  156 INTERRUPT(0x22)
  157 INTERRUPT(0x23)
  158 INTERRUPT(0x24)
  159 INTERRUPT(0x25)
  160 INTERRUPT(0x26)
  161 INTERRUPT(0x27)
  162 INTERRUPT(0x28)
  163 INTERRUPT(0x29)
  164 INTERRUPT(0x2a)
  165 INTERRUPT(0x2b)
  166 INTERRUPT(0x2c)
  167 INTERRUPT(0x2d)
  168 INTERRUPT(0x2e)
  169 INTERRUPT(0x2f)
  170 
  171 INTERRUPT(0x30)
  172 INTERRUPT(0x31)
  173 INTERRUPT(0x32)
  174 INTERRUPT(0x33)
  175 INTERRUPT(0x34)
  176 INTERRUPT(0x35)
  177 INTERRUPT(0x36)
  178 INTERRUPT(0x37)
  179 INTERRUPT(0x38)
  180 INTERRUPT(0x39)
  181 INTERRUPT(0x3a)
  182 INTERRUPT(0x3b)
  183 INTERRUPT(0x3c)
  184 INTERRUPT(0x3d)
  185 INTERRUPT(0x3e)
  186 INTERRUPT(0x3f)
  187 
  188 INTERRUPT(0x40)
  189 INTERRUPT(0x41)
  190 INTERRUPT(0x42)
  191 INTERRUPT(0x43)
  192 INTERRUPT(0x44)
  193 INTERRUPT(0x45)
  194 INTERRUPT(0x46)
  195 INTERRUPT(0x47)
  196 INTERRUPT(0x48)
  197 INTERRUPT(0x49)
  198 INTERRUPT(0x4a)
  199 INTERRUPT(0x4b)
  200 INTERRUPT(0x4c)
  201 INTERRUPT(0x4d)
  202 INTERRUPT(0x4e)
  203 INTERRUPT(0x4f)
  204 
  205 INTERRUPT(0x50)
  206 INTERRUPT(0x51)
  207 INTERRUPT(0x52)
  208 INTERRUPT(0x53)
  209 INTERRUPT(0x54)
  210 INTERRUPT(0x55)
  211 INTERRUPT(0x56)
  212 INTERRUPT(0x57)
  213 INTERRUPT(0x58)
  214 INTERRUPT(0x59)
  215 INTERRUPT(0x5a)
  216 INTERRUPT(0x5b)
  217 INTERRUPT(0x5c)
  218 INTERRUPT(0x5d)
  219 INTERRUPT(0x5e)
  220 INTERRUPT(0x5f)
  221 
  222 INTERRUPT(0x60)
  223 INTERRUPT(0x61)
  224 INTERRUPT(0x62)
  225 INTERRUPT(0x63)
  226 INTERRUPT(0x64)
  227 INTERRUPT(0x65)
  228 INTERRUPT(0x66)
  229 INTERRUPT(0x67)
  230 INTERRUPT(0x68)
  231 INTERRUPT(0x69)
  232 INTERRUPT(0x6a)
  233 INTERRUPT(0x6b)
  234 INTERRUPT(0x6c)
  235 INTERRUPT(0x6d)
  236 INTERRUPT(0x6e)
  237 INTERRUPT(0x6f)
  238 
  239 INTERRUPT(0x70)
  240 INTERRUPT(0x71)
  241 INTERRUPT(0x72)
  242 INTERRUPT(0x73)
  243 INTERRUPT(0x74)
  244 INTERRUPT(0x75)
  245 INTERRUPT(0x76)
  246 INTERRUPT(0x77)
  247 INTERRUPT(0x78)
  248 INTERRUPT(0x79)
  249 INTERRUPT(0x7a)
  250 INTERRUPT(0x7b)
  251 INTERRUPT(0x7c)
  252 INTERRUPT(0x7d)
  253 INTERRUPT(0x7e)
  254 INTERRUPT(0x7f)
  255 
  256 INTERRUPT(0x80)
  257 INTERRUPT(0x81)
  258 INTERRUPT(0x82)
  259 INTERRUPT(0x83)
  260 INTERRUPT(0x84)
  261 INTERRUPT(0x85)
  262 INTERRUPT(0x86)
  263 INTERRUPT(0x87)
  264 INTERRUPT(0x88)
  265 INTERRUPT(0x89)
  266 INTERRUPT(0x8a)
  267 INTERRUPT(0x8b)
  268 INTERRUPT(0x8c)
  269 INTERRUPT(0x8d)
  270 INTERRUPT(0x8e)
  271 INTERRUPT(0x8f)
  272 
  273 INTERRUPT(0x90)
  274 INTERRUPT(0x91)
  275 INTERRUPT(0x92)
  276 INTERRUPT(0x93)
  277 INTERRUPT(0x94)
  278 INTERRUPT(0x95)
  279 INTERRUPT(0x96)
  280 INTERRUPT(0x97)
  281 INTERRUPT(0x98)
  282 INTERRUPT(0x99)
  283 INTERRUPT(0x9a)
  284 INTERRUPT(0x9b)
  285 INTERRUPT(0x9c)
  286 INTERRUPT(0x9d)
  287 INTERRUPT(0x9e)
  288 INTERRUPT(0x9f)
  289 
  290 INTERRUPT(0xa0)
  291 INTERRUPT(0xa1)
  292 INTERRUPT(0xa2)
  293 INTERRUPT(0xa3)
  294 INTERRUPT(0xa4)
  295 INTERRUPT(0xa5)
  296 INTERRUPT(0xa6)
  297 INTERRUPT(0xa7)
  298 INTERRUPT(0xa8)
  299 INTERRUPT(0xa9)
  300 INTERRUPT(0xaa)
  301 INTERRUPT(0xab)
  302 INTERRUPT(0xac)
  303 INTERRUPT(0xad)
  304 INTERRUPT(0xae)
  305 INTERRUPT(0xaf)
  306 
  307 INTERRUPT(0xb0)
  308 INTERRUPT(0xb1)
  309 INTERRUPT(0xb2)
  310 INTERRUPT(0xb3)
  311 INTERRUPT(0xb4)
  312 INTERRUPT(0xb5)
  313 INTERRUPT(0xb6)
  314 INTERRUPT(0xb7)
  315 INTERRUPT(0xb8)
  316 INTERRUPT(0xb9)
  317 INTERRUPT(0xba)
  318 INTERRUPT(0xbb)
  319 INTERRUPT(0xbc)
  320 INTERRUPT(0xbd)
  321 INTERRUPT(0xbe)
  322 INTERRUPT(0xbf)
  323 
  324 INTERRUPT(0xc0)
  325 INTERRUPT(0xc1)
  326 INTERRUPT(0xc2)
  327 INTERRUPT(0xc3)
  328 INTERRUPT(0xc4)
  329 INTERRUPT(0xc5)
  330 INTERRUPT(0xc6)
  331 INTERRUPT(0xc7)
  332 INTERRUPT(0xc8)
  333 INTERRUPT(0xc9)
  334 INTERRUPT(0xca)
  335 INTERRUPT(0xcb)
  336 INTERRUPT(0xcc)
  337 INTERRUPT(0xcd)
  338 INTERRUPT(0xce)
  339 INTERRUPT(0xcf)
  340 
  341 INTERRUPT(0xd0)
  342 INTERRUPT(0xd1)
  343 INTERRUPT(0xd2)
  344 INTERRUPT(0xd3)
  345 INTERRUPT(0xd4)
  346 INTERRUPT(0xd5)
  347 INTERRUPT(0xd6)
  348 INTERRUPT(0xd7)
  349 INTERRUPT(0xd8)
  350 INTERRUPT(0xd9)
  351 INTERRUPT(0xda)
  352 INTERRUPT(0xdb)
  353 INTERRUPT(0xdc)
  354 INTERRUPT(0xdd)
  355 INTERRUPT(0xde)
  356 INTERRUPT(0xdf)
  357 
  358 INTERRUPT(0xe0)
  359 INTERRUPT(0xe1)
  360 INTERRUPT(0xe2)
  361 INTERRUPT(0xe3)
  362 INTERRUPT(0xe4)
  363 INTERRUPT(0xe5)
  364 INTERRUPT(0xe6)
  365 INTERRUPT(0xe7)
  366 INTERRUPT(0xe8)
  367 INTERRUPT(0xe9)
  368 INTERRUPT(0xea)
  369 INTERRUPT(0xeb)
  370 INTERRUPT(0xec)
  371 INTERRUPT(0xed)
  372 INTERRUPT(0xee)
  373 INTERRUPT(0xef)
  374 
  375 INTERRUPT(0xf0)
  376 INTERRUPT(0xf1)
  377 INTERRUPT(0xf2)
  378 INTERRUPT(0xf3)
  379 INTERRUPT(0xf4)
  380 INTERRUPT(0xf5)
  381 INTERRUPT(0xf6)
  382 INTERRUPT(0xf7)
  383 INTERRUPT(0xf8)
  384 INTERRUPT(0xf9)
  385 INTERRUPT(0xfa)
  386 INTERRUPT(0xfb)
  387 INTERRUPT(0xfc)
  388 INTERRUPT(0xfd)
  389 INTERRUPT(0xfe)
  390 INTERRUPT(0xff)
  391 

Cache object: b74bbf86c863af88a136da86a686e5a1


[ 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.