1 /* Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
3 * Permission is hereby granted, free of charge, to any person obtaining a
4 * copy of this software and associated documentation files (the "Software"),
5 * to deal in the Software without restriction, including without limitation
6 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 * and/or sell copies of the Software, and to permit persons to whom the
8 * Software is furnished to do so, subject to the following conditions:
10 * The above copyright notice and this permission notice (including the next
11 * paragraph) shall be included in all copies or substantial portions of the
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 * DEALINGS IN THE SOFTWARE.
24 #define FUNCTION_START(f,n) .inline f,n
25 #define FUNCTION_END(f) .end
28 #include <sys/asm_linkage.h>
29 #define FUNCTION_START(f,n) ENTRY(f)
30 #define FUNCTION_END(f) retl; nop; SET_SIZE(f)
33 /* Converted from common/compiler.h gcc inline format to Sun cc inline
34 * format by Kenjiro Tsuji
36 * The value 0x88 means ASI_PRIMARY_LITTLE.
37 * The store or load to/from the address space will be done
38 * as little-endian. In the original xrog code, the value
39 * is defined as the macro ASI_PL.
41 * In the original xorg code, "membar #StoreStore|#StoreLoad"
42 * is directly implemented as an instruction "0x8143e00a".
46 FUNCTION_START(outb, 0)
48 membar #StoreStore|#StoreLoad
51 FUNCTION_START(outw, 0)
53 membar #StoreStore|#StoreLoad
56 FUNCTION_START(outl, 0)
58 membar #StoreStore|#StoreLoad
61 FUNCTION_START(inb, 0)
65 FUNCTION_START(inw, 0)
69 FUNCTION_START(inl, 0)
73 FUNCTION_START(xf86ReadMmio8, 0)
74 lduba [%o0 + %o1] 0x88, %o0
75 FUNCTION_END(xf86ReadMmio8)
77 FUNCTION_START(xf86ReadMmio16Be, 0)
79 FUNCTION_END(xf86ReadMmio16Be)
81 FUNCTION_START(xf86ReadMmio16Le, 0)
82 lduha [%o0 + %o1] 0x88, %o0
83 FUNCTION_END(xf86ReadMmio16Le)
85 FUNCTION_START(xf86ReadMmio32Be, 0)
87 FUNCTION_END(xf86ReadMmio32Be)
89 FUNCTION_START(xf86ReadMmio32Le, 0)
90 lda [%o0 + %o1] 0x88, %o0
91 FUNCTION_END(xf86ReadMmio32Le)
93 FUNCTION_START(xf86WriteMmio8, 0)
94 stba %o2, [%o0 + %o1] 0x88
95 membar #StoreStore|#StoreLoad
96 FUNCTION_END(xf86WriteMmio8)
98 FUNCTION_START(xf86WriteMmio16Be, 0)
100 membar #StoreStore|#StoreLoad
101 FUNCTION_END(xf86WriteMmio16Be)
103 FUNCTION_START(xf86WriteMmio16Le, 0)
104 stha %o2, [%o0 + %o1] 0x88
105 membar #StoreStore|#StoreLoad
106 FUNCTION_END(xf86WriteMmio16Le)
108 FUNCTION_START(xf86WriteMmio32Be, 0)
110 membar #StoreStore|#StoreLoad
111 FUNCTION_END(xf86WriteMmio32Be)
113 FUNCTION_START(xf86WriteMmio32Le, 0)
114 sta %o2, [%o0 + %o1] 0x88
115 membar #StoreStore|#StoreLoad
116 FUNCTION_END(xf86WriteMmio32Le)
118 FUNCTION_START(xf86WriteMmio8NB, 0)
121 FUNCTION_END(xf86WriteMmio8NB)
123 FUNCTION_START(xf86WriteMmio16BeNB, 0)
125 FUNCTION_END(xf86WriteMmio16BeNB)
127 FUNCTION_START(xf86WriteMmio16LeNB, 0)
128 stha %o2, [%o0 + %o1] 0x88
129 FUNCTION_END(xf86WriteMmio16LeNB)
131 FUNCTION_START(xf86WriteMmio32BeNB, 0)
133 FUNCTION_END(xf86WriteMmio32BeNB)
135 FUNCTION_START(xf86WriteMmio32LeNB, 0)
136 sta %o2, [%o0 + %o1] 0x88
137 FUNCTION_END(xf86WriteMmio32LeNB)