ia64/xen-unstable

changeset 874:64754ee21add

bitkeeper revision 1.546 (3fa28f7diGvQF9o2YySrbVIsTMQmdw)

current.h, entry.S:
Correct stack arithmetic when esp is not a multiple of 4 (eg. in the middle of skanky pcibios code).
author kaf24@scramble.cl.cam.ac.uk
date Fri Oct 31 16:36:13 2003 +0000 (2003-10-31)
parents be83edd7ec0f
children ad4db8b417c1 d1833d5b387b
files xen/arch/i386/entry.S xen/include/asm-i386/current.h
line diff
     1.1 --- a/xen/arch/i386/entry.S	Thu Oct 30 18:15:13 2003 +0000
     1.2 +++ b/xen/arch/i386/entry.S	Fri Oct 31 16:36:13 2003 +0000
     1.3 @@ -161,7 +161,8 @@ NT_MASK		= 0x00004000
     1.4  #define GET_CURRENT(reg)   \
     1.5          movl $4096-4, reg; \
     1.6          orl  %esp, reg;    \
     1.7 -        movl (reg),reg     \
     1.8 +        andl $~3,reg;      \
     1.9 +        movl (reg),reg;
    1.10  
    1.11  ENTRY(continue_nonidle_task)
    1.12          GET_CURRENT(%ebx)
     2.1 --- a/xen/include/asm-i386/current.h	Thu Oct 30 18:15:13 2003 +0000
     2.2 +++ b/xen/include/asm-i386/current.h	Fri Oct 31 16:36:13 2003 +0000
     2.3 @@ -6,7 +6,7 @@ struct task_struct;
     2.4  static inline struct task_struct * get_current(void)
     2.5  {
     2.6      struct task_struct *current;
     2.7 -    __asm__ ( "orl %%esp,%0; movl (%0),%0" 
     2.8 +    __asm__ ( "orl %%esp,%0; andl $~3,%0; movl (%0),%0" 
     2.9                : "=r" (current) : "0" (4092UL) );
    2.10      return current;
    2.11  }
    2.12 @@ -15,7 +15,7 @@ static inline struct task_struct * get_c
    2.13  
    2.14  static inline void set_current(struct task_struct *p)
    2.15  {
    2.16 -    __asm__ ( "orl %%esp,%0; movl %1,(%0)" 
    2.17 +    __asm__ ( "orl %%esp,%0; andl $~3,%0; movl %1,(%0)" 
    2.18                : : "r" (4092UL), "r" (p) );    
    2.19  }
    2.20  
    2.21 @@ -30,7 +30,7 @@ static inline execution_context_t *get_e
    2.22  static inline unsigned long get_stack_top(void)
    2.23  {
    2.24      unsigned long p;
    2.25 -    __asm__ ( "orl %%esp,%0" 
    2.26 +    __asm__ ( "orl %%esp,%0; andl $~3,%0" 
    2.27                : "=r" (p) : "0" (4092UL) );
    2.28      return p;
    2.29  }