/kernel/trunk/core/apic.inc |
---|
439,7 → 439,38 |
pop ebp |
ret |
align 4 |
get_clock_ns: |
mov eax, [hpet_base] |
test eax, eax |
jz .old_tics |
push ebx |
pushfd |
cli |
mov ebx, eax |
@@: |
mov edx, [ebx+0xF4] |
mov eax, [ebx+0xF0] |
mov ecx, [ebx+0xF4] |
cmp ecx, edx |
jnz @B |
mov ecx, [hpet_period] |
mov ebx, edx |
imul ebx, ecx |
mul ecx |
add edx, ebx |
popfd |
pop ebx |
ret |
.old_tics: |
mov eax, [timer_ticks] |
mov edx, 10000000 |
mul edx |
ret |