Subversion Repositories Kolibri OS

Rev

Rev 5596 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5596 Rev 6339
Line 3... Line 3...
3
;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;;
3
;; Copyright (C) KolibriOS team 2004-2015. 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: 5596 $
8
$Revision: 6339 $
9
 
9
 
10
 
10
 
Line 583... Line 583...
583
        mov     eax, HEAP_TOP
583
        mov     eax, HEAP_TOP
584
        mov     [ebx+PROC.heap_base], esi
584
        mov     [ebx+PROC.heap_base], esi
585
        mov     [ebx+PROC.heap_top], eax
585
        mov     [ebx+PROC.heap_top], eax
Line 586... Line 586...
586
 
586
 
587
        sub     eax, esi
587
        sub     eax, esi
588
        shr     esi, 10
588
        shr     esi, 9
589
        mov     ecx, eax
589
        mov     ecx, eax
590
        sub     eax, PAGE_SIZE
590
        sub     eax, PAGE_SIZE
591
        or      ecx, FREE_BLOCK
591
        or      ecx, FREE_BLOCK
592
        mov     [page_tabs+esi], ecx
592
        mov     [page_tabs+esi], ecx
Line 614... Line 614...
614
        cmp     esi, edi
614
        cmp     esi, edi
615
        jae     .m_exit
615
        jae     .m_exit
Line 616... Line 616...
616
 
616
 
617
        mov     ebx, esi
617
        mov     ebx, esi
618
        shr     ebx, 12
618
        shr     ebx, 12
619
        mov     eax, [page_tabs+ebx*4]
619
        mov     eax, [page_tabs+ebx*8]
620
        test    al, FREE_BLOCK
620
        test    al, FREE_BLOCK
621
        jz      .test_used
621
        jz      .test_used
622
        and     eax, 0xFFFFF000
622
        and     eax, 0xFFFFF000
623
        cmp     eax, ecx   ;alloc_size
623
        cmp     eax, ecx   ;alloc_size
Line 626... Line 626...
626
 
626
 
627
        lea     edx, [esi+ecx]
627
        lea     edx, [esi+ecx]
628
        sub     eax, ecx
628
        sub     eax, ecx
629
        or      al, FREE_BLOCK
629
        or      al, FREE_BLOCK
630
        shr     edx, 12
630
        shr     edx, 12
631
        mov     [page_tabs+edx*4], eax
631
        mov     [page_tabs+edx*8], eax
632
@@:
632
@@:
633
        or      ecx, USED_BLOCK
633
        or      ecx, USED_BLOCK
634
        mov     [page_tabs+ebx*4], ecx
634
        mov     [page_tabs+ebx*8], ecx
635
        shr     ecx, 12
635
        shr     ecx, 12
636
        inc     ebx
636
        inc     ebx
637
        dec     ecx
637
        dec     ecx
638
        jz      .no
638
        jz      .no
639
@@:
639
@@:
640
        mov     dword [page_tabs+ebx*4], 2
640
        mov     dword [page_tabs+ebx*8], 2
641
        inc     ebx
641
        inc     ebx
642
        dec     ecx
642
        dec     ecx
643
        jnz     @B
643
        jnz     @B
Line 701... Line 701...
701
.scan:
701
.scan:
702
        cmp     esi, edi
702
        cmp     esi, edi
703
        jae     .error
703
        jae     .error
704
        mov     ebx, esi
704
        mov     ebx, esi
705
        shr     ebx, 12
705
        shr     ebx, 12
706
        mov     eax, [page_tabs+ebx*4]
706
        mov     eax, [page_tabs+ebx*8]
707
        mov     ecx, eax
707
        mov     ecx, eax
708
        and     ecx, 0xFFFFF000
708
        and     ecx, 0xFFFFF000
709
        add     ecx, esi
709
        add     ecx, esi
710
        cmp     edx, ecx
710
        cmp     edx, ecx
711
        jb      .found
711
        jb      .found
Line 738... Line 738...
738
; First or third block (or both) may be absent.
738
; First or third block (or both) may be absent.
739
        mov     eax, edx
739
        mov     eax, edx
740
        sub     eax, esi
740
        sub     eax, esi
741
        jz      .nofirst
741
        jz      .nofirst
742
        or      al, FREE_BLOCK
742
        or      al, FREE_BLOCK
743
        mov     [page_tabs+ebx*4], eax
743
        mov     [page_tabs+ebx*8], eax
