b63b6583 removed the old ESCC DMA implementation, taking the last users
of end_pull_data(), end_push_data(), and get_push_data_remaining() with
it. 9fb34efc later removed the last get_pull_data_remaining() call from
the sound server.
Nothing has called these hooks since. Remove them from DmaOutChannel,
DmaInChannel, and DMAChannel instead of carrying dead completion paths
alongside the DMA interfaces that are still in use.
With #214 we started to advertise the IDE DMA support from #192 to
guests. That appeared to break booting Mac OS 8.x, at least on the Beige
G3: the startup disk was not even detected.
Mac OS 8.1 sets up an IDE DMA read as INPUT_MORE, then a NOP with its i
field set to always, then STOP, which clears the channel's ACTIVE bit.
The emulated transfer completion path interpreted only one following
descriptor, so it stopped at NOP. NOP raised the interrupt, but STOP was
never reached and the channel stayed active. The Mac OS X driver is more
tolerant of this, which is why it was not an issue there.
The DBDMA Specification, section 1.4, says: "The target fetches command
entries and performs the command-entry-specified data-transfer operation,
processing command entries until a STOP entry is reached". Keep
interpreting ready commands until a transfer blocks or the channel stops,
as start() and resume() already did. This is closer to the hardware
behavior, and empirically lets Mac OS 8.1 boot again.
`TLBEntry` and its cache constants and flags are used exclusively by
ppcmmu.cpp. Keep them out of the public MMU header so future TLB changes
do not expand its interface.
This required a small fix in dbdma.cpp since it was implicitly relying on
an include that we removed.
Also declare `gTLBFlush*` variables as static to make it explicit that we
don't expect them to be accessed outside of ppcmmu.cpp.
Per the DBDMA spec (section 15.4.3), this is required. Fixes a hang
when booting 9.0 and 9.0.4 on the Beige G3 (they would get stuck in a
loop polling the `xferStatus.active` field).
- Make the method call less confusing.
- Use cur_host instead of passing cmd_struct.
- Pass a boolean to differentiate LOAD_QUAD and STORE_QUAD.
- Use xfer_size instead of req_count for res_count.
- Don't LOAD_QUAD to read-only DBDMA command.
We were treating resCount as a "result" count, but it's actually a "residual"
count that reports how many bytes from a descriptor were not transferred
when processing a command. We now correctly handle partial descriptors.
This ended up being necessary for the 10.0 public beta bringup too (the
`AppleUltra66ATA::stopDma` implementation in xnu-103 computes the number
of bytes transferred by subtracting `resCount` from `reqCount`).
If queue_len is a flag to determine when data is queued, then it
probably should be set last so that the other fields are valid when
another thread decides to act on the queued data.
Some Apple docs state that the CommandPtrLo can be written
if both the run and active bits are cleared.
Later docs say that only the active bit needs to be cleared.
Fix the code to conform to the logic of the latter.