[KERNEL] Preparing to merge legacy TASKDATA into APPDATA:

- now doesnt use TASK_COUNT, now uses [thread_count] global instead of it
- update come copyrights

git-svn-id: svn://kolibrios.org@8866 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Rustem Gimadutdinov (rgimad) 2021-06-16 10:04:10 +00:00
parent 8001bbcc4e
commit 9cdec89085
13 changed files with 66 additions and 65 deletions

View File

@ -221,7 +221,7 @@ window_data = OS_BASE + 0x0001000
TASK_TABLE = OS_BASE + 0x0003000 TASK_TABLE = OS_BASE + 0x0003000
CURRENT_TASK = OS_BASE + 0x0003000 CURRENT_TASK = OS_BASE + 0x0003000
TASK_COUNT = OS_BASE + 0x0003004 ;TASK_COUNT = OS_BASE + 0x0003004
TASK_BASE = OS_BASE + 0x0003010 TASK_BASE = OS_BASE + 0x0003010
TASK_DATA = OS_BASE + 0x0003020 TASK_DATA = OS_BASE + 0x0003020
TASK_EVENT = OS_BASE + 0x0003020 TASK_EVENT = OS_BASE + 0x0003020

View File

@ -1,6 +1,6 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2021. All rights reserved. ;;
;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa ;; ;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -75,7 +75,7 @@ update_counters:
ret ret
align 4 align 4
updatecputimes: updatecputimes:
mov ecx, [TASK_COUNT] mov ecx, [thread_count]
mov edi, TASK_DATA mov edi, TASK_DATA
.newupdate: .newupdate:
xor eax, eax xor eax, eax

View File

@ -629,7 +629,7 @@ destroy_thread:
; activate window ; activate window
movzx eax, word [WIN_STACK + esi*2] movzx eax, word [WIN_STACK + esi*2]
cmp eax, [TASK_COUNT] cmp eax, [thread_count]
jne .dont_activate jne .dont_activate
pushad pushad
.check_next_window: .check_next_window:
@ -719,7 +719,7 @@ destroy_thread:
mov eax, 2 mov eax, 2
mov ecx, SLOT_BASE+2*0x100+APPDATA.debugger_slot mov ecx, SLOT_BASE+2*0x100+APPDATA.debugger_slot
.xd0: .xd0:
cmp eax, [TASK_COUNT] cmp eax, [thread_count]
ja .xd1 ja .xd1
cmp dword [ecx], esi cmp dword [ecx], esi
jnz @f jnz @f

View File

@ -281,7 +281,7 @@ alloc_thread_slot:
; eax=[new_thread_slot]<>0 - ok ; eax=[new_thread_slot]<>0 - ok
; 0 - failed. ; 0 - failed.
;This function find least empty slot. ;This function find least empty slot.
;It doesn't increase [TASK_COUNT]! ;It doesn't increase [thread_count]!
mov edx, thr_slot_map mov edx, thr_slot_map
@ -483,7 +483,7 @@ pid_to_slot:
;Search process by PID. ;Search process by PID.
push ebx push ebx
push ecx push ecx
mov ebx, [TASK_COUNT] mov ebx, [thread_count]
shl ebx, BSF sizeof.TASKDATA ; multiply by size shl ebx, BSF sizeof.TASKDATA ; multiply by size
; add 2*32 cause: ; add 2*32 cause:
; [TASK_TABLE; TASK_TABLE + 32) isnt a task actually ; [TASK_TABLE; TASK_TABLE + 32) isnt a task actually
@ -941,8 +941,8 @@ proc set_app_params stdcall,slot:dword, params:dword, flags:dword
shr ecx, 2 shr ecx, 2
rep movsd rep movsd
cmp [TASK_COUNT], ebx cmp [thread_count], ebx
adc dword [TASK_COUNT], 0 ; update number of processes adc dword [thread_count], 0 ; update number of processes
shl ebx, 8 shl ebx, 8
lea edx, [ebx+SLOT_BASE+APP_EV_OFFSET] lea edx, [ebx+SLOT_BASE+APP_EV_OFFSET]
mov [SLOT_BASE+APPDATA.fd_ev+ebx], edx mov [SLOT_BASE+APPDATA.fd_ev+ebx], edx

View File

@ -1,6 +1,6 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2007-2015. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2007-2021. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -840,7 +840,7 @@ v86_irq2:
jmp v86_exc_c.simulate_int jmp v86_exc_c.simulate_int
.notcurrent: .notcurrent:
mov ebx, SLOT_BASE + 0x100 mov ebx, SLOT_BASE + 0x100
mov ecx, [TASK_COUNT] mov ecx, [thread_count]
.scan: .scan:
cmp [ebx+APPDATA.process], eax cmp [ebx+APPDATA.process], eax
jnz .cont jnz .cont

View File

@ -1,6 +1,6 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2021. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -439,6 +439,7 @@ LFBSize dd ?
current_process dd ? current_process dd ?
current_slot dd ? ; i.e. cureent thread current_slot dd ? ; i.e. cureent thread
thread_count dd ?
; device addresses ; device addresses
mididp dd ? mididp dd ?

View File

@ -1,6 +1,6 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2021. All rights reserved. ;;
;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa ;; ;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -588,7 +588,7 @@ align 4
.Buttons: ; eax=2, retval Buttons=3 .Buttons: ; eax=2, retval Buttons=3
cmp byte[BTN_COUNT], 0 cmp byte[BTN_COUNT], 0
je .loop ; empty ??? je .loop ; empty ???
cmp edx, [TASK_COUNT] cmp edx, [thread_count]
jne .loop ; not Top ??? jne .loop ; not Top ???
mov edx, [BTN_BUFF] mov edx, [BTN_BUFF]
shr edx, 8 shr edx, 8
@ -601,7 +601,7 @@ align 4
;-------------------------------------- ;--------------------------------------
align 4 align 4
.Keys: ; eax==1 .Keys: ; eax==1
cmp edx, [TASK_COUNT] cmp edx, [thread_count]
jne @f ; not Top ??? jne @f ; not Top ???
cmp [KEY_COUNT], al; al==1 cmp [KEY_COUNT], al; al==1
jae .result ; not empty ??? jae .result ; not empty ???

View File

@ -1,6 +1,6 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2021. All rights reserved. ;;
;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa ;; ;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
@ -57,7 +57,7 @@ syscall_draw_window: ;///// system function 0 /////////////////////////////////
;-------------------------------------- ;--------------------------------------
@@: @@:
; type IV & V - skinned window (resizable & not) ; type IV & V - skinned window (resizable & not)
mov eax, [TASK_COUNT] mov eax, [thread_count]
movzx eax, word[WIN_POS + eax * 2] movzx eax, word[WIN_POS + eax * 2]
cmp eax, [CURRENT_TASK] cmp eax, [CURRENT_TASK]
setz al setz al
@ -425,7 +425,7 @@ calculatescreen: ;/////////////////////////////////////////////////////////////
push ebp push ebp
mov ebp, [TASK_COUNT] mov ebp, [thread_count]
cmp ebp, 1 cmp ebp, 1
jbe .exit jbe .exit
@ -438,7 +438,7 @@ calculatescreen: ;/////////////////////////////////////////////////////////////
align 4 align 4
.layout: .layout:
mov esi, 1 ; = num in window stack mov esi, 1 ; = num in window stack
mov ebp, [TASK_COUNT] mov ebp, [thread_count]
;-------------------------------------- ;--------------------------------------
align 4 align 4
.next_window: .next_window:
@ -510,7 +510,7 @@ align 4
cmp dword[esp+10h], ZPOS_ALWAYS_TOP cmp dword[esp+10h], ZPOS_ALWAYS_TOP
jle .layout jle .layout
;--------------------------------------------- ;---------------------------------------------
mov esi, [TASK_COUNT] mov esi, [thread_count]
movzx edi, word[WIN_POS + esi * 2] movzx edi, word[WIN_POS + esi * 2]
shl edi, 5 shl edi, 5
add edi, window_data add edi, window_data
@ -532,7 +532,7 @@ repos_windows: ;///////////////////////////////////////////////////////////////
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
;? <description> ;? <description>
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
mov ecx, [TASK_COUNT] mov ecx, [thread_count]
mov edi, window_data + sizeof.WDATA * 2 mov edi, window_data + sizeof.WDATA * 2
call force_redraw_background call force_redraw_background
dec ecx dec ecx
@ -913,7 +913,7 @@ waredraw: ;////////////////////////////////////////////////////////////////////
;? Activate window, redrawing if necessary ;? Activate window, redrawing if necessary
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
push -1 push -1
mov eax, [TASK_COUNT] mov eax, [thread_count]
lea eax, [WIN_POS + eax * 2] lea eax, [WIN_POS + eax * 2]
cmp eax, esi cmp eax, esi
pop eax pop eax
@ -930,7 +930,7 @@ waredraw: ;////////////////////////////////////////////////////////////////////
call window._.window_activate call window._.window_activate
pushad pushad
mov edi, [TASK_COUNT] mov edi, [thread_count]
movzx esi, word[WIN_POS + edi * 2] movzx esi, word[WIN_POS + edi * 2]
shl esi, 5 shl esi, 5
add esi, window_data add esi, window_data
@ -943,7 +943,7 @@ waredraw: ;////////////////////////////////////////////////////////////////////
add ecx, eax add ecx, eax
add edx, ebx add edx, ebx
mov edi, [TASK_COUNT] mov edi, [thread_count]
movzx esi, word[WIN_POS + edi * 2] movzx esi, word[WIN_POS + edi * 2]
call window._.set_screen call window._.set_screen
@ -978,7 +978,7 @@ minimize_all_window:
cli cli
xor edx, edx xor edx, edx
mov eax, 2 ; we do not minimize the kernel thread N1 mov eax, 2 ; we do not minimize the kernel thread N1
mov ebx, [TASK_COUNT] mov ebx, [thread_count]
;-------------------------------------- ;--------------------------------------
align 4 align 4
.loop: .loop:
@ -1105,7 +1105,7 @@ restore_minimized_window: ;////////////////////////////////////////////////////
mov [edi + WDATA.fl_redraw], 1 mov [edi + WDATA.fl_redraw], 1
and [edi + WDATA.fl_wstate], not WSTATE_MINIMIZED and [edi + WDATA.fl_wstate], not WSTATE_MINIMIZED
mov ebp, window._.set_screen mov ebp, window._.set_screen
cmp eax, [TASK_COUNT] cmp eax, [thread_count]
jz @f jz @f
mov ebp, calculatescreen mov ebp, calculatescreen
;-------------------------------------- ;--------------------------------------
@ -1143,7 +1143,7 @@ window_check_events: ;/////////////////////////////////////////////////////////
je .exit je .exit
; okay, minimize or restore top-most window and exit ; okay, minimize or restore top-most window and exit
mov eax, [TASK_COUNT] mov eax, [thread_count]
mov bl, 0 mov bl, 0
xchg [window_minimize], bl xchg [window_minimize], bl
dec bl dec bl
@ -1962,9 +1962,9 @@ window._.window_activate: ;////////////////////////////////////////////////////
push eax ebx push eax ebx
; if type of current active window is 3 or 4, it must be redrawn ; if type of current active window is 3 or 4, it must be redrawn
mov ebx, [TASK_COUNT] mov ebx, [thread_count]
; DEBUGF 1, "K : TASK_COUNT (0x%x)\n", ebx ; DEBUGF 1, "K : thread_count (0x%x)\n", ebx
movzx ebx, word[WIN_POS + ebx * 2] movzx ebx, word[WIN_POS + ebx * 2]
shl ebx, 5 shl ebx, 5
@ -1992,7 +1992,7 @@ align 4
;-------------------------------------- ;--------------------------------------
align 4 align 4
.next_stack_window: .next_stack_window:
cmp eax, [TASK_COUNT] cmp eax, [thread_count]
jae .move_self_up jae .move_self_up
inc eax inc eax
@ -2010,8 +2010,8 @@ align 4
align 4 align 4
.move_self_up: .move_self_up:
movzx ebx, word[esi] movzx ebx, word[esi]
; number of processes ; number of thread
mov ax, [TASK_COUNT] mov ax, word [thread_count]
; this is the last (and the upper) ; this is the last (and the upper)
mov [WIN_STACK + ebx * 2], ax mov [WIN_STACK + ebx * 2], ax
@ -2020,7 +2020,7 @@ align 4
;-------------------------------------- ;--------------------------------------
align 4 align 4
.next_window_pos: .next_window_pos:
cmp eax, [TASK_COUNT] cmp eax, [thread_count]
jae .reset_vars jae .reset_vars
inc eax inc eax
movzx ebx, word[WIN_STACK + eax * 2] movzx ebx, word[WIN_STACK + eax * 2]
@ -2056,7 +2056,7 @@ align 4
;-------------------------------------- ;--------------------------------------
align 4 align 4
.next_stack_window: .next_stack_window:
cmp eax, [TASK_COUNT] cmp eax, [thread_count]
jae .move_self_down jae .move_self_down
inc eax inc eax
cmp [WIN_STACK + eax * 2], bx cmp [WIN_STACK + eax * 2], bx
@ -2074,7 +2074,7 @@ align 4
;-------------------------------------- ;--------------------------------------
align 4 align 4
.next_window_pos: .next_window_pos:
cmp eax, [TASK_COUNT] cmp eax, [thread_count]
jae .reset_vars jae .reset_vars
inc eax inc eax
movzx ebx, word[WIN_STACK + eax * 2] movzx ebx, word[WIN_STACK + eax * 2]
@ -2118,7 +2118,7 @@ align 4
.next_window: .next_window:
add esi, 2 add esi, 2
mov eax, [TASK_COUNT] mov eax, [thread_count]
lea eax, word[WIN_POS + eax * 2] ; number of the upper window lea eax, word[WIN_POS + eax * 2] ; number of the upper window
cmp esi, eax cmp esi, eax
@ -2172,7 +2172,7 @@ window._.draw_window_caption: ;////////////////////////////////////////////////
;? <description> ;? <description>
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
xor eax, eax xor eax, eax
mov edx, [TASK_COUNT] mov edx, [thread_count]
movzx edx, word[WIN_POS + edx * 2] movzx edx, word[WIN_POS + edx * 2]
cmp edx, [CURRENT_TASK] cmp edx, [CURRENT_TASK]
jne @f jne @f
@ -2377,7 +2377,7 @@ window._.set_top_wnd: ;////////////////////////////////////////////////////////
cli cli
push ebp push ebp
mov ebp, [TASK_COUNT] mov ebp, [thread_count]
cmp ebp, 1 cmp ebp, 1
jbe .exit jbe .exit
@ -2395,7 +2395,7 @@ window._.set_top_wnd: ;////////////////////////////////////////////////////////
align 4 align 4
.layout: .layout:
mov esi, 1 ; = num in window stack mov esi, 1 ; = num in window stack
mov ebp, [TASK_COUNT] mov ebp, [thread_count]
;-------------------------------------- ;--------------------------------------
align 4 align 4
.next_window: .next_window:

