Ignore:
Timestamp:
Sep 9, 2001, 5:31:35 PM (24 years ago)
Author:
sandervl
Message:

joystick reactivated; version increase; Rudi's fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sbliveos2/trunk/lib32/spinlock.c

    r142 r188  
    2828#include <asm/hardirq.h>
    2929
     30
     31unsigned long __lock(void);
     32#pragma aux __lock =            \
     33        "pushfd"                \
     34        "cli"                   \
     35        "pop eax"               \
     36        modify exact [eax]      \
     37        value [eax];
     38
     39
     40void __unlock(unsigned long cpuflags);
     41#pragma aux __unlock =          \
     42        "push eax"              \
     43        "popfd"                 \
     44        modify exact []         \
     45        parm [eax];
     46
     47
     48
    3049void spin_lock_init(spinlock_t *lock)
    3150{
     
    3554void spin_lock(spinlock_t *lock)
    3655{
    37   unsigned long cpuflags;
    38 
    39   _asm {
    40         pushfd
    41         pop eax
    42         mov [cpuflags], eax
    43         cli
    44   }
    45   *lock = cpuflags;
     56  *lock = __lock();
    4657}
    4758
    4859void spin_lock_flag(spinlock_t *lock, unsigned long *flag)
    4960{
    50   spin_lock(lock);
     61  *lock = __lock();
    5162}
    5263
     
    6576void spin_unlock(spinlock_t *lock)
    6677{
    67  unsigned long cpuflags = *lock;
     78  __unlock(*lock);
     79}
    6880
    69   _asm {
    70         mov  eax, [cpuflags]
    71         push eax
    72         popfd
    73   }
    74 }
     81
Note: See TracChangeset for help on using the changeset viewer.