-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
65 additions
and
55 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,28 @@ | ||
/* | ||
* Test for temporarily blocked interrupts | ||
* Test wake-up interrupts | ||
*/ | ||
|
||
lc r100, 0x10000000 // test result output pointer | ||
lc r101, halt | ||
lc r102, failure | ||
lc r103, 0x20000000 // timer: number of pulses (0xFFFFFFFF - infinite) | ||
lc r104, 0x20000004 // timer: delay between pulses (in cycles) | ||
lc iv0, timer_handler | ||
lc cr, 0x101 // enable interrupt 0 in temporarily blocked state | ||
lc r32, 0 // interrupt handler call counter | ||
lc r33, 1000 // loop counter | ||
lc r34, loop1 | ||
lc r35, loop2 | ||
sw r104, 100 | ||
sw r103, 1 | ||
lc r102, 0x30000000 // coprocessor input register | ||
lc r103, 0x30000004 // coprocessor output register | ||
lc r104, failure | ||
|
||
loop1: | ||
sub r33, r33, 1 | ||
cjmpug r34, r33, 0 // loop1 | ||
lc r33, 1000 | ||
mov cr, 1 // unblock interrupt 0 | ||
lcs cr, 0x0404 // enable coprocessor interrupt and mark it as wake-up | ||
loop2: | ||
sub r33, r33, 1 | ||
cjmpug r35, r33, 0 // loop2 | ||
sw r102, 33 | ||
// r32 should be 1 by this point | ||
cjmpne r102, r32, 1 // failure | ||
sw r100, 1 | ||
hlt | ||
|
||
lw r1, r103 | ||
cjmpne r104, r1, 99 | ||
|
||
sw r100, 1 // success | ||
|
||
halt: | ||
hlt | ||
jmp r101 // halt | ||
|
||
failure: | ||
sw r100, 2 | ||
halt: | ||
hlt | ||
jmp r101 // halt | ||
timer_handler: | ||
add r32, r32, 1 | ||
iret |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters