|Production Release P1.00 -- October 10, 1994
|
|M68060 Software Package Copyright © 1993, 1994 Motorola Inc. All rights reserved.
-|
+|
|THE SOFTWARE is provided on an "AS IS" basis and without warranty.
|To the maximum extent permitted by applicable law,
-|MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED,
+|MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED,
|INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
|and any warranty against infringement with regard to the SOFTWARE
|(INCLUDING ANY MODIFIED VERSIONS THEREOF) and any accompanying written materials.
#include <linux/linkage.h>
|################################
-| EXAMPLE CALL-OUTS #
-| #
+| EXAMPLE CALL-OUTS #
+| #
| _060_dmem_write() #
| _060_dmem_read() #
| _060_imem_read() #
| _060_real_access() #
|################################
-|
+|
| Each IO routine checks to see if the memory write/read is to/from user
| or supervisor application space. The examples below use simple "move"
| instructions for supervisor mode applications and call _copyin()/_copyout()
| for user mode applications.
-| When installing the 060SP, the _copyin()/_copyout() equivalents for a
+| When installing the 060SP, the _copyin()/_copyout() equivalents for a
| given operating system should be substituted.
|
| The addresses within the 060SP are guaranteed to be on the stack.
| Writes to data memory while in supervisor mode.
|
| INPUTS:
-| a0 - supervisor source address
+| a0 - supervisor source address
| a1 - user destination address
-| d0 - number of bytes to write
-| 0x4(%a6),bit5 - 1 = supervisor mode, 0 = user mode
+| d0 - number of bytes to write
+| 0x4(%a6),bit5 - 1 = supervisor mode, 0 = user mode
| OUTPUTS:
| d1 - 0 = success, !0 = failure
|
| a0 - user source address
| a1 - supervisor destination address
| d0 - number of bytes to read
-| 0x4(%a6),bit5 - 1 = supervisor mode, 0 = user mode
+| 0x4(%a6),bit5 - 1 = supervisor mode, 0 = user mode
| OUTPUTS:
| d1 - 0 = success, !0 = failure
|
- .global _060_imem_read
+ .global _060_imem_read
.global _060_dmem_read
_060_imem_read:
_060_dmem_read:
|
| _060_dmem_read_byte():
-|
+|
| Read a data byte from user memory.
|
| INPUTS:
| a0 - user source address
-| 0x4(%a6),bit5 - 1 = supervisor mode, 0 = user mode
+| 0x4(%a6),bit5 - 1 = supervisor mode, 0 = user mode
| OUTPUTS:
| d0 - data byte in d0
| d1 - 0 = success, !0 = failure
|
- .global _060_dmem_read_byte
+ .global _060_dmem_read_byte
_060_dmem_read_byte:
clr.l %d0 | clear whole longword
clr.l %d1 | assume success
|
| _060_dmem_read_word():
-|
+|
| Read a data word from user memory.
|
| INPUTS:
| a0 - user source address
-| 0x4(%a6),bit5 - 1 = supervisor mode, 0 = user mode
+| 0x4(%a6),bit5 - 1 = supervisor mode, 0 = user mode
| OUTPUTS:
| d0 - data word in d0
| d1 - 0 = success, !0 = failure
|
| _060_imem_read_word():
-|
+|
| Read an instruction word from user memory.
|
| INPUTS:
| a0 - user source address
-| 0x4(%a6),bit5 - 1 = supervisor mode, 0 = user mode
+| 0x4(%a6),bit5 - 1 = supervisor mode, 0 = user mode
| OUTPUTS:
| d0 - instruction word in d0
| d1 - 0 = success, !0 = failure
|
- .global _060_dmem_read_word
- .global _060_imem_read_word
+ .global _060_dmem_read_word
+ .global _060_imem_read_word
_060_dmem_read_word:
_060_imem_read_word:
clr.l %d1 | assume success
|
| _060_dmem_read_long():
-|
+|
|
| INPUTS:
| a0 - user source address
-| 0x4(%a6),bit5 - 1 = supervisor mode, 0 = user mode
+| 0x4(%a6),bit5 - 1 = supervisor mode, 0 = user mode
| OUTPUTS:
| d0 - data longword in d0
| d1 - 0 = success, !0 = failure
|
| _060_imem_read_long():
-|
+|
| Read an instruction longword from user memory.
|
| INPUTS:
| a0 - user source address
-| 0x4(%a6),bit5 - 1 = supervisor mode, 0 = user mode
+| 0x4(%a6),bit5 - 1 = supervisor mode, 0 = user mode
| OUTPUTS:
| d0 - instruction longword in d0
| d1 - 0 = success, !0 = failure
|
- .global _060_dmem_read_long
- .global _060_imem_read_long
+ .global _060_dmem_read_long
+ .global _060_imem_read_long
_060_dmem_read_long:
_060_imem_read_long:
clr.l %d1 | assume success
|
| INPUTS:
| a0 - user destination address
-| d0 - data byte in d0
-| 0x4(%a6),bit5 - 1 = supervisor mode, 0 = user mode
+| d0 - data byte in d0
+| 0x4(%a6),bit5 - 1 = supervisor mode, 0 = user mode
| OUTPUTS:
| d1 - 0 = success, !0 = failure
|
- .global _060_dmem_write_byte
+ .global _060_dmem_write_byte
_060_dmem_write_byte:
clr.l %d1 | assume success
btst #0x5,0x4(%a6) | check for supervisor state
|
| INPUTS:
| a0 - user destination address
-| d0 - data word in d0
-| 0x4(%a6),bit5 - 1 = supervisor mode, 0 = user mode
+| d0 - data word in d0
+| 0x4(%a6),bit5 - 1 = supervisor mode, 0 = user mode
| OUTPUTS:
| d1 - 0 = success, !0 = failure
|
- .global _060_dmem_write_word
+ .global _060_dmem_write_word
_060_dmem_write_word:
clr.l %d1 | assume success
btst #0x5,0x4(%a6) | check for supervisor state
|
| INPUTS:
| a0 - user destination address
-| d0 - data longword in d0
-| 0x4(%a6),bit5 - 1 = supervisor mode, 0 = user mode
+| d0 - data longword in d0
+| 0x4(%a6),bit5 - 1 = supervisor mode, 0 = user mode
| OUTPUTS:
| d1 - 0 = success, !0 = failure
|
- .global _060_dmem_write_long
+ .global _060_dmem_write_long
_060_dmem_write_long:
clr.l %d1 | assume success
btst #0x5,0x4(%a6) | check for supervisor state
|
| int _copyout(supervisor_addr, user_addr, nbytes)
|
- .global _copyout
+ .global _copyout
_copyout:
move.l 4(%sp),%a0 | source
move.l 8(%sp),%a1 | destination
|
| int _copyin(user_addr, supervisor_addr, nbytes)
|
- .global _copyin
+ .global _copyin
_copyin:
move.l 4(%sp),%a0 | source
move.l 8(%sp),%a1 | destination
move.l 12(%sp),%d0 | count
subq.l #1,%d0
morein:
-copyinae:
+copyinae:
movs.b (%a0)+,%d1 | fetch user byte
move.b %d1,(%a1)+ | write supervisor byte
dbra %d0,morein | are we through yet?
-| Execption handling for movs access to illegal memory
+| Execption handling for movs access to illegal memory
.section .fixup,#alloc,#execinstr
.even
1: moveq #-1,%d1