Subversion Repositories Kolibri OS

Compare Revisions

No changes between revisions

Regard whitespace Rev 864 → Rev 863

/kernel/branches/kolibri_pe/boot/boot.asm
4,7 → 4,7
 
include '../macros.inc'
 
$Revision$
$Revision: 849 $
 
__REV__ = __REV
 
Property changes:
Deleted: svn:keywords
-Revision
\ No newline at end of property
/kernel/branches/kolibri_pe/kernel.asm
141,8 → 141,6
extrn _init
extrn _init_mm
 
extrn @core_alloc@4
 
extrn @init_heap@8
extrn @find_large_md@4
extrn @find_small_md@4
149,19 → 147,18
extrn @phis_alloc@4
extrn @mem_alloc@8
 
extrn @heap_alloc@8
extrn _alloc_kernel_space@4
 
extrn _slab_cache_init
extrn _alloc_pages
extrn _alloc_page
 
extrn _get_free_mem
 
alloc_kernel_space equ _alloc_kernel_space@4
 
extrn _bx_from_load
 
 
@mem_alloc@8 equ @heap_alloc@8
 
 
section '.flat' code readable align 4096
 
use32
558,9 → 555,7
call init_fpu
call init_malloc
 
mov ecx, 0x51000
xor edx, edx
call @mem_alloc@8
stdcall alloc_kernel_space, 0x51000
mov [default_io_map], eax
 
add eax, 0x2000
616,10 → 611,8
mov [BgrDrawMode],eax
mov [BgrDataWidth],eax
mov [BgrDataHeight],eax
mov ecx, 4095
mov edx, PG_SW
mov [mem_BACKGROUND],4095
call @mem_alloc@8
stdcall kernel_alloc, [mem_BACKGROUND]
mov [img_background], eax
 
mov [SLOT_BASE + 256 + APPDATA.dir_table], _sys_pdbr + (0x100000000-OS_BASE)
2297,11 → 2290,10
@@:
mov eax,[BgrDataWidth]
imul eax,[BgrDataHeight]
lea ecx,[eax*3]
mov [mem_BACKGROUND],ecx
lea eax,[eax*3]
mov [mem_BACKGROUND],eax
; get memory for new background
mov edx, PG_SW
stdcall @mem_alloc@8
stdcall kernel_alloc, eax
test eax, eax
jz .exit_mem
mov [img_background], eax
/kernel/branches/kolibri_pe/core/heap.c
335,7 → 335,10
return NULL;
};
 
void * __fastcall heap_alloc(size_t size, u32_t flags)
void* __stdcall alloc_kernel_space(size_t size); //__asm__("alloc_kernel_space");
 
 
void* __stdcall alloc_kernel_space(size_t size)
{
md_t *md;
 
343,36 → 346,16
 
md = find_small_md(size);
 
DBG("alloc_kernel_space: %x size %x\n\n",md->base, size);
 
if( md )
{
if( flags & PG_MAP )
{
count_t tmp = size >> 12;
addr_t *pte = &((addr_t*)page_tabs)[md->base>>12];
 
while(tmp)
{
u32_t order;
addr_t frame;
size_t size;
 
asm volatile ("bsr %0, %1":"=&r"(order):"r"(tmp):"cc");
asm volatile ("btr %0, %1" :"=r"(tmp):"r"(order):"cc");
 
frame = core_alloc(order) | flags;
 
size = (1 << order);
while(size--)
{
*pte++ = frame;
frame+= 4096;
};
};
};
DBG("alloc_heap: %x size %x\n\n",md->base, size);
return (void*)md->base;
};
return NULL;
};
}
 
 
//void* __stdcall kernel_alloc(size_t size)
//{
//
// return NULL;
//}
//*/
/kernel/branches/kolibri_pe/core/memory.inc
37,37 → 37,42
 
proc map_io_mem stdcall, base:dword, size:dword, flags:dword
 
push ebx
push edi
 
mov ecx, [size]
add ecx, 4095
and ecx, -4096
mov [size], ecx
xor edx, edx
call @mem_alloc@8
mov eax, [size]
add eax, 4095
and eax, -4096
mov [size], eax
stdcall alloc_kernel_space, eax
test eax, eax
jz .fail
push eax
 
mov edx, eax
mov edi, eax
shr edi, 10
add edi, page_tabs
 
