# HG changeset patch # User Paul Boddie # Date 1510935766 -3600 # Node ID ff962c071724be815dd11aeb37afc5345881e955 # Parent 7edceda19310c46d591e96bec2eb73131b90079e Update timer interrupt priorities atomically, removing disable/enable code. diff -r 7edceda19310 -r ff962c071724 vga.S --- a/vga.S Thu Nov 16 23:59:56 2017 +0100 +++ b/vga.S Fri Nov 17 17:22:46 2017 +0100 @@ -867,19 +867,12 @@ The condition still occurs, however. */ - la $v0, IEC0 - li $v1, (1 << 9) - sw $v1, CLR($v0) /* T2IE = 0 */ - la $v0, IPC2 - li $v1, 0b11111 - sw $v1, CLR($v0) /* T2IP, T2IS = 0 */ - li $v1, 0b00111 - sw $v1, SET($v0) /* T2IP = 1; T2IS = 3 */ - - la $v0, IEC0 - li $v1, (1 << 9) - sw $v1, SET($v0) /* T2IE = 0 */ + lw $v1, 0($v0) + li $t8, ~0b11111 + and $v1, $v1, $t8 /* T2IP = 0; T2IS = 0 */ + ori $v1, $v1, 0b00111 /* T2IP = 1; T2IS = 3 */ + sw $v1, 0($v0) /* Enable the line channel for timer event transfer initiation. */ @@ -908,19 +901,12 @@ /* Restore delivery of the timer interrupt after the visible period. */ - la $v0, IEC0 - li $v1, (1 << 9) - sw $v1, CLR($v0) /* T2IE = 0 */ - la $v0, IPC2 - li $v1, 0b11111 - sw $v1, CLR($v0) /* T2IP, T2IS = 0 */ - li $v1, 0b11111 - sw $v1, SET($v0) /* T2IP = 7; T2IS = 3 */ - - la $v0, IEC0 - li $v1, (1 << 9) - sw $v1, SET($v0) /* T2IE = 1 */ + lw $v1, 0($v0) + li $t8, ~0b11111 + and $v1, $v1, $t8 /* T2IP = 0; T2IS = 0 */ + ori $v1, $v1, 0b11111 /* T2IP = 7; T2IS = 3 */ + sw $v1, 0($v0) /* Disable the line channel. */