Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions core/libs/prx/libSceAgcDriver/Execution/include/Pm4.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ inline bool CopyDataImmediate(std::uint32_t source) { return source >= 10 && sou
inline bool CopyDataToRegister(std::span<const std::uint32_t> packet) { return ((packet[1] >> 8u) & 0xfu) == 0; }
inline std::size_t CopyDataBytes(std::span<const std::uint32_t> packet) { return (packet[1] & 0x10000u) != 0 ? 8 : 4; }
inline constexpr std::uint32_t RewindValid = 0x80000000u;
inline constexpr std::uint32_t RewindOffloadEnable = 0x01000000u;
struct WaitFields {
std::uint32_t function;
std::uint64_t address;
Expand Down
2 changes: 1 addition & 1 deletion core/libs/prx/libSceAgcDriver/Execution/src/Pm4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ void Validate(std::span<const std::uint32_t> packet, std::uint32_t queue) {
}
case 0x59:
size(2);
require((packet[1] & 0x7fffffffu) == 0, "unsupported REWIND payload bits");
require((packet[1] & ~(RewindValid | RewindOffloadEnable)) == 0, "unsupported REWIND payload bits");
break;
case 0x3c: case 0x93: {
size(opcode == 0x3c ? 7 : 9);
Expand Down
6 changes: 6 additions & 0 deletions core/libs/prx/libSceAgcDriver/tests/Pm4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1105,6 +1105,11 @@ void testConditionalSubmission() {
check(results[13] == 0, "a rejected conditional submission executed a guarded packet");
}

void testRewindPayloadBits() {
for (const auto payload : {0x00000000u, 0x80000000u, 0x01000000u, 0x81000000u}) AgcDriver::Pm4::Validate(makePacket(0x59, {payload}), 0);
for (const auto payload : {0x82000000u, 0x80000001u, 0x00800000u}) expectFailure([&] { AgcDriver::Pm4::Validate(makePacket(0x59, {payload}), 0); }, "unsupported REWIND payload bits");
}

void testNopPadSubmission() {
alignas(8) static std::uint32_t zero = 0;
static std::array<std::uint32_t, 3> results{};
Expand Down Expand Up @@ -1824,6 +1829,7 @@ int main(int argc, char** argv) {
}
testCatalog();
testNopPad();
testRewindPayloadBits();
testWriteChangedKeepsUntouchedBytes();
testWriteChangedStoresExactlyTheChangedRuns();
testRegisters();
Expand Down
Loading