Subversion Repositories Kolibri OS

Rev

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

Rev 291 Rev 294
Line 473... Line 473...
473
           cmp edi, esi
473
           cmp edi, esi
474
           jb @B
474
           jb @B
475
 
475
 
Line 476... Line 476...
476
.update_size:
476
.update_size:
477
 
-
 
478
           mov ebx, [new_size]
477
        mov     ebx, [new_size]
479
           mov    [PROC_BASE+0x8c+edx],ebx
-
 
480
 
-
 
481
;search threads and update
-
 
482
;application memory size infomation
-
 
483
           mov    ecx,[PROC_BASE+0xb8+edx]
-
 
484
           mov    eax,2
478
        call    update_mem_size
Line 485... Line -...
485
 
-
 
486
.search_threads:
-
 
487
;eax = current slot
-
 
488
;ebx = new memory size
-
 
489
;ecx = page directory
-
 
490
           cmp    eax,[TASK_COUNT]
-
 
491
           jg     .search_threads_end
-
 
492
           mov    edx,eax
-
 
493
           shl    edx,5
-
 
494
           cmp    word [CURRENT_TASK+edx+0xa],9 ;if slot empty?
-
 
495
           jz     .search_threads_next
-
 
496
           shl    edx,3
-
 
497
           cmp    [PROC_BASE+edx+0xb8],ecx     ;if it is our thread?
-
 
498
           jnz    .search_threads_next
-
 
499
           mov    [PROC_BASE+edx+0x8c],ebx     ;update memory size
-
 
500
.search_threads_next:
-
 
501
           inc    eax
-
 
502
           jmp    .search_threads
-
 
503
.search_threads_end:
479
 
504
           xor eax, eax
480
           xor eax, eax
505
           dec [pg_data.pg_mutex]
481
           dec [pg_data.pg_mutex]
Line 506... Line 482...
506
           ret
482
           ret
Line 559... Line 535...
559
           pop edi
535
           pop edi
560
 
536
 
Line 561... Line 537...
561
           add esi, 0x1000
537
           add esi, 0x1000
562
           cmp esi, edi
538
           cmp esi, edi
563
           jna @B
539
           jb  @B
Line 564... Line 540...
564
 
540
 
565
           jmp .update_size
541
           jmp .update_size
566
.exit:
542
.exit:
567
           xor eax, eax
543
           xor eax, eax
568
           inc eax
544
           inc eax
569
           dec [pg_data.pg_mutex]
545
           dec [pg_data.pg_mutex]
570
           ret
546
           ret
Line -... Line 547...
-
 
547
endp
-
 
548
 
-
 
549
update_mem_size:
-
 
550
; in: edx = slot shl 8
-
 
551
;     ebx = new memory size
-
 
552
; destroys eax,ecx,edx
-
 
553
 
-
 
554
           mov    [PROC_BASE+APPDATA.mem_size+edx],ebx
-
 
555
;search threads and update
-
 
556
;application memory size infomation
-
 
557
           mov    ecx,[PROC_BASE+APPDATA.dir_table+edx]
-
 
558
           mov    eax,2
-
 
559
 
-
 
560
.search_threads:
-
 
561
;eax = current slot
-
 
562
;ebx = new memory size
-
 
563
;ecx = page directory
-
 
564
           cmp    eax,[TASK_COUNT]
-
 
565
           jg     .search_threads_end
-
 
566
           mov    edx,eax
-
 
567
           shl    edx,5
-
 
568
           cmp    word [CURRENT_TASK+edx+TASKDATA.state],9 ;if slot empty?
-
 
569
           jz     .search_threads_next
-
 
570
           shl    edx,3
-
 
571
           cmp    [PROC_BASE+edx+APPDATA.dir_table],ecx     ;if it is our thread?
-
 
572
           jnz    .search_threads_next
-
 
573
           mov    [PROC_BASE+edx+APPDATA.mem_size],ebx     ;update memory size
-
 
574
.search_threads_next:
-
 
575
           inc    eax
-
 
576
           jmp    .search_threads
-
 
577
.search_threads_end:
571
endp
578
           ret
572
 
579
 
573
; param
580
; param
574
;  eax= linear address
581
;  eax= linear address
575
;
582
;