socz80: fix timer, improve irq code a shade
authorAlan Cox <alan@linux.intel.com>
Tue, 3 Feb 2015 10:59:39 +0000 (10:59 +0000)
committerAlan Cox <alan@linux.intel.com>
Tue, 3 Feb 2015 10:59:39 +0000 (10:59 +0000)
Kernel/platform-socz80/main.c
Kernel/platform-socz80/socz80.s

index b2408d9..7439788 100644 (file)
@@ -18,7 +18,7 @@ __sfr __at 0x01 uart0_data;
 __sfr __at 0x28 uart1_status;
 __sfr __at 0x29 uart1_data;
 
-extern uint16_t irqwork;
+extern uint8_t irqwork;
 
 void platform_interrupt(void)
 {
index 08b1519..c76045c 100644 (file)
@@ -98,14 +98,13 @@ _trap_monitor:
             ; it's never a dull day with ROM around!
 
 platform_interrupt_all:
+           ld hl,#_irqwork
            in a,(TIMER_STATUS)
            bit 7, a
            jr z, not_timer
-           ld a,(_irqwork)
-           set 0, a
-           ld (_irqwork),a
+           set 0, (hl)
            xor a
-           out (TIMER_STATUS),a
+           out (TIMER_COMMAND),a
 not_timer:
            in a,(UART0_STATUS)
            ld b, a
@@ -115,7 +114,6 @@ not_timer:
            and b
            out (UART0_STATUS),a
            and #0xC0
-           ld hl,#_irqwork
            or (hl)
            ld (hl),a
            ret