Changeset 8e0eb63 in mainline for arch/ia32/src/asm.S


Ignore:
Timestamp:
2006-03-15T18:01:43Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
9e1c942
Parents:
2f7342d
Message:

Hopefully final version of interrupt handlers for amd64 and ia32.
amd64 has been especially tricky to debug.
Error code detection is now done in compile time.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • arch/ia32/src/asm.S

    r2f7342d r8e0eb63  
    7979#
    8080.macro handler i n
    81         push %eax
    8281
    8382        /*
    84          * Test if this is interrupt with error word or not.
    85          * Be careful about width of the shift.
     83         * This macro distinguishes between two versions of ia32 exceptions.
     84         * One version has error word and the other does not have it.
     85         * The latter version fakes the error word on the stack so that the
     86         * handlers and istate_t can be the same for both types.
    8687         */
     88
    8789        .iflt \i-32
    88                 movl $(1<<\i), %eax
    89         .else
    90                 movl $0, %eax
    91         .endif
    92         andl $ERROR_WORD_INTERRUPT_LIST, %eax
    93         movl (%esp), %eax
     90                .if (1 << \i) & ERROR_WORD_INTERRUPT_LIST
     91                        /*
     92                         * Version with error word.
     93                         * Just take space equal to subl $4, %esp.
     94                         */
     95                        nop
     96                        nop
     97                        nop
     98                .else
     99                        /*
     100                         * Version without error word,
     101                         */
     102                        subl $4, %esp
     103                .endif
     104        .else
     105                /*
     106                 * Version without error word,
     107                 */
     108                subl $4, %esp
     109        .endif
    94110
    95         /*
    96          * If this interrupt/exception stores error word,
    97          * we need to pop EAX.
    98          * If this interrupt doesn't store error word, we emulate it
    99          * for the sake of consistent istate structure. In that case
    100          * we merely leave the EAX on the stack.
    101          */
    102         jz 0f
    103 
    104         /*
    105          * This exception stores error word.
    106          * Remove EAX from the stack.
    107          */
    108         addl $4, %esp
    109 
    110 0:
    111111        pusha
    112112        movl %esp, %ebp
     
    139139       
    140140        popa
    141         addl $4,%esp    # Skip error word, whether real or fake.
     141        addl $4,%esp    # Skip error word, no matter whether real or fake.
    142142        iret
    143143
Note: See TracChangeset for help on using the changeset viewer.