View File

@ -1,6 +1,6 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2021. All rights reserved. ;;
;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa ;; ;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -103,7 +103,7 @@ hotkey_do_test:
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
align 4 align 4
set_keyboard_data: set_keyboard_data:
movzx eax, word[TASK_COUNT]; top window process movzx eax, word[thread_count]; top window process
movzx eax, word[WIN_POS+eax*2] movzx eax, word[WIN_POS+eax*2]
shl eax, 8 shl eax, 8
mov al, [SLOT_BASE+eax+APPDATA.keyboard_mode] mov al, [SLOT_BASE+eax+APPDATA.keyboard_mode]
@ -194,7 +194,7 @@ delete_keyboard:
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
align 4 align 4
irq1: irq1:
movzx eax, word[TASK_COUNT]; top window process movzx eax, word[thread_count]; top window process
movzx eax, word[WIN_POS+eax*2] movzx eax, word[WIN_POS+eax*2]
shl eax, 8 shl eax, 8
mov al, [SLOT_BASE+eax+APPDATA.keyboard_mode] mov al, [SLOT_BASE+eax+APPDATA.keyboard_mode]

View File

@ -1,6 +1,6 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2021. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -122,7 +122,7 @@ save_draw_mouse:
cmp esi, [current_cursor] cmp esi, [current_cursor]
je .draw je .draw
mov eax, [TASK_COUNT] mov eax, [thread_count]
movzx eax, word [WIN_POS+eax*2] movzx eax, word [WIN_POS+eax*2]
shl eax, 8 shl eax, 8

View File

