OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rc203soc/] [sw/] [uClinux/] [include/] [asm-armnommu/] [semaphore.h] - Blame information for rev 1777

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1633 jcastillo
/*
2
 * linux/include/asm-arm/semaphore.h
3
 *
4
 *
5
 */
6
#ifndef __ASM_ARM_SEMAPHORE_H
7
#define __ASM_ARM_SEMAPHORE_H
8
 
9
#include <linux/linkage.h>
10
 
11
struct semaphore {
12
        int count;
13
        int waking;
14
        int lock;
15
        struct wait_queue * wait;
16
};
17
 
18
#define MUTEX ((struct semaphore) { 1, 0, 0, NULL })
19
#define MUTEX_LOCKED ((struct semaphore) { 0, 0, 0, NULL })
20
 
21
extern void __down (struct semaphore *sem);
22
extern void __up (struct semaphore *sem);
23
extern int __down_interruptible (struct semaphore *sem);
24
 
25
/* Primitives to spin on a lock.  Needed only for SMP version.
26
 */
27
extern inline void get_buzz_lock (int *lock_ptr)
28
{
29
#ifdef __SMP__
30
        while (xchg(lock_ptr,1) != 0);
31
#endif
32
}
33
 
34
extern inline void give_buzz_lock (int *lock_ptr)
35
{
36
#ifdef __SMP__
37
        *lock_ptr = 0;
38
#endif
39
}
40
 
41
#ifdef __arm__
42
#include <asm/proc/semaphore.h>
43
#endif
44
 
45
#endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.