add delays

git-svn-id: svn://kolibrios.org@5049 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
CleverMouse 2014-08-21 12:41:24 +00:00
parent 2dab47a972
commit c66e498dba

View File

@ -725,23 +725,30 @@ endg
dec ebx dec ebx
.wake_cpus_loop: .wake_cpus_loop:
lodsd lodsd
push esi
xor esi, esi
inc esi
shl eax, 24 shl eax, 24
mov [edi+10h], eax mov [edi+10h], eax
; assert INIT IPI ; assert INIT IPI
mov dword [edi], 0C500h mov dword [edi], 0C500h
call delay_ms
@@: @@:
test dword [edi], 1000h test dword [edi], 1000h
jnz @b jnz @b
; deassert INIT IPI ; deassert INIT IPI
mov dword [edi], 8500h mov dword [edi], 8500h
call delay_ms
@@: @@:
test dword [edi], 1000h test dword [edi], 1000h
jnz @b jnz @b
; send STARTUP IPI ; send STARTUP IPI
mov dword [edi], 600h + (8000h shr 12) mov dword [edi], 600h + (8000h shr 12)
call delay_ms
@@: @@:
test dword [edi], 1000h test dword [edi], 1000h
jnz @b jnz @b
pop esi
dec ebx dec ebx
jnz .wake_cpus_loop jnz .wake_cpus_loop
mov eax, [cpu_count] mov eax, [cpu_count]
@ -5557,19 +5564,25 @@ yes_shutdown_param:
dec ebx dec ebx
.shutdown_cpus_loop: .shutdown_cpus_loop:
lodsd lodsd
push esi
xor esi, esi
inc esi
shl eax, 24 shl eax, 24
mov [edi+10h], eax mov [edi+10h], eax
; assert INIT IPI ; assert INIT IPI
mov dword [edi], 0C500h mov dword [edi], 0C500h
call delay_ms
@@: @@:
test dword [edi], 1000h test dword [edi], 1000h
jnz @b jnz @b
; deassert INIT IPI ; deassert INIT IPI
mov dword [edi], 8500h mov dword [edi], 8500h
call delay_ms
@@: @@:
test dword [edi], 1000h test dword [edi], 1000h
jnz @b jnz @b
; don't send STARTUP IPI: let other CPUs be in wait-for-startup state ; don't send STARTUP IPI: let other CPUs be in wait-for-startup state
pop esi
dec ebx dec ebx
jnz .shutdown_cpus_loop jnz .shutdown_cpus_loop
.no_shutdown_cpus: .no_shutdown_cpus: