Merge branch 'master' into x86_64
This commit is contained in:
@@ -161,6 +161,8 @@ arch_cpu_user_TLB_invalidate(void)
|
||||
}
|
||||
|
||||
|
||||
// TODO: all functions that use fault handlers need to be implemented
|
||||
// in assembly due to problems passing in label addresses in gcc4.
|
||||
status_t
|
||||
arch_cpu_user_memcpy(void *to, const void *from, size_t size,
|
||||
addr_t *faultHandler)
|
||||
|
||||
@@ -171,6 +171,8 @@ arch_cpu_user_TLB_invalidate(void)
|
||||
}
|
||||
|
||||
|
||||
// TODO: all functions that use fault handlers need to be implemented
|
||||
// in assembly due to problems passing in label addresses in gcc4.
|
||||
status_t
|
||||
arch_cpu_user_memcpy(void *to, const void *from, size_t size,
|
||||
addr_t *faultHandler)
|
||||
|
||||
@@ -172,6 +172,9 @@ arch_cpu_user_TLB_invalidate(void)
|
||||
}
|
||||
|
||||
|
||||
// TODO: all functions that use fault handlers need to be implemented
|
||||
// in assembly due to problems passing in label addresses in gcc4.
|
||||
|
||||
status_t
|
||||
arch_cpu_user_memcpy(void *to, const void *from, size_t size,
|
||||
addr_t *faultHandler)
|
||||
|
||||
@@ -276,32 +276,37 @@ FUNCTION(arch_cpu_user_strlcpy):
|
||||
/* Copy at most count - 1 bytes */
|
||||
dec %ecx
|
||||
|
||||
/* move data by bytes */
|
||||
/* If count is now 0, skip straight to null terminating
|
||||
as our loop will otherwise overflow */
|
||||
jnz .L_user_strlcpy_copy_begin
|
||||
movb $0,(%edi)
|
||||
jmp .L_user_strlcpy_source_count
|
||||
|
||||
.L_user_strlcpy_copy_begin:
|
||||
cld
|
||||
repnz
|
||||
movsb
|
||||
.L_user_strlcpy_copy_loop:
|
||||
/* move data by bytes */
|
||||
lodsb
|
||||
stosb
|
||||
test %al,%al
|
||||
jz .L_user_strlcpy_source_done
|
||||
loop .L_user_strlcpy_copy_loop
|
||||
|
||||
/* null terminate string */
|
||||
movb $0,(%edi)
|
||||
dec %esi
|
||||
|
||||
/* check if we copied the entire source string */
|
||||
cmp $0,%ecx
|
||||
jne .L_user_strlcpy_source_done
|
||||
|
||||
/* count remaining bytes in src */
|
||||
.L_user_strlcpy_source_count:
|
||||
not %ecx
|
||||
movb $0,%al
|
||||
xor %al,%al
|
||||
repnz
|
||||
scasb
|
||||
|
||||
.L_user_strlcpy_source_done:
|
||||
|
||||
movl %esi,%eax
|
||||
subl 20(%esp),%eax
|
||||
subl $1,%eax
|
||||
|
||||
dec %eax
|
||||
/* restore the old fault handler */
|
||||
movl %ebx,(%edx)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user