8080: add framework for 8085 vectored interrupts and 8214 interrupts
authorAlan Cox <alan@linux.intel.com>
Sun, 17 Feb 2019 23:56:11 +0000 (23:56 +0000)
committerAlan Cox <alan@linux.intel.com>
Sun, 17 Feb 2019 23:56:11 +0000 (23:56 +0000)
Kernel/kernel-8080.def
Kernel/lowlevel-8080.s

index 6b9c99a..9ed72d6 100644 (file)
@@ -57,3 +57,23 @@ BUFSIZE                     = 520
 !
 .sect .common                  ! 4
 .sect .discard                 ! 5
+
+
+! Currently only used for 8085
+
+#ifndef INT_ENTER
+#define INT_ENTER              ! just use the automatic di
+#endif
+
+#ifndef INT_EXIT
+#define INT_EXIT               ! nothing needed by default
+#endif
+
+#ifndef EI
+#define EI ei
+#endif
+
+#ifndef DI
+#define DI di
+#endif
+
index cae884a..1fc5a17 100644 (file)
@@ -44,10 +44,11 @@ deliver_signals_2:
        !       FIXME: if we ever have 8080 binaries with different load
        !       addresses we will need to fix this
        !
+       EI
        lhld PROGLOAD+16                ! signal vector
        pchl
 signal_return:
-       di
+       DI
        lxi h,0
        dad sp
        shld U_DATA__U_SYSCALL_SP
@@ -64,7 +65,6 @@ signal_return:
 .define unix_syscall_entry
 
 unix_syscall_entry:
-       di
        push b          ! Must preserve the frame pointer
        lxi h,6         ! Find arguments on stack frame
 
@@ -95,6 +95,7 @@ unix_syscall_entry:
        inx h
        mov a,m
        sta U_DATA__U_ARGN+7
+       DI
        ! We are now in kernel space
        mvi a,1
        sta U_DATA__U_INSYS
@@ -108,14 +109,14 @@ unix_syscall_entry:
        ! Now map the kernel and call it
        !
        call map_kernel_di
-       ei
+       EI
        call _unix_syscall
        xchg
        !
        ! Remember fork and execve don't necessarily return this way and fork
        ! can do it twice
        !
-       di
+       DI
        call map_process_always
        xra a
        sta U_DATA__U_INSYS
@@ -144,7 +145,7 @@ not_error:
 unix_pop:
        pop b
        ! ret must directly follow the ei
-       ei
+       EI
        ret
 via_signal:
        !
@@ -171,7 +172,7 @@ via_signal:
 .define _doexec
 
 _doexec:
-       di
+       DI
        call map_process_always
        pop b
        pop d
@@ -181,7 +182,7 @@ _doexec:
        sta U_DATA__U_INSYS
        xchg
        lxi d,PROGLOAD
-       ei
+       EI
        pchl
 !
 !      NULL trap. Must live in common space 
@@ -242,6 +243,7 @@ nmimsg:
 
 interrupt_handler:
        push psw
+       INT_ENTER
        push b
        push d
        push h
@@ -321,6 +323,7 @@ interrupt_pop:
        pop h
        pop d
        pop b
+       INT_EXIT
        pop psw
        ei
        ret