Print this page
de-linting of .s files
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/sun4u/io/px/px_asm_4u.s
+++ new/usr/src/uts/sun4u/io/px/px_asm_4u.s
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License, Version 1.0 only
6 6 * (the "License"). You may not use this file except in compliance
7 7 * with the License.
8 8 *
9 9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 10 * or http://www.opensolaris.org/os/licensing.
11 11 * See the License for the specific language governing permissions
12 12 * and limitations under the License.
13 13 *
14 14 * When distributing Covered Code, include this CDDL HEADER in each
15 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 16 * If applicable, add the following below this CDDL HEADER, with the
↓ open down ↓ |
16 lines elided |
↑ open up ↑ |
17 17 * fields enclosed by brackets "[]" replaced with your own identifying
18 18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 19 *
20 20 * CDDL HEADER END
21 21 */
22 22 /*
23 23 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
24 24 * Use is subject to license terms.
25 25 */
26 26
27 -#pragma ident "%Z%%M% %I% %E% SMI"
28 -
29 27 /*
30 28 * Assembly language support for px driver
31 29 */
32 30
33 31 #include <sys/asm_linkage.h>
34 32 #include <sys/machthread.h>
35 33 #include <sys/privregs.h>
36 34
37 35 /*LINTLIBRARY*/
38 36
39 -#if defined(lint)
40 -
41 -/*ARGSUSED*/
42 -int
43 -px_phys_peek_4u(size_t size, uint64_t paddr, uint64_t *value, int type)
44 -{ return (0); }
45 -
46 -/*ARGSUSED*/
47 -int
48 -px_phys_poke_4u(size_t size, uint64_t paddr, uint64_t *value, int type)
49 -{ return (0); }
50 -
51 -#else /* lint */
52 -
53 37 ! px_phys_peek_4u: Do physical address read.
54 38 !
55 39 ! %o0 is size in bytes - Must be 8, 4, 2 or 1. Invalid sizes default to 1.
56 40 ! %o1 is address to read
57 41 ! %o2 is address to save value into
58 42 ! %o3 is 0 for little endian, non-zero for big endian
59 43 !
60 44 ! To be called from an on_trap environment.
61 45 ! Interrupts will be disabled for the duration of the read, to prevent
62 46 ! an interrupt from raising the trap level to 1 and then a possible
63 47 ! data access exception being delivered while the trap level > 0.
64 48 !
65 49 ! Always returns success (0) in %o0
66 50 !
67 51 ! Assumes alignment is correct and that on_trap handling has been installed
68 52
69 53 ENTRY(px_phys_peek_4u)
70 54
71 55 rdpr %pstate, %o4 ! Disable interrupts if not already
72 56 andcc %o4, PSTATE_IE, %g2 ! Save original state first
73 57 bz .peek_ints_disabled
74 58 nop
75 59 wrpr %o4, PSTATE_IE, %pstate
76 60 .peek_ints_disabled:
77 61
78 62 tst %o3 ! Set up %asi with modifier for
79 63 movz %xcc, ASI_IOL, %g1 ! Big/little endian physical space
80 64 movnz %xcc, ASI_IO, %g1
81 65 mov %g1, %asi
82 66
83 67 cmp %o0, 8 ! 64-bit?
84 68 bne .peek_int
85 69 cmp %o0, 4 ! 32-bit?
86 70 ldxa [%o1]%asi, %g1
87 71 ba .peekdone
88 72 stx %g1, [%o2]
89 73
90 74 .peek_int:
91 75 bne .peek_half
92 76 cmp %o0, 2 ! 16-bit?
93 77 lduwa [%o1]%asi, %g1
94 78 ba .peekdone
95 79 stuw %g1, [%o2]
96 80
97 81 .peek_half:
98 82 bne .peek_byte
99 83 nop
100 84 lduha [%o1]%asi, %g1
101 85 ba .peekdone
102 86 stuh %g1, [%o2]
103 87
104 88 .peek_byte:
105 89 lduba [%o1]%asi, %g1 ! 8-bit!
106 90 stub %g1, [%o2]
107 91
108 92 .peekdone:
109 93 membar #Sync ! Make sure the loads take
110 94 tst %g2 ! No need to reenable interrupts
111 95 bz .peek_ints_done ! if not enabled at entry
112 96 rdpr %pstate, %o4
113 97 wrpr %o4, PSTATE_IE, %pstate
114 98 .peek_ints_done:
115 99 mov %g0, %o0
116 100 retl
117 101 nop
118 102 SET_SIZE(px_phys_peek_4u)
119 103
120 104
121 105 ! px_phys_poke_4u: Do physical address write.
122 106 !
123 107 ! %o0 is size in bytes - Must be 8, 4, 2 or 1. Invalid sizes default to 1.
124 108 ! %o1 is address to write to
125 109 ! %o2 is address to read from
126 110 ! %o3 is 0 for little endian, non-zero for big endian
127 111 !
128 112 ! Always returns success (0) in %o0
129 113 !
130 114 ! Assumes alignment is correct and that on_trap handling has been installed
131 115
132 116 ENTRY(px_phys_poke_4u)
133 117
134 118 tst %o3
135 119 movz %xcc, ASI_IOL, %g1 ! Big/little endian physical space
136 120 movnz %xcc, ASI_IO, %g1
137 121 mov %g1, %asi
138 122
139 123 cmp %o0, 8 ! 64 bit?
140 124 bne .poke_int
141 125 cmp %o0, 4 ! 32-bit?
142 126 ldx [%o2], %g1
143 127 ba .pokedone
144 128 stxa %g1, [%o1]%asi
145 129
146 130 .poke_int:
147 131 bne .poke_half
148 132 cmp %o0, 2 ! 16-bit?
149 133 lduw [%o2], %g1
150 134 ba .pokedone
151 135 stuwa %g1, [%o1]%asi
152 136
153 137 .poke_half:
154 138 bne .poke_byte
155 139 nop
156 140 lduh [%o2], %g1
157 141 ba .pokedone
158 142 stuha %g1, [%o1]%asi
159 143
↓ open down ↓ |
97 lines elided |
↑ open up ↑ |
160 144 .poke_byte:
161 145 ldub [%o2], %g1 ! 8-bit!
162 146 stuba %g1, [%o1]%asi
163 147
164 148 .pokedone:
165 149 membar #Sync
166 150 retl
167 151 mov %g0, %o0
168 152 SET_SIZE(px_phys_poke_4u)
169 153
170 -#endif
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX