68hc11: flesh out more of the support code
authorAlan Cox <alan@linux.intel.com>
Tue, 21 Jul 2015 22:34:00 +0000 (23:34 +0100)
committerAlan Cox <alan@linux.intel.com>
Tue, 21 Jul 2015 22:34:00 +0000 (23:34 +0100)
Kernel/platform-68hc11test/kernel.def
Kernel/platform-68hc11test/p68hc11.s

index 59eab43..7205c68 100644 (file)
@@ -9,38 +9,57 @@
 ;
 ;      EEPROM entry points
 ;
-;      A = srcbank, B = dstbank
-;      IX = src, returns value in D
+;      A = bank
+;      X = src, returns value in B or D
 .equ fargetb                   , 0xF840
-.equ fargetw                   , 0xF842
+.equ fargetw                   , 0xF843
 ;
-;      A = srcbank, B = dstbank
-;      IX = dst, IY = dstval
+;      A = bank B = value
+;      X = dst
+;
+.equ farputb                   , 0xF846
 ;
-.equ farputb                   , 0xF844
-.equ farputw                   , 0xF846
+;      A = bank
+;      X = dst, Y = value
+;
+.equ farputw                   , 0xF849
 ;
 ;      A = srcbank, B = dstbank
-;      IX = dst, IY = src
+;      X = dst, Y = src
 ;      kernel:_tmp1 = length (in kernel bank)
 ;
-.equ farcopy                   , 0xF848
+.equ farcopy                   , 0xF84C
 ;
-;      A = bank, IX = function, IY = far stack
+;      A = bank, X = function, Y = far stack
 ;
-.equ farcall                   , 0xF84A
+.equ farcall                   , 0xF84F
 ;
-;      A = bank, IX = function, IY = far stack
+;      A = bank, X = function, Y = far stack
 ;
-.equ farjump                   , 0xF84C
+.equ farjump                   , 0xF852
 ;
 ;      A = bank
 ;
-.equ setbank                   , 0xF84E
+.equ setbank                   , 0xF855
 ;
 ;      D = 0
 ;
-.equ reboot                    , 0xF850
+.equ reboot                    , 0xF858
+;
+;      A = srcbank, B = dstbank
+;      X = dst, Y = src
+;      kernel:_tmp1 = length (in kernel bank)
+;
+.equ farzcopy                  , 0xF85B
+;
+;      A = bank
+;      X = dst
+;      Y = len
+;
+;      Return in D
+;
+.equ farzero                   , 0xF85E
+;
 ;
 ;
 ;      Low memory usage (not banked)
index e01800a..e0bb1ca 100644 (file)
@@ -135,15 +135,105 @@ map_process:
        .globl _uzero
 
 
+;
+;      D = user address
+;
 doexec:
+       xgdx            ; function into X
+       ldaa usrbank    ; bank
+       ldy U_DATA__U_ISP
+       jsr farcall
+;
+;      If this returns we should probably do an exit call or something
+;      FIXME
+;
+       jmp trap_monitor
+
+
+;
+;      D = user address
+;
 sigdispatch:
+       xgdx
+       ldy U_DATA__U_SYSCALL_SP
+       ldaa usrbank
+       ; This may not return which is fine
+       jmp farcall
+       ; Signal handler completed and returned back to the eeprom and thus
+       ; banked back to kernel so returns to our caller
+
+;
+;      We have no common but instead route far accesses via the eeprom
+;      helpers in the firmware.
+;
 _ugetc:
+       xgdx
+       ldaa usrbank
+       jsr fargetb
+       clra
+       rts
 _ugetw:
+       xgdx
+       ldaa usrbank
+       jmp fargetw
+
+;
+;      D = src, 2(s) = dest, 4(s) = size
+;
 _ugets:
+       tsx
+       xgdy            ; D was src, we want it in Y
+       ldd 4,x         ; size
+       std tmp1        ; in tmp1
+       ldx 2,x         ; destination in X
+       clrb            ; 0 = kernel
+       ldaa usrbank    ; user space
+       jmp farzcopy    ; returns error/size in D
+;
+;      D = src, 2(s) = dest, 4(s) = size
+;
 _uget:
+       tsx
+       xgdy            ; D was src, we want it in Y
+       ldd 4,x         ; size
+       std tmp1        ; in tmp1
+       ldx 2,x         ; destination in X
+       clrb            ; 0 = kernel
+       ldaa usrbank    ; user space
+       jmp farcopy
+;
+;      D = value, 2(s) = dst
+;
 _uputc:
+       tsx
+       ldx 2,x         ; x is dst
+       xgdy            ; value into y
+       ldaa usrbank
+       jmp farputb
+
 _uputw:
+       tsx
+       ldx 2,x         ; x is dst
+       xgdy            ; value into y
+       ldaa usrbank
+       jmp farputw
+;
+;      D = src, 2(s) = dst, 4(s) = size
+;
 _uput:
+       tsx
+       xgdy            ; D was src, we want it in Y
+       ldd 4,x         ; size
+       std tmp1        ; in tmp1
+       ldx 2,x         ; destination in X
+       clra            ; 0 = kernel
+       ldab usrbank    ; user space
+       jmp farcopy
 _uzero:
-       /* FIXME */
+       tsx
+       ldy 2,x         ; length
+       xgdx            ; pointer
+       ldaa usrbank
+       jmp farzero
+
        rts