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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rc203soc/] [sw/] [uClinux/] [include/] [asm-i960/] [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
#ifndef _I960_SEMAPHORE_H
2
#define _I960_SEMAPHORE_H
3
 
4
/*
5
 * interrupt-safe (not SMP-safe) semaphores..
6
 *
7
 * (C) Copyright 1999           Keith Adams <kma@cse.ogi.edu>
8
 *                              Oregon Graduate Institute
9
 *
10
 * Based on include/asm-i386/semaphore.h:
11
 * (C) Copyright 1996 Linus Torvalds
12
 *
13
 */
14
#include <asm/atomic.h>
15
 
16
struct semaphore {
17
        atomic_t count;
18
        atomic_t waking;
19
        int lock;       /* we don't actually use this; sched.c needs it, tho */
20
        struct wait_queue * wait;
21
};
22
 
23
#define MUTEX ((struct semaphore) { 1, 0, 0, NULL })
24
#define MUTEX_LOCKED ((struct semaphore) { 0, 0, 0, NULL })
25
 
26
extern void down(struct semaphore * sem);
27
extern int down_interruptible(struct semaphore * sem);
28
extern void up(struct semaphore * sem);
29
 
30
extern void get_buzz_lock(int *lock_ptr);
31
extern void give_buzz_lock(int *lock_ptr);
32
 
33
#endif

powered by: WebSVN 2.1.0

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