744
.nofirst:
744
.nofirst:
745
        mov     eax, [alloc_size]
745
        mov     eax, [alloc_size]
746
        add     eax, 0x1FFF
746
        add     eax, 0x1FFF
747
        and     eax, not 0xFFF
747
        and     eax, not 0xFFF
748
        mov     ebx, edx
748
        mov     ebx, edx
749
        add     edx, eax
749
        add     edx, eax
750
        shr     ebx, 12
750
        shr     ebx, 12
751
        or      al, USED_BLOCK
751
        or      al, USED_BLOCK
752
        mov     [page_tabs+ebx*4], eax
752
        mov     [page_tabs+ebx*8], eax
753
        shr     eax, 12
753
        shr     eax, 12
754
        dec     eax
754
        dec     eax
755
        jz      .second_nofill
755
        jz      .second_nofill
756
        inc     ebx
756
        inc     ebx
757
.fill:
757
.fill:
758
        mov     dword [page_tabs+ebx*4], 2
758
        mov     dword [page_tabs+ebx*8], 2
759
        inc     ebx
759
        inc     ebx
760
        dec     eax
760
        dec     eax
761
        jnz     .fill
761
        jnz     .fill
Line 762... Line 762...
762
 
762
 
763
.second_nofill:
763
.second_nofill:
764
        sub     ecx, edx
764
        sub     ecx, edx
765
        jz      .nothird
765
        jz      .nothird
766
        or      cl, FREE_BLOCK
766
        or      cl, FREE_BLOCK
Line 767... Line 767...
767
        mov     [page_tabs+ebx*4], ecx
767
        mov     [page_tabs+ebx*8], ecx
768
 
768
 
769
.nothird:
769
.nothird:
770
        mov     edx, [current_process]
770
        mov     edx, [current_process]
Line 799... Line 799...
799
        lea     ecx, [ebx+PROC.heap_lock]
799
        lea     ecx, [ebx+PROC.heap_lock]
800
        call    mutex_lock
800
        call    mutex_lock
Line 801... Line 801...
801
 
801
 
802
        xor     ebx, ebx
802
        xor     ebx, ebx
803
        shr     esi, 12
803
        shr     esi, 12
804
        mov     eax, [page_tabs+(esi-1)*4]
804
        mov     eax, [page_tabs+(esi-1)*8]
805
        test    al, USED_BLOCK
805
        test    al, USED_BLOCK
806
        jz      .cantfree
806
        jz      .cantfree
807
        test    al, DONT_FREE_BLOCK
807
        test    al, DONT_FREE_BLOCK
Line 808... Line 808...
808
        jnz     .cantfree
808
        jnz     .cantfree
809
 
809
 
810
        and     eax, not 4095
810
        and     eax, not 4095
811
        mov     ecx, eax
811
        mov     ecx, eax
812
        or      al, FREE_BLOCK
812
        or      al, FREE_BLOCK
813
        mov     [page_tabs+(esi-1)*4], eax
813
        mov     [page_tabs+(esi-1)*8], eax
814
        sub     ecx, 4096
814
        sub     ecx, 4096
815
        mov     ebx, ecx
815
        mov     ebx, ecx
816
        shr     ecx, 12
816
        shr     ecx, 12
817
        jz      .released
817
        jz      .released
818
.release:
818
.release:
819
        xor     eax, eax
819
        xor     eax, eax
820
        xchg    eax, [page_tabs+esi*4]
820
        xchg    eax, [page_tabs+esi*8]
821
        test    al, 1
821
        test    al, 1
822
        jz      @F
822
        jz      @F
823
        test    eax, PG_SHARED
823
        test    eax, PG_SHARED
Line 875... Line 875...
875
        mov     edx, [offset]           ; check offset
875
        mov     edx, [offset]           ; check offset
876
        add     edx, ebx                ; must be below 2Gb app limit
876
        add     edx, ebx                ; must be below 2Gb app limit
877
        js      .error
877
        js      .error
Line 878... Line 878...
878
 
878
 
879
        shr     ebx, 12                 ; chek block attributes
879
        shr     ebx, 12                 ; chek block attributes
880
        lea     ebx, [page_tabs+ebx*4]
880
        lea     ebx, [page_tabs+ebx*8]
881
        mov     eax, [ebx-4]            ; block attributes
881
        mov     eax, [ebx-4]            ; block attributes
882
        test    al, USED_BLOCK
882
        test    al, USED_BLOCK
883
        jz      .error
883
        jz      .error