mov edi, 0x1000
mov ebx, eax
mov ecx, [size]
mov edx, [base]
shr eax, 12
shr ecx, 12
mov eax, [base]
and eax, -4096
or eax, [flags]
and edx, -4096
or edx, [flags]
@@:
stosd
add eax, 0x1000
mov [page_tabs+eax*4], edx
; push eax
; invlpg [ebx]
; pop eax
inc eax
add ebx, edi
add edx, edi
loop @B
 
mov eax, [base]
and eax, 4095
pop eax
mov edx, [base]
and edx, 4095
add eax, edx
.fail:
pop edi
pop ebx
ret
endp
 
189,9 → 194,8
cmp dword [LFBAddress], -1
jne @f
mov [BOOT_VAR+0x901c],byte 2
mov ecx, 0x280000
mov edx, PG_SW
call @mem_alloc@8
stdcall _alloc_pages, 0x280000 shr 12
add eax, OS_BASE
mov [LFBAddress], eax
ret
@@:
473,8 → 477,7
test edx, PG_MAP
jnz @F
 
xor ecx, ecx
call @core_alloc@4
call _alloc_page
test eax, eax
jz .fail
 
786,12 → 789,11
mov ecx, [ipc_tmp]
cmp esi, 0x40000-0x1000 ; size of [ipc_tmp] minus one page
jbe @f
push eax
lea ecx, [esi+0x1000]
xor edx, edx
call @mem_alloc@8
push eax esi edi
add esi,0x1000
stdcall alloc_kernel_space,esi
mov ecx, eax
pop eax
pop edi esi eax
@@:
mov [used_buf], ecx
stdcall map_mem, ecx, [SLOT_BASE+eax+0xB8],\
818,6 → 820,7
mov [edi+4], ecx
add edi, 8
mov esi, [msg_addr]
; add esi, new_app_base
cld
rep movsb
 
1151,50 → 1154,54
buf_ptr dd ?
endl
 
mov ecx, [size]
test ecx, 4095
jnz .fail
mov eax, [size]
test eax, eax
jz .fail
 
add ecx, ecx
xor edx, edx
call @mem_alloc@8
add eax, eax
stdcall alloc_kernel_space, eax
test eax, eax
mov [buf_ptr], eax
jz .fail
 
push ebx
 
xor ecx, ecx
mov edx, [size]
shr edx, 12
mov ebx, edx
dec edx
bsr ecx, edx
inc ecx
mov [buf_ptr], eax
 
call @core_alloc@4
mov ebx, [size]
shr ebx, 12
push ebx
 
stdcall _alloc_pages, ebx
pop ecx
 
test eax, eax
jz .mm_fail
 
push edi
 
or eax, [flags]
mov edx, [buf_ptr]
lea ecx, [ebx*4]
shr edx, 10
mov edi, [buf_ptr]
mov ebx, [buf_ptr]
mov edx, ecx
shl edx, 2
shr edi, 10
@@:
mov [page_tabs+edx], eax
mov [page_tabs+edx+ecx], eax
mov [page_tabs+edi], eax
mov [page_tabs+edi+edx], eax
add eax, 0x1000
add edx, 4
dec ebx
add ebx, 0x1000
add edi, 4
dec ecx
jnz @B
 
mov eax, [buf_ptr]
pop edi
pop ebx
ret
.mm_fail:
;stdcall free_kernel_space, [buf_ptr]
stdcall free_kernel_space, [buf_ptr]
xor eax, eax
pop ebx
xor eax, eax
.fail:
ret
endp
/kernel/branches/kolibri_pe/core/mm.c
559,7 → 559,7
v = zone_frame_alloc(&z_core, order);
spinlock_unlock(&z_core.lock);
safe_sti(efl);
DBG("core alloc: %x, size %x\n", v << FRAME_WIDTH, (1<<order)<<12);
 
return (v << FRAME_WIDTH);
};
 
593,6 → 593,29
return (v << FRAME_WIDTH);
};
 
