!
.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
+
! 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
.define unix_syscall_entry
unix_syscall_entry:
- di
push b ! Must preserve the frame pointer
lxi h,6 ! Find arguments on stack frame
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
! 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
unix_pop:
pop b
! ret must directly follow the ei
- ei
+ EI
ret
via_signal:
!
.define _doexec
_doexec:
- di
+ DI
call map_process_always
pop b
pop d
sta U_DATA__U_INSYS
xchg
lxi d,PROGLOAD
- ei
+ EI
pchl
!
! NULL trap. Must live in common space
interrupt_handler:
push psw
+ INT_ENTER
push b
push d
push h
pop h
pop d
pop b
+ INT_EXIT
pop psw
ei
ret