From 6d171d207db921bde6de2024d27e0328db41af7d Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Thu, 7 Jun 2018 11:53:39 -0400 Subject: [PATCH] Align assembly operands --- src/arch/amd64/crti.S | 8 ++--- src/arch/amd64/gdt.S | 12 +++---- src/arch/amd64/kernel.S | 20 ++++++------ src/arch/i386/crti.S | 8 ++--- src/arch/i386/gdt.S | 16 +++++----- src/arch/i386/kernel.S | 40 ++++++++++++------------ src/arch/i386/loader.S | 60 +++++++++++++++++------------------ src/arch/i386/multiboot.S | 66 +++++++++++++++++++-------------------- tools/arch/i386/start.S | 2 +- 9 files changed, 116 insertions(+), 116 deletions(-) diff --git a/src/arch/amd64/crti.S b/src/arch/amd64/crti.S index f0452f8..78f5791 100644 --- a/src/arch/amd64/crti.S +++ b/src/arch/amd64/crti.S @@ -11,8 +11,8 @@ .global _init .type _init, @function _init: - push %rbp - mov %rsp, %rbp + push %rbp + mov %rsp, %rbp /* fini */ @@ -20,5 +20,5 @@ _init: .global _fini .type _fini, @function _fini: - push %rbp - mov %rsp, %rbp + push %rbp + mov %rsp, %rbp diff --git a/src/arch/amd64/gdt.S b/src/arch/amd64/gdt.S index 27119a0..c9105bc 100644 --- a/src/arch/amd64/gdt.S +++ b/src/arch/amd64/gdt.S @@ -12,17 +12,17 @@ .type __arch_setgdt, @function __arch_setgdt: #if 0 - lea gdt_descriptor, %rcx + lea gdt_descriptor, %rcx #else - mov (gdt_descriptor), %rcx + mov (gdt_descriptor), %rcx #endif /* set the offset of the GDT */ - mov %rsi, 0x2(%rcx) + mov %rsi, 0x2(%rcx) /* set the size of the GDT */ - dec %rdi - mov %di, (%rcx) + dec %rdi + mov %di, (%rcx) /* load the GDT */ - lgdt (%rcx) + lgdt (%rcx) ret diff --git a/src/arch/amd64/kernel.S b/src/arch/amd64/kernel.S index 677b56d..b3013d2 100644 --- a/src/arch/amd64/kernel.S +++ b/src/arch/amd64/kernel.S @@ -27,7 +27,7 @@ _exit: /* infinite loop */ cli 1: hlt - jmp 1b + jmp 1b /* start */ @@ -38,28 +38,28 @@ _start: cli /* initialize the stack */ - mov $stack_top, %rsp - xor %rbp, %rbp + mov $stack_top, %rsp + xor %rbp, %rbp #if defined(__SSP__) /* initialize SSP */ - call __stack_chk_setup + call __stack_chk_setup #endif /* call the global constructors */ - call _init + call _init /* set the interrupt descriptor */ - call __arch_setidt + call __arch_setidt /* FIXME setup paging */ /* start the kernel */ - xor %rdi, %rdi - call main + xor %rdi, %rdi + call main /* exit the kernel */ - mov %rax, %rdi - call exit + mov %rax, %rdi + call exit hlt diff --git a/src/arch/i386/crti.S b/src/arch/i386/crti.S index 1b166d6..03e7149 100644 --- a/src/arch/i386/crti.S +++ b/src/arch/i386/crti.S @@ -11,8 +11,8 @@ .global _init .type _init, @function _init: - push %ebp - mov %esp, %ebp + push %ebp + mov %esp, %ebp /* fini */ @@ -20,5 +20,5 @@ _init: .global _fini .type _fini, @function _fini: - push %ebp - mov %esp, %ebp + push %ebp + mov %esp, %ebp diff --git a/src/arch/i386/gdt.S b/src/arch/i386/gdt.S index 0537507..a346b9e 100644 --- a/src/arch/i386/gdt.S +++ b/src/arch/i386/gdt.S @@ -12,19 +12,19 @@ .type __arch_setgdt, @function __arch_setgdt: #if 0 - lea gdt_descriptor, %ecx + lea gdt_descriptor, %ecx #else - mov (gdt_descriptor), %ecx + mov (gdt_descriptor), %ecx #endif /* set the offset of the GDT */ - mov 0x4(%esp), %eax - mov %eax, 0x2(%ecx) + mov 0x4(%esp), %eax + mov %eax, 0x2(%ecx) /* set the size of the GDT */ - mov 0x8(%esp), %eax - dec %eax - mov %ax, (%ecx) + mov 0x8(%esp), %eax + dec %eax + mov %ax, (%ecx) /* load the GDT */ - lgdt (%ecx) + lgdt (%ecx) ret diff --git a/src/arch/i386/kernel.S b/src/arch/i386/kernel.S index 1c7491e..0ba9c32 100644 --- a/src/arch/i386/kernel.S +++ b/src/arch/i386/kernel.S @@ -25,7 +25,7 @@ _exit: /* infinite loop */ cli 1: hlt - jmp 1b + jmp 1b /* start */ @@ -36,45 +36,45 @@ _start: cli /* initialize the stack */ - mov $stack_top, %esp - xor %ebp, %ebp + mov $stack_top, %esp + xor %ebp, %ebp - push %eax + push %eax /* reset EFLAGS */ - pushl $0x0 + pushl $0x0 popf #if defined(__SSP__) /* initialize SSP */ - call __stack_chk_setup + call __stack_chk_setup #endif /* call the global constructors */ - call _init + call _init /* detect multiboot */ - pop %eax - cmp $BOOT_MULTIBOOT_LOADER_MAGIC, %eax - jne 1f - push %ebx - call multiboot - add $0x4, %esp + pop %eax + cmp $BOOT_MULTIBOOT_LOADER_MAGIC, %eax + jne 1f + push %ebx + call multiboot + add $0x4, %esp 1: /* set the interrupt descriptor */ - call __arch_setidt + call __arch_setidt /* FIXME setup paging */ /* start the kernel */ - push $0x0 - call main - add $0x4, %esp + push $0x0 + call main + add $0x4, %esp /* exit the kernel */ - push %eax - call exit - add $0x4, %esp + push %eax + call exit + add $0x4, %esp hlt diff --git a/src/arch/i386/loader.S b/src/arch/i386/loader.S index c52d394..ecf967d 100644 --- a/src/arch/i386/loader.S +++ b/src/arch/i386/loader.S @@ -25,7 +25,7 @@ _exit: /* infinite loop */ cli 1: hlt - jmp 1b + jmp 1b /* start */ @@ -36,55 +36,55 @@ _start: cli /* initialize the stack */ - mov $stack_top, %esp - xor %ebp, %ebp + mov $stack_top, %esp + xor %ebp, %ebp - push %eax + push %eax /* reset EFLAGS */ - pushl $0x0 + pushl $0x0 popf #if defined(__SSP__) /* initialize SSP */ - call __stack_chk_setup + call __stack_chk_setup #endif /* call the global constructors */ - call _init + call _init /* detect multiboot */ - pop %eax - cmp $BOOT_MULTIBOOT_LOADER_MAGIC, %eax - jne 1f - push %ebx - call multiboot - add $0x4, %esp + pop %eax + cmp $BOOT_MULTIBOOT_LOADER_MAGIC, %eax + jne 1f + push %ebx + call multiboot + add $0x4, %esp /* start the loader */ - push $0x0 - push $0x0 - push $0x0 - mov %ebx, %eax - add $0x10, %eax - push %eax - push $0x1 - call main - add $0x14, %esp - jmp 2f + push $0x0 + push $0x0 + push $0x0 + mov %ebx, %eax + add $0x10, %eax + push %eax + push $0x1 + call main + add $0x14, %esp + jmp 2f 1: /* start the loader */ - push $0x0 - push $0x0 - push $0x0 - push $0x0 - call main - add $0x10, %esp + push $0x0 + push $0x0 + push $0x0 + push $0x0 + call main + add $0x10, %esp 2: /* exit the kernel */ - call _exit + call _exit hlt diff --git a/src/arch/i386/multiboot.S b/src/arch/i386/multiboot.S index 203ea32..94a0d2a 100644 --- a/src/arch/i386/multiboot.S +++ b/src/arch/i386/multiboot.S @@ -22,18 +22,18 @@ k_ptr: multiboot_boot_kernel32: /* jump into the 32-bit kernel */ #if 0 - mov 0x4(%esp), %ebx - mov 0x8(%esp), %eax - call *%eax + mov 0x4(%esp), %ebx + mov 0x8(%esp), %eax + call *%eax ret #else - push %ebp - mov %esp, %ebp + push %ebp + mov %esp, %ebp - mov 0x8(%ebp), %ebx - mov 0xc(%ebp), %ecx - mov $BOOT_MULTIBOOT_LOADER_MAGIC, %eax - jmp *%ecx + mov 0x8(%ebp), %ebx + mov 0xc(%ebp), %ecx + mov $BOOT_MULTIBOOT_LOADER_MAGIC, %eax + jmp *%ecx #endif @@ -42,41 +42,41 @@ multiboot_boot_kernel32: multiboot_boot_kernel64: /* check for 64-bit capability */ pushf - pop %eax - mov %eax, %ecx - xor $0x00200000, %eax - push %eax + pop %eax + mov %eax, %ecx + xor $0x00200000, %eax + push %eax popf pushf - pop %eax - cmp %ecx, %eax - jz 1f /* CPUID is not supported */ - push %ebx - mov $0x80000001, %eax + pop %eax + cmp %ecx, %eax + jz 1f /* CPUID is not supported */ + push %ebx + mov $0x80000001, %eax cpuid - pop %ebx - cmp $0x80000000, %eax - jl 1f /* 64-bit mode is not supported */ + pop %ebx + cmp $0x80000000, %eax + jl 1f /* 64-bit mode is not supported */ /* jump into the 64-bit kernel */ - mov 0x8(%esp), %esi - mov %esi, (k_ptr) + mov 0x8(%esp), %esi + mov %esi, (k_ptr) #if 0 - lgdt (_gdt64) + lgdt (_gdt64) - mov _gdt64_data, %ax - mov %ax, %ss - mov %ax, %ds - mov %ax, %es - jmp _gdt64_code + mov _gdt64_data, %ax + mov %ax, %ss + mov %ax, %ds + mov %ax, %es + jmp _gdt64_code .jmp_k: - mov 0x4(%esp), %edi - mov k_ptr, %eax + mov 0x4(%esp), %edi + mov k_ptr, %eax .long 0x0 - jmp *%eax + jmp *%eax #endif 1: - mov $-1, %eax + mov $-1, %eax ret diff --git a/tools/arch/i386/start.S b/tools/arch/i386/start.S index 0f1043f..b547aac 100644 --- a/tools/arch/i386/start.S +++ b/tools/arch/i386/start.S @@ -34,7 +34,7 @@ _read: .global _start .type _start, @function _start: - /* reset the stack */ + /* initialize the stack */ xor %ebp, %ebp /* setup the environment */