~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/m68k/ifpsp060/os.S

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /arch/m68k/ifpsp060/os.S (Architecture i386) and /arch/m68k/ifpsp060/os.S (Architecture m68k)


  1 |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~      1 |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  2 |MOTOROLA MICROPROCESSOR & MEMORY TECHNOLOGY G      2 |MOTOROLA MICROPROCESSOR & MEMORY TECHNOLOGY GROUP
  3 |M68000 Hi-Performance Microprocessor Division      3 |M68000 Hi-Performance Microprocessor Division
  4 |M68060 Software Package                            4 |M68060 Software Package
  5 |Production Release P1.00 -- October 10, 1994       5 |Production Release P1.00 -- October 10, 1994
  6 |                                                   6 |
  7 |M68060 Software Package Copyright © 1993, 19      7 |M68060 Software Package Copyright © 1993, 1994 Motorola Inc.  All rights reserved.
  8 |                                                   8 |
  9 |THE SOFTWARE is provided on an "AS IS" basis       9 |THE SOFTWARE is provided on an "AS IS" basis and without warranty.
 10 |To the maximum extent permitted by applicable     10 |To the maximum extent permitted by applicable law,
 11 |MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXP     11 |MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED,
 12 |INCLUDING IMPLIED WARRANTIES OF MERCHANTABILI     12 |INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
 13 |and any warranty against infringement with re     13 |and any warranty against infringement with regard to the SOFTWARE
 14 |(INCLUDING ANY MODIFIED VERSIONS THEREOF) and     14 |(INCLUDING ANY MODIFIED VERSIONS THEREOF) and any accompanying written materials.
 15 |                                                  15 |
 16 |To the maximum extent permitted by applicable     16 |To the maximum extent permitted by applicable law,
 17 |IN NO EVENT SHALL MOTOROLA BE LIABLE FOR ANY      17 |IN NO EVENT SHALL MOTOROLA BE LIABLE FOR ANY DAMAGES WHATSOEVER
 18 |(INCLUDING WITHOUT LIMITATION, DAMAGES FOR LO     18 |(INCLUDING WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS,
 19 |BUSINESS INTERRUPTION, LOSS OF BUSINESS INFOR     19 |BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY LOSS)
 20 |ARISING OF THE USE OR INABILITY TO USE THE SO     20 |ARISING OF THE USE OR INABILITY TO USE THE SOFTWARE.
 21 |Motorola assumes no responsibility for the ma     21 |Motorola assumes no responsibility for the maintenance and support of the SOFTWARE.
 22 |                                                  22 |
 23 |You are hereby granted a copyright license to     23 |You are hereby granted a copyright license to use, modify, and distribute the SOFTWARE
 24 |so long as this entire notice is retained wit     24 |so long as this entire notice is retained without alteration in any modified and/or
 25 |redistributed versions, and that such modifie     25 |redistributed versions, and that such modified versions are clearly identified as such.
 26 |No licenses are granted by implication, estop     26 |No licenses are granted by implication, estoppel or otherwise under any patents
 27 |or trademarks of Motorola, Inc.                   27 |or trademarks of Motorola, Inc.
 28 |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     28 |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 29 | os.s                                             29 | os.s
 30 |                                                  30 |
 31 | This file contains:                              31 | This file contains:
 32 |       - example "Call-Out"s required by both     32 |       - example "Call-Out"s required by both the ISP and FPSP.
 33 |                                                  33 |
 34                                                    34 
 35 #include <linux/linkage.h>                         35 #include <linux/linkage.h>
 36                                                    36 
 37 |################################                  37 |################################
 38 | EXAMPLE CALL-OUTS             #                  38 | EXAMPLE CALL-OUTS             #
 39 |                               #                  39 |                               #
 40 | _060_dmem_write()             #                  40 | _060_dmem_write()             #
 41 | _060_dmem_read()              #                  41 | _060_dmem_read()              #
 42 | _060_imem_read()              #                  42 | _060_imem_read()              #
 43 | _060_dmem_read_byte()         #                  43 | _060_dmem_read_byte()         #
 44 | _060_dmem_read_word()         #                  44 | _060_dmem_read_word()         #
 45 | _060_dmem_read_long()         #                  45 | _060_dmem_read_long()         #
 46 | _060_imem_read_word()         #                  46 | _060_imem_read_word()         #
 47 | _060_imem_read_long()         #                  47 | _060_imem_read_long()         #
 48 | _060_dmem_write_byte()        #                  48 | _060_dmem_write_byte()        #
 49 | _060_dmem_write_word()        #                  49 | _060_dmem_write_word()        #
 50 | _060_dmem_write_long()        #                  50 | _060_dmem_write_long()        #
 51 |                               #                  51 |                               #
 52 | _060_real_trace()             #                  52 | _060_real_trace()             #
 53 | _060_real_access()            #                  53 | _060_real_access()            #
 54 |################################                  54 |################################
 55                                                    55 
 56 |                                                  56 |
 57 | Each IO routine checks to see if the memory      57 | Each IO routine checks to see if the memory write/read is to/from user
 58 | or supervisor application space. The example     58 | or supervisor application space. The examples below use simple "move"
 59 | instructions for supervisor mode application     59 | instructions for supervisor mode applications and call _copyin()/_copyout()
 60 | for user mode applications.                      60 | for user mode applications.
 61 | When installing the 060SP, the _copyin()/_co     61 | When installing the 060SP, the _copyin()/_copyout() equivalents for a
 62 | given operating system should be substituted     62 | given operating system should be substituted.
 63 |                                                  63 |
 64 | The addresses within the 060SP are guarantee     64 | The addresses within the 060SP are guaranteed to be on the stack.
 65 | The result is that Unix processes are allowe     65 | The result is that Unix processes are allowed to sleep as a consequence
 66 | of a page fault during a _copyout.               66 | of a page fault during a _copyout.
 67 |                                                  67 |
 68 | Linux/68k: The _060_[id]mem_{read,write}_{by     68 | Linux/68k: The _060_[id]mem_{read,write}_{byte,word,long} functions
 69 | (i.e. all the known length <= 4) are impleme     69 | (i.e. all the known length <= 4) are implemented by single moves
 70 | statements instead of (more expensive) copy{     70 | statements instead of (more expensive) copy{in,out} calls, if
 71 | working in user space                            71 | working in user space
 72                                                    72 
 73 |                                                  73 |
 74 | _060_dmem_write():                               74 | _060_dmem_write():
 75 |                                                  75 |
 76 | Writes to data memory while in supervisor mo     76 | Writes to data memory while in supervisor mode.
 77 |                                                  77 |
 78 | INPUTS:                                          78 | INPUTS:
 79 |       a0 - supervisor source address             79 |       a0 - supervisor source address
 80 |       a1 - user destination address              80 |       a1 - user destination address
 81 |       d0 - number of bytes to write              81 |       d0 - number of bytes to write
 82 |       0x4(%a6),bit5 - 1 = supervisor mode, 0     82 |       0x4(%a6),bit5 - 1 = supervisor mode, 0 = user mode
 83 | OUTPUTS:                                         83 | OUTPUTS:
 84 |       d1 - 0 = success, !0 = failure             84 |       d1 - 0 = success, !0 = failure
 85 |                                                  85 |
 86         .global         _060_dmem_write            86         .global         _060_dmem_write
 87 _060_dmem_write:                                   87 _060_dmem_write:
 88         subq.l          #1,%d0                     88         subq.l          #1,%d0
 89         btst            #0x5,0x4(%a6)              89         btst            #0x5,0x4(%a6)           | check for supervisor state
 90         beqs            user_write                 90         beqs            user_write
 91 super_write:                                       91 super_write:
 92         move.b          (%a0)+,(%a1)+              92         move.b          (%a0)+,(%a1)+           | copy 1 byte
 93         dbra            %d0,super_write            93         dbra            %d0,super_write         | quit if --ctr < 0
 94         clr.l           %d1                        94         clr.l           %d1                     | return success
 95         rts                                        95         rts
 96 user_write:                                        96 user_write:
 97         move.b          (%a0)+,%d1                 97         move.b          (%a0)+,%d1              | copy 1 byte
 98 copyoutae:                                         98 copyoutae:
 99         movs.b          %d1,(%a1)+                 99         movs.b          %d1,(%a1)+
100         dbra            %d0,user_write            100         dbra            %d0,user_write          | quit if --ctr < 0
101         clr.l           %d1                       101         clr.l           %d1                     | return success
102         rts                                       102         rts
103                                                   103 
104 |                                                 104 |
105 | _060_imem_read(), _060_dmem_read():             105 | _060_imem_read(), _060_dmem_read():
106 |                                                 106 |
107 | Reads from data/instruction memory while in     107 | Reads from data/instruction memory while in supervisor mode.
108 |                                                 108 |
109 | INPUTS:                                         109 | INPUTS:
110 |       a0 - user source address                  110 |       a0 - user source address
111 |       a1 - supervisor destination address       111 |       a1 - supervisor destination address
112 |       d0 - number of bytes to read              112 |       d0 - number of bytes to read
113 |       0x4(%a6),bit5 - 1 = supervisor mode, 0    113 |       0x4(%a6),bit5 - 1 = supervisor mode, 0 = user mode
114 | OUTPUTS:                                        114 | OUTPUTS:
115 |       d1 - 0 = success, !0 = failure            115 |       d1 - 0 = success, !0 = failure
116 |                                                 116 |
117         .global         _060_imem_read            117         .global         _060_imem_read
118         .global         _060_dmem_read            118         .global         _060_dmem_read
119 _060_imem_read:                                   119 _060_imem_read:
120 _060_dmem_read:                                   120 _060_dmem_read:
121         subq.l          #1,%d0                    121         subq.l          #1,%d0
122         btst            #0x5,0x4(%a6)             122         btst            #0x5,0x4(%a6)           | check for supervisor state
123         beqs            user_read                 123         beqs            user_read
124 super_read:                                       124 super_read:
125         move.b          (%a0)+,(%a1)+             125         move.b          (%a0)+,(%a1)+           | copy 1 byte
126         dbra            %d0,super_read            126         dbra            %d0,super_read          | quit if --ctr < 0
127         clr.l           %d1                       127         clr.l           %d1                     | return success
128         rts                                       128         rts
129 user_read:                                        129 user_read:
130 copyinae:                                         130 copyinae:
131         movs.b          (%a0)+,%d1                131         movs.b          (%a0)+,%d1
132         move.b          %d1,(%a1)+                132         move.b          %d1,(%a1)+              | copy 1 byte
133         dbra            %d0,user_read             133         dbra            %d0,user_read           | quit if --ctr < 0
134         clr.l           %d1                       134         clr.l           %d1                     | return success
135         rts                                       135         rts
136                                                   136 
137 |                                                 137 |
138 | _060_dmem_read_byte():                          138 | _060_dmem_read_byte():
139 |                                                 139 |
140 | Read a data byte from user memory.              140 | Read a data byte from user memory.
141 |                                                 141 |
142 | INPUTS:                                         142 | INPUTS:
143 |       a0 - user source address                  143 |       a0 - user source address
144 |       0x4(%a6),bit5 - 1 = supervisor mode, 0    144 |       0x4(%a6),bit5 - 1 = supervisor mode, 0 = user mode
145 | OUTPUTS:                                        145 | OUTPUTS:
146 |       d0 - data byte in d0                      146 |       d0 - data byte in d0
147 |       d1 - 0 = success, !0 = failure            147 |       d1 - 0 = success, !0 = failure
148 |                                                 148 |
149         .global         _060_dmem_read_byte       149         .global         _060_dmem_read_byte
150 _060_dmem_read_byte:                              150 _060_dmem_read_byte:
151         clr.l           %d0                       151         clr.l           %d0                     | clear whole longword
152         clr.l           %d1                       152         clr.l           %d1                     | assume success
153         btst            #0x5,0x4(%a6)             153         btst            #0x5,0x4(%a6)           | check for supervisor state
154         bnes            dmrbs                     154         bnes            dmrbs                   | supervisor
155 dmrbuae:movs.b          (%a0),%d0                 155 dmrbuae:movs.b          (%a0),%d0               | fetch user byte
156         rts                                       156         rts
157 dmrbs:  move.b          (%a0),%d0                 157 dmrbs:  move.b          (%a0),%d0               | fetch super byte
158         rts                                       158         rts
159                                                   159 
160 |                                                 160 |
161 | _060_dmem_read_word():                          161 | _060_dmem_read_word():
162 |                                                 162 |
163 | Read a data word from user memory.              163 | Read a data word from user memory.
164 |                                                 164 |
165 | INPUTS:                                         165 | INPUTS:
166 |       a0 - user source address                  166 |       a0 - user source address
167 |       0x4(%a6),bit5 - 1 = supervisor mode, 0    167 |       0x4(%a6),bit5 - 1 = supervisor mode, 0 = user mode
168 | OUTPUTS:                                        168 | OUTPUTS:
169 |       d0 - data word in d0                      169 |       d0 - data word in d0
170 |       d1 - 0 = success, !0 = failure            170 |       d1 - 0 = success, !0 = failure
171 |                                                 171 |
172 | _060_imem_read_word():                          172 | _060_imem_read_word():
173 |                                                 173 |
174 | Read an instruction word from user memory.      174 | Read an instruction word from user memory.
175 |                                                 175 |
176 | INPUTS:                                         176 | INPUTS:
177 |       a0 - user source address                  177 |       a0 - user source address
178 |       0x4(%a6),bit5 - 1 = supervisor mode, 0    178 |       0x4(%a6),bit5 - 1 = supervisor mode, 0 = user mode
179 | OUTPUTS:                                        179 | OUTPUTS:
180 |       d0 - instruction word in d0               180 |       d0 - instruction word in d0
181 |       d1 - 0 = success, !0 = failure            181 |       d1 - 0 = success, !0 = failure
182 |                                                 182 |
183         .global         _060_dmem_read_word       183         .global         _060_dmem_read_word
184         .global         _060_imem_read_word       184         .global         _060_imem_read_word
185 _060_dmem_read_word:                              185 _060_dmem_read_word:
186 _060_imem_read_word:                              186 _060_imem_read_word:
187         clr.l           %d1                       187         clr.l           %d1                     | assume success
188         clr.l           %d0                       188         clr.l           %d0                     | clear whole longword
189         btst            #0x5,0x4(%a6)             189         btst            #0x5,0x4(%a6)           | check for supervisor state
190         bnes            dmrws                     190         bnes            dmrws                   | supervisor
191 dmrwuae:movs.w          (%a0), %d0                191 dmrwuae:movs.w          (%a0), %d0              | fetch user word
192         rts                                       192         rts
193 dmrws:  move.w          (%a0), %d0                193 dmrws:  move.w          (%a0), %d0              | fetch super word
194         rts                                       194         rts
195                                                   195 
196 |                                                 196 |
197 | _060_dmem_read_long():                          197 | _060_dmem_read_long():
198 |                                                 198 |
199                                                   199 
200 |                                                 200 |
201 | INPUTS:                                         201 | INPUTS:
202 |       a0 - user source address                  202 |       a0 - user source address
203 |       0x4(%a6),bit5 - 1 = supervisor mode, 0    203 |       0x4(%a6),bit5 - 1 = supervisor mode, 0 = user mode
204 | OUTPUTS:                                        204 | OUTPUTS:
205 |       d0 - data longword in d0                  205 |       d0 - data longword in d0
206 |       d1 - 0 = success, !0 = failure            206 |       d1 - 0 = success, !0 = failure
207 |                                                 207 |
208 | _060_imem_read_long():                          208 | _060_imem_read_long():
209 |                                                 209 |
210 | Read an instruction longword from user memor    210 | Read an instruction longword from user memory.
211 |                                                 211 |
212 | INPUTS:                                         212 | INPUTS:
213 |       a0 - user source address                  213 |       a0 - user source address
214 |       0x4(%a6),bit5 - 1 = supervisor mode, 0    214 |       0x4(%a6),bit5 - 1 = supervisor mode, 0 = user mode
215 | OUTPUTS:                                        215 | OUTPUTS:
216 |       d0 - instruction longword in d0           216 |       d0 - instruction longword in d0
217 |       d1 - 0 = success, !0 = failure            217 |       d1 - 0 = success, !0 = failure
218 |                                                 218 |
219         .global         _060_dmem_read_long       219         .global         _060_dmem_read_long
220         .global         _060_imem_read_long       220         .global         _060_imem_read_long
221 _060_dmem_read_long:                              221 _060_dmem_read_long:
222 _060_imem_read_long:                              222 _060_imem_read_long:
223         clr.l           %d1                       223         clr.l           %d1                     | assume success
224         btst            #0x5,0x4(%a6)             224         btst            #0x5,0x4(%a6)           | check for supervisor state
225         bnes            dmrls                     225         bnes            dmrls                   | supervisor
226 dmrluae:movs.l          (%a0),%d0                 226 dmrluae:movs.l          (%a0),%d0               | fetch user longword
227         rts                                       227         rts
228 dmrls:  move.l          (%a0),%d0                 228 dmrls:  move.l          (%a0),%d0               | fetch super longword
229         rts                                       229         rts
230                                                   230 
231 |                                                 231 |
232 | _060_dmem_write_byte():                         232 | _060_dmem_write_byte():
233 |                                                 233 |
234 | Write a data byte to user memory.               234 | Write a data byte to user memory.
235 |                                                 235 |
236 | INPUTS:                                         236 | INPUTS:
237 |       a0 - user destination address             237 |       a0 - user destination address
238 |       d0 - data byte in d0                      238 |       d0 - data byte in d0
239 |       0x4(%a6),bit5 - 1 = supervisor mode, 0    239 |       0x4(%a6),bit5 - 1 = supervisor mode, 0 = user mode
240 | OUTPUTS:                                        240 | OUTPUTS:
241 |       d1 - 0 = success, !0 = failure            241 |       d1 - 0 = success, !0 = failure
242 |                                                 242 |
243         .global         _060_dmem_write_byte      243         .global         _060_dmem_write_byte
244 _060_dmem_write_byte:                             244 _060_dmem_write_byte:
245         clr.l           %d1                       245         clr.l           %d1                     | assume success
246         btst            #0x5,0x4(%a6)             246         btst            #0x5,0x4(%a6)           | check for supervisor state
247         bnes            dmwbs                     247         bnes            dmwbs                   | supervisor
248 dmwbuae:movs.b          %d0,(%a0)                 248 dmwbuae:movs.b          %d0,(%a0)               | store user byte
249         rts                                       249         rts
250 dmwbs:  move.b          %d0,(%a0)                 250 dmwbs:  move.b          %d0,(%a0)               | store super byte
251         rts                                       251         rts
252                                                   252 
253 |                                                 253 |
254 | _060_dmem_write_word():                         254 | _060_dmem_write_word():
255 |                                                 255 |
256 | Write a data word to user memory.               256 | Write a data word to user memory.
257 |                                                 257 |
258 | INPUTS:                                         258 | INPUTS:
259 |       a0 - user destination address             259 |       a0 - user destination address
260 |       d0 - data word in d0                      260 |       d0 - data word in d0
261 |       0x4(%a6),bit5 - 1 = supervisor mode, 0    261 |       0x4(%a6),bit5 - 1 = supervisor mode, 0 = user mode
262 | OUTPUTS:                                        262 | OUTPUTS:
263 |       d1 - 0 = success, !0 = failure            263 |       d1 - 0 = success, !0 = failure
264 |                                                 264 |
265         .global         _060_dmem_write_word      265         .global         _060_dmem_write_word
266 _060_dmem_write_word:                             266 _060_dmem_write_word:
267         clr.l           %d1                       267         clr.l           %d1                     | assume success
268         btst            #0x5,0x4(%a6)             268         btst            #0x5,0x4(%a6)           | check for supervisor state
269         bnes            dmwws                     269         bnes            dmwws                   | supervisor
270 dmwwu:                                            270 dmwwu:
271 dmwwuae:movs.w          %d0,(%a0)                 271 dmwwuae:movs.w          %d0,(%a0)               | store user word
272         bras            dmwwr                     272         bras            dmwwr
273 dmwws:  move.w          %d0,(%a0)                 273 dmwws:  move.w          %d0,(%a0)               | store super word
274 dmwwr:  clr.l           %d1                       274 dmwwr:  clr.l           %d1                     | return success
275         rts                                       275         rts
276                                                   276 
277 |                                                 277 |
278 | _060_dmem_write_long():                         278 | _060_dmem_write_long():
279 |                                                 279 |
280 | Write a data longword to user memory.           280 | Write a data longword to user memory.
281 |                                                 281 |
282 | INPUTS:                                         282 | INPUTS:
283 |       a0 - user destination address             283 |       a0 - user destination address
284 |       d0 - data longword in d0                  284 |       d0 - data longword in d0
285 |       0x4(%a6),bit5 - 1 = supervisor mode, 0    285 |       0x4(%a6),bit5 - 1 = supervisor mode, 0 = user mode
286 | OUTPUTS:                                        286 | OUTPUTS:
287 |       d1 - 0 = success, !0 = failure            287 |       d1 - 0 = success, !0 = failure
288 |                                                 288 |
289         .global         _060_dmem_write_long      289         .global         _060_dmem_write_long
290 _060_dmem_write_long:                             290 _060_dmem_write_long:
291         clr.l           %d1                       291         clr.l           %d1                     | assume success
292         btst            #0x5,0x4(%a6)             292         btst            #0x5,0x4(%a6)           | check for supervisor state
293         bnes            dmwls                     293         bnes            dmwls                   | supervisor
294 dmwluae:movs.l          %d0,(%a0)                 294 dmwluae:movs.l          %d0,(%a0)               | store user longword
295         rts                                       295         rts
296 dmwls:  move.l          %d0,(%a0)                 296 dmwls:  move.l          %d0,(%a0)               | store super longword
297         rts                                       297         rts
298                                                   298 
299                                                   299 
300 #if 0                                             300 #if 0
301 |#############################################    301 |###############################################
302                                                   302 
303 |                                                 303 |
304 | Use these routines if your kernel doesn't ha    304 | Use these routines if your kernel doesn't have _copyout/_copyin equivalents.
305 | Assumes that D0/D1/A0/A1 are scratch registe    305 | Assumes that D0/D1/A0/A1 are scratch registers. The _copyin/_copyout
306 | below assume that the SFC/DFC have been set     306 | below assume that the SFC/DFC have been set previously.
307 |                                                 307 |
308 | Linux/68k: These are basically non-inlined v    308 | Linux/68k: These are basically non-inlined versions of
309 | memcpy_{to,from}fs, but without long-transfe    309 | memcpy_{to,from}fs, but without long-transfer optimization
310 | Note: Assumed that SFC/DFC are pointing corr    310 | Note: Assumed that SFC/DFC are pointing correctly to user data
311 | space... Should be right, or are there any e    311 | space... Should be right, or are there any exceptions?
312                                                   312 
313 |                                                 313 |
314 | int _copyout(supervisor_addr, user_addr, nby    314 | int _copyout(supervisor_addr, user_addr, nbytes)
315 |                                                 315 |
316         .global         _copyout                  316         .global         _copyout
317 _copyout:                                         317 _copyout:
318         move.l          4(%sp),%a0                318         move.l          4(%sp),%a0              | source
319         move.l          8(%sp),%a1                319         move.l          8(%sp),%a1              | destination
320         move.l          12(%sp),%d0               320         move.l          12(%sp),%d0             | count
321         subq.l          #1,%d0                    321         subq.l          #1,%d0
322 moreout:                                          322 moreout:
323         move.b          (%a0)+,%d1                323         move.b          (%a0)+,%d1              | fetch supervisor byte
324 copyoutae:                                        324 copyoutae:
325         movs.b          %d1,(%a1)+                325         movs.b          %d1,(%a1)+              | store user byte
326         dbra            %d0,moreout               326         dbra            %d0,moreout             | are we through yet?
327         moveq           #0,%d0                    327         moveq           #0,%d0                  | return success
328         rts                                       328         rts
329                                                   329 
330 |                                                 330 |
331 | int _copyin(user_addr, supervisor_addr, nbyt    331 | int _copyin(user_addr, supervisor_addr, nbytes)
332 |                                                 332 |
333         .global         _copyin                   333         .global         _copyin
334 _copyin:                                          334 _copyin:
335         move.l          4(%sp),%a0                335         move.l          4(%sp),%a0              | source
336         move.l          8(%sp),%a1                336         move.l          8(%sp),%a1              | destination
337         move.l          12(%sp),%d0               337         move.l          12(%sp),%d0             | count
338     subq.l      #1,%d0                            338     subq.l      #1,%d0
339 morein:                                           339 morein:
340 copyinae:                                         340 copyinae:
341         movs.b          (%a0)+,%d1                341         movs.b          (%a0)+,%d1              | fetch user byte
342         move.b          %d1,(%a1)+                342         move.b          %d1,(%a1)+              | write supervisor byte
343         dbra            %d0,morein                343         dbra            %d0,morein              | are we through yet?
344         moveq           #0,%d0                    344         moveq           #0,%d0                  | return success
345         rts                                       345         rts
346 #endif                                            346 #endif
347                                                   347 
348 |#############################################    348 |###########################################################################
349                                                   349 
350 |                                                 350 |
351 | _060_real_trace():                              351 | _060_real_trace():
352 |                                                 352 |
353 | This is the exit point for the 060FPSP when     353 | This is the exit point for the 060FPSP when an instruction is being traced
354 | and there are no other higher priority excep    354 | and there are no other higher priority exceptions pending for this instruction
355 | or they have already been processed.            355 | or they have already been processed.
356 |                                                 356 |
357 | The sample code below simply executes an "rt    357 | The sample code below simply executes an "rte".
358 |                                                 358 |
359         .global         _060_real_trace           359         .global         _060_real_trace
360 _060_real_trace:                                  360 _060_real_trace:
361         bral    trap                              361         bral    trap
362                                                   362 
363 |                                                 363 |
364 | _060_real_access():                             364 | _060_real_access():
365 |                                                 365 |
366 | This is the exit point for the 060FPSP when     366 | This is the exit point for the 060FPSP when an access error exception
367 | is encountered. The routine below should poi    367 | is encountered. The routine below should point to the operating system
368 | handler for access error exceptions. The exc    368 | handler for access error exceptions. The exception stack frame is an
369 | 8-word access error frame.                      369 | 8-word access error frame.
370 |                                                 370 |
371 | The sample routine below simply executes an     371 | The sample routine below simply executes an "rte" instruction which
372 | is most likely the incorrect thing to do and    372 | is most likely the incorrect thing to do and could put the system
373 | into an infinite loop.                          373 | into an infinite loop.
374 |                                                 374 |
375         .global         _060_real_access          375         .global         _060_real_access
376 _060_real_access:                                 376 _060_real_access:
377         bral    buserr                            377         bral    buserr
378                                                   378 
379                                                   379 
380                                                   380 
381 | Execption handling for movs access to illega    381 | Execption handling for movs access to illegal memory
382         .section .fixup,"ax"                      382         .section .fixup,"ax"
383         .even                                     383         .even
384 1:      moveq           #-1,%d1                   384 1:      moveq           #-1,%d1
385         rts                                       385         rts
386 .section __ex_table,"a"                           386 .section __ex_table,"a"
387         .align 4                                  387         .align 4
388         .long   dmrbuae,1b                        388         .long   dmrbuae,1b
389         .long   dmrwuae,1b                        389         .long   dmrwuae,1b
390         .long   dmrluae,1b                        390         .long   dmrluae,1b
391         .long   dmwbuae,1b                        391         .long   dmwbuae,1b
392         .long   dmwwuae,1b                        392         .long   dmwwuae,1b
393         .long   dmwluae,1b                        393         .long   dmwluae,1b
394         .long   copyoutae,1b                      394         .long   copyoutae,1b
395         .long   copyinae,1b                       395         .long   copyinae,1b
396         .text                                     396         .text
                                                      

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php