Use je/jne instead of jz/jnz when testing boolean variables in startup code.

Just for readability - they are aliases for the same instructions.
This commit is contained in:
Martin Whitaker 2022-02-12 09:05:34 +00:00
parent 39d5715224
commit 99e258457b
2 changed files with 5 additions and 5 deletions

View File

@ -100,7 +100,7 @@ startup:
# If first boot, save the boot params pointer... # If first boot, save the boot params pointer...
cmpl $1, first_boot@GOTOFF(%ebx) cmpl $1, first_boot@GOTOFF(%ebx)
jnz 1f jne 1f
movl %esi, boot_params_addr@GOTOFF(%ebx) movl %esi, boot_params_addr@GOTOFF(%ebx)
# ...and check if the processor supports long mode. # ...and check if the processor supports long mode.
@ -150,7 +150,7 @@ flush: movw $KERNEL_DS, %ax
leal idt@GOTOFF(%ebx), %edi leal idt@GOTOFF(%ebx), %edi
cmpl $1, use_long_mode@GOTOFF(%ebx) cmpl $1, use_long_mode@GOTOFF(%ebx)
jz init_idt64 je init_idt64
jmp init_idt32 jmp init_idt32
# Initialise the IDT descriptor. # Initialise the IDT descriptor.
@ -167,7 +167,7 @@ init_idt_descr:
# Zero the BSS (if first boot). # Zero the BSS (if first boot).
cmpl $1, first_boot@GOTOFF(%ebx) cmpl $1, first_boot@GOTOFF(%ebx)
jnz 1f jne 1f
xorl %eax, %eax xorl %eax, %eax
leal _bss@GOTOFF(%ebx), %edi leal _bss@GOTOFF(%ebx), %edi
leal _end@GOTOFF(%ebx), %ecx leal _end@GOTOFF(%ebx), %ecx
@ -212,7 +212,7 @@ init_idt_descr:
# Enable long mode if supported. # Enable long mode if supported.
cmpl $1, use_long_mode@GOTOFF(%ebx) cmpl $1, use_long_mode@GOTOFF(%ebx)
jnz 0f jne 0f
movl $0xc0000080, %ecx # enable long mode movl $0xc0000080, %ecx # enable long mode
rdmsr rdmsr

View File

@ -236,7 +236,7 @@ flush: movw $KERNEL_DS, %ax
# Zero the BSS (if first boot). # Zero the BSS (if first boot).
cmpl $1, first_boot(%rip) cmpl $1, first_boot(%rip)
jnz 1f jne 1f
xorq %rax, %rax xorq %rax, %rax
leaq _bss(%rip), %rdi leaq _bss(%rip), %rdi
leaq _end(%rip), %rcx leaq _end(%rip), %rcx