kernel: get_clock_ns() funny 96-bit arithmetic

git-svn-id: svn://kolibrios.org@6942 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Sergey Semyonov (Serge) 2017-08-11 16:17:30 +00:00
parent d8ccef567e
commit 2cbf514c37

View File

@ -460,17 +460,24 @@ get_clock_ns:
jne @B jne @B
popfd popfd
;96-bit arithmetic
;ebx - low dword
;esi - medium dword
;edx - high dword
mul [hpet_period] mul [hpet_period]
mov ebx, eax mov ebx, eax
mov esi, edx mov esi, edx
mov eax, ecx mov eax, ecx
mul [hpet_period] mul [hpet_period]
add eax, esi add esi, eax
mov edx, eax adc edx, 0
mov eax, ebx mov eax, ebx
shrd eax, edx, 10 mov ebx, esi
shr edx, 10 shrd eax, ebx, 10
shrd esi, edx, 10
mov edx, esi
pop esi pop esi
pop ebx pop ebx