884
        test    al, DONT_FREE_BLOCK
884
        test    al, DONT_FREE_BLOCK
Line 885... Line 885...
885
        jnz     .error
885
        jnz     .error
886
 
886
 
Line 887... Line 887...
887
        shr     edx, 12
887
        shr     edx, 12
888
        lea     edx, [page_tabs+edx*4]  ; unmap offset
888
        lea     edx, [page_tabs+edx*8]  ; unmap offset
889
 
889
 
Line 890... Line 890...
890
        mov     ecx, [size]
890
        mov     ecx, [size]
891
        add     ecx, 4095
891
        add     ecx, 4095
892
        shr     ecx, 12                 ; unmap size in pages
892
        shr     ecx, 12                 ; unmap size in pages
Line 893... Line 893...
893
 
893
 
894
        shr     eax, 12                 ; block size + 1 page
894
        shr     eax, 12                 ; block size + 1 page
Line 895... Line 895...
895
        lea     ebx, [ebx+eax*4-4]      ; block end ptr
895
        lea     ebx, [ebx+eax*8-8]      ; block end ptr
Line 912... Line 912...
912
                                        ; mark page as reserved
912
                                        ; mark page as reserved
913
        invlpg  [ebx]                   ; when we start using
913
        invlpg  [ebx]                   ; when we start using
914
        call    free_page               ; empty c-o-w page instead this ?
914
        call    free_page               ; empty c-o-w page instead this ?
915
@@:
915
@@:
916
        add     ebx, 4096
916
        add     ebx, 4096
917
        add     edx, 4
917
        add     edx, 8
918
        dec     ecx
918
        dec     ecx
919
        jnz     .unmap
919
        jnz     .unmap
Line 920... Line 920...
920
 
920
 
921
        pop     ebx
921
        pop     ebx
Line 933... Line 933...
933
; out: eax=0 <=> OK
933
; out: eax=0 <=> OK
934
; destroys: ebx,edx,esi,edi
934
; destroys: ebx,edx,esi,edi
935
        shr     esi, 12
935
        shr     esi, 12
936
        shr     edi, 12
936
        shr     edi, 12
937
@@:
937
@@:
938
        mov     eax, [page_tabs+esi*4]
938
        mov     eax, [page_tabs+esi*8]
939
        test    al, USED_BLOCK
939
        test    al, USED_BLOCK
940
        jz      .test_free
940
        jz      .test_free
941
        shr     eax, 12
941
        shr     eax, 12
942
        add     esi, eax
942
        add     esi, eax
943
        jmp     @B
943
        jmp     @B
Line 948... Line 948...
948
        shr     edx, 12
948
        shr     edx, 12
949
        add     edx, esi
949
        add     edx, esi
950
        cmp     edx, edi
950
        cmp     edx, edi
951
        jae     .exit
951
        jae     .exit
Line 952... Line 952...
952
 
952
 
953
        mov     ebx, [page_tabs+edx*4]
953
        mov     ebx, [page_tabs+edx*8]
954
        test    bl, USED_BLOCK
954
        test    bl, USED_BLOCK
Line 955... Line 955...
955
        jz      .next_free
955
        jz      .next_free
956
 
956
 
957
        shr     ebx, 12
957
        shr     ebx, 12
958
        add     edx, ebx
958
        add     edx, ebx
959
        mov     esi, edx
959
        mov     esi, edx
960
        jmp     @B
960
        jmp     @B
961
.next_free:
961
.next_free:
962
        test    bl, FREE_BLOCK
962
        test    bl, FREE_BLOCK
963
        jz      .err
963
        jz      .err
964
        and     dword [page_tabs+edx*4], 0
964
        and     dword [page_tabs+edx*8], 0
965
        add     eax, ebx
965
        add     eax, ebx
966
        and     eax, not 4095
966
        and     eax, not 4095
967
        or      eax, FREE_BLOCK
967
        or      eax, FREE_BLOCK
968
        mov     [page_tabs+esi*4], eax
968
        mov     [page_tabs+esi*8], eax
969
        jmp     @B
969
        jmp     @B
970
.exit:
970
.exit:
971
        xor     eax, eax
971
        xor     eax, eax
Line 993... Line 993...
993
        call    mutex_lock
993
        call    mutex_lock
994
        pop     eax
994
        pop     eax
Line 995... Line 995...
995
 
995
 
996
        lea     ecx, [eax - 0x1000]
996
        lea     ecx, [eax - 0x1000]
