Subversion Repositories Kolibri OS

Rev

Rev 9930 | Rev 9941 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 9930 Rev 9932
Line 75... Line 75...
75
format binary as "mnt"
75
format binary as "mnt"
Line 76... Line 76...
76
 
76
 
77
include 'macros.inc'
77
include 'macros.inc'
Line 78... Line 78...
78
include 'struct.inc'
78
include 'struct.inc'
Line 79... Line 79...
79
 
79
 
80
$Revision: 9930 $
80
$Revision: 9932 $
Line 2227... Line 2227...
2227
        mov     [esp + SYSCALL_STACK.eax], eax
2227
        mov     [esp + SYSCALL_STACK.eax], eax
2228
        ret
2228
        ret
Line 2229... Line 2229...
2229
 
2229
 
2230
;------------------------------------------------------------------------------
2230
;------------------------------------------------------------------------------
2231
sysfn_getidletime:              ; 18.4 = GET IDLETIME
-
 
2232
        ;mov     eax, [TASK_TABLE+32+TASKDATA.cpu_usage]
2231
sysfn_getidletime:              ; 18.4 = GET IDLETIME
2233
        mov     eax, [SLOT_BASE + APPDATA.cpu_usage]
2232
        mov     eax, [SLOT_BASE + sizeof.APPDATA + APPDATA.cpu_usage]
2234
        mov     [esp + SYSCALL_STACK.eax], eax
2233
        mov     [esp + SYSCALL_STACK.eax], eax
2235
        ret
2234
        ret
2236
;------------------------------------------------------------------------------
2235
;------------------------------------------------------------------------------
2237
sysfn_getcpuclock:              ; 18.5 = GET TSC/SEC
2236
sysfn_getcpuclock:              ; 18.5 = GET TSC/SEC
Line 2530... Line 2529...
2530
        mov     [ebx+6], ax
2529
        mov     [ebx+6], ax
Line 2531... Line 2530...
2531
 
2530
 
Line 2532... Line 2531...
2532
        shl     ecx, BSF sizeof.APPDATA
2531
        shl     ecx, BSF sizeof.APPDATA
2533
 
-
 
2534
; +0: dword: memory usage
2532
 
2535
        ;mov     eax, [ecx+TASK_TABLE+TASKDATA.cpu_usage]
2533
; +0: dword: memory usage
2536
        mov     eax, [SLOT_BASE + ecx - sizeof.APPDATA + APPDATA.cpu_usage]
2534
        mov     eax, [SLOT_BASE + ecx + APPDATA.cpu_usage]
2537
        mov     [ebx], eax
2535
        mov     [ebx], eax
2538
; +10: 11 bytes: name of the process
2536
; +10: 11 bytes: name of the process
2539
        push    ecx
2537
        push    ecx
2540
        lea     eax, [SLOT_BASE + ecx + APPDATA.app_name]
2538
        lea     eax, [SLOT_BASE + ecx + APPDATA.app_name]
2541
        add     ebx, 10
2539
        add     ebx, 10
2542
        mov     ecx, 11
2540
        mov     ecx, 11
Line 2543... Line -...
2543
        call    memmove
-
 
2544
        pop     ecx
2541
        call    memmove
2545
 
2542
        pop     ecx
2546
        shr     ecx, (BSF sizeof.APPDATA - BSF sizeof.WDATA)
2543
 
2547
; +22: address of the process in memory
2544
; +22: address of the process in memory
2548
; +26: size of used memory - 1
2545
; +26: size of used memory - 1
2549
        push    edi
2546
        push    edi
2550
        lea     edi, [ebx+12]
2547
        lea     edi, [ebx+12]
2551
        xor     eax, eax
2548
        xor     eax, eax
2552
        mov     edx, 0x100000*16
2549
        mov     edx, 0x100000*16
2553
        cmp     ecx, 1 shl BSF sizeof.WDATA
2550
        cmp     ecx, 1 shl BSF sizeof.APPDATA
2554
        je      .os_mem
2551
        je      .os_mem
2555
        mov     edx, [SLOT_BASE + ecx*(sizeof.APPDATA/sizeof.WDATA) + APPDATA.process]
2552
        mov     edx, [SLOT_BASE + ecx + APPDATA.process]
2556
        mov     edx, [edx + PROC.mem_used]
2553
        mov     edx, [edx + PROC.mem_used]
2557
        mov     eax, std_application_base_address
2554
        mov     eax, std_application_base_address
2558
.os_mem:
2555
.os_mem:
Line -... Line 2556...
-
 
2556
        stosd
-
 
2557
        lea     eax, [edx-1]
-
 
2558
        stosd
2559
        stosd
2559
 
2560
        lea     eax, [edx-1]
2560
        mov     edx, ecx
2561
        stosd
2561
        shr     edx, (BSF sizeof.APPDATA - BSF sizeof.WDATA)
Line 2562... Line 2562...
2562
 
2562
 
2563
; +30: PID/TID
2563
; +30: PID/TID
2564
        mov     eax, [SLOT_BASE + ecx*(sizeof.APPDATA/sizeof.WDATA) + APPDATA.tid]
2564
        mov     eax, [SLOT_BASE + ecx + APPDATA.tid]
2565
        stosd
2565
        stosd
2566
 
2566
 
2567
    ; window position and size
2567
    ; window position and size
2568
        push    esi
2568
        push    esi
Line 2569... Line 2569...
2569
        lea     esi, [window_data + ecx + WDATA.box]
2569
        lea     esi, [window_data + edx + WDATA.box]
2570
        movsd
2570
        movsd
2571
        movsd
2571
        movsd
Line 2572... Line 2572...
2572
        movsd
2572
        movsd
2573
        movsd
2573
        movsd
2574
 
2574
 
2575
    ; Process state (+50)
2575
    ; Process state (+50)
2576
        movzx   eax, byte [SLOT_BASE + ecx*(sizeof.APPDATA/sizeof.WDATA) + APPDATA.state]
2576
        movzx   eax, byte [SLOT_BASE + ecx + APPDATA.state]
2577
        stosd
2577
        stosd
Line 2578... Line 2578...
2578
 
2578
 
2579
    ; Window client area box
2579
    ; Window client area box
2580
        lea     esi, [window_data + ecx + WDATA.clientbox]
2580
        lea     esi, [window_data + edx + WDATA.clientbox]
Line 2581... Line 2581...
2581
        movsd
2581
        movsd
2582
        movsd
2582
        movsd
2583
        movsd
2583
        movsd
Line 2584... Line 2584...
2584
        movsd
2584
        movsd
2585
 
2585
 
2586
    ; Window state
2586
    ; Window state
Line 2587... Line 2587...
2587
        mov     al, [window_data + ecx + WDATA.fl_wstate]
2587
        mov     al, [window_data + edx + WDATA.fl_wstate]
2588
        stosb
2588
        stosb