Rev 4391 | Rev 5356 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4391 | Rev 4424 | ||
---|---|---|---|
Line 3... | Line 3... | ||
3 | ;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2012. 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: 4391 $ |
8 | $Revision: 4424 $ |
9 | 9 | ||
10 | 10 | ||
Line 127... | Line 127... | ||
127 | stosd |
127 | stosd |
128 | stosd |
128 | stosd |
129 | loop @B |
129 | loop @B |
Line 130... | Line 130... | ||
130 | 130 | ||
- | 131 | stdcall alloc_pages, dword 32 |
|
- | 132 | ||
- | 133 | or eax, PG_SW |
|
131 | stdcall alloc_pages, dword 32 |
134 | mov ebx, HEAP_BASE |
132 | mov ecx, 32 |
- | |
133 | mov edx, eax |
- | |
134 | mov edi, HEAP_BASE |
- | |
135 | .l1: |
- | |
136 | stdcall map_page, edi, edx, PG_SW |
135 | mov ecx, 32 |
137 | add edi, 0x1000 |
- | |
138 | add edx, 0x1000 |
- | |
139 | dec ecx |
- | |
Line 140... | Line 136... | ||
140 | jnz .l1 |
136 | call commit_pages |
141 | 137 | ||
142 | mov edi, HEAP_BASE ;descriptors |
138 | mov edi, HEAP_BASE ;descriptors |
Line 478... | Line 474... | ||
478 | mov ebx, eax |
474 | mov ebx, eax |
479 | shr ebx, 12 |
475 | shr ebx, 12 |
480 | mov [pages_count], ebx |
476 | mov [pages_count], ebx |
Line 481... | Line 477... | ||
481 | 477 | ||
- | 478 | stdcall alloc_kernel_space, eax |
|
- | 479 | mov [lin_addr], eax |
|
482 | stdcall alloc_kernel_space, eax |
480 | mov ebx, [pages_count] |
483 | test eax, eax |
481 | test eax, eax |
484 | jz .err |
- | |
Line 485... | Line -... | ||
485 | mov [lin_addr], eax |
- | |
486 | 482 | jz .err |
|
487 | mov ecx, [pages_count] |
- | |
Line 488... | Line 483... | ||
488 | mov edx, eax |
483 | |
489 | mov ebx, ecx |
484 | mov edx, eax |
Line 490... | Line 485... | ||
490 | 485 | ||
491 | shr ecx, 3 |
- | |
492 | jz .next |
486 | shr ebx, 3 |
493 | - | ||
494 | and ebx, not 7 |
487 | jz .tail |
495 | push ebx |
488 | |
Line 496... | Line 489... | ||
496 | stdcall alloc_pages, ebx |
489 | shl ebx, 3 |
497 | pop ecx ; yes ecx!!! |
490 | stdcall alloc_pages, ebx |
498 | and eax, eax |
- | |
499 | jz .err |
- | |
500 | 491 | test eax, eax |
|
501 | mov edi, eax |
492 | jz .err |
- | 493 | ||
502 | mov edx, [lin_addr] |
494 | mov ecx, ebx |
503 | @@: |
- | |
504 | stdcall map_page, edx, edi, dword PG_SW |
495 | or eax, PG_SW |
505 | add edx, 0x1000 |
496 | mov ebx, [lin_addr] |
506 | add edi, 0x1000 |
497 | call commit_pages |
507 | dec ecx |
498 | |
508 | jnz @B |
499 | mov edx, ebx ; this dirty hack |
509 | .next: |
- | |
510 | mov ecx, [pages_count] |
500 | .tail: |
511 | and ecx, 7 |
- | |
512 | jz .end |
501 | mov ebx, [pages_count] |
513 | @@: |
502 | and ebx, 7 |
Line 514... | Line 503... | ||
514 | push ecx |
503 | jz .end |
515 | call alloc_page |
504 | @@: |
516 | pop ecx |
505 | call alloc_page |
517 | test eax, eax |
506 | test eax, eax |
518 | jz .err |
507 | jz .err |
519 | 508 | ||
520 | stdcall map_page, edx, eax, dword PG_SW |
509 | stdcall map_page, edx, eax, dword PG_SW |
521 | add edx, 0x1000 |
510 | add edx, 0x1000 |