997
        shr     ecx, 12
997
        shr     ecx, 12
998
        mov     edx, [page_tabs+ecx*4]
998
        mov     edx, [page_tabs+ecx*8]
999
        test    dl, USED_BLOCK
999
        test    dl, USED_BLOCK
1000
        jnz     @f
1000
        jnz     @f
1001
; attempt to realloc invalid pointer
1001
; attempt to realloc invalid pointer
1002
.ret0:
1002
.ret0:
Line 1022... Line 1022...
1022
.loop:
1022
.loop:
1023
        cmp     edx, ebx
1023
        cmp     edx, ebx
1024
        jz      .release_done
1024
        jz      .release_done
1025
        dec     edx
1025
        dec     edx
1026
        xor     eax, eax
1026
        xor     eax, eax
1027
        xchg    eax, [page_tabs+edx*4]
1027
        xchg    eax, [page_tabs+edx*8]
1028
        test    al, 1
1028
        test    al, 1
1029
        jz      .loop
1029
        jz      .loop
1030
        call    free_page
1030
        call    free_page
1031
        mov     eax, edx
1031
        mov     eax, edx
1032
        shl     eax, 12
1032
        shl     eax, 12
Line 1034... Line 1034...
1034
        jmp     .loop
1034
        jmp     .loop
1035
.release_done:
1035
.release_done:
1036
        sub     ebx, ecx
1036
        sub     ebx, ecx
1037
        cmp     ebx, 1
1037
        cmp     ebx, 1
1038
        jnz     .nofreeall
1038
        jnz     .nofreeall
1039
        mov     eax, [page_tabs+ecx*4]
1039
        mov     eax, [page_tabs+ecx*8]
1040
        and     eax, not 0xFFF
1040
        and     eax, not 0xFFF
1041
        mov     edx, [current_process]
1041
        mov     edx, [current_process]
1042
        mov     ebx, [edx+PROC.mem_used]
1042
        mov     ebx, [edx+PROC.mem_used]
1043
        sub     ebx, eax
1043
        sub     ebx, eax
1044
        add     ebx, 0x1000
1044
        add     ebx, 0x1000
1045
        or      al, FREE_BLOCK
1045
        or      al, FREE_BLOCK
1046
        mov     [page_tabs+ecx*4], eax
1046
        mov     [page_tabs+ecx*8], eax
1047
        push    esi edi
1047
        push    esi edi
1048
        mov     esi, [edx+PROC.heap_base]
1048
        mov     esi, [edx+PROC.heap_base]
1049
        mov     edi, [edx+PROC.heap_top]
1049
        mov     edi, [edx+PROC.heap_top]
1050
        mov     [edx+PROC.mem_used], ebx
1050
        mov     [edx+PROC.mem_used], ebx
1051
        call    user_normalize
1051
        call    user_normalize
Line 1053... Line 1053...
1053
        jmp     .ret0   ; all freed
1053
        jmp     .ret0   ; all freed
1054
.nofreeall:
1054
.nofreeall:
1055
        sub     edx, ecx
1055
        sub     edx, ecx
1056
        shl     ebx, 12
1056
        shl     ebx, 12
1057
        or      ebx, USED_BLOCK
1057
        or      ebx, USED_BLOCK
1058
        xchg    [page_tabs+ecx*4], ebx
1058
        xchg    [page_tabs+ecx*8], ebx
1059
        shr     ebx, 12
1059
        shr     ebx, 12
1060
        sub     ebx, edx
1060
        sub     ebx, edx
1061
        push    ebx ecx edx
1061
        push    ebx ecx edx
1062
        mov     edx, [current_process]
1062
        mov     edx, [current_process]
1063
        shl     ebx, 12
1063
        shl     ebx, 12
Line 1077... Line 1077...
1077
        mov     esi, [esi+PROC.heap_top]
1077
        mov     esi, [esi+PROC.heap_top]
1078
        shr     esi, 12
1078
        shr     esi, 12
1079
@@:
1079
@@:
1080
        cmp     edx, esi
1080
        cmp     edx, esi
1081
        jae     .merge_done
1081
        jae     .merge_done
1082
        mov     eax, [page_tabs+edx*4]
1082
        mov     eax, [page_tabs+edx*8]
1083
        test    al, USED_BLOCK
1083
        test    al, USED_BLOCK
1084
        jnz     .merge_done
1084
        jnz     .merge_done
1085
        and     dword [page_tabs+edx*4], 0
