From: Neal Andrew Crook Date: Wed, 1 Jun 2016 19:11:12 +0000 (+0100) Subject: Move platform-dependent register definitions to common file. Adjust X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=34c53eb2b2f12aedcfcde0bb635576501d086a93;p=FUZIX.git Move platform-dependent register definitions to common file. Adjust makefile to add asm .def files as a dependency for assembly. No functional changes. --- diff --git a/Kernel/platform-multicomp09/Makefile b/Kernel/platform-multicomp09/Makefile index 78d49958..d58a413e 100644 --- a/Kernel/platform-multicomp09/Makefile +++ b/Kernel/platform-multicomp09/Makefile @@ -32,7 +32,7 @@ $(CDOBJS): %$(BINEXT): %.c $(DOBJS): %$(BINEXT): ../dev/%.c $(CROSS_CC) $(CROSS_CCOPTS) -c $< -$(AOBJS): %$(BINEXT): %.s +$(AOBJS): %$(BINEXT): %.s dw.def kernel.def platform.def ../kernel09.def $(CROSS_AS) $(ASOPTS) $< -o $*.o diff --git a/Kernel/platform-multicomp09/multicomp09.s b/Kernel/platform-multicomp09/multicomp09.s index 20883565..e7cb0f1f 100644 --- a/Kernel/platform-multicomp09/multicomp09.s +++ b/Kernel/platform-multicomp09/multicomp09.s @@ -60,64 +60,43 @@ ;;; registers are selecting blocks 0-7. ;;; map1 mapping registers are uninitialised. - -;;; multicomp09 HW registers -MMUADR equ $ffde -MMUDAT equ $ffdf -TIMER equ $ffdd - -;;; bit-fields -MMUADR_ROMDIS equ $80 ; 0 after reset, 1 when FUZIX boots. Leave at 1. -MMUADR_TR equ $40 ; 0 after reset, 0 when FUZIX boots. 0=map0, 1=map1 -MMUADR_MMUEN equ $20 ; 0 after reset, 1 when FUZIX boots. Leave at 1. -MMUADR_NMI equ $10 ; 0 after reset, 0 when FUZIX boots. Do not write 1. -MMUADR_MAPSEL equ $0f ; last-written value is UNDEFINED. -;;; the only two useful values for the upper nibble -MMU_MAP0 equ (MMUADR_ROMDIS|MMUADR_MMUEN) -MMU_MAP1 equ (MMUADR_ROMDIS|MMUADR_MMUEN|MMUADR_TR) - -TIMER_ON equ $02 -TIMER_OFF equ $00 -TIMER_INT equ $80 - - - .module multicomp09 - - ; exported symbols - .globl init_early - .globl init_hardware - .globl interrupt_handler - .globl _program_vectors - .globl map_kernel - .globl map_process - .globl map_process_always - .globl map_save - .globl map_restore - .globl _need_resched - .globl _bufpool - .globl _discard_size - .globl _krn_mmu_map - .globl _usr_mmu_map - .globl curr_tr - - ; exported debugging tools - .globl _trap_monitor - .globl _trap_reboot - .globl outchar - .globl _di - .globl _ei - .globl _irqrestore - - ; imported symbols - .globl _ramsize - .globl _procmem - .globl unix_syscall_entry - .globl nmi_handler - .globl null_handler - - include "kernel.def" - include "../kernel09.def" - + .module multicomp09 + + ; exported symbols + .globl init_early + .globl init_hardware + .globl interrupt_handler + .globl _program_vectors + .globl map_kernel + .globl map_process + .globl map_process_always + .globl map_save + .globl map_restore + .globl _need_resched + .globl _bufpool + .globl _discard_size + .globl _krn_mmu_map + .globl _usr_mmu_map + .globl curr_tr + + ; exported debugging tools + .globl _trap_monitor + .globl _trap_reboot + .globl outchar + .globl _di + .globl _ei + .globl _irqrestore + + ; imported symbols + .globl _ramsize + .globl _procmem + .globl unix_syscall_entry + .globl nmi_handler + .globl null_handler + + include "kernel.def" + include "../kernel09.def" + include "platform.def" .area .buffers diff --git a/Kernel/platform-multicomp09/platform.def b/Kernel/platform-multicomp09/platform.def new file mode 100644 index 00000000..c2c185ae --- /dev/null +++ b/Kernel/platform-multicomp09/platform.def @@ -0,0 +1,41 @@ +;;; +;;; Hardware definitions for Multicomp 6809 FPGA-based computer +;;; + +;;; [NAC HACK 2016May03] maybe I should define these all as offsets from IOBASE.. +;;; then index any of them from a single register. +;;; [NAC HACK 2016Jun01] or use the DP register and access them all on the direct page + +;;; MMU registers +MMUADR equ $ffde +MMUDAT equ $ffdf + + + +;;; MMU bit-fields +MMUADR_ROMDIS equ $80 ; 0 after reset, 1 when FUZIX boots. Leave at 1. +MMUADR_TR equ $40 ; 0 after reset, 0 when FUZIX boots. 0=map0, 1=map1 +MMUADR_MMUEN equ $20 ; 0 after reset, 1 when FUZIX boots. Leave at 1. +MMUADR_NMI equ $10 ; 0 after reset, 0 when FUZIX boots. Do not write 1. +MMUADR_MAPSEL equ $0f ; last-written value is UNDEFINED. +;;; the only two useful values for the upper nibble +MMU_MAP0 equ (MMUADR_ROMDIS|MMUADR_MMUEN) +MMU_MAP1 equ (MMUADR_ROMDIS|MMUADR_MMUEN|MMUADR_TR) + + + +;;; Timer registers +TIMER equ $ffdd + +;;; Timer bit-fields +TIMER_ON equ $02 +TIMER_OFF equ $00 +TIMER_INT equ $80 + + +;;; SD Controller registers +SDDATA equ $FFD8 +SDCTL equ $FFD9 +SDLBA0 equ $FFDA ; not used here +SDLBA1 equ $FFDB ; not used here +SDLBA2 equ $FFDC ; not used here diff --git a/Kernel/platform-multicomp09/sdc.s b/Kernel/platform-multicomp09/sdc.s index 878ebc8e..c4518408 100644 --- a/Kernel/platform-multicomp09/sdc.s +++ b/Kernel/platform-multicomp09/sdc.s @@ -9,13 +9,7 @@ .globl _devsd_write .globl _devsd_read - -;;; multicomp09 hw registers -SDDATA equ $FFD8 -SDCTL equ $FFD9 -SDLBA0 equ $FFDA ; not used here -SDLBA1 equ $FFDB ; not used here -SDLBA2 equ $FFDC ; not used here + include "platform.def" section .common diff --git a/Kernel/platform-multicomp09/tricks.s b/Kernel/platform-multicomp09/tricks.s index f8b3b39b..c889929f 100644 --- a/Kernel/platform-multicomp09/tricks.s +++ b/Kernel/platform-multicomp09/tricks.s @@ -2,26 +2,6 @@ ;;; CoCo3 ghoulish tricks (boo!) ported to multicomp09 ;;; - -;;; [NAC HACK 2016May01] want all the hw reg definitions in a common place. - -;;; multicomp09 HW registers -MMUADR equ $ffde -MMUDAT equ $ffdf - -;;; bit-fields -MMUADR_ROMDIS equ $80 ; 0 after reset, 1 when FUZIX boots. Leave at 1. -MMUADR_TR equ $40 ; 0 after reset, 0 when FUZIX boots. 0=map0, 1=map1 -MMUADR_MMUEN equ $20 ; 0 after reset, 1 when FUZIX boots. Leave at 1. -MMUADR_NMI equ $10 ; 0 after reset, 0 when FUZIX boots. Do not write 1. -MMUADR_MAPSEL equ $0f ; last-written value is UNDEFINED. -;;; the only two useful values for the upper nibble -MMU_MAP0 equ (MMUADR_ROMDIS|MMUADR_MMUEN) -MMU_MAP1 equ (MMUADR_ROMDIS|MMUADR_MMUEN|MMUADR_TR) - - - - .module tricks ;; imported @@ -41,7 +21,7 @@ MMU_MAP1 equ (MMUADR_ROMDIS|MMUADR_MMUEN|MMUADR_TR) include "kernel.def" include "../kernel09.def" - + include "platform.def" .area .data ;;; _ramtop cannot be in common, as this memory becomes per-process diff --git a/Kernel/platform-multicomp09/usermem_gime.s b/Kernel/platform-multicomp09/usermem_gime.s index 0036746d..54db90fa 100644 --- a/Kernel/platform-multicomp09/usermem_gime.s +++ b/Kernel/platform-multicomp09/usermem_gime.s @@ -2,29 +2,14 @@ ;;; ;;; 6809 copy to and from userspace via -;;; Color Computer 3 GIME mmu +;;; Multicomp09 MMU which imitates a Color Computer 3 GIME mmu ;;; -;;; multicomp09 HW registers -;;; [NAC HACK 2016May03] maybe I should define these all as offsets from IOBASE.. -;;; then index any of them from a single register. -MMUADR equ $ffde -MMUDAT equ $ffdf - -;;; bit-fields -MMUADR_ROMDIS equ $80 ; 0 after reset, 1 when FUZIX boots. Leave at 1. -MMUADR_TR equ $40 ; 0 after reset, 0 when FUZIX boots. 0=map0, 1=map1 -MMUADR_MMUEN equ $20 ; 0 after reset, 1 when FUZIX boots. Leave at 1. -MMUADR_NMI equ $10 ; 0 after reset, 0 when FUZIX boots. Do not write 1. -MMUADR_MAPSEL equ $0f ; last-written value is UNDEFINED. -;;; the only two useful values for the upper nibble -MMU_MAP0 equ (MMUADR_ROMDIS|MMUADR_MMUEN) -MMU_MAP1 equ (MMUADR_ROMDIS|MMUADR_MMUEN|MMUADR_TR) - include "kernel.def" include "../kernel09.def" + include "platform.def" - ;; window xfer treshhold - any user/krn space xtfers + ;; window xfer threshhold - any user/krn space xtfers ;; bigger than this will be routed to the banking/windowing ;; transfers, rather than the original slower routines WINTR equ 256 ; window xfer threshold @@ -339,4 +324,3 @@ a@ lda ,u+ ; get a byte ;; return ldx #0 ; return #0 - success puls u,y,cc,pc ; return -