Skip to content

Commit c8e8fca

Browse files
author
Ian Seyler
committed
Rename nt_tx_head to nt_tx_tail
1 parent 1ec1d95 commit c8e8fca

File tree

4 files changed

+17
-22
lines changed

4 files changed

+17
-22
lines changed

src/drivers/net/i8254x.asm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ net_i8254x_transmit:
240240
mov rdi, [rdx+nt_tx_desc] ; Transmit Descriptor Base Address
241241

242242
; Calculate the descriptor to write to
243-
mov eax, [rdx+nt_tx_head] ; Get tx_lasttail
243+
mov eax, [rdx+nt_tx_tail] ; Get tx_lasttail
244244
push rax ; Save lasttail
245245
shl eax, 4 ; Quick multiply by 16
246246
add rdi, rax ; Add offset to RDI
@@ -258,7 +258,7 @@ net_i8254x_transmit:
258258
pop rax ; Restore lasttail
259259
add eax, 1
260260
and eax, i8254x_MAX_DESC - 1
261-
mov [rdx+nt_tx_head], eax ; Set tx_lasttail
261+
mov [rdx+nt_tx_tail], eax ; Set tx_lasttail
262262
mov rdi, [rdx+nt_base] ; Load the base MMIO of the NIC
263263
mov [rdi+i8254x_TDT], eax ; TDL - Transmit Descriptor Tail
264264

src/drivers/net/i8257x.asm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ net_i8257x_transmit:
242242
mov rdi, [rdx+nt_tx_desc] ; Transmit Descriptor Base Address
243243

244244
; Calculate the descriptor to write to
245-
mov eax, [rdx+nt_tx_head] ; Get tx_lasttail
245+
mov eax, [rdx+nt_tx_tail] ; Get tx_lasttail
246246
push rax ; Save lasttail
247247
shl eax, 4 ; Quick multiply by 16
248248
add rdi, rax ; Add offset to RDI
@@ -260,7 +260,7 @@ net_i8257x_transmit:
260260
pop rax ; Restore lasttail
261261
add eax, 1
262262
and eax, i8257x_MAX_DESC - 1
263-
mov [rdx+nt_tx_head], eax ; Set tx_lasttail
263+
mov [rdx+nt_tx_tail], eax ; Set tx_lasttail
264264
mov rdi, [rdx+nt_base] ; Load the base MMIO of the NIC
265265
mov [rdi+i8257x_TDT], eax ; TDL - Transmit Descriptor Tail
266266

src/drivers/net/i8259x.asm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ net_i8259x_transmit:
394394
mov rdi, [rdx+nt_tx_desc] ; Transmit Descriptor Base Address
395395

396396
; Calculate the descriptor to write to
397-
mov eax, [rdx+nt_tx_head] ; Get tx_lasttail
397+
mov eax, [rdx+nt_tx_tail] ; Get tx_lasttail
398398
push rax ; Save lasttail
399399
shl eax, 4 ; Quick multiply by 16
400400
add rdi, rax ; Add offset to RDI
@@ -412,7 +412,7 @@ net_i8259x_transmit:
412412
pop rax ; Restore lasttail
413413
add eax, 1
414414
and eax, i8259x_MAX_DESC - 1
415-
mov [rdx+nt_tx_head], eax ; Set tx_lasttail
415+
mov [rdx+nt_tx_tail], eax ; Set tx_lasttail
416416
mov rdi, [rdx+nt_base] ; Load the base MMIO of the NIC
417417
mov [rdi+i8259x_TDT], eax ; TDL - Transmit Descriptor Tail
418418

src/sysvar.asm

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,11 @@ os_nvs_mem: equ 0x0000000000130000 ; 0x130000 -> 0x15FFFF 192K NVS structures/b
4343
os_usb_mem: equ 0x0000000000160000 ; 0x160000 -> 0x19FFFF 256K USB structures/buffers
4444

