Print this page
de-linting of .s files
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/sun4u/io/pci/pci_asm.s
+++ new/usr/src/uts/sun4u/io/pci/pci_asm.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 physical big/little endian access of pcitool
31 29 * in the PCI drivers.
32 30 */
33 31
34 32 #include <sys/asm_linkage.h>
35 33 #include <sys/machthread.h>
36 34 #include <sys/privregs.h>
37 35
38 36 /*LINTLIBRARY*/
39 37
40 -#if defined(lint)
41 -
42 -/*ARGSUSED*/
43 -int pci_do_phys_peek(size_t size, uint64_t paddr, uint64_t *value, int type)
44 -{ return (0); }
45 -
46 -int pci_do_phys_poke(size_t size, uint64_t paddr, uint64_t *value, int type)
47 -{ return (0); }
48 -
49 -#else /* lint */
50 -
51 38 ! pci_do_phys_peek: Do physical address read.
52 39 !
53 40 ! %o0 is size in bytes - Must be 8, 4, 2 or 1. Invalid sizes default to 1.
54 41 ! %o1 is address to read
55 42 ! %o2 is address to save value into
56 43 ! %o3 is 0 for little endian, non-zero for big endian
57 44 !
58 45 ! To be called from an on_trap environment.
59 46 ! Interrupts will be disabled for the duration of the read, to prevent
60 47 ! an interrupt from raising the trap level to 1 and then a possible
61 48 ! data access exception being delivered while the trap level > 0.
62 49 !
63 50 ! Assumes alignment is correct.
64 51
65 52 ENTRY(pci_do_phys_peek)
66 53
67 54 rdpr %pstate, %o4 ! Disable interrupts if not already
68 55 andcc %o4, PSTATE_IE, %g2 ! Save original state first
69 56 bz .peek_ints_disabled
70 57 nop
71 58 wrpr %o4, PSTATE_IE, %pstate
72 59 .peek_ints_disabled:
73 60
74 61 tst %o3 ! Set up %asi with modifier for
75 62 movz %xcc, ASI_IOL, %g1 ! Big/little endian physical space
76 63 movnz %xcc, ASI_IO, %g1
77 64 mov %g1, %asi
78 65
79 66 cmp %o0, 8 ! 64-bit?
80 67 bne .peek_int
81 68 cmp %o0, 4 ! 32-bit?
82 69 ldxa [%o1]%asi, %g1
83 70 ba .peekdone
84 71 stx %g1, [%o2]
85 72
86 73 .peek_int:
87 74 bne .peek_half
88 75 cmp %o0, 2 ! 16-bit?
89 76 lduwa [%o1]%asi, %g1
90 77 ba .peekdone
91 78 stuw %g1, [%o2]
92 79
93 80 .peek_half:
94 81 bne .peek_byte
95 82 nop
96 83 lduha [%o1]%asi, %g1
97 84 ba .peekdone
98 85 stuh %g1, [%o2]
99 86
100 87 .peek_byte:
101 88 lduba [%o1]%asi, %g1 ! 8-bit!
102 89 stub %g1, [%o2]
103 90
104 91 .peekdone:
105 92 membar #Sync ! Make sure the loads take
106 93 tst %g2 ! No need to reenable interrupts
107 94 bz .peek_ints_done ! if not enabled at entry
108 95 rdpr %pstate, %o4
109 96 wrpr %o4, PSTATE_IE, %pstate
110 97 .peek_ints_done:
111 98 mov %g0, %o0
112 99 retl
113 100 nop
114 101 SET_SIZE(pci_do_phys_peek)
115 102
116 103
117 104 ! pci_do_phys_poke: Do physical address write.
118 105 !
119 106 ! %o0 is size in bytes - Must be 8, 4, 2 or 1. Invalid sizes default to 1.
120 107 ! %o1 is address to write to
121 108 ! %o2 is address to read from
122 109 ! %o3 is 0 for little endian, non-zero for big endian
123 110 !
124 111 ! Always returns success (0) in %o0
125 112 !
126 113 ! Assumes alignment is correct and that on_trap handling has been installed
127 114
128 115 ENTRY(pci_do_phys_poke)
129 116
130 117 tst %o3
131 118 bz .poke_asi_set
132 119 mov ASI_IOL, %asi
133 120 mov ASI_IO, %asi
134 121 .poke_asi_set:
135 122
136 123 cmp %o0, 8 ! 64 bit?
137 124 bne .poke_int
138 125 cmp %o0, 4 ! 32-bit?
139 126 ldx [%o2], %g1
140 127 ba .pokedone
141 128 stxa %g1, [%o1]%asi
142 129
143 130 .poke_int:
144 131 bne .poke_half
145 132 cmp %o0, 2 ! 16-bit?
146 133 lduw [%o2], %g1
147 134 ba .pokedone
148 135 stuwa %g1, [%o1]%asi
149 136
150 137 .poke_half:
151 138 bne .poke_byte
152 139 nop
153 140 lduh [%o2], %g1
154 141 ba .pokedone
155 142 stuha %g1, [%o1]%asi
156 143
↓ open down ↓ |
96 lines elided |
↑ open up ↑ |
157 144 .poke_byte:
158 145 ldub [%o2], %g1 ! 8-bit!
159 146 stuba %g1, [%o1]%asi
160 147
161 148 .pokedone:
162 149 membar #Sync
163 150 retl
164 151 mov %g0, %o0
165 152 SET_SIZE(pci_do_phys_poke)
166 153
167 -#endif
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX