Kernel: Replace CriticalScopes with SpinLocks in networking code

This commit is contained in:
2024-02-29 12:02:09 +02:00
parent 7f028f70d5
commit 90878a7c2b
6 changed files with 35 additions and 30 deletions

View File

@@ -261,7 +261,7 @@ namespace Kernel
{
ASSERT_LTE(buffer.size() + sizeof(EthernetHeader), E1000_TX_BUFFER_SIZE);
CriticalScope _;
SpinLockGuard _(m_lock);
size_t tx_current = read32(REG_TDT) % E1000_TX_DESCRIPTOR_COUNT;
@@ -291,6 +291,8 @@ namespace Kernel
if (read32(REG_ICR) & ICR_RxQ0)
return;
SpinLockGuard _(m_lock);
for (;;) {
uint32_t rx_current = (read32(REG_RDT0) + 1) % E1000_RX_DESCRIPTOR_COUNT;