4545
; Network memory
46-
os_net_mem: equ 0x00000000001A0000 ; 0x1A0000 -> 0x1CFFFF 192K Network descriptors/buffers
46+
os_net_mem: equ 0x00000000001A0000 ; 0x1A0000 -> 0x1BFFFF 128K Network descriptors/buffers
4747
os_rx_desc: equ 0x00000000001A0000 ; 0x1A0000 -> 0x1AFFFF 64K Ethernet receive descriptors
4848
os_tx_desc: equ 0x00000000001B0000 ; 0x1B0000 -> 0x1BFFFF 64K Ethernet transmit descriptors
49-
os_PacketBuffers: equ 0x00000000001C0000 ; 0x1C0000 -> 0x1CFFFF 64K Ethernet packet buffers
49+
50+
; 0x1C0000 -> 0x1CFFFF 64K Free
5051

5152
; LFB font data
5253
os_font: equ 0x00000000001D0000 ; 0x1D0000 -> 0x1DFFFF 64K Font video data
@@ -58,6 +59,8 @@ os_SMP: equ 0x00000000001FF800 ; SMP table. Each item is 8 bytes. (2KiB before
5859
app_start: equ 0xFFFF800000000000 ; Location of application memory
5960

6061

62+
; System Variables
63+
6164
; DQ - Starting at offset 0, increments by 8
6265
os_LocalAPICAddress: equ os_SystemVariables + 0x0000
6366
os_IOAPICAddress: equ os_SystemVariables + 0x0008
@@ -118,7 +121,7 @@ key: equ os_SystemVariables + 0x0301
118121
key_shift: equ os_SystemVariables + 0x0302
119122
os_BusEnabled: equ os_SystemVariables + 0x0303 ; 1 if PCI is enabled, 2 if PCIe is enabled
120123
os_NetEnabled: equ os_SystemVariables + 0x0304 ; 1 if a supported network card was enabled
121-
os_NetIRQ: equ os_SystemVariables + 0x0305 ; Set to Interrupt line that NIC is connected to
124+
;os_NetIRQ: equ os_SystemVariables + 0x0305 ; Set to Interrupt line that NIC is connected to
122125
;os_NetActivity_TX: equ os_SystemVariables + 0x0306
123126
;os_NetActivity_RX: equ os_SystemVariables + 0x0307
124127
;os_EthernetBuffer_C1: equ os_SystemVariables + 0x0308 ; Counter 1 for the Ethernet RX Ring Buffer
@@ -142,22 +145,14 @@ os_BSP: equ os_SystemVariables + 0x0319
142145
os_HPET_IRQ: equ os_SystemVariables + 0x031A
143146
os_net_icount: equ os_SystemVariables + 0x031B
144147

145-
; Network Device Table Base
146-
os_net_table: equ os_SystemVariables + 0x2000
147-
148-
; Network Devices Entries - each entry is 64 bytes
149-
os_net_entry_base: equ os_SystemVariables + 0x2000
150-
os_net_entry_transmit: equ os_SystemVariables + 0x2008
151-
os_net_entry_poll: equ os_SystemVariables + 0x2010
152-
os_net_entry_stats: equ os_SystemVariables + 0x2018
153-
os_net_entry_MAC: equ os_SystemVariables + 0x2020
154-
os_net_entry_tx_tail: equ os_SystemVariables + 0x2028
155-
os_net_entry_rx_tail: equ os_SystemVariables + 0x202C
156-
; Next Device starts at 0x8040
157148

149+
; System tables
158150
bus_table: equ os_SystemVariables + 0x8000
159151
net_table: equ os_SystemVariables + 0xA000
160152

153+
; Buffers
154+
os_PacketBuffers: equ os_SystemVariables + 0xC000 ; 16KiB
155+
161156
; net_table values (per device - 128 bytes)
162157
nt_ID: equ 0x00 ; 16-bit
163158
nt_MAC: equ 0x08 ; 48-bit
@@ -167,7 +162,7 @@ nt_transmit: equ 0x20 ; 64-bit
167162
nt_poll: equ 0x28 ; 64-bit
168163
nt_tx_desc: equ 0x30 ; 64-bit
169164
nt_rx_desc: equ 0x38 ; 64-bit
170-
nt_tx_head: equ 0x40 ; 64-bit
165+
nt_tx_tail: equ 0x40 ; 64-bit
171166
nt_rx_head: equ 0x44 ; 64-bit
172167
nt_tx_packets: equ 0x50 ; 64-bit
173168
nt_tx_bytes: equ 0x58 ; 64-bit

0 commit comments

Comments
 (0)