From 315305ed2a2f15a5e4ba73d4dd0cc816a00c84ce Mon Sep 17 00:00:00 2001 From: "Sergey Semyonov (Serge)" Date: Mon, 3 Jun 2013 19:47:50 +0000 Subject: [PATCH] Kernel: cheap and cheat delay_hs git-svn-id: svn://kolibrios.org@3595 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/trunk/kernel.asm | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/kernel/trunk/kernel.asm b/kernel/trunk/kernel.asm index 278e482a63..ffa2dcfce7 100644 --- a/kernel/trunk/kernel.asm +++ b/kernel/trunk/kernel.asm @@ -3853,26 +3853,25 @@ endp align 4 delay_hs: ; delay in 1/100 secs ; ebx = delay time - push ecx - push edx - mov edx, [timer_ticks] -;-------------------------------------- -align 4 -newtic: - mov ecx, [timer_ticks] - sub ecx, edx - cmp ecx, ebx - jae zerodelay + pushad + push ebx + xor esi, esi + mov ecx, MANUAL_DESTROY + call create_event + test eax, eax + jz .done - call change_task - - jmp newtic -;-------------------------------------- -align 4 -zerodelay: - pop edx - pop ecx + mov ebx, edx + mov ecx, [esp] + push eax + call wait_event_timeout + pop eax + mov ebx, [esp] + call destroy_event +.done: + add esp, 4 + popad ret ;----------------------------------------------------------------------------- align 16 ;very often call this subrutine