aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/asm-sh/cpu-sh4/freq.h3
-rw-r--r--include/asm-sh/dma.h1
-rw-r--r--include/asm-sh/io.h6
-rw-r--r--include/asm-sh/smp.h2
-rw-r--r--include/asm-sh/spinlock.h8
-rw-r--r--include/asm-sh/spinlock_types.h4
6 files changed, 18 insertions, 6 deletions
diff --git a/include/asm-sh/cpu-sh4/freq.h b/include/asm-sh/cpu-sh4/freq.h
index 86564e7a26ae..39f41fcd509d 100644
--- a/include/asm-sh/cpu-sh4/freq.h
+++ b/include/asm-sh/cpu-sh4/freq.h
@@ -24,6 +24,9 @@
24#define FRQMR1 0xffc80014 24#define FRQMR1 0xffc80014
25#else 25#else
26#define FRQCR 0xffc00000 26#define FRQCR 0xffc00000
27#define FRQCR_PSTBY 0x0200
28#define FRQCR_PLLEN 0x0400
29#define FRQCR_CKOEN 0x0800
27#endif 30#endif
28#define MIN_DIVISOR_NR 0 31#define MIN_DIVISOR_NR 0
29#define MAX_DIVISOR_NR 3 32#define MAX_DIVISOR_NR 3
diff --git a/include/asm-sh/dma.h b/include/asm-sh/dma.h
index faf3051cd429..6034d4a29e73 100644
--- a/include/asm-sh/dma.h
+++ b/include/asm-sh/dma.h
@@ -13,6 +13,7 @@
13 13
14#include <linux/spinlock.h> 14#include <linux/spinlock.h>
15#include <linux/wait.h> 15#include <linux/wait.h>
16#include <linux/sched.h>
16#include <linux/sysdev.h> 17#include <linux/sysdev.h>
17#include <asm/cpu/dma.h> 18#include <asm/cpu/dma.h>
18 19
diff --git a/include/asm-sh/io.h b/include/asm-sh/io.h
index a0e55b09e4fd..aa80930ce8e4 100644
--- a/include/asm-sh/io.h
+++ b/include/asm-sh/io.h
@@ -116,13 +116,13 @@ void __raw_readsl(unsigned long addr, void *data, int longlen);
116 * redefined by userlevel programs. 116 * redefined by userlevel programs.
117 */ 117 */
118#ifdef __readb 118#ifdef __readb
119# define readb(a) ({ unsigned long r_ = __raw_readb(a); mb(); r_; }) 119# define readb(a) ({ unsigned int r_ = __raw_readb(a); mb(); r_; })
120#endif 120#endif
121#ifdef __raw_readw 121#ifdef __raw_readw
122# define readw(a) ({ unsigned long r_ = __raw_readw(a); mb(); r_; }) 122# define readw(a) ({ unsigned int r_ = __raw_readw(a); mb(); r_; })
123#endif 123#endif
124#ifdef __raw_readl 124#ifdef __raw_readl
125# define readl(a) ({ unsigned long r_ = __raw_readl(a); mb(); r_; }) 125# define readl(a) ({ unsigned int r_ = __raw_readl(a); mb(); r_; })
126#endif 126#endif
127 127
128#ifdef __raw_writeb 128#ifdef __raw_writeb
diff --git a/include/asm-sh/smp.h b/include/asm-sh/smp.h
index 71ecddf70db3..caa7b93f1bce 100644
--- a/include/asm-sh/smp.h
+++ b/include/asm-sh/smp.h
@@ -15,7 +15,7 @@
15 15
16#ifdef CONFIG_SMP 16#ifdef CONFIG_SMP
17 17
18#include <asm/spinlock.h> 18#include <linux/spinlock.h>
19#include <asm/atomic.h> 19#include <asm/atomic.h>
20#include <asm/current.h> 20#include <asm/current.h>
21 21
diff --git a/include/asm-sh/spinlock.h b/include/asm-sh/spinlock.h
index 2586eef07d57..92f6e2008b2e 100644
--- a/include/asm-sh/spinlock.h
+++ b/include/asm-sh/spinlock.h
@@ -11,6 +11,7 @@
11#define __ASM_SH_SPINLOCK_H 11#define __ASM_SH_SPINLOCK_H
12 12
13#include <asm/atomic.h> 13#include <asm/atomic.h>
14#include <asm/spinlock_types.h>
14 15
15/* 16/*
16 * Your basic SMP spinlocks, allowing only a single CPU anywhere 17 * Your basic SMP spinlocks, allowing only a single CPU anywhere
@@ -42,7 +43,7 @@ static inline void __raw_spin_lock(raw_spinlock_t *lock)
42 43
43static inline void __raw_spin_unlock(raw_spinlock_t *lock) 44static inline void __raw_spin_unlock(raw_spinlock_t *lock)
44{ 45{
45 assert_spin_locked(lock); 46 //assert_spin_locked(lock);
46 47
47 lock->lock = 0; 48 lock->lock = 0;
48} 49}
@@ -88,6 +89,11 @@ static inline void __raw_write_unlock(raw_rwlock_t *rw)
88 __raw_spin_unlock(&rw->lock); 89 __raw_spin_unlock(&rw->lock);
89} 90}
90 91
92static inline int __raw_write_can_lock(raw_rwlock_t *rw)
93{
94 return (atomic_read(&rw->counter) == RW_LOCK_BIAS);
95}
96
91static inline int __raw_read_trylock(raw_rwlock_t *lock) 97static inline int __raw_read_trylock(raw_rwlock_t *lock)
92{ 98{
93 atomic_t *count = (atomic_t*)lock; 99 atomic_t *count = (atomic_t*)lock;
diff --git a/include/asm-sh/spinlock_types.h b/include/asm-sh/spinlock_types.h
index 8c41b6c3aac8..5c58134f2c4e 100644
--- a/include/asm-sh/spinlock_types.h
+++ b/include/asm-sh/spinlock_types.h
@@ -9,7 +9,9 @@ typedef struct {
9 volatile unsigned long lock; 9 volatile unsigned long lock;
10} raw_spinlock_t; 10} raw_spinlock_t;
11 11
12#define __SPIN_LOCK_UNLOCKED { 0 } 12#define __RAW_SPIN_LOCK_UNLOCKED { 1 }
13
14#include <asm/atomic.h>
13 15
14typedef struct { 16typedef struct {
15 raw_spinlock_t lock; 17 raw_spinlock_t lock;