aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-powerpc/dcr-native.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-07 12:02:26 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-07 12:02:26 -0500
commit37969581301e50872a1ae84dc73962b5f7ee6b76 (patch)
tree35bbd6a07f903f248f4bd209b8d194a922415fe0 /include/asm-powerpc/dcr-native.h
parent80ff8a805113850a3ffafcc8e6eaa1fdd51b02f3 (diff)
parent24f1a849614ba1805e26a05da7cc8c6bd67490ea (diff)
Merge branch 'for-2.6.25' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc
* 'for-2.6.25' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc: (69 commits) [POWERPC] Add SPE registers to core dumps [POWERPC] Use regset code for compat PTRACE_*REGS* calls [POWERPC] Use generic compat_sys_ptrace [POWERPC] Use generic compat_ptrace_request [POWERPC] Use generic ptrace peekdata/pokedata [POWERPC] Use regset code for PTRACE_*REGS* requests [POWERPC] Switch to generic compat_binfmt_elf code [POWERPC] Switch to using user_regset-based core dumps [POWERPC] Add user_regset compat support [POWERPC] Add user_regset_view definitions [POWERPC] Use user_regset accessors for GPRs [POWERPC] ptrace accessors for special regs MSR and TRAP [POWERPC] Use user_regset accessors for SPE regs [POWERPC] Use user_regset accessors for altivec regs [POWERPC] Use user_regset accessors for FP regs [POWERPC] mpc52xx: fix compile error introduce when rebasing patch [POWERPC] 4xx: PCIe indirect DCR spinlock fix. [POWERPC] Add missing native dcr dcr_ind_lock spinlock [POWERPC] 4xx: Fix offset value on Warp board [POWERPC] 4xx: Add 440EPx Sequoia ehci dts entry ...
Diffstat (limited to 'include/asm-powerpc/dcr-native.h')
-rw-r--r--include/asm-powerpc/dcr-native.h47
1 files changed, 29 insertions, 18 deletions
diff --git a/include/asm-powerpc/dcr-native.h b/include/asm-powerpc/dcr-native.h
index af5fb31af559..be6c879e8760 100644
--- a/include/asm-powerpc/dcr-native.h
+++ b/include/asm-powerpc/dcr-native.h
@@ -59,25 +59,36 @@ do { \
59/* R/W of indirect DCRs make use of standard naming conventions for DCRs */ 59/* R/W of indirect DCRs make use of standard naming conventions for DCRs */
60extern spinlock_t dcr_ind_lock; 60extern spinlock_t dcr_ind_lock;
61 61
62#define mfdcri(base, reg) \ 62static inline unsigned __mfdcri(int base_addr, int base_data, int reg)
63({ \ 63{
64 unsigned long flags; \ 64 unsigned long flags;
65 unsigned int val; \ 65 unsigned int val;
66 spin_lock_irqsave(&dcr_ind_lock, flags); \
67 mtdcr(DCRN_ ## base ## _CONFIG_ADDR, reg); \
68 val = mfdcr(DCRN_ ## base ## _CONFIG_DATA); \
69 spin_unlock_irqrestore(&dcr_ind_lock, flags); \
70 val; \
71})
72 66
73#define mtdcri(base, reg, data) \ 67 spin_lock_irqsave(&dcr_ind_lock, flags);
74do { \ 68 __mtdcr(base_addr, reg);
75 unsigned long flags; \ 69 val = __mfdcr(base_data);
76 spin_lock_irqsave(&dcr_ind_lock, flags); \ 70 spin_unlock_irqrestore(&dcr_ind_lock, flags);
77 mtdcr(DCRN_ ## base ## _CONFIG_ADDR, reg); \ 71 return val;
78 mtdcr(DCRN_ ## base ## _CONFIG_DATA, data); \ 72}
79 spin_unlock_irqrestore(&dcr_ind_lock, flags); \ 73
80} while (0) 74static inline void __mtdcri(int base_addr, int base_data, int reg,
75 unsigned val)
76{
77 unsigned long flags;
78
79 spin_lock_irqsave(&dcr_ind_lock, flags);
80 __mtdcr(base_addr, reg);
81 __mtdcr(base_data, val);
82 spin_unlock_irqrestore(&dcr_ind_lock, flags);
83}
84
85#define mfdcri(base, reg) __mfdcri(DCRN_ ## base ## _CONFIG_ADDR, \
86 DCRN_ ## base ## _CONFIG_DATA, \
87 reg)
88
89#define mtdcri(base, reg, data) __mtdcri(DCRN_ ## base ## _CONFIG_ADDR, \
90 DCRN_ ## base ## _CONFIG_DATA, \
91 reg, data)
81 92
82#endif /* __ASSEMBLY__ */ 93#endif /* __ASSEMBLY__ */
83#endif /* __KERNEL__ */ 94#endif /* __KERNEL__ */