Merge branch 'master' into x86_64

This commit is contained in:
Alex Smith
2012-07-03 08:46:52 +01:00
4 changed files with 23 additions and 11 deletions
+2
View File
@@ -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)
+2
View File
@@ -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)
+3
View File
@@ -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)
+16 -11
View File
@@ -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)