Commit Graph
86 Commits
Author SHA1 Message Date
joevt 8413e9245a dbdma: Add missing this. 2026-09-27 09:34:50 -07:00
joevt 019a15e6eb dbdma: Remove extra spaces. 2026-09-27 09:28:15 -07:00
joevt 529fff7d4d timermanager: Pre-allocate TimerInfo.
Remove std::shared_ptr allocation/deallocation of TimerInfo structs.
2026-09-25 20:12:05 -07:00
joevt 14bae3d789 timermanager: Add time parameters to callback. 2026-09-23 07:04:04 -07:00
joevt 583137f327 dbdma: Remove unused callbacks. 2026-08-23 16:29:03 -07:00
Mihai Parparita 4d3cd65429 dma: Remove the old pull/push completion API
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.
2026-08-21 22:51:37 -07:00
Mihai Parparita a35736dda3 dbdma: Interpret command lists until STOP
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.
2026-08-21 22:51:37 -07:00
joevt 834006d311 dbdma: Fix STORE_QUAD and LOAD_QUAD. 2026-08-08 06:51:03 -07:00
joevt 90b3119b8f dbdma: Use update_cmd for flush also. 2026-08-06 07:47:26 -07:00
Mihai Parparita 1b0ac89674 ppcmmu: Move TLB internals into implementation
`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.
2026-08-06 07:33:54 -07:00
joevt 577ddb28a9 dbdma: Add update_cmd. 2026-08-05 19:39:27 -07:00
joevt 49cc164a11 dbdma: Add comment. 2026-08-05 19:38:34 -07:00
Mihai Parparita 45ea0103ed dbdma: update xferStatus and resCount when handling FLUSH command (#198)
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).
2026-08-05 18:43:52 -07:00
joevt fd9899ae87 dbdma: xfer_quad improvements and fixes.
- 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.
2026-07-15 07:52:16 -07:00
joevt ff911cc056 dbdma: Add is_active to more methods. 2026-07-15 07:11:18 -07:00
joevt 7af1235b8e dbdma: Flush only applies to INPUT commands. 2026-07-14 20:25:11 -07:00
joevt 06ea4a844e dbdma: Add is_active. 2026-07-14 20:23:41 -07:00
joevt 813350f14a dbdma: Remove superfluous update_irq method. 2026-07-14 19:57:37 -07:00
joevt 4bcd96e6b1 dbdma: Save current dbdma cmd host address.
Use the saved address for finish_cmd.
2026-07-14 19:24:03 -07:00
joevt 83775309e9 dbdma: Set res_count at beginning of command.
Don't need to reset it at the end of a command.
2026-07-14 18:52:22 -07:00
joevt 2a3b6d9cb7 dmacore: Rename is_ready.
So that it is not confused with other contexts.
2026-07-14 18:48:10 -07:00
joevt fce52eacfb dbdma: Remove interpret_cmd result. 2026-07-14 07:59:22 -07:00
dingusdev e5b8ff49e4 Restore clearing CH_STAT_FLUSH
This is still required so that the MacTest Pro (Nov. 99) CD can boot up.
2026-07-13 08:30:35 -07:00
Mihai Parparita 36420c55b9 dbdma: Report residual descriptor byte counts
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`).
2026-07-07 11:06:55 +02:00
joevt 37da4d3162 dmacore: Add DmaPushResult. 2026-07-02 08:10:04 -07:00
joevt 3e9397c478 dbdma: Set queue_len after all other fields.
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.
2026-07-02 08:07:54 -07:00
joevt dd5ba1dcfc dbdma: Fix setting of gp channel control bits. 2026-06-18 20:06:44 -07:00
joevt d3483523d6 dbdma: Fix spelling. 2026-06-18 20:06:35 -07:00
joevt 67418b07b0 dbdma: Maintain and report res_count. 2026-06-18 20:06:12 -07:00
joevt cbe840ff3f dbdma: Set flush status when doing flush command. 2026-06-18 19:43:52 -07:00
joevt 290c575503 dbdma: Fix indenting of flush handler. 2026-06-18 19:43:30 -07:00
Maxim Poliakovski 0e2ffa7863 Move endianswap.h to core/* 2026-06-07 21:10:51 +02:00
Maxim Poliakovski 0e03cac082 Move memaccess.h to core/* 2026-06-07 20:32:46 +02:00
Maxim Poliakovski 0f14a075cc dbdma: fix pausing/resuming of channel execution.
Suspend execution only if the ACTIVE bit is set.
Resume execution only if the channel was previously suspended.
2026-06-02 02:47:47 +02:00
Maxim Poliakovski 767811b952 dbdma: send notification messages to devices. 2026-05-29 23:36:24 +02:00
Maxim Poliakovski 30d95e1409 dmacore: add support for several channels per device. 2026-05-29 23:22:16 +02:00
Maxim Poliakovski 4138074789 dbdma: rewrite CH_STAT update logic. 2026-05-29 23:16:07 +02:00
Maxim Poliakovski 0f4b4c0f67 dbdma.cpp: fix CommandPtrLo update.
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.
2026-05-18 22:01:41 +02:00
Maxim Poliakovski ab1f9c59bc dbdma: fix endianness for STORE_QUAD targeting MMIO. 2026-05-16 00:13:16 +02:00
joevt f7b5a440e8 dbdma: Use saved_cmd_bits. 2026-04-04 17:17:13 -07:00
Copilotandjarz 798af27514 dbdma: Fix update_irq bug in finish_cmd.
Co-authored-by: jarz <90255+jarz@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2026-04-04 17:16:52 -07:00
dingusdev 213dd4c16e Update copyright info further 2026-01-30 08:12:04 -07:00
Maxim Poliakovski e75ee8d32a Update copyright year. 2026-01-30 12:15:00 +01:00
dingusdev b813a080da Add additional registers to read for DMAReg 2025-12-04 06:52:48 -07:00
Maxim Poliakovski ee776e41cf dbdma: warn for unexpected amount of data in xfer_from_device. 2025-09-21 00:24:33 +02:00
Maxim Poliakovski c742beb623 sc53c94: return actual number of bytes transferred
in xfer_to and xfer_from methods.
2025-04-01 04:02:51 +02:00
Maxim Poliakovski 2d61e4c604 dbdma: implement new DmaChannel methods. 2025-04-01 04:01:26 +02:00
Maxim Poliakovski 5057792d4d dbdma: implement xfer_to_device method. 2024-12-03 11:37:18 +01:00
Maxim Poliakovski 04899d6528 dbdma: prevent STOP from updating xferStatus. 2024-11-30 12:12:32 +01:00
dingusdev d279ada718 Revert "dbdma: Schedule interpret_cmd."
This reverts commit e1849a2bfd.
2024-11-17 06:49:43 -07:00