remove weird double spaces, remove /EXPORT from build.bat in favor of __declspec(dllexport)
This commit is contained in:
1 parent
9fa2a7e0db
commit
83d48e09bb
41 files changed
+156
-170
No files matched your search
@@ -10,14 +10,14 @@
|
||||
//
|
||||
// Async I/O model (IRP path):
|
||||
// Each drive has a dedicated kernel worker thread (AhciWorker) that blocks
|
||||
// on a per-drive counting semaphore. Callers submit IRPs via AhciSubmitIrp,
|
||||
// which enqueues the IRP and signals the semaphore. The worker dequeues
|
||||
// on a per-drive counting semaphore. Callers submit IRPs via AhciSubmitIrp,
|
||||
// which enqueues the IRP and signals the semaphore. The worker dequeues
|
||||
// one IRP at a time, runs the synchronous hardware transfer (blocking the
|
||||
// worker, NOT the submitting thread), then writes irp->Status and fires
|
||||
// irp->CompletionEvent / irp->CompletionFn.
|
||||
//
|
||||
// This gives true async I/O from the caller's perspective: IoSubmitIrp()
|
||||
// returns STATUS_PENDING immediately. Multiple callers can have outstanding
|
||||
// returns STATUS_PENDING immediately. Multiple callers can have outstanding
|
||||
// requests against different drives concurrently without stalling each other.
|
||||
//
|
||||
// NCQ extension (future work — see "NCQ TODO" comments):
|
||||
@@ -30,13 +30,13 @@
|
||||
// • In AhciIsr: completed slots = prev_sact ^ port->sact; look up
|
||||
// slot_irp[slot] and fire each completion from within the ISR.
|
||||
// • The worker becomes a pure dispatcher: grab a free slot, build the
|
||||
// command, issue it, return immediately. No per-slot KeWaitForEvent.
|
||||
// command, issue it, return immediately. No per-slot KeWaitForEvent.
|
||||
//
|
||||
// Interrupt model (unchanged):
|
||||
// GHC.IE and per-port PORT_IE are enabled after each port is initialised.
|
||||
// AhciIsr fires on the PCI IRQ line and signals the per-drive completionEvent.
|
||||
// port_issue_cmd blocks the worker thread on KeWaitForEvent instead of
|
||||
// spinning on CI. port_issue_cmd_poll is kept for early init (IDENTIFY)
|
||||
// spinning on CI. port_issue_cmd_poll is kept for early init (IDENTIFY)
|
||||
// before the scheduler is live.
|
||||
|
||||
#include <stdint.h>
|
||||
@@ -383,7 +383,7 @@ typedef struct {
|
||||
// -----------------------------------------------------------------------
|
||||
// IRP queue — async dispatch
|
||||
// -----------------------------------------------------------------------
|
||||
// AhciWorker blocks here waiting for work. AhciSubmitIrp enqueues an IRP
|
||||
// AhciWorker blocks here waiting for work. AhciSubmitIrp enqueues an IRP
|
||||
// and signals the semaphore to wake the worker.
|
||||
IRP_QUEUE irpQueue;
|
||||
THREAD *workerThread;
|
||||
@@ -838,7 +838,7 @@ static KSTATUS AhciSubmitIrp(void *ctx, IRP *irp) {
|
||||
|
||||
// AhciWorker — kernel thread, one per drive.
|
||||
// Dequeues IRPs and executes them one at a time using the existing
|
||||
// single-slot interrupt-driven path. Completion fires the IRP's event
|
||||
// single-slot interrupt-driven path. Completion fires the IRP's event
|
||||
// and/or callback so the original caller can observe the result without
|
||||
// ever having blocked in a driver call.
|
||||
//
|
||||
@@ -1106,7 +1106,7 @@ KSTATUS AhciInitialize(const HAL_API *hal) {
|
||||
// Phase 5b: create the IRP queue semaphore and initialise the queue.
|
||||
// The semaphore starts at 0; each submitted IRP increments it by one.
|
||||
SEMAPHORE *irpSem = (SEMAPHORE *)0;
|
||||
st = SemaphoreCreate(0, 0x7FFFFFFF, &irpSem);
|
||||
st = KeSemaphoreCreate(0, 0x7FFFFFFF, &irpSem);
|
||||
if (!KSUCCESS(st)) {
|
||||
DbgPrint("AHCI: port %u: semaphore create failed (0x%x)\n", portno, st);
|
||||
continue;
|
||||
@@ -1167,7 +1167,7 @@ KSTATUS AhciInitialize(const HAL_API *hal) {
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Register the ISR. All ports on this HBA share one PCI IRQ line.
|
||||
// Register the ISR. All ports on this HBA share one PCI IRQ line.
|
||||
// Do this after all drives are initialised so the ISR sees valid state.
|
||||
// -----------------------------------------------------------------------
|
||||
KeIrqRegister(g_irq, AhciIsr);
|
||||
|
||||
Reference in new issue
Block a user