@ -626,7 +626,7 @@ high_code:
call scheduler_add_thread call scheduler_add_thread
mov dword [CURRENT_TASK], 2 mov dword [CURRENT_TASK], 2
mov dword [TASK_COUNT], 2 mov dword [thread_count], 2
mov dword [current_slot], SLOT_BASE + sizeof.APPDATA*2 mov dword [current_slot], SLOT_BASE + sizeof.APPDATA*2
mov dword [TASK_BASE], CURRENT_TASK + sizeof.TASKDATA*2 mov dword [TASK_BASE], CURRENT_TASK + sizeof.TASKDATA*2
@ -1966,7 +1966,7 @@ dd .loadCursorUni
ret ret
.msz: .msz:
mov edi, [TASK_COUNT] mov edi, [thread_count]
movzx edi, word [WIN_POS + edi*2] movzx edi, word [WIN_POS + edi*2]
cmp edi, [CURRENT_TASK] cmp edi, [CURRENT_TASK]
jne @f jne @f
@ -2189,7 +2189,7 @@ sysfn_shutdown: ; 18.9 = system shutdown
jg exit_for_anyone jg exit_for_anyone
mov [BOOT.shutdown_type], cl mov [BOOT.shutdown_type], cl
mov eax, [TASK_COUNT] mov eax, [thread_count]
mov [SYS_SHUTDOWN], al mov [SYS_SHUTDOWN], al
mov [shutdown_processes], eax mov [shutdown_processes], eax
call wakeup_osloop call wakeup_osloop
@ -2212,10 +2212,10 @@ sysfn_terminate: ; 18.2 = TERMINATE
push ecx push ecx
cmp ecx, 2 cmp ecx, 2
jb noprocessterminate jb noprocessterminate
mov edx, [TASK_COUNT] mov edx, [thread_count]
cmp ecx, edx cmp ecx, edx
ja noprocessterminate ja noprocessterminate
mov eax, [TASK_COUNT] mov eax, [thread_count]
shl ecx, BSF sizeof.TASKDATA shl ecx, BSF sizeof.TASKDATA
mov edx, [ecx+CURRENT_TASK+TASKDATA.pid] mov edx, [ecx+CURRENT_TASK+TASKDATA.pid]
add ecx, CURRENT_TASK+TASKDATA.state add ecx, CURRENT_TASK+TASKDATA.state
@ -2290,7 +2290,7 @@ sysfn_terminate2:
sysfn_deactivate: ; 18.1 = DEACTIVATE WINDOW sysfn_deactivate: ; 18.1 = DEACTIVATE WINDOW
cmp ecx, 2 cmp ecx, 2
jb .nowindowdeactivate jb .nowindowdeactivate
cmp ecx, [TASK_COUNT] cmp ecx, [thread_count]
ja .nowindowdeactivate ja .nowindowdeactivate
movzx esi, word [WIN_STACK + ecx*2] movzx esi, word [WIN_STACK + ecx*2]
@ -2311,7 +2311,7 @@ sysfn_deactivate: ; 18.1 = DEACTIVATE WINDOW
sysfn_activate: ; 18.3 = ACTIVATE WINDOW sysfn_activate: ; 18.3 = ACTIVATE WINDOW
cmp ecx, 2 cmp ecx, 2
jb .nowindowactivate jb .nowindowactivate
cmp ecx, [TASK_COUNT] cmp ecx, [thread_count]
ja .nowindowactivate ja .nowindowactivate
;------------------------------------- ;-------------------------------------
@@: @@:
@ -2329,7 +2329,7 @@ sysfn_activate: ; 18.3 = ACTIVATE WINDOW
call wakeup_osloop call wakeup_osloop
movzx esi, word [WIN_STACK + ecx*2] movzx esi, word [WIN_STACK + ecx*2]
cmp esi, [TASK_COUNT] cmp esi, [thread_count]
je .nowindowactivate; already active je .nowindowactivate; already active
mov edi, ecx mov edi, ecx
@ -2355,7 +2355,7 @@ sysfn_zmodif:
jne @f jne @f
mov edx, [CURRENT_TASK] mov edx, [CURRENT_TASK]
@@: @@:
cmp edx, [TASK_COUNT] cmp edx, [thread_count]
ja .fail ja .fail
cmp edx, 1 cmp edx, 1
je .fail je .fail
@ -2428,7 +2428,7 @@ get_cpu_freq:
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
align 4 align 4
sysfn_getactive: ; 18.7 = get active window sysfn_getactive: ; 18.7 = get active window
mov eax, [TASK_COUNT] mov eax, [thread_count]
movzx eax, word [WIN_POS + eax*2] movzx eax, word [WIN_POS + eax*2]
mov [esp+32], eax mov [esp+32], eax
ret ret
@ -3105,7 +3105,7 @@ sys_getkey:
; test main buffer ; test main buffer
mov ebx, [CURRENT_TASK] ; TOP OF WINDOW STACK mov ebx, [CURRENT_TASK] ; TOP OF WINDOW STACK
movzx ecx, word [WIN_STACK + ebx * 2] movzx ecx, word [WIN_STACK + ebx * 2]
mov edx, [TASK_COUNT] mov edx, [thread_count]
cmp ecx, edx cmp ecx, edx
jne .finish jne .finish
cmp [KEY_COUNT], byte 0 cmp [KEY_COUNT], byte 0
@ -3161,7 +3161,7 @@ sys_getbutton:
mov ebx, [CURRENT_TASK] ; TOP OF WINDOW STACK mov ebx, [CURRENT_TASK] ; TOP OF WINDOW STACK
mov [esp + 32], dword 1 mov [esp + 32], dword 1
movzx ecx, word [WIN_STACK + ebx * 2] movzx ecx, word [WIN_STACK + ebx * 2]
mov edx, [TASK_COUNT] ; less than 256 processes mov edx, [thread_count] ; less than 256 processes
cmp ecx, edx cmp ecx, edx
jne .exit jne .exit
movzx eax, byte [BTN_COUNT] movzx eax, byte [BTN_COUNT]
@ -3278,7 +3278,7 @@ sys_cpuusage:
.nofillbuf: .nofillbuf:
; return number of processes ; return number of processes
mov eax, [TASK_COUNT] mov eax, [thread_count]
mov [esp+32], eax mov [esp+32], eax
ret ret
@ -3567,7 +3567,7 @@ nocpustart:
xor edi, edi xor edi, edi
mov ebx, CURRENT_TASK mov ebx, CURRENT_TASK
mov ecx, [TASK_COUNT] mov ecx, [thread_count]
movzx eax, word [WIN_POS + ecx*2] ; active window movzx eax, word [WIN_POS + ecx*2] ; active window
shl eax, 8 shl eax, 8
push eax push eax
@ -3641,7 +3641,7 @@ backgr:
;--------- set event 5 start ---------- ;--------- set event 5 start ----------
push ecx edi push ecx edi
xor edi, edi xor edi, edi
mov ecx, [TASK_COUNT] mov ecx, [thread_count]
;-------------------------------------- ;--------------------------------------
align 4 align 4
set_bgr_event: set_bgr_event:
@ -3733,7 +3733,7 @@ no_mark_system_shutdown:
;-------------------------------------- ;--------------------------------------
align 4 align 4
noshutdown: noshutdown:
mov eax, [TASK_COUNT] ; termination mov eax, [thread_count] ; termination
mov ebx, TASK_DATA+TASKDATA.state mov ebx, TASK_DATA+TASKDATA.state
mov esi, 1 mov esi, 1
;-------------------------------------- ;--------------------------------------
@ -3972,7 +3972,7 @@ ricino:
not_this_task: not_this_task:
pop ecx pop ecx
cmp ecx, [TASK_COUNT] cmp ecx, [thread_count]
jle newdw2 jle newdw2
pop eax pop eax

View File

@ -1,6 +1,6 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2020. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2021. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;; Part of the TCP/IP network stack for KolibriOS ;; ;; Part of the TCP/IP network stack for KolibriOS ;;
@ -1899,7 +1899,7 @@ socket_notify:
je .found je .found
inc ecx inc ecx
add esi, sizeof.TASKDATA add esi, sizeof.TASKDATA
cmp ecx, [TASK_COUNT] cmp ecx, [thread_count]
jbe .next jbe .next
.error2: .error2:

View File

@ -1,6 +1,6 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2019. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2021. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;; STACK.INC ;; ;; STACK.INC ;;
@ -434,7 +434,7 @@ net_send_event:
; Send event to all applications ; Send event to all applications
push edi ecx push edi ecx
mov edi, SLOT_BASE mov edi, SLOT_BASE
mov ecx, [TASK_COUNT] mov ecx, [thread_count]
.loop: .loop:
add edi, 256 add edi, 256
or [edi + APPDATA.event_mask], EVENT_NETWORK2 or [edi + APPDATA.event_mask], EVENT_NETWORK2