Ignore:
Timestamp:
08/19/98 20:09:59 (25 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
26b5c77f
Parents:
7549e14
Message:

Patch from Eric Valette <valette@…>:

  • Use the "hlt" instruction for the Idle thread,
  • Optimise interrupt PATH leadding to thread wakeup,
  • Preparation for Intel exception management that should come before the end of the week...
File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/i386/shared/irq/irq_asm.s

    r7549e14 r8b2ee37c  
    1515#include <irq_asm.h>
    1616
    17 .set SAVED_REGS     , 32                   # space consumed by saved regs
    18 .set EIP_OFFSET     , SAVED_REGS           # offset of tasks eip
    19 .set CS_OFFSET      , EIP_OFFSET+4         # offset of tasks code segment
    20 .set EFLAGS_OFFSET  , CS_OFFSET+4          # offset of tasks eflags
    21        
    22 
    23 /*PAGE
    24  *  void _New_ISR_Displatch()
    25  *
    26  *  Entry point from the outermost interrupt service routine exit.
    27  *  The current stack is the supervisor mode stack.
    28  */
    29 
    30         PUBLIC (_New_ISR_Displatch)
    31 SYM (_New_ISR_Displatch):
    32 
    33         call      SYM (_Thread_Dispatch)   # invoke Dispatcher
    34 
    35        /*
    36         * BEGINNING OF DE-ESTABLISH SEGMENTS
    37         *
    38         *  NOTE:  Make sure there is code here if code is added to
    39         *         load the segment registers.
    40         *
    41         */
    42 
    43        /***** DE-ESTABLISH SEGMENTS CODE GOES HERE ****/
    44 
    45        /*
    46         * END OF DE-ESTABLISH SEGMENTS
    47         */
    48 
    49         popa                                # restore general registers
    50         iret                                # return to interrupted thread
    51 
    52                
    53 SYM (_New_ISR_Handler):
     17SYM (_ISR_Handler):     
    5418       /*
    5519        *  Before this was point is reached the vectors unique
    5620        *  entry point did the following:
    5721        *
    58         *     1. saved sctach registers registers eax edx ecx"
     22        *     1. saved scratch registers registers eax edx ecx"
    5923        *     2. put the vector number in ecx.
    6024        *
     
    177141        cmpl      $0, SYM (_Context_Switch_necessary)
    178142                                            # Is task switch necessary?
    179         jne       bframe                    # Yes, then build stack
     143        jne       .schedule                 # Yes, then call the scheduler
    180144
    181145        cmpl      $0, SYM (_ISR_Signals_to_thread_executing)
     
    184148        je        .exit                     # No, exit
    185149
    186 bframe:
     150       
     151.bframe:
    187152        movl      $0, SYM (_ISR_Signals_to_thread_executing)
    188153        /*
    189          * complete code as if a pusha had been executed on entry
    190          */
    191         pushl     ebx
    192         pushl     esp
    193         pushl     ebp
    194         pushl     esi
    195         pushl     edi
    196                                             # push the isf for Isr_dispatch
    197         pushl     EFLAGS_OFFSET(esp)        # push tasks eflags
    198         push      cs                        # cs of Isr_dispatch
    199         pushl     $ SYM (_New_ISR_Displatch)# entry point
    200         iret
    201 
     154         * This code is the less critical path. In order to have a single
     155         * Thread Context, we take the same frame than the one pushed on
     156         * exceptions. This makes sense because Signal is a software
     157         * exception.
     158         */
     159        popl    edx
     160        popl    ecx
     161        popl    eax
     162
     163        pushl   $0      # fake fault code
     164        pushl   $0      # fake exception number
     165
     166        pusha
     167        pushl   esp
     168        call    _ThreadProcessSignalsFromIrq
     169        addl    $4, esp
     170        popa
     171        addl    $8, esp
     172        iret
     173                       
     174.schedule:
     175        /*
     176         * the scratch registers have already been saved and we are already
     177         * back on the thread system stack. So we can call _Thread_Displatch
     178         * directly
     179         */
     180        call _Thread_Dispatch
     181        /*
     182         * fall through exit to restore complete contex (scratch registers
     183         * eip, CS, Flags).
     184         */
    202185.exit:
    203186       /*
     
    218201        popl    eax
    219202        iret
    220                
     203
     204                               
    221205#define DISTINCT_INTERRUPT_ENTRY(_vector) \
    222206        .p2align 4                         ; \
     
    227211        pushl   edx             ; \
    228212        movl    $ _vector, ecx  ; \
    229         jmp   SYM (_New_ISR_Handler) ;
     213        jmp   SYM (_ISR_Handler) ;
    230214
    231215DISTINCT_INTERRUPT_ENTRY(0)
Note: See TracChangeset for help on using the changeset viewer.