Changeset abf41fd in rtems


Ignore:
Timestamp:
Oct 29, 2009, 3:20:21 AM (10 years ago)
Author:
Till Straumann <strauman@…>
Branches:
4.10, 4.11, master
Children:
edfc0f9
Parents:
b80e857
Message:

2009-10-28 Till Straumann <strauman@…>

  • shared/irq/irq_asm.S: Make sure stack is aligned to CPU_STACK_ALIGNMENT before invoking C-code.
Location:
c/src/lib/libbsp/i386
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/i386/ChangeLog

    rb80e857 rabf41fd  
     12009-10-28      Till Straumann <strauman@slac.stanford.edu>
     2
     3        * shared/irq/irq_asm.S: Make sure stack is aligned to
     4        CPU_STACK_ALIGNMENT before invoking C-code.
     5
    162009-10-17      Chris Johns <chrisj@rtems.org>
    27
  • c/src/lib/libbsp/i386/shared/irq/irq_asm.S

    rb80e857 rabf41fd  
    1414#include <rtems/asm.h>
    1515#include <bsp/irq_asm.h>
     16#include <rtems/score/cpu.h>
     17
     18#ifndef CPU_STACK_ALIGNMENT
     19#error "Missing header? CPU_STACK_ALIGNMENT is not defined here"
     20#endif
    1621
    1722               BEGIN_CODE
     
    96101        incl      SYM (_ISR_Nest_level)     /* one nest level deeper */
    97102        incl      SYM (_Thread_Dispatch_disable_level) /* disable multitasking */
     103
     104        /*
     105     * Ensure CPU_STACK_ALIGNMENT for C-code.
     106     *  esp = (esp - 4) & ~(CPU_STACK_ALIGNMENT - 1)
     107         * makes sure 'esp' is aligned AND there is enough space
     108         * for the vector argument on the stack!
     109         */
     110        subl $4, esp
     111
     112        andl $ - CPU_STACK_ALIGNMENT, esp
    98113        /*
    99114         * re-enable interrupts at processor level as the current
     
    102117        sti
    103118
    104         /*
     119    /*
    105120         *  ECX is preloaded with the vector number but it is a scratch register
    106121         *  so we must save it again.
    107122         */
    108123
    109         pushl     ecx                       /* push vector number */
     124        movl ecx, (esp)  /* store vector arg in stack */
    110125        call      C_dispatch_isr
    111         addl      $4, esp
    112126
    113127        /*
     
    115129         */
    116130        cli
    117         popl       ecx                       /* ecx = vector number */
     131
    118132        /*
    119133         * restore stack
Note: See TracChangeset for help on using the changeset viewer.