1085
        and     dword [page_tabs+edx*8], 0
1086
        shr     eax, 12
1086
        shr     eax, 12
1087
        add     edx, eax
1087
        add     edx, eax
1088
        shl     eax, 12
1088
        shl     eax, 12
1089
        add     ebx, eax
1089
        add     ebx, eax
1090
        jmp     @b
1090
        jmp     @b
1091
.merge_done:
1091
.merge_done:
1092
        pop     esi
1092
        pop     esi
1093
        or      ebx, FREE_BLOCK
1093
        or      ebx, FREE_BLOCK
1094
        mov     [page_tabs+ecx*4], ebx
1094
        mov     [page_tabs+ecx*8], ebx
1095
.ret:
1095
.ret:
1096
        mov     ecx, [current_process]
1096
        mov     ecx, [current_process]
1097
        lea     ecx, [ecx+PROC.heap_lock]
1097
        lea     ecx, [ecx+PROC.heap_lock]
1098
        call    mutex_unlock
1098
        call    mutex_unlock
1099
        pop     eax edx ecx
1099
        pop     eax edx ecx
Line 1104... Line 1104...
1104
        mov     eax, [current_process]
1104
        mov     eax, [current_process]
1105
        mov     eax, [eax+PROC.heap_top]
1105
        mov     eax, [eax+PROC.heap_top]
1106
        shr     eax, 12
1106
        shr     eax, 12
1107
        cmp     edx, eax
1107
        cmp     edx, eax
1108
        jae     .cant_inplace
1108
        jae     .cant_inplace
1109
        mov     eax, [page_tabs+edx*4]
1109
        mov     eax, [page_tabs+edx*8]
1110
        test    al, FREE_BLOCK
1110
        test    al, FREE_BLOCK
1111
        jz      .cant_inplace
1111
        jz      .cant_inplace
1112
        shr     eax, 12
1112
        shr     eax, 12
1113
        add     eax, edx
1113
        add     eax, edx
1114
        sub     eax, ebx
1114
        sub     eax, ebx
1115
        jb      .cant_inplace
1115
        jb      .cant_inplace
1116
        jz      @f
1116
        jz      @f
1117
        shl     eax, 12
1117
        shl     eax, 12
1118
        or      al, FREE_BLOCK
1118
        or      al, FREE_BLOCK
1119
        mov     [page_tabs+ebx*4], eax
1119
        mov     [page_tabs+ebx*8], eax
1120
@@:
1120
@@:
1121
        mov     eax, ebx
1121
        mov     eax, ebx
1122
        sub     eax, ecx
1122
        sub     eax, ecx
1123
        shl     eax, 12
1123
        shl     eax, 12
1124
        or      al, USED_BLOCK
1124
        or      al, USED_BLOCK
1125
        mov     [page_tabs+ecx*4], eax
1125
        mov     [page_tabs+ecx*8], eax
1126
        lea     eax, [ecx+1]
1126
        lea     eax, [ecx+1]
1127
        shl     eax, 12
1127
        shl     eax, 12
1128
        push    eax
1128
        push    eax
1129
        push    edi
1129
        push    edi
1130
        lea     edi, [page_tabs+edx*4]
1130
        lea     edi, [page_tabs+edx*8]
1131
        mov     eax, 2
1131
        mov     eax, 2
1132
        sub     ebx, edx
1132
        sub     ebx, edx
1133
        mov     ecx, ebx
1133
        mov     ecx, ebx
1134
        cld
1134
        cld
1135
        rep stosd
1135
        rep stosd
Line 1153... Line 1153...
1153
        shr     edi, 12
1153
        shr     edi, 12
1154
        sub     ebx, ecx
1154
        sub     ebx, ecx
1155
.find_place:
1155
.find_place:
1156
        cmp     esi, edi
1156
        cmp     esi, edi
1157
        jae     .place_not_found
1157
        jae     .place_not_found
1158
        mov     eax, [page_tabs+esi*4]
1158
        mov     eax, [page_tabs+esi*8]
1159
        test    al, FREE_BLOCK
1159
        test    al, FREE_BLOCK
1160
        jz      .next_place
1160
        jz      .next_place
1161
        shr     eax, 12
1161
        shr     eax, 12
1162
        cmp     eax, ebx
1162
        cmp     eax, ebx
1163
        jae     .place_found
1163
        jae     .place_found
Line 1175... Line 1175...
1175
        jz      @f
1175
        jz      @f
