mirror of
https://github.com/RhapsodiOS/RhapsodiOS.git
synced 2026-11-03 22:01:40 -07:00
[PR #33] [MERGED] drivers: clamp elapsed-time differences against backward clock steps #89
Labels
No labels
bug
documentation
enhancement
enhancement
good first issue
help wanted
help wanted
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github-starred/RhapsodiOS#89
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/RhapsodiOS/RhapsodiOS/pull/33
Author: @raynorpat
Created: 9/26/2026
Status: ✅ Merged
Merged: 9/26/2026
Merged by: @raynorpat
Base:
master← Head:claude/hopeful-pasteur-r3wqxx📝 Commits (1)
3304607drivers: clamp elapsed-time deltas against backward clock steps📊 Changes
12 files changed (+67 additions, -12 deletions)
View changed files
📝
src/drivers-i386/ide/drvEIDE/EIDE.drvproj/EIDE.lksproj/IdeDiskInternal.m(+1 -1)📝
src/drivers-i386/ide/drvPCFloppy/Floppy.drvproj/Floppy.lksproj/FloppyDriveInt2.m(+4 -3)📝
src/drivers-i386/ide/drvPCFloppy/reconstruction/divergences.md(+15 -0)📝
src/drivers-i386/scsi/drvAMDPCSCSIDriver/AMDPCSCSIDriver.drvproj/AMDPCSCSIDriver.lksproj/AMD_SCSI.m(+4 -3)📝
src/drivers-i386/scsi/drvAMDPCSCSIDriver/AMDPCSCSIDriver.drvproj/AMDPCSCSIDriver.lksproj/AMD_x86.m(+2 -1)📝
src/drivers-i386/scsi/drvAdaptec1542B/Adaptec1542B.drvproj/Adaptec1542B.lksproj/AHAThread.m(+1 -1)📝
src/drivers-i386/scsi/drvAdaptec1542B/reconstruction/divergences.md(+13 -0)📝
src/drivers-i386/scsi/drvAdaptec6X60/Adaptec6X60.drvproj/Adaptec6X60.lksproj/AIC6X60Thread.m(+1 -1)📝
src/drivers-i386/scsi/drvAdaptec6X60/reconstruction/divergences.md(+12 -0)📝
src/drivers-i386/scsi/drvBusLogic/BusLogic.drvproj/BusLogic.lksproj/BusLogicThread.m(+1 -1)📝
src/drivers-i386/scsi/drvDPT2000/DPT2000.drvproj/DPT2000.lksproj/EATAControllerThread.m(+1 -1)📝
src/drivers-i386/scsi/drvDPT2000/reconstruction/divergences.md(+12 -0)📄 Description
Summary
Follow-up to #26. Clamps the remaining
now - thenelapsed-time computations on the unsigned 64-bitns_time_t(fromIOGetTimestamp()) that could wrap to ~1.8e19 ns if a backward clock step occurs (possible under heavy TCG load when IRQ0 is serviced more than one PIT period late).Sites fixed, all changed from
end - startto(end > start) ? end - start : 0(or equivalent):Transfer statistics (
totalTime/latentTime):drvEIDE/IdeDiskInternal.m—delta = end_time - start_timedrvPCFloppy/FloppyDriveInt2.m—endTime - startTime(both read/write branches)drvBusLogic/BusLogicThread.m—scsiReq->totalTimedrvAdaptec1542B/AHAThread.m—scsiReq->totalTimedrvAdaptec6X60/AIC6X60Thread.m—scsiReq->totalTimedrvDPT2000/EATAControllerThread.m—scsiReq->totalTimedrvAMDPCSCSIDriver/AMD_SCSI.m—scsiReq->latentTime += currentTime - disconnectTimeDebug-only timing (DDM builds):
drvAMDPCSCSIDriver/AMD_SCSI.m— interrupt elapsed timedrvAMDPCSCSIDriver/AMD_x86.m— IPL testusTimecomputationThe other sites the issue identified as already safe (timeout scans comparing absolute deadlines,
IODelay, etc.) were left untouched.Recorded the four statistics-path fixes with a
reconstruction/divergences.md(drvPCFloppy, drvAdaptec1542B, drvAdaptec6X60, drvDPT2000) as intentional divergences from the reference binary, per the issue's guidance.Test plan
Fixes #28
🤖 Generated with Claude Code
https://claude.ai/code/session_015XptfxXQbyzUsRG1LkNicw
Generated by Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.