addr_t __stdcall alloc_pages(count_t count) //obsolete
{
eflags_t efl;
u32_t edx;
pfn_t v;
 
count = (count+7)&~7;
 
edx = save_edx();
efl = safe_cli();
spinlock_lock(&z_core.lock);
v = zone_frame_alloc(&z_core, to_order(count));
spinlock_unlock(&z_core.lock);
safe_sti(efl);
 
DBG("alloc_pages: %x count %x\n", v << FRAME_WIDTH, count);
 
restore_edx(edx);
 
return (v << FRAME_WIDTH);
};
 
 
void __fastcall zone_free(zone_t *zone, pfn_t frame_idx)
{
frame_t *frame;
/kernel/branches/kolibri_pe/core/malloc.inc
983,9 → 983,7
align 4
init_malloc:
 
mov ecx, 6
call @core_alloc@4
add eax, OS_BASE
stdcall kernel_alloc, 0x40000
 
mov [mst.top], eax
mov [mst.topsize], 256*1024
/kernel/branches/kolibri_pe/core/taskman.inc
955,8 → 955,7
pl0_stack dd ?
endl
 
mov ecx, 1 ;(RING0_STACK_SIZE+512) shr 12
call @core_alloc@4
stdcall _alloc_pages, (RING0_STACK_SIZE+512) shr 12
add eax, OS_BASE
mov [pl0_stack], eax
 
/kernel/branches/kolibri_pe/core/heap.inc
45,7 → 45,81
ret
endp
 
align 4
proc kernel_alloc stdcall, size:dword
locals
lin_addr dd ?
pages_count dd ?
endl
 
push ebx
push edi
 
mov eax, [size]
add eax, 4095
and eax, not 4095;
mov [size], eax
test eax, eax
jz .err
 
mov ebx, eax
shr ebx, 12
mov [pages_count], ebx
 
stdcall alloc_kernel_space, eax
test eax, eax
jz .err
mov [lin_addr], eax
 
mov ecx, [pages_count]
mov edx, eax
mov ebx, ecx
 
shr ecx, 3
jz .next
 
and ebx, not 7
push ebx
stdcall _alloc_pages, ebx
pop ecx ; yes ecx!!!
test eax, eax
jz .err
 
mov edi, eax
mov edx, [lin_addr]
@@:
stdcall map_page,edx,edi,dword PG_SW
add edx, 0x1000
add edi, 0x1000
dec ecx
jnz @B
.next:
mov ecx, [pages_count]
and ecx, 7
jz .end
@@:
push ecx
call _alloc_page
pop ecx
test eax, eax
jz .err
 
stdcall map_page,edx,eax,dword PG_SW
add edx, 0x1000
dec ecx
jnz @B
.end:
mov eax, [lin_addr]
pop edi
pop ebx
ret
.err:
xor eax, eax
pop edi
pop ebx
ret
endp
 
align 4
proc kernel_free stdcall, base:dword
 
/kernel/branches/kolibri_pe/core/v86.inc
49,11 → 49,10
; first half (0x800 bytes) is page table for addresses 0 - 0x100000,
; second half is for V86-to-linear translation.
; Third and fourth are for I/O permission map.
mov ecx, 2
call @core_alloc@4
push 8000h ; blocks less than 8 pages are discontinuous
call kernel_alloc
test eax, eax
jz .fail2
add eax, OS_BASE
mov [ebx+V86_machine.pagedir], eax
push edi eax
mov edi, eax
/kernel/branches/kolibri_pe/core/exports.inc
31,6 → 31,7
szPciWrite32 db 'PciWrite32',0
 
szAllocPage db 'AllocPage',0
szAllocPages db 'AllocPages',0
szFreePage db 'FreePage',0
szGetPgAddr db 'GetPgAddr',0
szMapPage db 'MapPage',0
41,7 → 42,7
 
szAllocKernelSpace db 'AllocKernelSpace',0
szFreeKernelSpace db 'FreeKernelSpace',0
szHeapAlloc db 'HeapAlloc',0
szKernelAlloc db 'KernelAlloc',0
szKernelFree db 'KernelFree',0
szUserAlloc db 'UserAlloc',0
szUserFree db 'UserFree',0
103,6 → 104,7
dd szPciWrite32 , pci_write32
 
dd szAllocPage , _alloc_page ;stdcall
dd szAllocPages , _alloc_pages ;stdcall
dd szFreePage , free_page
dd szMapPage , map_page ;stdcall
dd szMapSpace , map_space
111,8 → 113,9
dd szCommitPages , commit_pages ;not implemented
dd szReleasePages , release_pages
 
dd szAllocKernelSpace, alloc_kernel_space ;stdcall
dd szFreeKernelSpace , free_kernel_space ;stdcall
dd szHeapAlloc , @heap_alloc@8 ;fastcall
dd szKernelAlloc , kernel_alloc ;stdcall
dd szKernelFree , kernel_free ;stdcall
dd szUserAlloc , user_alloc ;stdcall
dd szUserFree , user_free ;stdcall
/kernel/branches/kolibri_pe/core/dll.inc
585,15 → 585,12
test eax, eax
jnz .fail
 
mov ecx, [file_size]
cmp ecx, 1024*1024*16
mov eax, [file_size]
cmp eax, 1024*1024*16
ja .fail
 
mov edx, PG_SW
call @mem_alloc@8
stdcall kernel_alloc, [file_size]
mov [file], eax
test eax, eax
jz .fail
 
stdcall read_file, [file_name], eax, dword 0, [file_size]
cmp ebx, [file_size]
602,11 → 599,10
mov eax, [file]
cmp dword [eax], 0x4B43504B
jne .exit
mov ebx, [eax+4]
mov [file_size], ebx
stdcall kernel_alloc, ebx
 
mov ecx, [eax+4]
mov [file_size], ecx
mov edx, PG_SW
call @mem_alloc@8
test eax, eax
jz .cleanup
 
828,20 → 824,20
 
mov [coff], eax
 
movzx ebx, [eax+CFH.nSections]
movzx ecx, [eax+CFH.nSections]
xor ebx, ebx
 
lea edx, [eax+20]
xor ecx, ecx
@@:
add ecx, [edx+CFS.SizeOfRawData]
add ecx, 15
and ecx, not 15
add ebx, [edx+CFS.SizeOfRawData]
add ebx, 15
and ebx, not 15
add edx, COFF_SECTION_SIZE
dec ebx
dec ecx
jnz @B
mov [img_size], ebx
 
mov [img_size], ecx
mov edx, PG_SW
call @mem_alloc@8
stdcall kernel_alloc, ebx
test eax, eax
jz .fail
mov [img_base], eax
/kernel/branches/kolibri_pe/core/peload.inc
24,14 → 24,14
 
mov [image], eax
 
mov ebx, [eax+60]
mov ecx, [eax+80+edx]
mov edx, PG_SW
call @mem_alloc@8
mov edx, [eax+60]
 
stdcall kernel_alloc, [eax+80+edx]
test eax, eax
mov [base], eax
jz .cleanup
 
mov [base], eax
 
stdcall map_PE, eax, [image]
 
mov [entry], eax
279,11 → 279,13
align 16
__exports:
export 'KERNEL', \
alloc_kernel_space, 'AllocKernelSpace', \ ; stdcall
commit_pages, 'CommitPages', \ ; eax, ebx, ecx
create_kernel_object, 'CreateObject', \
create_ring_buffer, 'CreateRingBuffer', \ ; stdcall
destroy_kernel_object, 'DestroyObject', \
free_kernel_space, 'FreeKernelSpace', \ ; stdcall
kernel_alloc, 'KernelAlloc', \ ; stdcall
kernel_free, 'KernelFree', \ ; stdcall
malloc, 'Kmalloc', \
free, 'Kfree', \
/kernel/branches/kolibri_pe/include/mm.h
29,18 → 29,14
}phismem_t;
 
 
#define PG_MAP 1
# define PA2KA(x) (((addr_t) (x)) + OS_BASE)
# define KA2PA(x) (((addr_t) (x)) - OS_BASE)
 
 
#define PAGE_SIZE 4096
#define FRAME_WIDTH 12
 
