Add assembly file symbol sizes.
This commit is contained in:
parent
9224f8f43d
commit
dc4ef04e7c
|
@ -52,3 +52,4 @@ _start:
|
||||||
# Terminate the process with main's exit code.
|
# Terminate the process with main's exit code.
|
||||||
movl %eax, %edi
|
movl %eax, %edi
|
||||||
call exit
|
call exit
|
||||||
|
.size _start, .-_start
|
||||||
|
|
|
@ -64,4 +64,4 @@ after_fork:
|
||||||
# which does that for us.
|
# which does that for us.
|
||||||
leaveq
|
leaveq
|
||||||
retq
|
retq
|
||||||
|
.size __call_tfork_with_regs, . - __call_tfork_with_regs
|
||||||
|
|
|
@ -22,10 +22,9 @@
|
||||||
|
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
.globl SignalHandlerAssembly
|
|
||||||
|
|
||||||
.section .text
|
.section .text
|
||||||
|
|
||||||
|
.global SignalHandlerAssembly
|
||||||
.type SignalHandlerAssembly, @function
|
.type SignalHandlerAssembly, @function
|
||||||
SignalHandlerAssembly:
|
SignalHandlerAssembly:
|
||||||
|
|
||||||
|
@ -34,3 +33,4 @@ SignalHandlerAssembly:
|
||||||
|
|
||||||
# Return control to the kernel, so normal execution can continue.
|
# Return control to the kernel, so normal execution can continue.
|
||||||
int $131
|
int $131
|
||||||
|
.size SignalHandlerAssembly, . - SignalHandlerAssembly
|
||||||
|
|
|
@ -31,8 +31,6 @@
|
||||||
# clobbered: %rdi, %rsi, %r8, %r9, %r10, %r11
|
# clobbered: %rdi, %rsi, %r8, %r9, %r10, %r11
|
||||||
# preserved: %rbx, %rsp, %rbp, %r12, %r13, %r14, %r15
|
# preserved: %rbx, %rsp, %rbp, %r12, %r13, %r14, %r15
|
||||||
|
|
||||||
.section .text
|
|
||||||
|
|
||||||
.global asm_syscall
|
.global asm_syscall
|
||||||
asm_syscall: /* syscall num in %rax. */
|
asm_syscall: /* syscall num in %rax. */
|
||||||
push %rbp
|
push %rbp
|
||||||
|
@ -58,3 +56,4 @@ asm_syscall: /* syscall num in %rax. */
|
||||||
pop %rbx
|
pop %rbx
|
||||||
pop %rbp
|
pop %rbp
|
||||||
ret
|
ret
|
||||||
|
.size asm_syscall, .-asm_syscall
|
||||||
|
|
|
@ -52,3 +52,4 @@ _start:
|
||||||
# Terminate the process with main's exit code.
|
# Terminate the process with main's exit code.
|
||||||
push %eax
|
push %eax
|
||||||
call exit
|
call exit
|
||||||
|
.size _start, .-_start
|
||||||
|
|
|
@ -59,4 +59,4 @@ after_fork:
|
||||||
# which does that for us.
|
# which does that for us.
|
||||||
leavel
|
leavel
|
||||||
retl
|
retl
|
||||||
|
.size __call_tfork_with_regs, . - __call_tfork_with_regs
|
||||||
|
|
|
@ -38,3 +38,4 @@ SignalHandlerAssembly:
|
||||||
|
|
||||||
# Return control to the kernel, so normal execution can continue.
|
# Return control to the kernel, so normal execution can continue.
|
||||||
int $131
|
int $131
|
||||||
|
.size SignalHandlerAssembly, . - SignalHandlerAssembly
|
||||||
|
|
|
@ -62,3 +62,4 @@ asm_syscall: /* syscall num in %eax. */
|
||||||
pop %ebx
|
pop %ebx
|
||||||
pop %ebp
|
pop %ebp
|
||||||
ret
|
ret
|
||||||
|
.size asm_syscall, .-asm_syscall
|
||||||
|
|
|
@ -23,14 +23,11 @@
|
||||||
|
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
|
||||||
.globl beginkernel, _beginkernel
|
|
||||||
.globl start, _start
|
|
||||||
|
|
||||||
.section .text
|
.section .text
|
||||||
|
|
||||||
.type _beginkernel, @function
|
.global beginkernel
|
||||||
|
.type beginkernel, @function
|
||||||
beginkernel:
|
beginkernel:
|
||||||
_beginkernel:
|
|
||||||
movw $0x736, 0xB83E8
|
movw $0x736, 0xB83E8
|
||||||
movw $0x734, 0xB83EA
|
movw $0x734, 0xB83EA
|
||||||
movw $0x753, 0xB83EE
|
movw $0x753, 0xB83EE
|
||||||
|
@ -54,16 +51,17 @@ _beginkernel:
|
||||||
mov %rax, %rdi
|
mov %rax, %rdi
|
||||||
|
|
||||||
call KernelInit
|
call KernelInit
|
||||||
|
.size beginkernel, . - beginkernel
|
||||||
|
|
||||||
.globl HaltKernel
|
.global HaltKernel
|
||||||
HaltKernel:
|
HaltKernel:
|
||||||
cli
|
cli
|
||||||
hlt
|
hlt
|
||||||
jmp HaltKernel
|
jmp HaltKernel
|
||||||
|
.size HaltKernel, . - HaltKernel
|
||||||
|
|
||||||
.globl WaitForInterrupt
|
.global WaitForInterrupt
|
||||||
.type WaitForInterrupt, @function # void WaitForInterrupt();
|
.type WaitForInterrupt, @function # void WaitForInterrupt();
|
||||||
WaitForInterrupt:
|
WaitForInterrupt:
|
||||||
hlt
|
hlt
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
|
@ -23,13 +23,12 @@
|
||||||
|
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
|
||||||
.globl start, _start
|
|
||||||
|
|
||||||
.section .text
|
.section .text
|
||||||
.text 0x100000
|
.text 0x100000
|
||||||
|
|
||||||
|
.global _start
|
||||||
.type _start, @function
|
.type _start, @function
|
||||||
.code32
|
.code32
|
||||||
start:
|
|
||||||
_start:
|
_start:
|
||||||
jmp prepare_kernel_execution
|
jmp prepare_kernel_execution
|
||||||
|
|
||||||
|
@ -145,6 +144,7 @@ Realm64:
|
||||||
# Alright, that was the bootstrap code. Now begin preparing to run the
|
# Alright, that was the bootstrap code. Now begin preparing to run the
|
||||||
# actual 64-bit kernel.
|
# actual 64-bit kernel.
|
||||||
jmp Main
|
jmp Main
|
||||||
|
.size _start, . - _start
|
||||||
|
|
||||||
.section .data
|
.section .data
|
||||||
GDT64: # Global Descriptor Table (64-bit).
|
GDT64: # Global Descriptor Table (64-bit).
|
||||||
|
@ -194,4 +194,4 @@ Main:
|
||||||
mov 0x100004, %eax
|
mov 0x100004, %eax
|
||||||
|
|
||||||
jmp beginkernel
|
jmp beginkernel
|
||||||
|
.size Main, . - Main
|
||||||
|
|
|
@ -49,4 +49,4 @@ calltrace_done:
|
||||||
popq %rbx
|
popq %rbx
|
||||||
popq %rbp
|
popq %rbp
|
||||||
retq
|
retq
|
||||||
|
.size calltrace, . - calltrace
|
||||||
|
|
|
@ -43,6 +43,7 @@ gdt_flush:
|
||||||
ljmp *(%rax)
|
ljmp *(%rax)
|
||||||
gdt_flush_postjmp:
|
gdt_flush_postjmp:
|
||||||
ret
|
ret
|
||||||
|
.size gdt_flush, . - gdt_flush
|
||||||
|
|
||||||
.global tss_flush
|
.global tss_flush
|
||||||
.type tss_flush, @function
|
.type tss_flush, @function
|
||||||
|
@ -55,6 +56,7 @@ tss_flush:
|
||||||
# Load the task state register.
|
# Load the task state register.
|
||||||
ltr %ax
|
ltr %ax
|
||||||
ret
|
ret
|
||||||
|
.size tss_flush, . - tss_flush
|
||||||
|
|
||||||
.section .data
|
.section .data
|
||||||
GDT_FLUSH_POSTJMP:
|
GDT_FLUSH_POSTJMP:
|
||||||
|
|
|
@ -30,4 +30,4 @@ idt_flush:
|
||||||
# Load the IDT pointer.
|
# Load the IDT pointer.
|
||||||
lidt (%rdi)
|
lidt (%rdi)
|
||||||
ret
|
ret
|
||||||
|
.size idt_flush, . - idt_flush
|
||||||
|
|
|
@ -486,11 +486,13 @@ load_interrupted_registers:
|
||||||
|
|
||||||
# Return to where we came from.
|
# Return to where we came from.
|
||||||
iretq
|
iretq
|
||||||
|
.size interrupt_handler_prepare, . - interrupt_handler_prepare
|
||||||
|
|
||||||
.global interrupt_handler_null
|
.global interrupt_handler_null
|
||||||
.type interrupt_handler_null, @function
|
.type interrupt_handler_null, @function
|
||||||
interrupt_handler_null:
|
interrupt_handler_null:
|
||||||
iretq
|
iretq
|
||||||
|
.size interrupt_handler_null, . - interrupt_handler_null
|
||||||
|
|
||||||
.global asm_interrupts_are_enabled
|
.global asm_interrupts_are_enabled
|
||||||
.type asm_interrupts_are_enabled, @function
|
.type asm_interrupts_are_enabled, @function
|
||||||
|
@ -499,6 +501,7 @@ asm_interrupts_are_enabled:
|
||||||
popq %rax
|
popq %rax
|
||||||
andq $0x000200, %rax # FLAGS_INTERRUPT
|
andq $0x000200, %rax # FLAGS_INTERRUPT
|
||||||
retq
|
retq
|
||||||
|
.size asm_interrupts_are_enabled, . - asm_interrupts_are_enabled
|
||||||
|
|
||||||
.global load_registers
|
.global load_registers
|
||||||
.type load_registers, @function
|
.type load_registers, @function
|
||||||
|
@ -506,4 +509,4 @@ load_registers:
|
||||||
# Let the register struct become our temporary stack
|
# Let the register struct become our temporary stack
|
||||||
movq %rdi, %rsp
|
movq %rdi, %rsp
|
||||||
jmp load_interrupted_registers
|
jmp load_interrupted_registers
|
||||||
|
.size load_registers, . - load_registers
|
||||||
|
|
|
@ -34,6 +34,7 @@ kthread_mutex_trylock:
|
||||||
not %eax
|
not %eax
|
||||||
leaveq
|
leaveq
|
||||||
retq
|
retq
|
||||||
|
.size kthread_mutex_trylock, . - kthread_mutex_trylock
|
||||||
|
|
||||||
.global kthread_mutex_lock
|
.global kthread_mutex_lock
|
||||||
.type kthread_mutex_lock, @function
|
.type kthread_mutex_lock, @function
|
||||||
|
@ -50,6 +51,7 @@ kthread_mutex_lock_retry:
|
||||||
kthread_mutex_lock_failed:
|
kthread_mutex_lock_failed:
|
||||||
int $0x81 # Yield the CPU.
|
int $0x81 # Yield the CPU.
|
||||||
jmp kthread_mutex_lock_retry
|
jmp kthread_mutex_lock_retry
|
||||||
|
.size kthread_mutex_lock, . - kthread_mutex_lock
|
||||||
|
|
||||||
.global kthread_mutex_lock_signal
|
.global kthread_mutex_lock_signal
|
||||||
.type kthread_mutex_lock_signal, @function
|
.type kthread_mutex_lock_signal, @function
|
||||||
|
@ -74,6 +76,7 @@ kthread_mutex_lock_signal_failed:
|
||||||
kthread_mutex_lock_signal_pending:
|
kthread_mutex_lock_signal_pending:
|
||||||
xorl %eax, %eax
|
xorl %eax, %eax
|
||||||
jmp kthread_mutex_lock_signal_out
|
jmp kthread_mutex_lock_signal_out
|
||||||
|
.size kthread_mutex_lock_signal, . - kthread_mutex_lock_signal
|
||||||
|
|
||||||
.global kthread_mutex_unlock
|
.global kthread_mutex_unlock
|
||||||
.type kthread_mutex_unlock, @function
|
.type kthread_mutex_unlock, @function
|
||||||
|
@ -83,3 +86,4 @@ kthread_mutex_unlock:
|
||||||
movl $0, (%rdi)
|
movl $0, (%rdi)
|
||||||
leaveq
|
leaveq
|
||||||
retq
|
retq
|
||||||
|
.size kthread_mutex_unlock, . - kthread_mutex_unlock
|
||||||
|
|
|
@ -93,3 +93,5 @@ call_signal_dispatcher:
|
||||||
# If we end up here, it means that the signal didn't override anything and
|
# If we end up here, it means that the signal didn't override anything and
|
||||||
# that we should just go ahead and return to userspace ourselves.
|
# that we should just go ahead and return to userspace ourselves.
|
||||||
iretq
|
iretq
|
||||||
|
|
||||||
|
.size syscall_handler, .-syscall_handler
|
||||||
|
|
|
@ -23,11 +23,9 @@
|
||||||
|
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
|
||||||
.globl beginkernel, _beginkernel
|
|
||||||
|
|
||||||
.section .text
|
.section .text
|
||||||
|
|
||||||
.text 0x100000
|
.global beginkernel
|
||||||
.type beginkernel, @function
|
.type beginkernel, @function
|
||||||
beginkernel:
|
beginkernel:
|
||||||
# Initialize the stack pointer. The magic value is from kernel.cpp.
|
# Initialize the stack pointer. The magic value is from kernel.cpp.
|
||||||
|
@ -47,15 +45,18 @@ beginkernel:
|
||||||
cli
|
cli
|
||||||
|
|
||||||
call KernelInit
|
call KernelInit
|
||||||
|
.size beginkernel, . - beginkernel
|
||||||
|
|
||||||
.globl HaltKernel
|
.global HaltKernel
|
||||||
HaltKernel:
|
HaltKernel:
|
||||||
cli
|
cli
|
||||||
hlt
|
hlt
|
||||||
jmp HaltKernel
|
jmp HaltKernel
|
||||||
|
.size HaltKernel, . - HaltKernel
|
||||||
|
|
||||||
.globl WaitForInterrupt
|
.global WaitForInterrupt
|
||||||
.type WaitForInterrupt, @function # void WaitForInterrupt();
|
.type WaitForInterrupt, @function # void WaitForInterrupt();
|
||||||
WaitForInterrupt:
|
WaitForInterrupt:
|
||||||
hlt
|
hlt
|
||||||
ret
|
ret
|
||||||
|
.size WaitForInterrupt, . - WaitForInterrupt
|
||||||
|
|
|
@ -23,27 +23,25 @@
|
||||||
|
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
|
||||||
.globl start, _start
|
|
||||||
|
|
||||||
.section .text
|
.section .text
|
||||||
|
.text 0x100000
|
||||||
|
|
||||||
.text 0x100000
|
.global _start
|
||||||
.type _start, @function
|
.type _start, @function
|
||||||
start:
|
|
||||||
_start:
|
_start:
|
||||||
jmp prepare_kernel_execution
|
jmp prepare_kernel_execution
|
||||||
|
|
||||||
# Align 32 bits boundary.
|
# Align 32 bits boundary.
|
||||||
.align 4
|
.align 4
|
||||||
|
|
||||||
# Multiboot header.
|
# Multiboot header.
|
||||||
multiboot_header:
|
multiboot_header:
|
||||||
# Magic.
|
# Magic.
|
||||||
.long 0x1BADB002
|
.long 0x1BADB002
|
||||||
# Flags.
|
# Flags.
|
||||||
.long 0x00000003
|
.long 0x00000003
|
||||||
# Checksum.
|
# Checksum.
|
||||||
.long -(0x1BADB002 + 0x00000003)
|
.long -(0x1BADB002 + 0x00000003)
|
||||||
|
|
||||||
prepare_kernel_execution:
|
prepare_kernel_execution:
|
||||||
# Enable the floating point unit.
|
# Enable the floating point unit.
|
||||||
|
|
|
@ -51,4 +51,4 @@ calltrace_done:
|
||||||
popl %ebx
|
popl %ebx
|
||||||
popl %ebp
|
popl %ebp
|
||||||
retl
|
retl
|
||||||
|
.size calltrace, . - calltrace
|
||||||
|
|
|
@ -44,6 +44,7 @@ gdt_flush:
|
||||||
ljmp *(%eax)
|
ljmp *(%eax)
|
||||||
gdt_flush_postjmp:
|
gdt_flush_postjmp:
|
||||||
ret
|
ret
|
||||||
|
.size gdt_flush, . - gdt_flush
|
||||||
|
|
||||||
.global tss_flush
|
.global tss_flush
|
||||||
.type tss_flush, @function
|
.type tss_flush, @function
|
||||||
|
@ -56,6 +57,7 @@ tss_flush:
|
||||||
# Load the task state register.
|
# Load the task state register.
|
||||||
ltr %ax
|
ltr %ax
|
||||||
ret
|
ret
|
||||||
|
.size tss_flush, . - tss_flush
|
||||||
|
|
||||||
.section .data
|
.section .data
|
||||||
GDT_FLUSH_POSTJMP:
|
GDT_FLUSH_POSTJMP:
|
||||||
|
|
|
@ -31,3 +31,4 @@ idt_flush:
|
||||||
mov 4(%esp), %eax
|
mov 4(%esp), %eax
|
||||||
lidt (%eax)
|
lidt (%eax)
|
||||||
ret
|
ret
|
||||||
|
.size idt_flush, . - idt_flush
|
||||||
|
|
|
@ -572,11 +572,13 @@ fixup_switch_stack:
|
||||||
mov -20(%esp), %ecx # restore interrupted ecx value
|
mov -20(%esp), %ecx # restore interrupted ecx value
|
||||||
|
|
||||||
jmp fixup_switch_stack_complete
|
jmp fixup_switch_stack_complete
|
||||||
|
.size interrupt_handler_prepare, . - interrupt_handler_prepare
|
||||||
|
|
||||||
.global interrupt_handler_null
|
.global interrupt_handler_null
|
||||||
.type interrupt_handler_null, @function
|
.type interrupt_handler_null, @function
|
||||||
interrupt_handler_null:
|
interrupt_handler_null:
|
||||||
iret
|
iret
|
||||||
|
.size interrupt_handler_null, . - interrupt_handler_null
|
||||||
|
|
||||||
.global asm_interrupts_are_enabled
|
.global asm_interrupts_are_enabled
|
||||||
.type asm_interrupts_are_enabled, @function
|
.type asm_interrupts_are_enabled, @function
|
||||||
|
@ -585,6 +587,7 @@ asm_interrupts_are_enabled:
|
||||||
popl %eax
|
popl %eax
|
||||||
andl $0x000200, %eax # FLAGS_INTERRUPT
|
andl $0x000200, %eax # FLAGS_INTERRUPT
|
||||||
retl
|
retl
|
||||||
|
.size asm_interrupts_are_enabled, . - asm_interrupts_are_enabled
|
||||||
|
|
||||||
.global load_registers
|
.global load_registers
|
||||||
.type load_registers, @function
|
.type load_registers, @function
|
||||||
|
@ -592,4 +595,4 @@ load_registers:
|
||||||
# Let the register struct become our temporary stack
|
# Let the register struct become our temporary stack
|
||||||
movl 4(%esp), %esp
|
movl 4(%esp), %esp
|
||||||
jmp load_interrupted_registers
|
jmp load_interrupted_registers
|
||||||
|
.size load_registers, . - load_registers
|
||||||
|
|
|
@ -35,6 +35,7 @@ kthread_mutex_trylock:
|
||||||
not %eax
|
not %eax
|
||||||
leavel
|
leavel
|
||||||
retl
|
retl
|
||||||
|
.size kthread_mutex_trylock, . - kthread_mutex_trylock
|
||||||
|
|
||||||
.global kthread_mutex_lock
|
.global kthread_mutex_lock
|
||||||
.type kthread_mutex_lock, @function
|
.type kthread_mutex_lock, @function
|
||||||
|
@ -52,6 +53,7 @@ kthread_mutex_lock_retry:
|
||||||
kthread_mutex_lock_failed:
|
kthread_mutex_lock_failed:
|
||||||
int $0x81 # Yield the CPU.
|
int $0x81 # Yield the CPU.
|
||||||
jmp kthread_mutex_lock_retry
|
jmp kthread_mutex_lock_retry
|
||||||
|
.size kthread_mutex_lock, . - kthread_mutex_lock
|
||||||
|
|
||||||
.global kthread_mutex_lock_signal
|
.global kthread_mutex_lock_signal
|
||||||
.type kthread_mutex_lock_signal, @function
|
.type kthread_mutex_lock_signal, @function
|
||||||
|
@ -87,6 +89,7 @@ kthread_mutex_unlock:
|
||||||
movl $0, (%edx)
|
movl $0, (%edx)
|
||||||
leavel
|
leavel
|
||||||
retl
|
retl
|
||||||
|
.size kthread_mutex_lock_signal, . - kthread_mutex_lock_signal
|
||||||
|
|
||||||
.global asm_call_BootstrapKernelThread
|
.global asm_call_BootstrapKernelThread
|
||||||
.type asm_call_BootstrapKernelThread, @function
|
.type asm_call_BootstrapKernelThread, @function
|
||||||
|
@ -95,6 +98,7 @@ asm_call_BootstrapKernelThread:
|
||||||
pushl %edi
|
pushl %edi
|
||||||
call BootstrapKernelThread
|
call BootstrapKernelThread
|
||||||
# BootstrapKernelThread is noreturn, no need for code here.
|
# BootstrapKernelThread is noreturn, no need for code here.
|
||||||
|
.size asm_call_BootstrapKernelThread, . - asm_call_BootstrapKernelThread
|
||||||
|
|
||||||
.global asm_call_Thread__OnSigKill
|
.global asm_call_Thread__OnSigKill
|
||||||
.type asm_call_Thread__OnSigKill, @function
|
.type asm_call_Thread__OnSigKill, @function
|
||||||
|
@ -102,3 +106,4 @@ asm_call_Thread__OnSigKill:
|
||||||
pushl %edi
|
pushl %edi
|
||||||
call Thread__OnSigKill
|
call Thread__OnSigKill
|
||||||
# Thread__OnSigKill is noreturn, no need for code here.
|
# Thread__OnSigKill is noreturn, no need for code here.
|
||||||
|
.size asm_call_Thread__OnSigKill, . - asm_call_Thread__OnSigKill
|
||||||
|
|
|
@ -95,3 +95,5 @@ call_signal_dispatcher:
|
||||||
# If we end up here, it means that the signal didn't override anything and
|
# If we end up here, it means that the signal didn't override anything and
|
||||||
# that we should just go ahead and return to userspace ourselves.
|
# that we should just go ahead and return to userspace ourselves.
|
||||||
iretl
|
iretl
|
||||||
|
|
||||||
|
.size syscall_handler, .-syscall_handler
|
||||||
|
|
Loading…
Reference in New Issue