]> err.no Git - linux-2.6/blob - arch/powerpc/kernel/misc.S
[POWERPC] remove unused asm routines
[linux-2.6] / arch / powerpc / kernel / misc.S
1 /*
2  * This file contains miscellaneous low-level functions.
3  *    Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
4  *
5  * Largely rewritten by Cort Dougan (cort@cs.nmt.edu)
6  * and Paul Mackerras.
7  *
8  * Adapted for iSeries by Mike Corrigan (mikejc@us.ibm.com)
9  * PPC64 updates by Dave Engebretsen (engebret@us.ibm.com)
10  *
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License
13  * as published by the Free Software Foundation; either version
14  * 2 of the License, or (at your option) any later version.
15  */
16 #include <asm/ppc_asm.h>
17
18         .text
19
20 /*
21  * Returns (address we are running at) - (address we were linked at)
22  * for use before the text and data are mapped to KERNELBASE.
23  */
24
25 _GLOBAL(reloc_offset)
26         mflr    r0
27         bl      1f
28 1:      mflr    r3
29         LOAD_REG_IMMEDIATE(r4,1b)
30         subf    r3,r4,r3
31         mtlr    r0
32         blr
33
34 /*
35  * add_reloc_offset(x) returns x + reloc_offset().
36  */
37 _GLOBAL(add_reloc_offset)
38         mflr    r0
39         bl      1f
40 1:      mflr    r5
41         LOAD_REG_IMMEDIATE(r4,1b)
42         subf    r5,r4,r5
43         add     r3,r3,r5
44         mtlr    r0
45         blr
46
47 /*
48  * I/O string operations
49  *
50  * insb(port, buf, len)
51  * outsb(port, buf, len)
52  * insw(port, buf, len)
53  * outsw(port, buf, len)
54  * insl(port, buf, len)
55  * outsl(port, buf, len)
56  * insw_ns(port, buf, len)
57  * outsw_ns(port, buf, len)
58  * insl_ns(port, buf, len)
59  * outsl_ns(port, buf, len)
60  *
61  * The *_ns versions don't do byte-swapping.
62  */
63 _GLOBAL(_insb)
64         sync
65         cmpwi   0,r5,0
66         mtctr   r5
67         subi    r4,r4,1
68         blelr-
69 00:     lbz     r5,0(r3)
70         eieio
71         stbu    r5,1(r4)
72         bdnz    00b
73         twi     0,r5,0
74         isync
75         blr
76
77 _GLOBAL(_outsb)
78         cmpwi   0,r5,0
79         mtctr   r5
80         subi    r4,r4,1
81         blelr-
82         sync
83 00:     lbzu    r5,1(r4)
84         stb     r5,0(r3)
85         bdnz    00b
86         sync
87         blr
88
89 #ifdef CONFIG_PPC32
90 _GLOBAL(__ide_mm_insw)
91 #endif
92 _GLOBAL(_insw_ns)
93         sync
94         cmpwi   0,r5,0
95         mtctr   r5
96         subi    r4,r4,2
97         blelr-
98 00:     lhz     r5,0(r3)
99         eieio
100         sthu    r5,2(r4)
101         bdnz    00b
102         twi     0,r5,0
103         isync
104         blr
105
106 #ifdef CONFIG_PPC32
107 _GLOBAL(__ide_mm_outsw)
108 #endif
109 _GLOBAL(_outsw_ns)
110         cmpwi   0,r5,0
111         mtctr   r5
112         subi    r4,r4,2
113         blelr-
114         sync
115 00:     lhzu    r5,2(r4)
116         sth     r5,0(r3)
117         bdnz    00b
118         sync
119         blr
120
121 #ifdef CONFIG_PPC32
122 _GLOBAL(__ide_mm_insl)
123 #endif
124 _GLOBAL(_insl_ns)
125         sync
126         cmpwi   0,r5,0
127         mtctr   r5
128         subi    r4,r4,4
129         blelr-
130 00:     lwz     r5,0(r3)
131         eieio
132         stwu    r5,4(r4)
133         bdnz    00b
134         twi     0,r5,0
135         isync
136         blr
137
138 #ifdef CONFIG_PPC32
139 _GLOBAL(__ide_mm_outsl)
140 #endif
141 _GLOBAL(_outsl_ns)
142         cmpwi   0,r5,0
143         mtctr   r5
144         subi    r4,r4,4
145         blelr-
146         sync
147 00:     lwzu    r5,4(r4)
148         stw     r5,0(r3)
149         bdnz    00b
150         sync
151         blr
152