aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/mm/page.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-09-27 07:50:08 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-09-27 07:50:08 -0400
commit9ffecb10283508260936b96022d4ee43a7798b4c (patch)
treed9ea9e34c4b2cd0ff2a9d51f849a65c2094c742f /arch/mips/mm/page.c
parent162e6df47c4f80c87cb617ec473eca015df454ca (diff)
Linux 4.3-rc3
Diffstat (limited to 'arch/mips/mm/page.c')
0 files changed, 0 insertions, 0 deletions
git/commit/include/linux/semaphore.h?id=64ac24e738823161693bf791f87adc802cf529ff'>64ac24e73882
8292c9e15c3b
64ac24e73882



febc88c5948f


64ac24e73882






64ac24e73882
64ac24e73882
f06d96865861
64ac24e73882
f1241c87a16c
64ac24e73882


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46





                                                        
                                                                     






                           
                                                                
                  
                                     
                                      




                                                                         
                                                                         



                                                                         


                                                                






                                                                           
                                        
                                                                  
                                                             
                                                            
                                                                          


                                      
/*
 * Copyright (c) 2008 Intel Corporation
 * Author: Matthew Wilcox <willy@linux.intel.com>
 *
 * Distributed under the terms of the GNU GPL, version 2
 *
 * Please see kernel/semaphore.c for documentation of these functions
 */
#ifndef __LINUX_SEMAPHORE_H
#define __LINUX_SEMAPHORE_H

#include <linux/list.h>
#include <linux/spinlock.h>

/* Please don't access any members of this structure directly */
struct semaphore {
	raw_spinlock_t		lock;
	unsigned int		count;
	struct list_head	wait_list;
};

#define __SEMAPHORE_INITIALIZER(name, n)				\
{									\
	.lock		= __RAW_SPIN_LOCK_UNLOCKED((name).lock),	\
	.count		= n,						\
	.wait_list	= LIST_HEAD_INIT((name).wait_list),		\
}

#define DEFINE_SEMAPHORE(name)	\
	struct semaphore name = __SEMAPHORE_INITIALIZER(name, 1)

static inline void sema_init(struct semaphore *sem, int val)
{
	static struct lock_class_key __key;
	*sem = (struct semaphore) __SEMAPHORE_INITIALIZER(*sem, val);
	lockdep_init_map(&sem->lock.dep_map, "semaphore->lock", &__key, 0);
}

extern void down(struct semaphore *sem);
extern int __must_check down_interruptible(struct semaphore *sem);
extern int __must_check down_killable(struct semaphore *sem);
extern int __must_check down_trylock(struct semaphore *sem);
extern int __must_check down_timeout(struct semaphore *sem, long jiffies);
extern void up(struct semaphore *sem);

#endif /* __LINUX_SEMAPHORE_H */