mirror of
https://github.com/adulau/aha.git
synced 2024-12-29 12:16:20 +00:00
0a58458341
All the simple microblaze header files were adapted to use their asm-generic implementations. These files are more simple and were quite straightforward to change. fb.h, vga.h and parport.h previously did not exist, using the generic version makes it possible to build more drivers successfully in allyesonfig. Signed-off-by: Remis Lima Baima <remis.developer@googlemail.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Michal Simek <monstr@monstr.eu>
24 lines
474 B
C
24 lines
474 B
C
#ifndef _ASM_MICROBLAZE_ATOMIC_H
|
|
#define _ASM_MICROBLAZE_ATOMIC_H
|
|
|
|
#include <asm-generic/atomic.h>
|
|
|
|
/*
|
|
* Atomically test *v and decrement if it is greater than 0.
|
|
* The function returns the old value of *v minus 1.
|
|
*/
|
|
static inline int atomic_dec_if_positive(atomic_t *v)
|
|
{
|
|
unsigned long flags;
|
|
int res;
|
|
|
|
local_irq_save(flags);
|
|
res = v->counter - 1;
|
|
if (res >= 0)
|
|
v->counter = res;
|
|
local_irq_restore(flags);
|
|
|
|
return res;
|
|
}
|
|
|
|
#endif /* _ASM_MICROBLAZE_ATOMIC_H */
|