[haiku-commits] haiku: hrev44284 - src/system/kernel/arch/x86

  • From: anevilyak@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 3 Jul 2012 01:42:44 +0200 (CEST)

hrev44284 adds 1 changeset to branch 'master'
old head: dc5a16bb70c95c64b1203682acf5a67e19b2b882
new head: 29291c8c924ada62bf015aaf70d04616cc2e7314

----------------------------------------------------------------------------

29291c8: Cleanups/optimizations.

                                      [ Rene Gollent <anevilyak@xxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev44284
Commit:      29291c8c924ada62bf015aaf70d04616cc2e7314
URL:         http://cgit.haiku-os.org/haiku/commit/?id=29291c8
Author:      Rene Gollent <anevilyak@xxxxxxxxx>
Date:        Mon Jul  2 23:42:20 2012 UTC

----------------------------------------------------------------------------

1 file changed, 6 insertions(+), 13 deletions(-)
src/system/kernel/arch/x86/arch_x86.S |   19 ++++++-------------

----------------------------------------------------------------------------

diff --git a/src/system/kernel/arch/x86/arch_x86.S 
b/src/system/kernel/arch/x86/arch_x86.S
index f731299..d5c5150 100644
--- a/src/system/kernel/arch/x86/arch_x86.S
+++ b/src/system/kernel/arch/x86/arch_x86.S
@@ -278,9 +278,8 @@ FUNCTION(arch_cpu_user_strlcpy):
 
        /* If count is now 0, skip straight to null terminating
           as our loop will otherwise overflow */
-       cmp             $0,%ecx
-       jne             .L_user_strlcpy_copy_begin
-       movb            $0,(%edi)
+       jnz             .L_user_strlcpy_copy_begin
+       movb    $0,(%edi)
        jmp             .L_user_strlcpy_source_count
 
 .L_user_strlcpy_copy_begin:
@@ -289,30 +288,24 @@ FUNCTION(arch_cpu_user_strlcpy):
        /* move data by bytes */
        movsb
        cmpb $0,-1(%esi)
-       je .L_user_strlcpy_copy_loop_done
+       je .L_user_strlcpy_source_done
        loop .L_user_strlcpy_copy_loop
 
-.L_user_strlcpy_copy_loop_done:
-       /* check if we copied the entire source string */
-       cmp             $0,%ecx
-       jne             .L_user_strlcpy_source_done
-
-.L_user_strlcpy_zero_terminate:
        /* null terminate string */
        movb    $0,(%edi)
-       dec     %esi
+       dec             %esi
 
        /* 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)
 


Other related posts:

  • » [haiku-commits] haiku: hrev44284 - src/system/kernel/arch/x86 - anevilyak