Skip to content

Commit

Permalink
[bench-dma] Adjust TF detection
Browse files Browse the repository at this point in the history
  • Loading branch information
kostorr committed Jan 10, 2022
1 parent 972f609 commit 315abd1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/CommandLineUtilities/ProgramDmaBench.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,6 @@ class ProgramDmaBench : public Program
bool checkTimeFrameAlignment(uintptr_t pageAddress, bool atStartOfSuperpage)
{
static bool overflowGuard = false;
static uint32_t mNextTFOrbit = 0x0;
static uint32_t prevOrbit = 0x0;

// check that the TimeFrame starts at the beginning of the superpage
Expand All @@ -822,9 +821,11 @@ class ProgramDmaBench : public Program
if (!atStartOfSuperpage) {
return false;
}
// Update next TF orbit expected
overflowGuard = (mNextTFOrbit + mTimeFrameLength) & 0x100000000; // next TF orbit overflown, need to wait for orbit to overflow as well
mNextTFOrbit = mNextTFOrbit + mTimeFrameLength;
while (mNextTFOrbit <= mOrbit) { // If we end up on an orbit that is more than a TF length away
// Update next TF orbit expected
overflowGuard = (mNextTFOrbit + mTimeFrameLength) & 0x100000000; // next TF orbit overflown, need to wait for orbit to overflow as well
mNextTFOrbit = mNextTFOrbit + mTimeFrameLength;
}
}

return true;
Expand Down

0 comments on commit 315abd1

Please sign in to comment.