From 4b862c1c0b9aff33c7ef877324d769bb5f5968ed Mon Sep 17 00:00:00 2001 From: Doczom Date: Fri, 3 Jun 2022 23:34:04 +0000 Subject: [PATCH] KERNEL: reducing the use of current_slot_idx git-svn-id: svn://kolibrios.org@9828 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/trunk/core/dll.inc | 5 +- kernel/trunk/core/heap.inc | 5 +- kernel/trunk/core/sys32.inc | 7 +- kernel/trunk/core/v86.inc | 5 +- kernel/trunk/fs/iso9660.inc | 5 +- kernel/trunk/gui/mouse.inc | 27 +++-- kernel/trunk/hid/keyboard.inc | 3 +- kernel/trunk/kernel.asm | 187 ++++++++++++++++----------------- kernel/trunk/video/cursors.inc | 16 ++- 9 files changed, 124 insertions(+), 136 deletions(-) diff --git a/kernel/trunk/core/dll.inc b/kernel/trunk/core/dll.inc index 7dfd66d6bc..1929b3cf74 100644 --- a/kernel/trunk/core/dll.inc +++ b/kernel/trunk/core/dll.inc @@ -1154,9 +1154,8 @@ proc load_library stdcall, file_name:dword, encoding:dword call malloc test eax, eax jz .fail_and_free_user - mov ebx, [current_slot_idx] - shl ebx, BSF sizeof.APPDATA - mov edx, [SLOT_BASE + ebx + APPDATA.tid] + mov ebx, [current_slot] + mov edx, [ebx + APPDATA.tid] mov [eax + HDLL.pid], edx push eax call init_dlls_in_thread diff --git a/kernel/trunk/core/heap.inc b/kernel/trunk/core/heap.inc index 9fdeadf1d1..ba593a07cc 100644 --- a/kernel/trunk/core/heap.inc +++ b/kernel/trunk/core/heap.inc @@ -1396,9 +1396,8 @@ align 4 mov edx, E_ACCESS ja .fail - mov ebx, [current_slot_idx] - shl ebx, BSF sizeof.APPDATA - mov ebx, [SLOT_BASE + ebx + APPDATA.tid] + mov ebx, [current_slot] + mov ebx, [ebx + APPDATA.tid] mov eax, sizeof.SMAP call create_kernel_object diff --git a/kernel/trunk/core/sys32.inc b/kernel/trunk/core/sys32.inc index c4ea2e19d7..e137f1bad4 100644 --- a/kernel/trunk/core/sys32.inc +++ b/kernel/trunk/core/sys32.inc @@ -342,9 +342,8 @@ lock_application_table: mov ecx, application_table_mutex call mutex_lock - mov eax, [current_slot_idx] - shl eax, BSF sizeof.APPDATA - mov eax, [eax + SLOT_BASE + APPDATA.tid] + mov eax, [current_slot] + mov eax, [eax + APPDATA.tid] mov [application_table_owner], eax @@ -389,7 +388,7 @@ sys_resize_app_memory: @@: stdcall new_mem_resize, ecx .store_result: - mov [esp+32], eax + mov [esp + SYSCALL_STACK._eax], eax .no_application_mem_resize: ret diff --git a/kernel/trunk/core/v86.inc b/kernel/trunk/core/v86.inc index 7802e2428a..7a154bf772 100644 --- a/kernel/trunk/core/v86.inc +++ b/kernel/trunk/core/v86.inc @@ -827,9 +827,8 @@ v86_irq: v86_irq2: mov esi, [v86_irqhooks + edi*8] ; get VM handle mov eax, [esi + V86_machine.process] - mov ecx, [current_slot_idx] - shl ecx, BSF sizeof.APPDATA - cmp [SLOT_BASE + ecx + APPDATA.process], eax + mov ecx, [current_slot] + cmp [ecx + APPDATA.process], eax jnz .notcurrent lea eax, [edi+8] cmp al, 10h diff --git a/kernel/trunk/fs/iso9660.inc b/kernel/trunk/fs/iso9660.inc index dc0cc5f131..60f80bf08e 100644 --- a/kernel/trunk/fs/iso9660.inc +++ b/kernel/trunk/fs/iso9660.inc @@ -56,9 +56,8 @@ reserve_cd: ;----------------------------------------------------------------------------- reserve_ok2: push eax - mov eax, [current_slot_idx] - shl eax, BSF sizeof.APPDATA - mov eax, [eax + SLOT_BASE + APPDATA.tid] + mov eax, [current_slot] + mov eax, [eax + APPDATA.tid] mov [cd_status], eax pop eax sti diff --git a/kernel/trunk/gui/mouse.inc b/kernel/trunk/gui/mouse.inc index 9241fb516d..488840bad9 100644 --- a/kernel/trunk/gui/mouse.inc +++ b/kernel/trunk/gui/mouse.inc @@ -718,7 +718,7 @@ dd .loadCursorUni mov eax, [MOUSE_X] shl eax, 16 mov ax, [MOUSE_Y] - mov [esp+36-4], eax + mov [esp + SYSCALL_STACK._eax], eax @@: ret @@ -732,30 +732,29 @@ dd .loadCursorUni shl ebx, 16 mov bx, word [esi + window_data + WDATA.box.top] sub eax, ebx - mov edi, [current_slot_idx] - shl edi, 8 - sub ax, word[edi+SLOT_BASE+APPDATA.wnd_clientbox.top] + mov edi, [current_slot] + sub ax, word[edi + APPDATA.wnd_clientbox.top] rol eax, 16 - sub ax, word[edi+SLOT_BASE+APPDATA.wnd_clientbox.left] + sub ax, word[edi + APPDATA.wnd_clientbox.left] rol eax, 16 - mov [esp+36-4], eax + mov [esp + SYSCALL_STACK._eax], eax ret .msbutton: movzx eax, byte [BTN_DOWN] - mov [esp+36-4], eax + mov [esp + SYSCALL_STACK._eax], eax ret .msbuttonExt: mov eax, [BTN_DOWN] - mov [esp+36-4], eax + mov [esp + SYSCALL_STACK._eax], eax ret .app_load_cursor: cmp ecx, OS_BASE jae @f stdcall load_cursor, ecx, edx - mov [esp+36-4], eax + mov [esp + SYSCALL_STACK._eax], eax @@: ret @@ -772,19 +771,19 @@ dd .loadCursorUni test eax, eax jz @f stdcall load_cursor, ebp, LOAD_FROM_FILE - mov [esp+32], eax + mov [esp + SYSCALL_STACK._eax], eax @@: stdcall kernel_free, ebp ret .app_set_cursor: stdcall set_cursor, ecx - mov [esp+36-4], eax + mov [esp + SYSCALL_STACK._eax], eax ret .app_delete_cursor: stdcall delete_cursor, ecx - mov [esp+36-4], eax + mov [esp + SYSCALL_STACK._eax], eax ret .msz: @@ -795,10 +794,10 @@ dd .loadCursorUni mov ax, [MOUSE_SCROLL_H] shl eax, 16 mov ax, [MOUSE_SCROLL_V] - mov [esp+36-4], eax + mov [esp + SYSCALL_STACK._eax], eax and [MOUSE_SCROLL_H], word 0 and [MOUSE_SCROLL_V], word 0 ret @@: - and [esp+36-4], dword 0 + and [esp + SYSCALL_STACK._eax], dword 0 ret \ No newline at end of file diff --git a/kernel/trunk/hid/keyboard.inc b/kernel/trunk/hid/keyboard.inc index f5e915fcac..d5104934c4 100644 --- a/kernel/trunk/hid/keyboard.inc +++ b/kernel/trunk/hid/keyboard.inc @@ -105,7 +105,7 @@ align 4 set_keyboard_data: movzx eax, word[thread_count]; top window process movzx eax, word[WIN_POS + eax*2] - shl eax, 8 + shl eax, BSF sizeof.APPDATA mov al, [SLOT_BASE + eax + APPDATA.keyboard_mode] mov [keyboard_mode], al @@ -203,6 +203,7 @@ irq1: in al, 0x60 ;-------------------------------------- send_scancode: + ;DEBUGF 1, "K : Scan code: %x \n", al mov [keyboard_data], al ; ch = scancode ; cl = ext_code diff --git a/kernel/trunk/kernel.asm b/kernel/trunk/kernel.asm index 1efb31b1c5..f92b217e7c 100644 --- a/kernel/trunk/kernel.asm +++ b/kernel/trunk/kernel.asm @@ -1584,7 +1584,7 @@ sys_setup: ; 11 = enable lba read ; 12 = enable pci access ;----------------------------------------------------------------------------- - and [esp+32], dword 0 + and [esp + SYSCALL_STACK._eax], dword 0 ; F.21.1 - set MPU MIDI base port dec ebx jnz @f @@ -1671,7 +1671,7 @@ sys_setup: ret ;-------------------------------------- .error: - or [esp+32], dword -1 + or [esp + SYSCALL_STACK._eax], dword -1 ret ;----------------------------------------------------------------------------- align 4 @@ -1694,7 +1694,7 @@ sys_getsetup: jnz @f movzx eax, [midi_base] - mov [esp+32], eax + mov [esp + SYSCALL_STACK._eax], eax ret ;-------------------------------------- @@: @@ -1741,11 +1741,11 @@ sys_getsetup: jnz .error movzx eax, word [keyboard] - mov [esp+32], eax + mov [esp + SYSCALL_STACK._eax], eax ret .addr_error: ; if given memory address is illegal - mov dword [esp+32], -1 + or dword [esp + SYSCALL_STACK._eax], -1 ret ;-------------------------------------- @@: @@ -1754,7 +1754,7 @@ sys_getsetup: jnz @f mov eax, [syslang] - mov [esp+32], eax + mov [esp + SYSCALL_STACK._eax], eax ret ;-------------------------------------- @@: @@ -1763,7 +1763,7 @@ sys_getsetup: jnz @f mov eax, [timer_ticks] - mov [esp+32], eax + mov [esp + SYSCALL_STACK._eax], eax ret ;-------------------------------------- @@: @@ -1772,8 +1772,8 @@ sys_getsetup: jnz @f call get_clock_ns - mov [esp+24], edx - mov [esp+32], eax + mov [esp + SYSCALL_STACK._edx], edx + mov [esp + SYSCALL_STACK._eax], eax ret ;-------------------------------------- @@: @@ -1782,7 +1782,7 @@ sys_getsetup: jnz @f mov eax, [lba_read_enabled] - mov [esp+32], eax + mov [esp + SYSCALL_STACK._eax], eax ret ;-------------------------------------- @@: @@ -1791,11 +1791,11 @@ sys_getsetup: jnz .error mov eax, [pci_access_enabled] - mov [esp+32], eax + mov [esp + SYSCALL_STACK._eax], eax ret ;-------------------------------------- .error: - or [esp+32], dword -1 + or [esp + SYSCALL_STACK._eax], dword -1 ret ;----------------------------------------------------------------------------- get_timer_ticks: @@ -2006,7 +2006,7 @@ sysfn_shutdown: ; 18.9 = system shutdown mov [SYS_SHUTDOWN], al mov [shutdown_processes], eax call wakeup_osloop - and dword [esp+32], 0 + and dword [esp + SYSCALL_STACK._eax], 0 exit_for_anyone: ret uglobal @@ -2093,11 +2093,11 @@ sysfn_terminate2: call sysfn_terminate call unlock_application_table sti - and dword [esp+32], 0 + and dword [esp + SYSCALL_STACK._eax], 0 ret .not_found: call unlock_application_table - or dword [esp+32], -1 + or dword [esp + SYSCALL_STACK._eax], -1 ret ;------------------------------------------------------------------------------ sysfn_deactivate: ; 18.1 = DEACTIVATE WINDOW @@ -2216,19 +2216,19 @@ sysfn_zmodif: .fail: xor eax, eax .exit: - mov [esp+32], eax + mov [esp + SYSCALL_STACK._eax], eax ret ;------------------------------------------------------------------------------ sysfn_getidletime: ; 18.4 = GET IDLETIME ;mov eax, [TASK_TABLE+32+TASKDATA.cpu_usage] mov eax, [SLOT_BASE + APPDATA.cpu_usage] - mov [esp+32], eax + mov [esp + SYSCALL_STACK._eax], eax ret ;------------------------------------------------------------------------------ sysfn_getcpuclock: ; 18.5 = GET TSC/SEC mov eax, dword [cpu_freq] - mov [esp+32], eax + mov [esp + SYSCALL_STACK._eax], eax ret ;------------------------------------------------------------------------------ get_cpu_freq: @@ -2244,7 +2244,7 @@ align 4 sysfn_getactive: ; 18.7 = get active window mov eax, [thread_count] movzx eax, word [WIN_POS + eax*2] - mov [esp+32], eax + mov [esp + SYSCALL_STACK._eax], eax ret ;------------------------------------------------------------------------------ sysfn_sound_flag: ; 18.8 = get/set sound_flag @@ -2252,7 +2252,7 @@ sysfn_sound_flag: ; 18.8 = get/set sound_flag dec ecx jnz nogetsoundflag movzx eax, byte [sound_flag]; get sound_flag - mov [esp+32], eax + mov [esp + SYSCALL_STACK._eax], eax ret nogetsoundflag: ; cmp ecx,2 @@ -2293,7 +2293,7 @@ sysfn_getversion: ; 18.13 = get kernel ID and version rep movsb ret .addr_error: ; if given memory address is illegal - mov dword [esp+32], -1 + mov dword [esp + SYSCALL_STACK._eax], -1 ret ;------------------------------------------------------------------------------ sysfn_waitretrace: ; 18.14 = sys wait retrace @@ -2304,7 +2304,7 @@ sysfn_waitretrace: ; 18.14 = sys wait retrace in al, dx test al, 1000b jz WaitRetrace_loop - and [esp+32], dword 0 + and [esp + SYSCALL_STACK._eax], dword 0 ret ;------------------------------------------------------------------------------ align 4 @@ -2317,7 +2317,7 @@ sysfn_centermouse: ; 18.15 = mouse centered mov [MOUSE_Y], ax call wakeup_osloop xor eax, eax - and [esp+32], eax + and [esp + SYSCALL_STACK._eax], eax ret ;------------------------------------------------------------------------------ sysfn_mouse_acceleration: ; 18.19 = set/get mouse features @@ -2327,7 +2327,7 @@ sysfn_mouse_acceleration: ; 18.19 = set/get mouse features .get_mouse_acceleration: xor eax, eax mov ax, [mouse_speed_factor] - mov [esp+32], eax + mov [esp + SYSCALL_STACK._eax], eax ret .set_mouse_acceleration: mov [mouse_speed_factor], dx @@ -2335,7 +2335,7 @@ sysfn_mouse_acceleration: ; 18.19 = set/get mouse features .get_mouse_delay: xor eax, eax mov al, [mouse_delay] - mov [esp+32], eax + mov [esp + SYSCALL_STACK._eax], eax ret .set_mouse_delay: mov [mouse_delay], dl @@ -2357,7 +2357,7 @@ sysfn_mouse_acceleration: ; 18.19 = set/get mouse features .get_doubleclick_delay: xor eax, eax mov al, [mouse_doubleclick_delay] - mov [esp+32], eax + mov [esp + SYSCALL_STACK._eax], eax ret .set_doubleclick_delay: mov [mouse_doubleclick_delay], dl @@ -2376,19 +2376,19 @@ dd .set_doubleclick_delay sysfn_getfreemem: mov eax, [pg_data.pages_free] shl eax, 2 - mov [esp+32], eax + mov [esp + SYSCALL_STACK._eax], eax ret ;------------------------------------------------------------------------------ sysfn_getallmem: mov eax, [MEM_AMOUNT] shr eax, 10 - mov [esp+32], eax + mov [esp + SYSCALL_STACK._eax], eax ret ;------------------------------------------------------------------------------ sysfn_pid_to_slot: mov eax, ecx call pid_to_slot - mov [esp+32], eax + mov [esp + SYSCALL_STACK._eax], eax ret ;------------------------------------------------------------------------------ sysfn_min_rest_window: @@ -2400,7 +2400,7 @@ sysfn_min_rest_window: @@: or eax, eax ; eax - number of slot jz .error - cmp eax, 255 ; varify maximal slot number + cmp eax, max_processes ; varify maximal slot number ja .error movzx eax, word [WIN_STACK + eax*2] shr ecx, 1 @@ -2413,18 +2413,18 @@ sysfn_min_rest_window: .exit: popad xor eax, eax - mov [esp+32], eax + mov [esp + SYSCALL_STACK._eax], eax ret .error: popad xor eax, eax dec eax - mov [esp+32], eax + mov [esp + SYSCALL_STACK._eax], eax ret ;------------------------------------------------------------------------------ sysfn_min_windows: call minimize_all_window - mov [esp+32], eax + mov [esp + SYSCALL_STACK._eax], eax call change_task ret ;------------------------------------------------------------------------------ @@ -2487,10 +2487,10 @@ sys_cachetodiskette: cmp ebx, 2 ja .no_floppy_save call save_image - mov [esp + 32], eax + mov [esp + SYSCALL_STACK._eax], eax ret .no_floppy_save: - mov [esp + 32], dword 1 + mov [esp + SYSCALL_STACK._eax], dword 1 ret ;------------------------------------------------------------------------------ @@ -2524,7 +2524,7 @@ sys_getkey: ;-------------------------------------- align 4 .ret_eax: - mov [esp + 32], eax + mov [esp + SYSCALL_STACK._eax], eax ret ;-------------------------------------- align 4 @@ -2554,7 +2554,7 @@ align 4 align 4 sys_getbutton: mov ebx, [current_slot_idx] ; TOP OF WINDOW STACK - mov [esp + 32], dword 1 + mov [esp + SYSCALL_STACK._eax], dword 1 movzx ecx, word [WIN_STACK + ebx * 2] mov edx, [thread_count] ; less than 256 processes cmp ecx, edx @@ -2565,7 +2565,7 @@ sys_getbutton: mov eax, [BTN_BUFF] and al, 0xFE ; delete left button bit mov [BTN_COUNT], byte 0 - mov [esp + 32], eax + mov [esp + SYSCALL_STACK._eax], eax ;-------------------------------------- align 4 .exit: @@ -2676,11 +2676,11 @@ sys_cpuusage: ; return number of processes mov eax, [thread_count] - mov [esp+32], eax + mov [esp + SYSCALL_STACK._eax], eax ret .addr_error: ; if given memory address is illegal - mov dword [esp+32], -1 + mov dword [esp + SYSCALL_STACK._eax], -1 ret @@ -2774,7 +2774,7 @@ sys_sheduler: ;.shed_counter: .00: mov eax, [context_counter] - mov [esp+32], eax + mov [esp + SYSCALL_STACK._eax], eax ret .02: @@ -2804,8 +2804,8 @@ sys_sheduler: mov eax, esi mov ecx, edx rdmsr - mov [esp+32], eax - mov [esp+20], edx ;ret in ebx? + mov [esp + SYSCALL_STACK._eax], eax + mov [esp + SYSCALL_STACK._ebx], edx ;ret in ebx? ret .04: @@ -2850,9 +2850,9 @@ is_cache_enabled: mov ebx, eax and eax, 01100000000000000000000000000000b jz cache_disabled - mov [esp+32], ebx + mov [esp + SYSCALL_STACK._eax], ebx cache_disabled: - mov dword [esp+32], eax;0 + mov dword [esp + SYSCALL_STACK._eax], eax;0 ret modify_pce: @@ -2862,7 +2862,7 @@ modify_pce: ; xor eax,ebx ;invert pce bts eax, 8;pce=cr4[8] mov cr4, eax - mov [esp+32], eax + mov [esp + SYSCALL_STACK._eax], eax ret ;--------------------------------------------------------------------------------------------- @@ -3377,7 +3377,7 @@ align 4 set_app_param: mov edi, [current_slot] xchg ebx, [edi + APPDATA.event_mask] ; set new event mask - mov [esp+32], ebx ; return old mask value + mov [esp + SYSCALL_STACK._eax], ebx ; return old mask value ret ;----------------------------------------------------------------------------- @@ -3511,7 +3511,7 @@ align 4 syscall_reserveportarea: ; ReservePortArea and FreePortArea call r_f_port_area - mov [esp+32], eax + mov [esp + SYSCALL_STACK._eax], eax ret ;reserve/free group of ports @@ -3717,11 +3717,10 @@ sys_putimage_palette: pop ecx jnz sys_putimage.exit - mov eax, [current_slot_idx] - shl eax, 8 - add dx, word [SLOT_BASE + eax + APPDATA.wnd_clientbox.top] + mov eax, [current_slot] + add dx, word [eax + APPDATA.wnd_clientbox.top] rol edx, 16 - add dx, word [SLOT_BASE + eax + APPDATA.wnd_clientbox.left] + add dx, word [eax + APPDATA.wnd_clientbox.left] rol edx, 16 ;-------------------------------------- align 4 @@ -4228,7 +4227,7 @@ end if ret @@: - mov [esp+32], ecx + mov [esp + SYSCALL_STACK._eax], ecx mov [esp+20], ecx jmp .ret @@ -4243,7 +4242,7 @@ end if movzx edx, byte [ebx] call memmove dec [msg_board_count] - mov [esp + 32], edx ;eax + mov [esp + SYSCALL_STACK._eax], edx ;eax mov [esp + 20], dword 1 ret @@ -4270,93 +4269,92 @@ sys_process_def: cmp ebx, 7 jae .not_support ;if >=8 then or eax,-1 - mov edi, [current_slot_idx] + mov edi, [current_slot] jmp dword [f66call + ebx*4] .not_support: - or eax, -1 + or [esp + SYSCALL_STACK._eax], -1 ret ;----------------------------------------------------------------------------- align 4 .1: - shl edi, BSF sizeof.APPDATA - mov [SLOT_BASE + edi + APPDATA.keyboard_mode], cl - + mov [edi + APPDATA.keyboard_mode], cl ret ;----------------------------------------------------------------------------- align 4 .2: ; 2 = get keyboard mode - shl edi, BSF sizeof.APPDATA - movzx eax, byte [SLOT_BASE + edi + APPDATA.keyboard_mode] - mov [esp+32], eax + movzx eax, byte [edi + APPDATA.keyboard_mode] + mov [esp + SYSCALL_STACK._eax], eax ret ;----------------------------------------------------------------------------- align 4 .3: ;3 = get keyboard ctrl, alt, shift mov eax, [kb_state] - mov [esp+32], eax + mov [esp + SYSCALL_STACK._eax], eax ret ;----------------------------------------------------------------------------- align 4 .4: + mov edi, [current_slot_idx] mov eax, hotkey_list @@: - cmp dword [eax+8], 0 + cmp dword [eax + 8], 0 jz .found_free add eax, 16 cmp eax, hotkey_list+16*256 jb @b - mov dword [esp+32], 1 + mov dword [esp + SYSCALL_STACK._eax], 1 ret .found_free: - mov [eax+8], edi - mov [eax+4], edx + mov [eax + 8], edi + mov [eax + 4], edx movzx ecx, cl lea ecx, [hotkey_scancodes+ecx*4] mov edx, [ecx] mov [eax], edx mov [ecx], eax - mov [eax+12], ecx + mov [eax + 12], ecx test edx, edx jz @f - mov [edx+12], eax + mov [edx + 12], eax @@: - and dword [esp+32], 0 + and dword [esp + SYSCALL_STACK._eax], 0 ret ;----------------------------------------------------------------------------- align 4 .5: + mov edi, [current_slot_idx] movzx ebx, cl lea ebx, [hotkey_scancodes+ebx*4] mov eax, [ebx] .scan: test eax, eax jz .notfound - cmp [eax+8], edi + cmp [eax + 8], edi jnz .next - cmp [eax+4], edx + cmp [eax + 4], edx jz .found .next: mov eax, [eax] jmp .scan .notfound: - mov dword [esp+32], 1 + mov dword [esp + SYSCALL_STACK._eax], 1 ret .found: mov ecx, [eax] jecxz @f - mov edx, [eax+12] - mov [ecx+12], edx + mov edx, [eax + 12] + mov [ecx + 12], edx @@: - mov ecx, [eax+12] + mov ecx, [eax + 12] mov edx, [eax] mov [ecx], edx xor edx, edx - mov [eax+4], edx - mov [eax+8], edx - mov [eax+12], edx + mov [eax + 4], edx + mov [eax + 8], edx + mov [eax + 12], edx mov [eax], edx - mov [esp+32], edx + mov [esp + SYSCALL_STACK._eax], edx ret ;----------------------------------------------------------------------------- align 4 @@ -4367,9 +4365,8 @@ align 4 test eax, eax jnz @f ; get current PID - mov eax, [current_slot_idx] - shl eax, BSF sizeof.APPDATA - mov eax, [eax + SLOT_BASE+APPDATA.tid] + mov eax, [current_slot] + mov eax, [eax + APPDATA.tid] ; set current PID for lock input mov [PID_lock_input], eax @@: @@ -4382,9 +4379,8 @@ align 4 test eax, eax jz @f ; get current PID - mov ebx, [current_slot_idx] - shl ebx, BSF sizeof.APPDATA - mov ebx, [ebx + SLOT_BASE+APPDATA.tid] + mov ebx, [current_slot] + mov ebx, [ebx + APPDATA.tid] ; compare current lock input with current PID cmp ebx, eax jne @f @@ -4419,7 +4415,7 @@ sys_gs: ; direct screen access ja .not_support jmp dword [f61call + ebx*4] .not_support: - or [esp+32], dword -1 + or [esp + SYSCALL_STACK._eax], dword -1 ret @@ -4427,15 +4423,15 @@ sys_gs: ; direct screen access mov eax, [_display.width] shl eax, 16 mov ax, word [_display.height] - mov [esp+32], eax + mov [esp + SYSCALL_STACK._eax], eax ret .2: ; bits per pixel mov eax, [_display.bits_per_pixel] - mov [esp+32], eax + mov [esp + SYSCALL_STACK._eax], eax ret .3: ; bytes per scanline mov eax, [_display.lfb_pitch] - mov [esp+32], eax + mov [esp + SYSCALL_STACK._eax], eax ret align 4 @@ -4445,7 +4441,7 @@ syscall_getscreensize: ; GetScreenSize shl eax, 16 mov ax, word [_display.height] dec ax - mov [esp + 32], eax + mov [esp + SYSCALL_STACK._eax], eax ret ;----------------------------------------------------------------------------- align 4 @@ -4535,7 +4531,7 @@ align 4 ;-------------------------------------- align 4 .store: - mov [esp + 32], eax + mov [esp + SYSCALL_STACK._eax], eax ret ;----------------------------------------------------------------------------- align 4 @@ -4548,7 +4544,7 @@ syscall_getpixel: ; GetPixel xchg eax, ebx and ecx, 0xFBFFFFFF ;negate 0x04000000 use mouseunder area call dword [GETPIXEL]; eax - x, ebx - y - mov [esp + 32], ecx + mov [esp + SYSCALL_STACK._eax], ecx ret ;----------------------------------------------------------------------------- align 4 @@ -4631,11 +4627,10 @@ syscall_threads: ; CreateThreads ; edx=thread stack pointer ; ; on return : eax = pid - xor ebx, ebx call new_sys_threads - mov [esp+32], eax + mov [esp + SYSCALL_STACK._eax], eax ret ;------------------------------------------------------------------------------ @@ -4793,7 +4788,7 @@ sys_apm: align 4 undefined_syscall: ; Undefined system call - mov [esp + 32], dword -1 + mov [esp + SYSCALL_STACK._eax], dword -1 ret align 4 diff --git a/kernel/trunk/video/cursors.inc b/kernel/trunk/video/cursors.inc index ad7f76aca2..9b05479846 100644 --- a/kernel/trunk/video/cursors.inc +++ b/kernel/trunk/video/cursors.inc @@ -422,9 +422,8 @@ align 4 push esi push edi - mov eax, [current_slot_idx] - shl eax, BSF sizeof.APPDATA - mov eax, [SLOT_BASE + eax + APPDATA.tid] + mov eax, [current_slot] + mov eax, [eax + APPDATA.tid] mov ebx, [src] mov ecx, [flags] call create_cursor ;eax, ebx, ecx @@ -459,10 +458,9 @@ proc delete_cursor stdcall, hcursor:dword cmp [esi + CURSOR.magic], 'CURS' jne .fail - mov ebx, [current_slot_idx] - shl ebx, BSF sizeof.APPDATA - mov ebx, [ebx + SLOT_BASE + APPDATA.tid] - cmp ebx, [esi+CURSOR.pid] + mov ebx, [current_slot] + mov ebx, [ebx + APPDATA.tid] + cmp ebx, [esi + CURSOR.pid] jne .fail mov ebx, [current_slot] @@ -503,7 +501,7 @@ destroy_cursor: ;------------------------------------------------------------------------------ align 4 select_cursor: - mov eax, [esp+4] + mov eax, [esp + 4] mov [_display.cursor], eax ret 4 ;------------------------------------------------------------------------------ @@ -522,7 +520,7 @@ proc restore_24 stdcall, x:dword, y:dword mov esi, cur_saved_data mov ecx, [cur.w] - lea ecx, [ecx+ecx*2] + lea ecx, [ecx + ecx*2] push ecx ;-------------------------------------- align 4