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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [linux/] [linux-2.4/] [include/] [asm-sh64/] [smplock.h] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1276 phoenix
#ifndef __ASM_SH64_SMPLOCK_H
2
#define __ASM_SH64_SMPLOCK_H
3
 
4
/*
5
 * This file is subject to the terms and conditions of the GNU General Public
6
 * License.  See the file "COPYING" in the main directory of this archive
7
 * for more details.
8
 *
9
 * include/asm-sh64/smplock.h
10
 *
11
 * Copyright (C) 2000, 2001  Paolo Alberelli
12
 *
13
 */
14
 
15
#include <linux/config.h>
16
 
17
#ifndef CONFIG_SMP
18
 
19
#define lock_kernel()                           do { } while(0)
20
#define unlock_kernel()                         do { } while(0)
21
#define release_kernel_lock(task, cpu, depth)   ((depth) = 1)
22
#define reacquire_kernel_lock(task, cpu, depth) do { } while(0)
23
 
24
#else
25
 
26
#error "We do not support SMP on ST50 yet"
27
/*
28
 * Default SMP lock implementation
29
 */
30
 
31
#include <linux/interrupt.h>
32
#include <asm/spinlock.h>
33
 
34
extern spinlock_t kernel_flag;
35
 
36
/*
37
 * Getting the big kernel lock.
38
 *
39
 * This cannot happen asynchronously,
40
 * so we only need to worry about other
41
 * CPU's.
42
 */
43
extern __inline__ void lock_kernel(void)
44
{
45
        if (!++current->lock_depth)
46
                spin_lock(&kernel_flag);
47
}
48
 
49
extern __inline__ void unlock_kernel(void)
50
{
51
        if (--current->lock_depth < 0)
52
                spin_unlock(&kernel_flag);
53
}
54
 
55
/*
56
 * Release global kernel lock and global interrupt lock
57
 */
58
#define release_kernel_lock(task, cpu) \
59
do { \
60
        if (task->lock_depth >= 0) \
61
                spin_unlock(&kernel_flag); \
62
        release_irqlock(cpu); \
63
        __sti(); \
64
} while (0)
65
 
66
/*
67
 * Re-acquire the kernel lock
68
 */
69
#define reacquire_kernel_lock(task) \
70
do { \
71
        if (task->lock_depth >= 0) \
72
                spin_lock(&kernel_flag); \
73
} while (0)
74
 
75
#endif /* CONFIG_SMP */
76
 
77
#endif /* __ASM_SH64_SMPLOCK_H */

powered by: WebSVN 2.1.0

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