diff options
author | Tony Luck <tony.luck@intel.com> | 2006-03-21 11:22:17 -0500 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2006-03-21 11:22:17 -0500 |
commit | ae02e964b669f19fb08d953032463ab7dc6f79eb (patch) | |
tree | e02ff418110b06c5b7cac8302f9930573f2f35b0 /include/asm-ia64/sn | |
parent | 409761bb6a06bd61e2d8e27a1af534371d9537ed (diff) | |
parent | dcc1dd2366a7c355fd8b6543c52685b864a2044f (diff) |
Pull icc-cleanup into release branch
Diffstat (limited to 'include/asm-ia64/sn')
-rw-r--r-- | include/asm-ia64/sn/rw_mmr.h | 56 |
1 files changed, 5 insertions, 51 deletions
diff --git a/include/asm-ia64/sn/rw_mmr.h b/include/asm-ia64/sn/rw_mmr.h index f40fd1a5510d..2d78f4c5a45e 100644 --- a/include/asm-ia64/sn/rw_mmr.h +++ b/include/asm-ia64/sn/rw_mmr.h | |||
@@ -3,15 +3,14 @@ | |||
3 | * License. See the file "COPYING" in the main directory of this archive | 3 | * License. See the file "COPYING" in the main directory of this archive |
4 | * for more details. | 4 | * for more details. |
5 | * | 5 | * |
6 | * Copyright (C) 2002-2004 Silicon Graphics, Inc. All Rights Reserved. | 6 | * Copyright (C) 2002-2006 Silicon Graphics, Inc. All Rights Reserved. |
7 | */ | 7 | */ |
8 | #ifndef _ASM_IA64_SN_RW_MMR_H | 8 | #ifndef _ASM_IA64_SN_RW_MMR_H |
9 | #define _ASM_IA64_SN_RW_MMR_H | 9 | #define _ASM_IA64_SN_RW_MMR_H |
10 | 10 | ||
11 | 11 | ||
12 | /* | 12 | /* |
13 | * This file contains macros used to access MMR registers via | 13 | * This file that access MMRs via uncached physical addresses. |
14 | * uncached physical addresses. | ||
15 | * pio_phys_read_mmr - read an MMR | 14 | * pio_phys_read_mmr - read an MMR |
16 | * pio_phys_write_mmr - write an MMR | 15 | * pio_phys_write_mmr - write an MMR |
17 | * pio_atomic_phys_write_mmrs - atomically write 1 or 2 MMRs with psr.ic=0 | 16 | * pio_atomic_phys_write_mmrs - atomically write 1 or 2 MMRs with psr.ic=0 |
@@ -22,53 +21,8 @@ | |||
22 | */ | 21 | */ |
23 | 22 | ||
24 | 23 | ||
25 | extern inline long | 24 | extern long pio_phys_read_mmr(volatile long *mmr); |
26 | pio_phys_read_mmr(volatile long *mmr) | 25 | extern void pio_phys_write_mmr(volatile long *mmr, long val); |
27 | { | 26 | extern void pio_atomic_phys_write_mmrs(volatile long *mmr1, long val1, volatile long *mmr2, long val2); |
28 | long val; | ||
29 | asm volatile | ||
30 | ("mov r2=psr;;" | ||
31 | "rsm psr.i | psr.dt;;" | ||
32 | "srlz.i;;" | ||
33 | "ld8.acq %0=[%1];;" | ||
34 | "mov psr.l=r2;;" | ||
35 | "srlz.i;;" | ||
36 | : "=r"(val) | ||
37 | : "r"(mmr) | ||
38 | : "r2"); | ||
39 | return val; | ||
40 | } | ||
41 | |||
42 | |||
43 | |||
44 | extern inline void | ||
45 | pio_phys_write_mmr(volatile long *mmr, long val) | ||
46 | { | ||
47 | asm volatile | ||
48 | ("mov r2=psr;;" | ||
49 | "rsm psr.i | psr.dt;;" | ||
50 | "srlz.i;;" | ||
51 | "st8.rel [%0]=%1;;" | ||
52 | "mov psr.l=r2;;" | ||
53 | "srlz.i;;" | ||
54 | :: "r"(mmr), "r"(val) | ||
55 | : "r2", "memory"); | ||
56 | } | ||
57 | |||
58 | extern inline void | ||
59 | pio_atomic_phys_write_mmrs(volatile long *mmr1, long val1, volatile long *mmr2, long val2) | ||
60 | { | ||
61 | asm volatile | ||
62 | ("mov r2=psr;;" | ||
63 | "rsm psr.i | psr.dt | psr.ic;;" | ||
64 | "cmp.ne p9,p0=%2,r0;" | ||
65 | "srlz.i;;" | ||
66 | "st8.rel [%0]=%1;" | ||
67 | "(p9) st8.rel [%2]=%3;;" | ||
68 | "mov psr.l=r2;;" | ||
69 | "srlz.i;;" | ||
70 | :: "r"(mmr1), "r"(val1), "r"(mmr2), "r"(val2) | ||
71 | : "p9", "r2", "memory"); | ||
72 | } | ||
73 | 27 | ||
74 | #endif /* _ASM_IA64_SN_RW_MMR_H */ | 28 | #endif /* _ASM_IA64_SN_RW_MMR_H */ |