-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rspq: Fix infinite loop with max command size
Previously, the maximum command size was 63 words, which is one less word than the size of the command buffer in DMEM. Depending on alignment within the RDRAM buffer, commands with this maximum size could be DMA'd into the DMEM buffer at an offset of one word. In that case, the command ended exactly at the end of the DMEM buffer. Due to an optimization in rspq (which saves some IMEM), this lead to rspq refetching the commands in an infinite loop. This is now fixed by decreasing the maximum command size to 62 instead. Additionally, this makes rspq more robust by moving some magic numbers to macros and adding some (static) asserts.
- Loading branch information
Showing
7 changed files
with
47 additions
and
22 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#ifndef TEST_RSPQ_CONSTANTS | ||
#define TEST_RSPQ_CONSTANTS | ||
|
||
#define TEST_RSPQ_BIG_COMMAND_SIZE 62 | ||
#define TEST_RSPQ_BIG_PAYLOAD_WORDS (TEST_RSPQ_BIG_COMMAND_SIZE-1) | ||
#define TEST_RSPQ_BIG_PAYLOAD_SIZE (TEST_RSPQ_BIG_PAYLOAD_WORDS*4) | ||
|
||
#endif |