1176
        push    esi
1176
        push    esi
1177
        add     esi, ebx
1177
        add     esi, ebx
1178
        shl     eax, 12
1178
        shl     eax, 12
1179
        or      al, FREE_BLOCK
1179
        or      al, FREE_BLOCK
1180
        mov     [page_tabs+esi*4], eax
1180
        mov     [page_tabs+esi*8], eax
1181
        pop     esi
1181
        pop     esi
1182
@@:
1182
@@:
1183
        mov     eax, ebx
1183
        mov     eax, ebx
1184
        shl     eax, 12
1184
        shl     eax, 12
1185
        or      al, USED_BLOCK
1185
        or      al, USED_BLOCK
1186
        mov     [page_tabs+esi*4], eax
1186
        mov     [page_tabs+esi*8], eax
1187
        inc     esi
1187
        inc     esi
1188
        mov     eax, esi
1188
        mov     eax, esi
1189
        shl     eax, 12
1189
        shl     eax, 12
1190
        push    eax
1190
        push    eax
1191
        mov     eax, [page_tabs+ecx*4]
1191
        mov     eax, [page_tabs+ecx*8]
1192
        and     eax, not 0xFFF
1192
        and     eax, not 0xFFF
1193
        or      al, FREE_BLOCK
1193
        or      al, FREE_BLOCK
1194
        sub     edx, ecx
1194
        sub     edx, ecx
1195
        mov     [page_tabs+ecx*4], eax
1195
        mov     [page_tabs+ecx*8], eax
1196
        inc     ecx
1196
        inc     ecx
1197
        dec     ebx
1197
        dec     ebx
1198
        dec     edx
1198
        dec     edx
1199
        jz      .no
1199
        jz      .no
1200
@@:
1200
@@:
1201
        xor     eax, eax
1201
        xor     eax, eax
1202
        xchg    eax, [page_tabs+ecx*4]
1202
        xchg    eax, [page_tabs+ecx*8]
1203
        mov     [page_tabs+esi*4], eax
1203
        mov     [page_tabs+esi*8], eax
1204
        mov     eax, ecx
1204
        mov     eax, ecx
1205
        shl     eax, 12
1205
        shl     eax, 12
1206
        invlpg  [eax]
1206
        invlpg  [eax]
1207
        inc     esi
1207
        inc     esi
1208
        inc     ecx
1208
        inc     ecx
Line 1214... Line 1214...
1214
        mov     edx, [current_process]
1214
        mov     edx, [current_process]
1215
        shl     ebx, 12
1215
        shl     ebx, 12
1216
        add     [edx+PROC.mem_used], ebx
1216
        add     [edx+PROC.mem_used], ebx
1217
        pop     ebx
1217
        pop     ebx
1218
@@:
1218
@@:
1219
        mov     dword [page_tabs+esi*4], 2
1219
        mov     dword [page_tabs+esi*8], 2
1220
        inc     esi
1220
        inc     esi
1221
        dec     ebx
1221
        dec     ebx
1222
        jnz     @b
1222
        jnz     @b
Line 1223... Line 1223...
1223
 
1223
 
Line 1439... Line 1439...
1439
 
1439
 
1440
        mov     ecx, [esi+SMEM.size]
1440
        mov     ecx, [esi+SMEM.size]
Line 1441... Line 1441...
1441
        mov     [size], ecx
1441
        mov     [size], ecx
1442
 
1442
 
Line 1443... Line 1443...
1443
        shr     ecx, 12
1443
        shr     ecx, 12
1444
        shr     eax, 10
1444
        shr     eax, 9
1445
 
1445
 
1446
        mov     esi, [esi+SMEM.base]
1446
        mov     esi, [esi+SMEM.base]
Line 1447... Line 1447...
1447
        shr     esi, 10
1447
        shr     esi, 9
1448
        lea     edi, [page_tabs+eax]
1448
        lea     edi, [page_tabs+eax]
Line 1455... Line 1455...
1455
@@:
1455
@@:
1456
        lodsd
1456
        lodsd
1457
        and     eax, 0xFFFFF000
1457
        and     eax, 0xFFFFF000
1458
        or      eax, edx
1458
        or      eax, edx
1459
        stosd
1459
        stosd
-
 
1460
        movsd
1460
        loop    @B
1461
        loop    @B
Line 1461... Line 1462...
1461
 
1462
 
Line 1462... Line 1463...
1462
        xor     edx, edx
1463
        xor     edx, edx