Code Review
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
[PATCH] CRIS update: SMP
[linux-2.6.git]
/
include
/
asm-cris
/
semaphore.h
diff --git
a/include/asm-cris/semaphore.h
b/include/asm-cris/semaphore.h
index 605aa7eaaaf8d4190c767ba7920c2ddab8a9d886..8ed7636ab31127274966641022db9c8580b7313c 100644
(file)
--- a/
include/asm-cris/semaphore.h
+++ b/
include/asm-cris/semaphore.h
@@
-72,10
+72,9
@@
extern inline void down(struct semaphore * sem)
might_sleep();
/* atomically decrement the semaphores count, and if its negative, we wait */
might_sleep();
/* atomically decrement the semaphores count, and if its negative, we wait */
- local_save_flags(flags);
- local_irq_disable();
+ cris_atomic_save(sem, flags);
failed = --(sem->count.counter) < 0;
failed = --(sem->count.counter) < 0;
-
local_irq_restore(
flags);
+
cris_atomic_restore(sem,
flags);
if(failed) {
__down(sem);
}
if(failed) {
__down(sem);
}
@@
-95,10
+94,9
@@
extern inline int down_interruptible(struct semaphore * sem)
might_sleep();
/* atomically decrement the semaphores count, and if its negative, we wait */
might_sleep();
/* atomically decrement the semaphores count, and if its negative, we wait */
- local_save_flags(flags);
- local_irq_disable();
+ cris_atomic_save(sem, flags);
failed = --(sem->count.counter) < 0;
failed = --(sem->count.counter) < 0;
-
local_irq_restore(
flags);
+
cris_atomic_restore(sem,
flags);
if(failed)
failed = __down_interruptible(sem);
return(failed);
if(failed)
failed = __down_interruptible(sem);
return(failed);
@@
-109,13
+107,13
@@
extern inline int down_trylock(struct semaphore * sem)
unsigned long flags;
int failed;
unsigned long flags;
int failed;
- local_save_flags(flags);
- local_irq_disable();
+ cris_atomic_save(sem, flags);
failed = --(sem->count.counter) < 0;
failed = --(sem->count.counter) < 0;
-
local_irq_restore(
flags);
+
cris_atomic_restore(sem,
flags);
if(failed)
failed = __down_trylock(sem);
return(failed);
if(failed)
failed = __down_trylock(sem);
return(failed);
+
}
/*
}
/*
@@
-130,10
+128,9
@@
extern inline void up(struct semaphore * sem)
int wakeup;
/* atomically increment the semaphores count, and if it was negative, we wake people */
int wakeup;
/* atomically increment the semaphores count, and if it was negative, we wake people */
- local_save_flags(flags);
- local_irq_disable();
+ cris_atomic_save(sem, flags);
wakeup = ++(sem->count.counter) <= 0;
wakeup = ++(sem->count.counter) <= 0;
-
local_irq_restore(
flags);
+
cris_atomic_restore(sem,
flags);
if(wakeup) {
__up(sem);
}
if(wakeup) {
__up(sem);
}