77
88
99init_smp:
10- sti ; Enable interrupts in case PIT is needed
11-
1210 ; Check if we want the AP's to be enabled.. if not then skip to end
1311 cmp byte [ cfg_smpinit ], 1 ; Check if SMP should be enabled
1412 jne noMP ; If not then skip SMP init
@@ -52,7 +50,7 @@ smp_send_INIT_done:
5250
5351 ; Wait 500 microseconds
5452 mov eax , 500
55- call delay
53+ call timer_delay
5654
5755 mov esi , IM_DetectedCoreIDs
5856 xor ecx , ecx
@@ -84,7 +82,7 @@ smp_send_SIPI_done:
8482
8583 ; Wait 10000 microseconds for the AP's to finish
8684 mov eax , 10000
87- call delay
85+ call timer_delay
8886
8987noMP:
9088 ; Gather and store the APIC ID of the BSP
@@ -102,7 +100,7 @@ noMP:
102100 rdtsc
103101 push rax
104102 mov rax , 1024
105- call delay
103+ call timer_delay
106104 rdtsc
107105 pop rdx
108106 sub rax , rdx
@@ -111,28 +109,7 @@ noMP:
111109 div rcx
112110 mov [ p_cpu_speed ], ax
113111
114- cli ; Disable interrupts in case PIT was needed
115-
116- ret
117-
118-
119- ; -----------------------------------------------------------------------------
120- ; delay -- Delay by X microseconds
121- ; IN: RAX = Time microseconds
122- ; OUT: All registers preserved
123- ; Note: There are 1,000,000 microseconds in a second
124- ; There are 1,000 milliseconds in a second
125- delay:
126- push rax
127- push rbx
128-
129- call os_hpet_delay
130-
131- delay_done:
132- pop rbx
133- pop rax
134112 ret
135- ; -----------------------------------------------------------------------------
136113
137114
138115; =============================================================================
0 commit comments