Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 9822 → Rev 9823

/kernel/trunk/core/dll.inc
287,10 → 287,10
proc get_coff_sym stdcall, pSym:dword,count:dword, sz_sym:dword
 
@@:
stdcall strncmp, [pSym], [sz_sym], 8
stdcall strncmp, [pSym], [sz_sym], sizeof.COFF_SYM.Name
test eax, eax
jz .ok
add [pSym], 18
add [pSym], sizeof.COFF_SYM
dec [count]
jnz @b
xor eax, eax
297,7 → 297,7
ret
.ok:
mov eax, [pSym]
mov eax, [eax+8]
mov eax, [eax+COFF_SYM.Value]
ret
endp
 
964,7 → 964,7
movzx ecx, [edx + COFF_HEADER.nSections]
xor ebx, ebx
 
add edx, 20
add edx, sizeof.COFF_HEADER
@@:
call coff_get_align
add ebx, eax
1045,7 → 1045,7
movzx ecx, [edx + COFF_HEADER.nSections]
lea ecx, [ecx*5]
lea edi, [edi + ecx*8+20]
add edx, 20
add edx, sizeof.COFF_HEADER
@@:
movzx eax, [edx + COFF_SECTION.NumReloc]
lea eax, [eax*5]
1097,7 → 1097,7
; fixup symbols
mov edx, ebx
mov eax, [ebx + COFF_HEADER.nSymbols]
add edx, 20
add edx, sizeof.COFF_HEADER
mov ecx, [esi + DLLDESCR.symbols_num]
lea ecx, [ecx*9]
add ecx, ecx
1184,7 → 1184,7
shr ecx, 12
.map_pages_loop:
mov eax, [page_tabs + ecx*4]
and eax, not 0xFFF
and eax, -PAGE_SIZE
or al, PG_UR
xchg eax, [page_tabs + edx*4]
test al, 1
1194,7 → 1194,7
invlpg [ebx+edi]
inc ecx
inc edx
add edi, 0x1000
add edi, PAGE_SIZE
cmp edi, [esi + DLLDESCR.size]
jb .map_pages_loop
 
/kernel/trunk/core/memory.inc
1141,8 → 1141,8
.18:
mov eax, edx
.19:
cmp ecx, OS_BASE
jae .fail
stdcall is_string_userspace, ecx
jnz .fail
stdcall load_library, ecx, eax
mov [esp + SYSCALL_STACK._eax], eax
ret
/kernel/trunk/kernel.asm
4820,6 → 4820,30
ret
endp
 
align 4
; @brief Check whether given string lays in userspace memory, i.e. below OS_BASE
; @param base Base address of string
; @return ZF = 1 if string in userspace memory,
; zf = 0 otherwise
proc is_string_userspace stdcall, base:dword
push eax ecx edi
xor eax, eax
mov edi, [base]
 
mov ecx, OS_BASE-1
sub ecx, edi
jb .done ; zf
inc ecx
cmp ecx, 0x10000 ; don't allow strings larger than 64k?
jbe @f
mov ecx, 0x10000
@@:
repnz scasb
.done:
pop edi ecx eax
ret
endp
 
if ~ lang eq sp
diff16 "end of .text segment",0,$
end if