Subversion Repositories Kolibri OS

Rev

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

Rev 1090 Rev 1130
Line 3... Line 3...
3
;; Copyright (C) KolibriOS team 2004-2008. All rights reserved. ;;
3
;; Copyright (C) KolibriOS team 2004-2008. 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: 1090 $
8
$Revision: 1130 $
9
 
9
 
10
 
10
 
Line 89... Line 89...
89
}
89
}
Line 90... Line 90...
90
 
90
 
91
align 4
91
align 4
Line 92... Line 92...
92
proc init_kernel_heap
92
proc init_kernel_heap
93
 
93
 
94
           mov ecx, 64/4
94
           mov ecx, 64
95
           mov edi, mem_block_list
95
           mov edi, mem_block_list
96
           xor eax, eax
96
           xor eax, eax
Line 138... Line 138...
138
           mov [ebx+list_bk], eax
138
           mov [ebx+list_bk], eax
139
           mov [ebx+block_base], HEAP_BASE+4096*MEM_BLOCK_SIZE
139
           mov [ebx+block_base], HEAP_BASE+4096*MEM_BLOCK_SIZE
Line 140... Line 140...
140
 
140
 
141
           mov ecx, [pg_data.kernel_pages]
141
           mov ecx, [pg_data.kernel_pages]
142
           shl ecx, 12
-
 
143
           neg ecx
-
 
144
           add ecx, [MEM_AMOUNT]
142
           shl ecx, 12
145
           sub ecx, 4096*MEM_BLOCK_SIZE
143
           sub ecx, HEAP_BASE+4096*MEM_BLOCK_SIZE
146
           mov [heap_size], ecx
144
           mov [heap_size], ecx
147
           mov [heap_free], ecx
145
           mov [heap_free], ecx
148
           mov [ebx+block_size], ecx
146
           mov [ebx+block_size], ecx
Line 153... Line 151...
153
 
151
 
154
           mov [mem_block_list+63*4], ebx
152
           mov [mem_block_list+63*4], ebx
155
           mov byte [mem_block_map], 0xFC
153
           mov byte [mem_block_map], 0xFC
156
           and [heap_mutex], 0
154
           and [heap_mutex], 0
157
           mov [heap_blocks], 4095
155
           mov [heap_blocks], 4095
158
           mov [free_blocks], 4095
156
           mov [free_blocks], 4094
159
           ret
157
           ret
Line 160... Line 158...
160
endp
158
endp
161
 
159