Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset f77e591 in mainline for kernel/arch/amd64/src/asm.S


Ignore:
Timestamp:
2010-07-14T13:05:28Z (12 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial
Children:
257ceb1, 4003861
Parents:
2bf2e1d
Message:

Do not align the amd64 interrupt handlers. Give each its own unique label and
use those labels to initialize IDT. This is a similar change to the one which
went in in changeset:mainline,551.1.30 for ia32.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/amd64/src/asm.S

    r2bf2e1d rf77e591  
    192192#define ERROR_WORD_INTERRUPT_LIST  0x00027D00
    193193
    194 #define INTERRUPT_ALIGN         256
    195 
    196 /** Declare interrupt handlers
    197  *
    198  * Declare interrupt handlers for n interrupt
    199  * vectors starting at vector i.
    200  *
    201  * The handlers call exc_dispatch().
    202  *
    203  */
    204 .macro handler i n
    205        
     194.macro handler i
     195.global int_\i
     196int_\i:
     197
    206198        /*
    207199         * Choose between version with error code and version without error
    208          * code. Both versions have to be of the same size. amd64 assembly is,
    209          * however, a little bit tricky. For instance, subq $0x80, %rsp and
    210          * subq $0x78, %rsp can result in two instructions with different
    211          * op-code lengths.
    212          * Therefore we align the interrupt handlers.
     200         * code.
    213201         */
    214202       
     
    290278        addq $(ISTATE_SOFT_SIZE + 8), %rsp
    291279        iretq
    292        
    293         .align INTERRUPT_ALIGN
    294         .if (\n - \i) - 1
    295                 handler "(\i + 1)", \n
    296         .endif
    297280.endm
    298281
    299 .align INTERRUPT_ALIGN
     282#define LIST_0_63 \
     283        0, 1, 2, 3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,\
     284        28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,\
     285        53,54,55,56,57,58,59,60,61,62,63
     286
    300287interrupt_handlers:
    301         h_start:
    302                 handler 0 IDT_ITEMS
    303         h_end:
     288.irp cnt, LIST_0_63
     289        handler \cnt
     290.endr
    304291
    305292/** Low-level syscall handler
     
    545532        ret
    546533
    547 .data
    548 .global interrupt_handler_size
    549 
    550 interrupt_handler_size: .quad (h_end - h_start) / IDT_ITEMS
Note: See TracChangeset for help on using the changeset viewer.