p112: Implement _trap_reboot
authorWill Sowerbutts <will@sowerbutts.com>
Fri, 26 Jun 2015 19:38:56 +0000 (20:38 +0100)
committerWill Sowerbutts <will@sowerbutts.com>
Fri, 26 Jun 2015 19:39:58 +0000 (20:39 +0100)
Kernel/platform-p112/p112.s

index 3eb53b4..3e22d4a 100644 (file)
@@ -12,7 +12,7 @@
         .globl outstring
         .globl outcharhex
         .globl platform_interrupt_all
-        .globl _trap_monitor
+        .globl _trap_reboot
 
         ; imported symbols
         .globl z180_init_hardware
@@ -111,5 +111,13 @@ inchar:
         in0 a, (ESCC_DATA_A)
         ret
 
+_trap_reboot:
+        in0 a, (Z182_SYSCONFIG)
+        res 3, a                    ; re-enable the ROM select line
+        out0 (Z182_SYSCONFIG), a
+        xor a
+        out0 (MMU_BBR), a           ; map ROM into the lower 60K
+        jp 0                        ; jump to the boot ROM entry vector
+
 platform_interrupt_all:
         ret