# HG changeset patch # User Josef 'Jeff' Sipek # Date 1565554726 14400 # Sun Aug 11 16:18:46 2019 -0400 # Node ID 39cbb375e1b09d08a2332a909f6f645d3cc686cd # Parent 866e79cf580fcc1cdead498302010333dd6d1a3c loader: rewrite I/O code to handle relocations more gracefully This is some of the oldest code in the repository, and sadly it is showing its age. This change should be enough to get us a step closer to using the sastart code and therefore deleting this mess completely. Signed-off-by: Josef 'Jeff' Sipek diff --git a/loader/loader/loader_asm.s b/loader/loader/loader_asm.s --- a/loader/loader/loader_asm.s +++ b/loader/loader/loader_asm.s @@ -25,26 +25,16 @@ .globl __do_io .type __do_io, @function __do_io: - # - # r4 = 0x80000000 - # - XGR %r4, %r4 - LHI %r4, 0x8 - SLL %r4, 20 - # - # r14 = r14 & 0x7fffffff don't ask, it's strangely retarded - # - L %r1,ADDRMASK(%r4) - NR %r14, %r1 # mask out the bit - L %r1, 0xb8 # load subsystem ID - SSCH orb(%r4) # issue IO + LARL %r4, orb + SSCH 0(%r4) # issue IO /* 7) Enable the PSW for I/O interrupts and go into wait state (you need bits 6, 12 & 14 set to 1 in the PSW : X'020A000000000000' is a good example) */ - LPSWE WAITPSW(%r4) + LARL %r4, WAITPSW + LPSWE 0(%r4) # # The IO interrupt handler @@ -52,15 +42,17 @@ .globl IOHANDLER IOHANDLER: # is this for us? - L %r1, MAGICVAL(%r4) + LARL %r1, MAGICVAL + L %r1, 0(%r1) C %r1, 0xbc - BNE IONOTDONE(%r4) + JNE IONOTDONE # it is! - L %r1, 0xb8 # load subsystem ID + LLGF %r1, 0xb8 # load subsystem ID - TSCH irb(%r4) + LARL %r4, irb + TSCH 0(%r4) /* FIXME: we should do more checking! @@ -71,7 +63,7 @@ */ # unit check? (end of media?) - L %r1,irb+5(%r4) + L %r1,5(%r4) LA %r0,0x02 NR %r0,%r1 LA %r2,1 # return 1 - end of medium