File tree Expand file tree Collapse file tree 3 files changed +27
-36
lines changed
Expand file tree Collapse file tree 3 files changed +27
-36
lines changed Original file line number Diff line number Diff line change @@ -23,16 +23,13 @@ net_i8254x_init:
2323 add rdi , rax
2424
2525 mov ax , 0x8254 ; Driver tag for i8254x
26- stosw
27- add rdi , 14
26+ mov [ rdi + nt_ID ], ax
2827
2928 ; Get the Base Memory Address of the device
3029 mov al , 0 ; Read BAR0
3130 call os_bus_read_bar
32- stosq ; Save the base
31+ mov [ rdi + nt_base ], rax ; Save the base
3332 push rax ; Save the base for gathering the MAC later
34- mov rax , rcx
35- stosq ; Save the length
3633
3734 ; Set PCI Status/Command values
3835 mov dl , 0x01 ; Read Status/Command
@@ -44,7 +41,8 @@ net_i8254x_init:
4441
4542 ; Get the MAC address
4643 pop rsi ; Restore the base
47- sub rdi , 24 ; 8 bytes into net table entry
44+ push rdi
45+ add rdi , 8
4846 mov eax , [ rsi + i8254x_RAL ] ; RAL
4947 stosb
5048 shr eax , 8
@@ -57,31 +55,30 @@ net_i8254x_init:
5755 stosb
5856 shr eax , 8
5957 stosb
58+ pop rdi
6059
6160 ; Set base addresses for TX and RX descriptors
6261 xor ecx , ecx
6362 mov cl , byte [ os_net_icount ]
6463 shl ecx , 15
6564
66- add rdi , 0x22
6765 mov rax , os_tx_desc
6866 add rax , rcx
69- stosq
67+ mov [ rdi + nt_tx_desc ], rax
7068 mov rax , os_rx_desc
7169 add rax , rcx
72- stosq
70+ mov [ rdi + nt_rx_desc ], rax
7371
7472 ; Reset the device
7573 xor edx , edx
7674 mov dl , [ os_net_icount ]
7775 call net_i8254x_reset
7876
7977 ; Store call addresses
80- sub rdi , 0x20
8178 mov rax , net_i8254x_transmit
82- stosq
79+ mov [ rdi + nt_transmit ], rax
8380 mov rax , net_i8254x_poll
84- stosq
81+ mov [ rdi + nt_poll ], rax
8582
8683net_i8254x_init_error:
8784
Original file line number Diff line number Diff line change @@ -26,16 +26,13 @@ net_i8257x_init:
2626 add rdi , rax
2727
2828 mov ax , 0x8257 ; Driver tag for i8257x
29- stosw
30- add rdi , 14
29+ mov [ rdi + nt_ID ], ax
3130
3231 ; Get the Base Memory Address of the device
3332 mov al , 0 ; Read BAR0
3433 call os_bus_read_bar
35- stosq ; Save the base
34+ mov [ rdi + nt_base ], rax ; Save the base
3635 push rax ; Save the base for gathering the MAC later
37- mov rax , rcx
38- stosq ; Save the length
3936
4037 ; Set PCI Status/Command values
4138 mov dl , 0x01 ; Read Status/Command
@@ -47,7 +44,8 @@ net_i8257x_init:
4744
4845 ; Get the MAC address
4946 pop rsi ; Restore the base
50- sub rdi , 24 ; 8 bytes into net table entry
47+ push rdi
48+ add rdi , 8
5149 mov eax , [ rsi + i8257x_RAL ] ; RAL
5250 stosb
5351 shr eax , 8
@@ -60,31 +58,30 @@ net_i8257x_init:
6058 stosb
6159 shr eax , 8
6260 stosb
61+ pop rdi
6362
6463 ; Set base addresses for TX and RX descriptors
6564 xor ecx , ecx
6665 mov cl , byte [ os_net_icount ]
6766 shl ecx , 15
6867
69- add rdi , 0x22
7068 mov rax , os_tx_desc
7169 add rax , rcx
72- stosq
70+ mov [ rdi + nt_tx_desc ], rax
7371 mov rax , os_rx_desc
7472 add rax , rcx
75- stosq
73+ mov [ rdi + nt_rx_desc ], rax
7674
7775 ; Reset the device
7876 xor edx , edx
7977 mov dl , [ os_net_icount ]
8078 call net_i8257x_reset
8179
8280 ; Store call addresses
83- sub rdi , 0x20
8481 mov rax , net_i8257x_transmit
85- stosq
82+ mov [ rdi + nt_transmit ], rax
8683 mov rax , net_i8257x_poll
87- stosq
84+ mov [ rdi + nt_poll ], rax
8885
8986net_i8257x_init_error:
9087
Original file line number Diff line number Diff line change @@ -23,16 +23,13 @@ net_i8259x_init:
2323 add rdi , rax
2424
2525 mov ax , 0x8259 ; Driver tag for i8259x
26- stosw
27- add rdi , 14
26+ mov [ rdi + nt_ID ], ax
2827
2928 ; Get the Base Memory Address of the device
3029 mov al , 0 ; Read BAR0
3130 call os_bus_read_bar
32- stosq ; Save the base
31+ mov [ rdi + nt_base ], rax ; Save the base
3332 push rax ; Save the base for gathering the MAC later
34- mov rax , rcx
35- stosq ; Save the length
3633
3734 ; Set PCI Status/Command values
3835 mov dl , 0x01 ; Read Status/Command
@@ -44,7 +41,8 @@ net_i8259x_init:
4441
4542 ; Get the MAC address
4643 pop rsi ; Restore the base
47- sub rdi , 24 ; 8 bytes into net table entry
44+ push rdi
45+ add rdi , 8
4846 mov eax , [ rsi + i8259x_RAL ] ; RAL
4947 stosb
5048 shr eax , 8
@@ -57,31 +55,30 @@ net_i8259x_init:
5755 stosb
5856 shr eax , 8
5957 stosb
58+ pop rdi
6059
6160 ; Set base addresses for TX and RX descriptors
6261 xor ecx , ecx
6362 mov cl , byte [ os_net_icount ]
6463 shl ecx , 15
6564
66- add rdi , 0x22
6765 mov rax , os_tx_desc
6866 add rax , rcx
69- stosq
67+ mov [ rdi + nt_tx_desc ], rax
7068 mov rax , os_rx_desc
7169 add rax , rcx
72- stosq
70+ mov [ rdi + nt_rx_desc ], rax
7371
7472 ; Reset the device
7573 xor edx , edx
7674 mov dl , [ os_net_icount ]
7775 call net_i8259x_reset
7876
7977 ; Store call addresses
80- sub rdi , 0x20
8178 mov rax , net_i8259x_transmit
82- stosq
79+ mov [ rdi + nt_transmit ], rax
8380 mov rax , net_i8259x_poll
84- stosq
81+ mov [ rdi + nt_poll ], rax
8582
8683net_i8259x_init_error:
8784
You can’t perform that action at this time.
0 commit comments