Changeset 53f9821 in mainline for arch/ia32/include


Ignore:
Timestamp:
2006-03-20T20:32:17Z (20 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
018d957e
Parents:
9d3e185
Message:

Cleanup of spinlocks, now compiles both ia32 and amd64 with
and without DEBUG_SPINLOCKS. Made spinlocks inline.
Moved syscall_handler to generic (it was identical for ia32,amd64 & mips32).
Made slightly faster syscall for ia32.
Made better interrupt routines for ia32.
Allow not saving non-scratch registers during interrupt on ia32,amd64,mips32.
Aligned interrupt handlers on ia32,amd64, this should prevent problems
with different instruction lengths.

Location:
arch/ia32/include
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • arch/ia32/include/atomic.h

    r9d3e185 r53f9821  
    3131
    3232#include <arch/types.h>
     33#include <arch/barrier.h>
     34#include <preemption.h>
    3335
    3436typedef struct { volatile __u32 count; } atomic_t;
     
    101103}
    102104
     105/** Ia32 specific fast spinlock */
     106static inline void atomic_lock_arch(atomic_t *val)
     107{
     108        __u32 tmp;
    103109
    104 extern void spinlock_arch(volatile int *val);
     110        preemption_disable();
     111        __asm__ volatile (
     112                "0:;"
     113#ifdef CONFIG_HT
     114                "pause;" /* Pentium 4's HT love this instruction */
     115#endif
     116                "mov %0, %1;"
     117                "testl %1, %1;"
     118                "jnz 0b;"       /* Leightweight looping on locked spinlock */
     119               
     120                "incl %1;"      /* now use the atomic operation */
     121                "xchgl %0, %1;"
     122                "testl %1, %1;"
     123                "jnz 0b;"
     124                : "=m"(val->count),"=r"(tmp)
     125                );
     126        /*
     127         * Prevent critical section code from bleeding out this way up.
     128         */
     129        CS_ENTER_BARRIER();
     130}
    105131
    106132#endif
  • arch/ia32/include/interrupt.h

    r9d3e185 r53f9821  
    6464
    6565struct istate {
     66        __u32 eax;
     67        __u32 ecx;
     68        __u32 edx;
     69        __u32 esi;
    6670        __u32 edi;
    67         __u32 esi;
    6871        __u32 ebp;
    69         __u32 esp;
    7072        __u32 ebx;
    71         __u32 edx;
    72         __u32 ecx;
    73         __u32 eax;
     73
     74        __u32 gs;
     75        __u32 fs;
     76        __u32 es;
     77        __u32 ds;
     78
    7479        __u32 error_word;
    7580        __u32 eip;
Note: See TracChangeset for help on using the changeset viewer.