From a0f9d2e23630d5821e09529688dee13023b02ac3 Mon Sep 17 00:00:00 2001 From: hidnplayr Date: Fri, 17 May 2013 13:33:04 +0000 Subject: [PATCH] Fixed Network2 event (low level network event) git-svn-id: svn://kolibrios.org@3518 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/branches/net/applications/macros.inc | 19 +++--- kernel/branches/net/const.inc | 75 +++++++++++---------- kernel/branches/net/gui/event.inc | 60 ++++++++--------- kernel/branches/net/network/stack.inc | 2 +- 4 files changed, 79 insertions(+), 77 deletions(-) diff --git a/kernel/branches/net/applications/macros.inc b/kernel/branches/net/applications/macros.inc index 9165974ad2..d6568ca0eb 100644 --- a/kernel/branches/net/applications/macros.inc +++ b/kernel/branches/net/applications/macros.inc @@ -576,12 +576,13 @@ EV_IPC = 7 EV_STACK = 8 ; event mask bits for function 40 -EVM_REDRAW = 1b -EVM_KEY = 10b -EVM_BUTTON = 100b -EVM_EXIT = 1000b -EVM_BACKGROUND = 10000b -EVM_MOUSE = 100000b -EVM_IPC = 1000000b -EVM_STACK = 10000000b -EVM_STACK2 = 0x400 +EVM_REDRAW = 1b +EVM_KEY = 10b +EVM_BUTTON = 100b +EVM_EXIT = 1000b +EVM_BACKGROUND = 10000b +EVM_MOUSE = 100000b +EVM_IPC = 1000000b +EVM_STACK = 10000000b +EVM_DEBUG = 100000000b +EVM_STACK2 = 1000000000b diff --git a/kernel/branches/net/const.inc b/kernel/branches/net/const.inc index a1ec37bd2d..5e8b04f02c 100644 --- a/kernel/branches/net/const.inc +++ b/kernel/branches/net/const.inc @@ -400,8 +400,9 @@ EVENT_MOUSE equ 0x00000020 EVENT_IPC equ 0x00000040 EVENT_NETWORK equ 0x00000080 EVENT_DEBUG equ 0x00000100 -EVENT_EXTENDED equ 0x00000200 -EVENT_NETWORK2 equ 0x00000400 +EVENT_NETWORK2 equ 0x00000200 +EVENT_EXTENDED equ 0x00000400 + EV_INTR equ 1 @@ -568,41 +569,41 @@ ends struct MUTEX lhead LHEAD - count dd ? -ends - -struct PCIDEV - bk dd ? - fd dd ? - vendor_device_id dd ? - class dd ? - devfn db ? - bus db ? -ends - -; The following macro assume that we are on uniprocessor machine. -; Serious work is needed for multiprocessor machines. -macro spin_lock_irqsave spinlock -{ - pushf - cli -} -macro spin_unlock_irqrestore spinlock -{ - popf -} -macro spin_lock_irq spinlock -{ - cli -} -macro spin_unlock_irq spinlock -{ - sti -} - -struct MEM_STATE - mutex MUTEX - smallmap dd ? + count dd ? +ends + +struct PCIDEV + bk dd ? + fd dd ? + vendor_device_id dd ? + class dd ? + devfn db ? + bus db ? +ends + +; The following macro assume that we are on uniprocessor machine. +; Serious work is needed for multiprocessor machines. +macro spin_lock_irqsave spinlock +{ + pushf + cli +} +macro spin_unlock_irqrestore spinlock +{ + popf +} +macro spin_lock_irq spinlock +{ + cli +} +macro spin_unlock_irq spinlock +{ + sti +} + +struct MEM_STATE + mutex MUTEX + smallmap dd ? treemap dd ? topsize dd ? top dd ? diff --git a/kernel/branches/net/gui/event.inc b/kernel/branches/net/gui/event.inc index 4e44639816..36e1b53711 100644 --- a/kernel/branches/net/gui/event.inc +++ b/kernel/branches/net/gui/event.inc @@ -304,29 +304,29 @@ wait_event: ;; EXPORT use mov ecx, eax ; wait_param mov edx, get_event_alone ; wait_test call Wait_events ; timeout ignored - jmp wait_finish -;----------------------------------------------------------------------------- -align 4 -wait_event_timeout: -;param: -; eax - event -; ebx - uid (for Dummy testing) -; ecx - timeout in timer ticks -;retval: -; eax - EVENT handle or 0 if timeout - call DummyTest - mov ebx, ecx - mov ecx, eax ; wait_param - mov edx, get_event_alone ; wait_test - call Wait_events_ex - test eax, eax - jnz wait_finish - ret -;----------------------------------------------------------------------------- -align 4 -get_event_ex: ;; f68:14 -;info: -; Ожидание любого события в очереди EventList текущего слота + jmp wait_finish +;----------------------------------------------------------------------------- +align 4 +wait_event_timeout: +;param: +; eax - event +; ebx - uid (for Dummy testing) +; ecx - timeout in timer ticks +;retval: +; eax - EVENT handle or 0 if timeout + call DummyTest + mov ebx, ecx + mov ecx, eax ; wait_param + mov edx, get_event_alone ; wait_test + call Wait_events_ex + test eax, eax + jnz wait_finish + ret +;----------------------------------------------------------------------------- +align 4 +get_event_ex: ;; f68:14 +;info: +; Ожидание любого события в очереди EventList текущего слота ; Данные события code - копируются в память приложения (косвенно по edi) ; При активном флаге MANUAL_RESET - больше ничего ; Иначе: флаги EVENT_SIGNALED и EVENT_WATCHED у полученного события сбрасываются, @@ -515,8 +515,8 @@ align 4 jz .no_events ; исчерпали все биты маски, но ничего не нашли ??? btr ecx, eax ; сбрасываем проверяемый бит маски ; переходим на обработчик этого (eax) бита - cmp eax, 9 - jae .loop ; eax=[9..31], ignored (event 10...32) + cmp eax, 10 + jae .loop ; eax=[10..31], ignored (event 11...32) cmp eax, 3 je .loop ; eax=3, ignored (event 4) @@ -527,7 +527,7 @@ align 4 cmp eax, 5 je .mouse_check ; eax=5, retvals=eax+1 (event 6) - ja .FlagAutoReset ; eax=[6..8], retvals=eax+1 (event 7...9) + ja .FlagAutoReset ; eax=[6..8], retvals=eax+1 (event 7...10) cmp eax, 1 jae .BtKy ; eax=[1,2], retvals=eax+1 (event 2,3) @@ -609,7 +609,7 @@ align 4 je .result add edx, 8 cmp edx, hotkey_buffer+120*8 - jb @b - jmp .loop -;end. -;----------------------------------------------------------------------------- + jb @b + jmp .loop +;end. +;----------------------------------------------------------------------------- diff --git a/kernel/branches/net/network/stack.inc b/kernel/branches/net/network/stack.inc index f8bf99c133..0748c111f6 100644 --- a/kernel/branches/net/network/stack.inc +++ b/kernel/branches/net/network/stack.inc @@ -317,7 +317,7 @@ NET_send_event: loop .loop pop ecx edi -; call change_task + call change_task ret