diff --git a/kernel/trunk/const.inc b/kernel/trunk/const.inc index b21151c39f..d0131821d4 100644 --- a/kernel/trunk/const.inc +++ b/kernel/trunk/const.inc @@ -221,7 +221,7 @@ window_data = OS_BASE + 0x0001000 TASK_TABLE = OS_BASE + 0x0003000 CURRENT_TASK = OS_BASE + 0x0003000 -TASK_COUNT = OS_BASE + 0x0003004 +;TASK_COUNT = OS_BASE + 0x0003004 TASK_BASE = OS_BASE + 0x0003010 TASK_DATA = OS_BASE + 0x0003020 TASK_EVENT = OS_BASE + 0x0003020 diff --git a/kernel/trunk/core/sched.inc b/kernel/trunk/core/sched.inc index 81b4e1467b..9110f44b9b 100644 --- a/kernel/trunk/core/sched.inc +++ b/kernel/trunk/core/sched.inc @@ -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 ;; ;; Distributed under terms of the GNU General Public License ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -75,7 +75,7 @@ update_counters: ret align 4 updatecputimes: - mov ecx, [TASK_COUNT] + mov ecx, [thread_count] mov edi, TASK_DATA .newupdate: xor eax, eax diff --git a/kernel/trunk/core/sys32.inc b/kernel/trunk/core/sys32.inc index 6622926f2d..a0fbf58ea1 100644 --- a/kernel/trunk/core/sys32.inc +++ b/kernel/trunk/core/sys32.inc @@ -629,7 +629,7 @@ destroy_thread: ; activate window movzx eax, word [WIN_STACK + esi*2] - cmp eax, [TASK_COUNT] + cmp eax, [thread_count] jne .dont_activate pushad .check_next_window: @@ -719,7 +719,7 @@ destroy_thread: mov eax, 2 mov ecx, SLOT_BASE+2*0x100+APPDATA.debugger_slot .xd0: - cmp eax, [TASK_COUNT] + cmp eax, [thread_count] ja .xd1 cmp dword [ecx], esi jnz @f diff --git a/kernel/trunk/core/taskman.inc b/kernel/trunk/core/taskman.inc index b7e397fb22..b9ab6012af 100644 --- a/kernel/trunk/core/taskman.inc +++ b/kernel/trunk/core/taskman.inc @@ -281,7 +281,7 @@ alloc_thread_slot: ; eax=[new_thread_slot]<>0 - ok ; 0 - failed. ;This function find least empty slot. -;It doesn't increase [TASK_COUNT]! +;It doesn't increase [thread_count]! mov edx, thr_slot_map @@ -483,7 +483,7 @@ pid_to_slot: ;Search process by PID. push ebx push ecx - mov ebx, [TASK_COUNT] + mov ebx, [thread_count] shl ebx, BSF sizeof.TASKDATA ; multiply by size ; add 2*32 cause: ; [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 rep movsd - cmp [TASK_COUNT], ebx - adc dword [TASK_COUNT], 0 ; update number of processes + cmp [thread_count], ebx + adc dword [thread_count], 0 ; update number of processes shl ebx, 8 lea edx, [ebx+SLOT_BASE+APP_EV_OFFSET] mov [SLOT_BASE+APPDATA.fd_ev+ebx], edx diff --git a/kernel/trunk/core/v86.inc b/kernel/trunk/core/v86.inc index ba3312d674..e3be652edc 100644 --- a/kernel/trunk/core/v86.inc +++ b/kernel/trunk/core/v86.inc @@ -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 ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -840,7 +840,7 @@ v86_irq2: jmp v86_exc_c.simulate_int .notcurrent: mov ebx, SLOT_BASE + 0x100 - mov ecx, [TASK_COUNT] + mov ecx, [thread_count] .scan: cmp [ebx+APPDATA.process], eax jnz .cont diff --git a/kernel/trunk/data32.inc b/kernel/trunk/data32.inc index 7b1e063d20..55726f7771 100644 --- a/kernel/trunk/data32.inc +++ b/kernel/trunk/data32.inc @@ -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 ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -439,6 +439,7 @@ LFBSize dd ? current_process dd ? current_slot dd ? ; i.e. cureent thread +thread_count dd ? ; device addresses mididp dd ? diff --git a/kernel/trunk/gui/event.inc b/kernel/trunk/gui/event.inc index 7bf7976a43..72336395d1 100644 --- a/kernel/trunk/gui/event.inc +++ b/kernel/trunk/gui/event.inc @@ -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 ;; ;; Distributed under terms of the GNU General Public License ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -588,7 +588,7 @@ align 4 .Buttons: ; eax=2, retval Buttons=3 cmp byte[BTN_COUNT], 0 je .loop ; empty ??? - cmp edx, [TASK_COUNT] + cmp edx, [thread_count] jne .loop ; not Top ??? mov edx, [BTN_BUFF] shr edx, 8 @@ -601,7 +601,7 @@ align 4 ;-------------------------------------- align 4 .Keys: ; eax==1 - cmp edx, [TASK_COUNT] + cmp edx, [thread_count] jne @f ; not Top ??? cmp [KEY_COUNT], al; al==1 jae .result ; not empty ??? diff --git a/kernel/trunk/gui/window.inc b/kernel/trunk/gui/window.inc index 53e922070f..daac9e0277 100644 --- a/kernel/trunk/gui/window.inc +++ b/kernel/trunk/gui/window.inc @@ -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 ;; ;; 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) - mov eax, [TASK_COUNT] + mov eax, [thread_count] movzx eax, word[WIN_POS + eax * 2] cmp eax, [CURRENT_TASK] setz al @@ -425,7 +425,7 @@ calculatescreen: ;///////////////////////////////////////////////////////////// push ebp - mov ebp, [TASK_COUNT] + mov ebp, [thread_count] cmp ebp, 1 jbe .exit @@ -438,7 +438,7 @@ calculatescreen: ;///////////////////////////////////////////////////////////// align 4 .layout: mov esi, 1 ; = num in window stack - mov ebp, [TASK_COUNT] + mov ebp, [thread_count] ;-------------------------------------- align 4 .next_window: @@ -510,7 +510,7 @@ align 4 cmp dword[esp+10h], ZPOS_ALWAYS_TOP jle .layout ;--------------------------------------------- - mov esi, [TASK_COUNT] + mov esi, [thread_count] movzx edi, word[WIN_POS + esi * 2] shl edi, 5 add edi, window_data @@ -532,7 +532,7 @@ repos_windows: ;/////////////////////////////////////////////////////////////// ;------------------------------------------------------------------------------ ;? ;------------------------------------------------------------------------------ - mov ecx, [TASK_COUNT] + mov ecx, [thread_count] mov edi, window_data + sizeof.WDATA * 2 call force_redraw_background dec ecx @@ -913,7 +913,7 @@ waredraw: ;//////////////////////////////////////////////////////////////////// ;? Activate window, redrawing if necessary ;------------------------------------------------------------------------------ push -1 - mov eax, [TASK_COUNT] + mov eax, [thread_count] lea eax, [WIN_POS + eax * 2] cmp eax, esi pop eax @@ -930,7 +930,7 @@ waredraw: ;//////////////////////////////////////////////////////////////////// call window._.window_activate pushad - mov edi, [TASK_COUNT] + mov edi, [thread_count] movzx esi, word[WIN_POS + edi * 2] shl esi, 5 add esi, window_data @@ -943,7 +943,7 @@ waredraw: ;//////////////////////////////////////////////////////////////////// add ecx, eax add edx, ebx - mov edi, [TASK_COUNT] + mov edi, [thread_count] movzx esi, word[WIN_POS + edi * 2] call window._.set_screen @@ -978,7 +978,7 @@ minimize_all_window: cli xor edx, edx mov eax, 2 ; we do not minimize the kernel thread N1 - mov ebx, [TASK_COUNT] + mov ebx, [thread_count] ;-------------------------------------- align 4 .loop: @@ -1105,7 +1105,7 @@ restore_minimized_window: ;//////////////////////////////////////////////////// mov [edi + WDATA.fl_redraw], 1 and [edi + WDATA.fl_wstate], not WSTATE_MINIMIZED mov ebp, window._.set_screen - cmp eax, [TASK_COUNT] + cmp eax, [thread_count] jz @f mov ebp, calculatescreen ;-------------------------------------- @@ -1143,7 +1143,7 @@ window_check_events: ;///////////////////////////////////////////////////////// je .exit ; okay, minimize or restore top-most window and exit - mov eax, [TASK_COUNT] + mov eax, [thread_count] mov bl, 0 xchg [window_minimize], bl dec bl @@ -1962,9 +1962,9 @@ window._.window_activate: ;//////////////////////////////////////////////////// push eax ebx ; 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] shl ebx, 5 @@ -1992,7 +1992,7 @@ align 4 ;-------------------------------------- align 4 .next_stack_window: - cmp eax, [TASK_COUNT] + cmp eax, [thread_count] jae .move_self_up inc eax @@ -2010,8 +2010,8 @@ align 4 align 4 .move_self_up: movzx ebx, word[esi] - ; number of processes - mov ax, [TASK_COUNT] + ; number of thread + mov ax, word [thread_count] ; this is the last (and the upper) mov [WIN_STACK + ebx * 2], ax @@ -2020,7 +2020,7 @@ align 4 ;-------------------------------------- align 4 .next_window_pos: - cmp eax, [TASK_COUNT] + cmp eax, [thread_count] jae .reset_vars inc eax movzx ebx, word[WIN_STACK + eax * 2] @@ -2056,7 +2056,7 @@ align 4 ;-------------------------------------- align 4 .next_stack_window: - cmp eax, [TASK_COUNT] + cmp eax, [thread_count] jae .move_self_down inc eax cmp [WIN_STACK + eax * 2], bx @@ -2074,7 +2074,7 @@ align 4 ;-------------------------------------- align 4 .next_window_pos: - cmp eax, [TASK_COUNT] + cmp eax, [thread_count] jae .reset_vars inc eax movzx ebx, word[WIN_STACK + eax * 2] @@ -2118,7 +2118,7 @@ align 4 .next_window: add esi, 2 - mov eax, [TASK_COUNT] + mov eax, [thread_count] lea eax, word[WIN_POS + eax * 2] ; number of the upper window cmp esi, eax @@ -2172,7 +2172,7 @@ window._.draw_window_caption: ;//////////////////////////////////////////////// ;? ;------------------------------------------------------------------------------ xor eax, eax - mov edx, [TASK_COUNT] + mov edx, [thread_count] movzx edx, word[WIN_POS + edx * 2] cmp edx, [CURRENT_TASK] jne @f @@ -2377,7 +2377,7 @@ window._.set_top_wnd: ;//////////////////////////////////////////////////////// cli push ebp - mov ebp, [TASK_COUNT] + mov ebp, [thread_count] cmp ebp, 1 jbe .exit @@ -2395,7 +2395,7 @@ window._.set_top_wnd: ;//////////////////////////////////////////////////////// align 4 .layout: mov esi, 1 ; = num in window stack - mov ebp, [TASK_COUNT] + mov ebp, [thread_count] ;-------------------------------------- align 4 .next_window: diff --git a/kernel/trunk/hid/keyboard.inc b/kernel/trunk/hid/keyboard.inc index f9b3effef0..df5fe4e33c 100644 --- a/kernel/trunk/hid/keyboard.inc +++ b/kernel/trunk/hid/keyboard.inc @@ -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 ;; ;; Distributed under terms of the GNU General Public License ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -103,7 +103,7 @@ hotkey_do_test: ;--------------------------------------------------------------------- align 4 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] shl eax, 8 mov al, [SLOT_BASE+eax+APPDATA.keyboard_mode] @@ -194,7 +194,7 @@ delete_keyboard: ;--------------------------------------------------------------------- align 4 irq1: - movzx eax, word[TASK_COUNT]; top window process + movzx eax, word[thread_count]; top window process movzx eax, word[WIN_POS+eax*2] shl eax, 8 mov al, [SLOT_BASE+eax+APPDATA.keyboard_mode] diff --git a/kernel/trunk/hid/mousedrv.inc b/kernel/trunk/hid/mousedrv.inc index 70b2a93fca..9177419c3a 100644 --- a/kernel/trunk/hid/mousedrv.inc +++ b/kernel/trunk/hid/mousedrv.inc @@ -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 ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -122,7 +122,7 @@ save_draw_mouse: cmp esi, [current_cursor] je .draw - mov eax, [TASK_COUNT] + mov eax, [thread_count] movzx eax, word [WIN_POS+eax*2] shl eax, 8 diff --git a/kernel/trunk/kernel.asm b/kernel/trunk/kernel.asm index 628025d361..a5c9fe905f 100644 --- a/kernel/trunk/kernel.asm +++ b/kernel/trunk/kernel.asm @@ -626,7 +626,7 @@ high_code: call scheduler_add_thread 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 [TASK_BASE], CURRENT_TASK + sizeof.TASKDATA*2 @@ -1966,7 +1966,7 @@ dd .loadCursorUni ret .msz: - mov edi, [TASK_COUNT] + mov edi, [thread_count] movzx edi, word [WIN_POS + edi*2] cmp edi, [CURRENT_TASK] jne @f @@ -2189,7 +2189,7 @@ sysfn_shutdown: ; 18.9 = system shutdown jg exit_for_anyone mov [BOOT.shutdown_type], cl - mov eax, [TASK_COUNT] + mov eax, [thread_count] mov [SYS_SHUTDOWN], al mov [shutdown_processes], eax call wakeup_osloop @@ -2212,10 +2212,10 @@ sysfn_terminate: ; 18.2 = TERMINATE push ecx cmp ecx, 2 jb noprocessterminate - mov edx, [TASK_COUNT] + mov edx, [thread_count] cmp ecx, edx ja noprocessterminate - mov eax, [TASK_COUNT] + mov eax, [thread_count] shl ecx, BSF sizeof.TASKDATA mov edx, [ecx+CURRENT_TASK+TASKDATA.pid] add ecx, CURRENT_TASK+TASKDATA.state @@ -2290,7 +2290,7 @@ sysfn_terminate2: sysfn_deactivate: ; 18.1 = DEACTIVATE WINDOW cmp ecx, 2 jb .nowindowdeactivate - cmp ecx, [TASK_COUNT] + cmp ecx, [thread_count] ja .nowindowdeactivate movzx esi, word [WIN_STACK + ecx*2] @@ -2311,7 +2311,7 @@ sysfn_deactivate: ; 18.1 = DEACTIVATE WINDOW sysfn_activate: ; 18.3 = ACTIVATE WINDOW cmp ecx, 2 jb .nowindowactivate - cmp ecx, [TASK_COUNT] + cmp ecx, [thread_count] ja .nowindowactivate ;------------------------------------- @@: @@ -2329,7 +2329,7 @@ sysfn_activate: ; 18.3 = ACTIVATE WINDOW call wakeup_osloop movzx esi, word [WIN_STACK + ecx*2] - cmp esi, [TASK_COUNT] + cmp esi, [thread_count] je .nowindowactivate; already active mov edi, ecx @@ -2355,7 +2355,7 @@ sysfn_zmodif: jne @f mov edx, [CURRENT_TASK] @@: - cmp edx, [TASK_COUNT] + cmp edx, [thread_count] ja .fail cmp edx, 1 je .fail @@ -2428,7 +2428,7 @@ get_cpu_freq: ;------------------------------------------------------------------------------ align 4 sysfn_getactive: ; 18.7 = get active window - mov eax, [TASK_COUNT] + mov eax, [thread_count] movzx eax, word [WIN_POS + eax*2] mov [esp+32], eax ret @@ -3105,7 +3105,7 @@ sys_getkey: ; test main buffer mov ebx, [CURRENT_TASK] ; TOP OF WINDOW STACK movzx ecx, word [WIN_STACK + ebx * 2] - mov edx, [TASK_COUNT] + mov edx, [thread_count] cmp ecx, edx jne .finish cmp [KEY_COUNT], byte 0 @@ -3161,7 +3161,7 @@ sys_getbutton: mov ebx, [CURRENT_TASK] ; TOP OF WINDOW STACK mov [esp + 32], dword 1 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 jne .exit movzx eax, byte [BTN_COUNT] @@ -3278,7 +3278,7 @@ sys_cpuusage: .nofillbuf: ; return number of processes - mov eax, [TASK_COUNT] + mov eax, [thread_count] mov [esp+32], eax ret @@ -3567,7 +3567,7 @@ nocpustart: xor edi, edi mov ebx, CURRENT_TASK - mov ecx, [TASK_COUNT] + mov ecx, [thread_count] movzx eax, word [WIN_POS + ecx*2] ; active window shl eax, 8 push eax @@ -3641,7 +3641,7 @@ backgr: ;--------- set event 5 start ---------- push ecx edi xor edi, edi - mov ecx, [TASK_COUNT] + mov ecx, [thread_count] ;-------------------------------------- align 4 set_bgr_event: @@ -3733,7 +3733,7 @@ no_mark_system_shutdown: ;-------------------------------------- align 4 noshutdown: - mov eax, [TASK_COUNT] ; termination + mov eax, [thread_count] ; termination mov ebx, TASK_DATA+TASKDATA.state mov esi, 1 ;-------------------------------------- @@ -3972,7 +3972,7 @@ ricino: not_this_task: pop ecx - cmp ecx, [TASK_COUNT] + cmp ecx, [thread_count] jle newdw2 pop eax diff --git a/kernel/trunk/network/socket.inc b/kernel/trunk/network/socket.inc index ad2e1f256f..4307ad1348 100644 --- a/kernel/trunk/network/socket.inc +++ b/kernel/trunk/network/socket.inc @@ -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 ;; ;; ;; ;; Part of the TCP/IP network stack for KolibriOS ;; @@ -1899,7 +1899,7 @@ socket_notify: je .found inc ecx add esi, sizeof.TASKDATA - cmp ecx, [TASK_COUNT] + cmp ecx, [thread_count] jbe .next .error2: diff --git a/kernel/trunk/network/stack.inc b/kernel/trunk/network/stack.inc index 6c95deb6d1..59e3f79de2 100644 --- a/kernel/trunk/network/stack.inc +++ b/kernel/trunk/network/stack.inc @@ -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 ;; ;; ;; ;; STACK.INC ;; @@ -434,7 +434,7 @@ net_send_event: ; Send event to all applications push edi ecx mov edi, SLOT_BASE - mov ecx, [TASK_COUNT] + mov ecx, [thread_count] .loop: add edi, 256 or [edi + APPDATA.event_mask], EVENT_NETWORK2