replace nob with ms' build, move disk creation to build.bat, major comment cleanup, remove old and stupid tests, overhaul interrupt management with per-CPU vector allocation, affinity migration and safe teardown, add proper IOAPIC routing and PCI MSI/MSI-X/INTx support, migrate drivers to the new interrupt API, integrate ACPICA with a proper OS services layer, move ACPI firmware events, power button handling and S5 shutdown into acpi.sys, add parallel driver startup and atomic publication, replace PnP arrays with dynamic lists, redesign service startup again to be asynchronous, add delayed startup mode for services, allow omitting keys in services.ini, fix acpi ec deferred work handling, fix kernel threads having garbage exit code.
This commit is contained in:
1 parent
d36f19509c
commit
36eef8f58d
696 files changed
+147281
-7530
No files matched your search
@@ -2,7 +2,6 @@
|
||||
|
||||
#include "ahci.h"
|
||||
|
||||
// Implements the ahci map mmio operation.
|
||||
KSTATUS ahci_map_mmio(uint64_t physBase, uint64_t length) {
|
||||
if (length == 0)
|
||||
length = AHCI_MMIO_PAGES * 4096ull;
|
||||
@@ -25,7 +24,6 @@ KSTATUS ahci_map_mmio(uint64_t physBase, uint64_t length) {
|
||||
return NTLSTATUS_SUCCESS;
|
||||
}
|
||||
|
||||
// Implements the port stop operation.
|
||||
void port_stop(HBA_PORT* port) {
|
||||
// Clear ST (bit 0).
|
||||
port->cmd &= ~PORT_CMD_ST;
|
||||
@@ -41,7 +39,6 @@ void port_stop(HBA_PORT* port) {
|
||||
}
|
||||
}
|
||||
|
||||
// Implements the port start operation.
|
||||
void port_start(HBA_PORT* port) {
|
||||
// Wait until CR is clear before setting ST.
|
||||
for (int i = 0; i < POLL_TIMEOUT; i++) {
|
||||
@@ -51,7 +48,6 @@ void port_start(HBA_PORT* port) {
|
||||
port->cmd |= PORT_CMD_ST;
|
||||
}
|
||||
|
||||
// Implements the hba reset operation.
|
||||
KSTATUS hba_reset(HBA_MEM* hba) {
|
||||
// BIOS/OS handoff (spec §10.6.3).
|
||||
if (hba->cap2 & CAP2_BOH) {
|
||||
@@ -85,25 +81,21 @@ KSTATUS hba_reset(HBA_MEM* hba) {
|
||||
return NTLSTATUS_SUCCESS;
|
||||
}
|
||||
|
||||
// Implements the port link up operation.
|
||||
bool port_link_up(HBA_PORT* port) {
|
||||
uint32_t det = port->ssts & 0x0F;
|
||||
uint32_t ipm = (port->ssts >> 8) & 0x0F;
|
||||
return (det == PORT_DET_PRESENT && ipm == PORT_IPM_ACTIVE);
|
||||
}
|
||||
|
||||
// Implements the port is sata disk operation.
|
||||
bool port_is_sata_disk(HBA_PORT* port) {
|
||||
return port->sig == SATA_SIG_ATA;
|
||||
}
|
||||
|
||||
// Implements the ahci delay ms operation.
|
||||
void ahci_delay_ms(uint32_t ms) {
|
||||
for (uint32_t i = 0; i < ms * 1000; i++)
|
||||
__outbyte(0x80, 0);
|
||||
}
|
||||
|
||||
// Implements the port comreset operation.
|
||||
KSTATUS port_comreset(AHCI_DRIVE* drv) {
|
||||
HBA_PORT* port = drv->port;
|
||||
|
||||
|
||||
Reference in new issue
Block a user