#define BUDDY_SYSTEM_INNER_BLOCK 0xff
 
 
# define PA2KA(x) (((addr_t) (x)) + OS_BASE)
# define KA2PA(x) (((addr_t) (x)) - OS_BASE)
 
static inline count_t SIZE2FRAMES(size_t size)
{
if (!size)
70,5 → 66,3
 
void __fastcall frame_set_parent(pfn_t pfn, void *data);
void* __fastcall frame_get_parent(pfn_t pfn);
 
void* __fastcall heap_alloc(size_t size, u32_t flags) ;
/kernel/branches/kolibri_pe/makefile
11,20 → 11,13
 
KERNEL_SRC:= \
kernel.asm \
data32.inc \
core/memory.inc \
core/heap.inc \
core/malloc.inc \
core/taskman.inc \
core/v86.inc \
core/sys32.inc \
core/dll.inc \
core/exports.inc \
fs/ntfs.inc \
gui/event.inc \
video/cursors.inc
data32.inc
 
 
PE_SRC:= \
init.c \
mm.c \
/kernel/branches/kolibri_pe/drivers/infinity.asm
81,9 → 81,7
jz .fail
mov [hSound], eax
 
mov ecx, 16*512
mov edx, PG_SW
call HeapAlloc
stdcall KernelAlloc, 16*512
test eax, eax
jz .out_of_mem
mov [mix_buff], eax
327,6 → 325,7
locals
str dd ?
ring_size dd ?
ring_pages dd ?
endl
 
mov eax, [format]
403,6 → 402,8
.waveout:
mov [ring_size], ebx
mov eax, ebx
shr ebx, 12
mov [ring_pages], ebx
 
stdcall CreateRingBuffer, eax, PG_SW
 
425,8 → 426,7
mov ecx, [size]
add ecx, 128 ;resampler required
mov [eax+STREAM.in_size], ecx
mov edx, PG_SW
call HeapAlloc
stdcall KernelAlloc, ecx
 
mov edi, [str]
mov [edi+STREAM.in_base], eax
440,7 → 440,7
mov [edi+STREAM.in_top], eax
 
.out_buff:
stdcall CreateRingBuffer, 64*1024, PG_SW
stdcall AllocKernelSpace, dword 128*1024
 
mov edi, [str]
mov [edi+STREAM.out_base], eax
450,6 → 450,21
add eax, 64*1024
mov [edi+STREAM.out_top], eax
 
stdcall AllocPages, dword 64/4
mov edi, [str]
mov ebx, [edi+STREAM.out_base]
mov ecx, 16
or eax, PG_SW
push eax
push ebx
call CommitPages ;eax, ebx, ecx
mov ecx, 16
pop ebx
pop eax
add ebx, 64*1024
call CommitPages ;double mapped
 
mov edi, [str]
mov ecx, [edi+STREAM.in_top]
mov edi, [edi+STREAM.in_base]
sub ecx, edi
/kernel/branches/kolibri_pe/drivers/imports.inc
36,6 → 36,7
PciWrite32,\
\
AllocPage,\
AllocPages,\
FreePage,\
MapPage,\
MapSpace,\
44,8 → 45,9
CommitPages,\
ReleasePages,\
\
AllocKernelSpace,\
FreeKernelSpace,\
HeapAlloc,\
KernelAlloc,\
KernelFree,\
UserAlloc,\
UserFree,\
/kernel/branches/kolibri_pe/drivers/sis.asm
32,8 → 32,6
 
CPU_FREQ equ 2600d
 
PG_SW equ 0x003
 
BIT0 EQU 0x00000001
BIT1 EQU 0x00000002
BIT2 EQU 0x00000004
509,9 → 507,7
align 4
proc create_primary_buff
 
mov ecx, 0x10000
mov edx, PG_SW
call HeapAlloc
stdcall KernelAlloc, 0x10000
mov [ctrl.buffer], eax
 
mov edi, eax
/kernel/branches/kolibri_pe/drivers/sound.asm
32,8 → 32,6
 
CPU_FREQ equ 2600d
 
PG_SW equ 0x003
 
BIT0 EQU 0x00000001
BIT1 EQU 0x00000002
BIT2 EQU 0x00000004
531,9 → 529,7
align 4
proc create_primary_buff
 
mov ecx, 0x10000
mov edx, PG_SW
call HeapAlloc
stdcall KernelAlloc, 0x10000
mov [ctrl.buffer], eax
 
mov edi, eax
/kernel/branches/kolibri_pe/gui/event.inc
10,11 → 10,7
 
align 4
init_events:
 
mov ecx, 512*EVENT_SIZE
mov edx, PG_SW
call @mem_alloc@8
 
stdcall kernel_alloc, 512*EVENT_SIZE
mov [events], eax
xor eax, eax
mov [event_uid], eax
/kernel/branches/kolibri_pe/video/cursors.inc
313,14 → 313,13
mov [eax+CURSOR.hot_x], ebx
mov [eax+CURSOR.hot_y], ebx
 
mov edi, eax
mov ecx, 0x1000
mov edx, PG_SW
call @mem_alloc@8
stdcall kernel_alloc, 0x1000
test eax, eax
mov [edi+CURSOR.base], eax
jz .fail
 
mov edi, [.hcursor]
mov [edi+CURSOR.base], eax
 
mov esi, [.src]
mov ebx, [.flags]
cmp bx, LOAD_INDIRECT
/kernel/branches/kolibri_pe/detect/getcache.inc
91,9 → 91,7
and [esi+cache_ide0_search_start-cache_ide0],0
and [esi+cache_ide0_appl_search_start-cache_ide0],0
push ecx
mov ecx, [esi+cache_ide0_size-cache_ide0]
mov edx, PG_SW
call @mem_alloc@8
stdcall kernel_alloc,[esi+cache_ide0_size-cache_ide0]
mov [esi+cache_ide0_pointer-cache_ide0],eax
pop ecx
mov edx,eax
/kernel/branches/kolibri_pe/fs/parse_fn.inc
84,10 → 84,7
endp
 
proc load_file_parse_table
 
xor eac, ecx
call @core_alloc@4
add eax, OS_BASE
stdcall kernel_alloc,0x1000
mov [tmp_file_name_table],eax
mov edi,eax
mov esi,sysdir_name
/kernel/branches/kolibri_pe/fs/ntfs.inc
133,15 → 133,14
mov eax, 1
shl eax, cl
.4:
mov ecx, [ntfs_data.frs_size]
mov [ntfs_data.iab_size], eax
; allocate space for buffers
add ecx, eax
mov edx, PG_SW
call @mem_alloc@8
add eax, [ntfs_data.frs_size]
push eax
call kernel_alloc
test eax, eax
jz problem_fat_dec_count
mov [ntfs_data.frs_buffer], eax
jz problem_fat_dec_count
add eax, [ntfs_data.frs_size]
mov [ntfs_data.iab_buffer], eax
; read $MFT disposition
178,9 → 177,10
.mftok:
; read $MFT table retrieval information
; start with one page, increase if not enough (when MFT too fragmented)
mov ecx, 0x1000
mov edx, PG_SW
call @mem_alloc@8
push ebx
push 0x1000
call kernel_alloc
pop ebx
test eax, eax
jz .fail_free_frs
mov [ntfs_data.mft_retrieval], eax
225,12 → 225,11
; if they will be needed, they will be loaded later
 
mov [ntfs_data.cur_index_size], 0x1000/0x200
mov ecx, 0x1000
mov edx, PG_SW
call @mem_alloc@8
push 0x1000
call kernel_alloc
test eax, eax
jz .fail_free_mft
mov [ntfs_data.cur_index_buf], eax
jz .fail_free_mft
 
popad
call free_hd_channel
242,12 → 241,11
mov eax, [ntfs_data.mft_retrieval_size]
cmp eax, [ntfs_data.mft_retrieval_alloc]
jnz .ok
 
lea ecx, [eax+0x1000/8]
mov [ntfs_data.mft_retrieval_alloc], ecx
shl ecx, 3
mov edx, PG_SW
call @mem_alloc@8
add eax, 0x1000/8
mov [ntfs_data.mft_retrieval_alloc], eax
shl eax, 3
push eax
call kernel_alloc
test eax, eax
jnz @f
popad
982,10 → 980,10
push eax
push [ntfs_data.cur_index_buf]
call kernel_free
pop ecx
mov [ntfs_data.cur_index_size], ecx
mov edx, PG_SW
call @mem_alloc@8
pop eax
mov [ntfs_data.cur_index_size], eax
push eax
call kernel_alloc
test eax, eax
jnz @f
and [ntfs_data.cur_index_size], 0
1000,13 → 998,12
shr ebp, 9
cmp ebp, [ntfs_data.cur_index_size]
jbe .ok2
 
mov ecx, ebp
mov edx, PG_SW
call @mem_alloc@8
push esi ebp
push ebp
call kernel_alloc
pop ebp esi
test eax, eax
jz .stc_ret
 
mov edi, eax
mov ecx, [ntfs_data.cur_index_size]
shl ecx, 9-2
1329,10 → 1326,10
push eax
push [ntfs_data.cur_index_buf]
call kernel_free
pop ecx
mov [ntfs_data.cur_index_size], ecx
mov edx, PG_SW
call @mem_alloc@8
pop eax
mov [ntfs_data.cur_index_size], eax
push eax
call kernel_alloc
test eax, eax
jnz @f
and [ntfs_data.cur_index_size], 0
1352,13 → 1349,12
shr ebp, 9
cmp ebp, [ntfs_data.cur_index_size]
jbe .ok2
 
mov ecx, ebp
mov edx, PG_SW
call @mem_alloc@8
push esi ebp
push ebp
call kernel_alloc
pop ebp esi
test eax, eax
jz .nomem
 
mov edi, eax
mov ecx, [ntfs_data.cur_index_size]
shl ecx, 9-2