Subversion Repositories Kolibri OS

Rev

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

Rev 620 Rev 660
Line 3... Line 3...
3
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
3
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
4
;; Distributed under terms of the GNU General Public License    ;;
4
;; Distributed under terms of the GNU General Public License    ;;
5
;;                                                              ;;
5
;;                                                              ;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 7... Line 7...
7
 
7
 
Line 8... Line 8...
8
$Revision: 620 $
8
$Revision: 660 $
9
 
9
 
10
 
10
 
Line 267... Line 267...
267
 
267
 
268
align 4
268
align 4
269
proc alloc_kernel_space stdcall, size:dword
269
proc alloc_kernel_space stdcall, size:dword
Line -... Line 270...
-
 
270
           local block_ind:DWORD
-
 
271
 
-
 
272
           push ebx
-
 
273
           push esi
270
           local block_ind:DWORD
274
           push edi
271
 
275
 
272
           mov eax, [size]
276
           mov eax, [size]
273
           add eax, 4095
277
           add eax, 4095
Line 354... Line 358...
354
           mov [esi+block_flags], USED_BLOCK
358
           mov [esi+block_flags], USED_BLOCK
355
           mov eax, [esi+block_base]
359
           mov eax, [esi+block_base]
356
           mov ebx, [size]
360
           mov ebx, [size]
357
           sub [heap_free], ebx
361
           sub [heap_free], ebx
358
           and [heap_mutex], 0
362
           and [heap_mutex], 0
-
 
363
           pop edi
-
 
364
           pop esi
-
 
365
           pop ebx
359
           ret
366
           ret
360
.m_eq_size:
367
.m_eq_size:
361
           remove_from_list edi
368
           remove_from_list edi
362
           mov [mem_block_list+ebx*4], edx
369
           mov [mem_block_list+ebx*4], edx
363
           and edx, edx
370
           and edx, edx
Line 374... Line 381...
374
           mov [edi+block_flags], USED_BLOCK
381
           mov [edi+block_flags], USED_BLOCK
375
           mov eax, [edi+block_base]
382
           mov eax, [edi+block_base]
376
           mov ebx, [size]
383
           mov ebx, [size]
377
           sub [heap_free], ebx
384
           sub [heap_free], ebx
378
           and [heap_mutex], 0
385
           and [heap_mutex], 0
-
 
386
           pop edi
-
 
387
           pop esi
-
 
388
           pop ebx
379
           ret
389
           ret
380
.error:
390
.error:
381
           xor eax, eax
391
           xor eax, eax
382
           mov [heap_mutex], eax
392
           mov [heap_mutex], eax
-
 
393
           pop edi
-
 
394
           pop esi
-
 
395
           pop ebx
383
           ret
396
           ret
384
endp
397
endp
Line 385... Line 398...
385
 
398
 
386
align 4
399
align 4
387
proc free_kernel_space stdcall uses ebx ecx edx esi edi, base:dword
-
 
-
 
400
proc free_kernel_space stdcall uses ebx ecx edx esi edi, base:dword
-
 
401
           push ebx
-
 
402
           push esi
388
 
403
           push edi
389
           mov ebx, heap_mutex
404
           mov ebx, heap_mutex
Line 390... Line 405...
390
           call wait_mutex    ;ebx
405
           call wait_mutex    ;ebx
391
 
406
 
Line 478... Line 493...
478
           bts [mem_block_mask], eax
493
           bts [mem_block_mask], eax
479
.m_eq:
494
.m_eq:
480
           xor eax, eax
495
           xor eax, eax
481
           mov [heap_mutex], eax
496
           mov [heap_mutex], eax
482
           dec eax
497
           dec eax
-
 
498
           pop edi
-
 
499
           pop esi
-
 
500
           pop ebx
483
           ret
501
           ret
484
.insert:
502
.insert:
485
           remove_from_used esi
503
           remove_from_used esi
Line 486... Line 504...
486
 
504
 
Line 497... Line 515...
497
           bts [mem_block_mask], eax
515
           bts [mem_block_mask], eax
498
           mov [esi+block_flags],FREE_BLOCK
516
           mov [esi+block_flags],FREE_BLOCK
499
           xor eax, eax
517
           xor eax, eax
500
           mov [heap_mutex], eax
518
           mov [heap_mutex], eax
501
           dec eax
519
           dec eax
-
 
520
           pop edi
-
 
521
           pop esi
-
 
522
           pop ebx
502
           ret
523
           ret
503
.fail:
524
.fail:
504
           xor eax, eax
525
           xor eax, eax
505
           mov [heap_mutex], eax
526
           mov [heap_mutex], eax
-
 
527
           pop edi
-
 
528
           pop esi
-
 
529
           pop ebx
506
           ret
530
           ret
507
endp
531
endp
Line 508... Line 532...
508
 
532
 
509
align 4
533
align 4