pcw8256: update rest of IRQ handling
authorAlan Cox <alan@linux.intel.com>
Mon, 1 Oct 2018 12:40:02 +0000 (13:40 +0100)
committerAlan Cox <alan@linux.intel.com>
Mon, 1 Oct 2018 12:40:02 +0000 (13:40 +0100)
Kernel/platform-pcw8256/fdc765.s
Kernel/platform-pcw8256/pcw8256.s

index 52849c5..ec8edd0 100644 (file)
@@ -19,6 +19,7 @@
 
                .globl  map_process_always
                .globl  map_kernel
+               .globl _int_disabled
 
                .area _COMMONMEM
 
@@ -194,7 +195,7 @@ fd765_xfer_outdi:
 ;      Read a disc sector.
 ;
 _fd765_read_sector:
-               ld a, i
+               ld a,(_int_disabled)
                push af
                ld a, (_fd765_user)
                or a
@@ -233,7 +234,8 @@ read_status:                                        ; clean up is shared
 read_out:
                call map_kernel
                pop af
-               ret po
+               or a
+               ret nz
                ei
                ret
 read_failed:
@@ -245,7 +247,7 @@ read_failed:
 ;      be self modifying to save space.
 ;
 _fd765_write_sector:
-               ld a, i
+               ld a,(_int_disabled)
                push af
                ld a, (_fd765_user)
                or a
index 42a0e04..16cd75a 100644 (file)
@@ -201,13 +201,16 @@ map_process_always_di:
            pop af
            ret
 
+;
+;      We shouldn't need IRQ protection here - review
+;
 map_process:
 map_process_di:
            ld a, h
            or l
            jr z, map_kernel
 map_process_1:
-           ld a, i
+           ld a, (int_disabled)
            push af
            di                  ; ensure we don't take an irq mid update
            push de
@@ -226,7 +229,8 @@ map_loop:
            pop bc
            pop de
            pop af
-           ret po
+           or a
+           ret nz
            ei
            ret
 
@@ -329,7 +333,7 @@ _scroll_down:
 
            .area _COMMONMEM
 
-addr_de:    ld a, i
+addr_de:    ld a, (_int_disabled)
            push af
            ld a, (roller)
            rra                 ; in text lines
@@ -386,7 +390,8 @@ addr_de:    ld a, i
            out (0xf1), a
            pop bc
            pop af
-           ret po
+           or a
+           ret nz
            ei
            ret
 _plot_char: