Kernel: Use local labels in assembly

This commit is contained in:
2026-08-22 11:57:19 +03:00
parent 2f25bfb2db
commit 82fd57af9e
7 changed files with 57 additions and 62 deletions
+6 -7
View File
@@ -28,27 +28,26 @@ safe_user_strncpy:
testl %ecx, %ecx
jz safe_user_strncpy_fault
.safe_user_strncpy_loop:
.Lsafe_user_strncpy_loop:
movb (%esi), %al
movb %al, (%edi)
testb %al, %al
jz .safe_user_strncpy_done
jz .Lsafe_user_strncpy_done
incl %edi
incl %esi
decl %ecx
jnz .safe_user_strncpy_loop
jnz .Lsafe_user_strncpy_loop
safe_user_strncpy_fault:
xorl %eax, %eax
jmp .safe_user_strncpy_return
jmp .Lsafe_user_strncpy_return
.safe_user_strncpy_done:
.Lsafe_user_strncpy_done:
movl $1, %eax
.safe_user_strncpy_return:
.Lsafe_user_strncpy_return:
movl 4(%esp), %edi
movl 8(%esp), %esi
ret
safe_user_strncpy_end: