1
0
Fork 0
mirror of https://gitlab.com/sortix/sortix.git synced 2023-02-13 20:55:38 -05:00

Add assembly file symbol sizes.

This commit is contained in:
Jonas 'Sortie' Termansen 2013-05-22 22:06:18 +02:00
parent 9224f8f43d
commit dc4ef04e7c
24 changed files with 61 additions and 37 deletions

View file

@ -52,3 +52,4 @@ _start:
# Terminate the process with main's exit code.
movl %eax, %edi
call exit
.size _start, .-_start

View file

@ -64,4 +64,4 @@ after_fork:
# which does that for us.
leaveq
retq
.size __call_tfork_with_regs, . - __call_tfork_with_regs

View file

@ -22,10 +22,9 @@
*******************************************************************************/
.globl SignalHandlerAssembly
.section .text
.global SignalHandlerAssembly
.type SignalHandlerAssembly, @function
SignalHandlerAssembly:
@ -34,3 +33,4 @@ SignalHandlerAssembly:
# Return control to the kernel, so normal execution can continue.
int $131
.size SignalHandlerAssembly, . - SignalHandlerAssembly

View file

@ -31,8 +31,6 @@
# clobbered: %rdi, %rsi, %r8, %r9, %r10, %r11
# preserved: %rbx, %rsp, %rbp, %r12, %r13, %r14, %r15
.section .text
.global asm_syscall
asm_syscall: /* syscall num in %rax. */
push %rbp
@ -58,3 +56,4 @@ asm_syscall: /* syscall num in %rax. */
pop %rbx
pop %rbp
ret
.size asm_syscall, .-asm_syscall

View file

@ -52,3 +52,4 @@ _start:
# Terminate the process with main's exit code.
push %eax
call exit
.size _start, .-_start

View file

@ -59,4 +59,4 @@ after_fork:
# which does that for us.
leavel
retl
.size __call_tfork_with_regs, . - __call_tfork_with_regs

View file

@ -38,3 +38,4 @@ SignalHandlerAssembly:
# Return control to the kernel, so normal execution can continue.
int $131
.size SignalHandlerAssembly, . - SignalHandlerAssembly

View file

@ -62,3 +62,4 @@ asm_syscall: /* syscall num in %eax. */
pop %ebx
pop %ebp
ret
.size asm_syscall, .-asm_syscall

View file

@ -23,14 +23,11 @@
******************************************************************************/
.globl beginkernel, _beginkernel
.globl start, _start
.section .text
.type _beginkernel, @function
.global beginkernel
.type beginkernel, @function
beginkernel:
_beginkernel:
movw $0x736, 0xB83E8
movw $0x734, 0xB83EA
movw $0x753, 0xB83EE
@ -54,16 +51,17 @@ _beginkernel:
mov %rax, %rdi
call KernelInit
.size beginkernel, . - beginkernel
.globl HaltKernel
.global HaltKernel
HaltKernel:
cli
hlt
jmp HaltKernel
.size HaltKernel, . - HaltKernel
.globl WaitForInterrupt
.global WaitForInterrupt
.type WaitForInterrupt, @function # void WaitForInterrupt();
WaitForInterrupt:
hlt
ret

View file

@ -23,13 +23,12 @@
******************************************************************************/
.globl start, _start
.section .text
.text 0x100000
.text 0x100000
.global _start
.type _start, @function
.code32
start:
_start:
jmp prepare_kernel_execution
@ -145,6 +144,7 @@ Realm64:
# Alright, that was the bootstrap code. Now begin preparing to run the
# actual 64-bit kernel.
jmp Main
.size _start, . - _start
.section .data
GDT64: # Global Descriptor Table (64-bit).
@ -194,4 +194,4 @@ Main:
mov 0x100004, %eax
jmp beginkernel
.size Main, . - Main

View file

@ -49,4 +49,4 @@ calltrace_done:
popq %rbx
popq %rbp
retq
.size calltrace, . - calltrace

View file

@ -43,6 +43,7 @@ gdt_flush:
ljmp *(%rax)
gdt_flush_postjmp:
ret
.size gdt_flush, . - gdt_flush
.global tss_flush
.type tss_flush, @function
@ -55,6 +56,7 @@ tss_flush:
# Load the task state register.
ltr %ax
ret
.size tss_flush, . - tss_flush
.section .data
GDT_FLUSH_POSTJMP:

View file

@ -30,4 +30,4 @@ idt_flush:
# Load the IDT pointer.
lidt (%rdi)
ret
.size idt_flush, . - idt_flush

View file

@ -486,11 +486,13 @@ load_interrupted_registers:
# Return to where we came from.
iretq
.size interrupt_handler_prepare, . - interrupt_handler_prepare
.global interrupt_handler_null
.type interrupt_handler_null, @function
interrupt_handler_null:
iretq
.size interrupt_handler_null, . - interrupt_handler_null
.global asm_interrupts_are_enabled
.type asm_interrupts_are_enabled, @function
@ -499,6 +501,7 @@ asm_interrupts_are_enabled:
popq %rax
andq $0x000200, %rax # FLAGS_INTERRUPT
retq
.size asm_interrupts_are_enabled, . - asm_interrupts_are_enabled
.global load_registers
.type load_registers, @function
@ -506,4 +509,4 @@ load_registers:
# Let the register struct become our temporary stack
movq %rdi, %rsp
jmp load_interrupted_registers
.size load_registers, . - load_registers

View file

@ -34,6 +34,7 @@ kthread_mutex_trylock:
not %eax
leaveq
retq
.size kthread_mutex_trylock, . - kthread_mutex_trylock
.global kthread_mutex_lock
.type kthread_mutex_lock, @function
@ -50,6 +51,7 @@ kthread_mutex_lock_retry:
kthread_mutex_lock_failed:
int $0x81 # Yield the CPU.
jmp kthread_mutex_lock_retry
.size kthread_mutex_lock, . - kthread_mutex_lock
.global kthread_mutex_lock_signal
.type kthread_mutex_lock_signal, @function
@ -74,6 +76,7 @@ kthread_mutex_lock_signal_failed:
kthread_mutex_lock_signal_pending:
xorl %eax, %eax
jmp kthread_mutex_lock_signal_out
.size kthread_mutex_lock_signal, . - kthread_mutex_lock_signal
.global kthread_mutex_unlock
.type kthread_mutex_unlock, @function
@ -83,3 +86,4 @@ kthread_mutex_unlock:
movl $0, (%rdi)
leaveq
retq
.size kthread_mutex_unlock, . - kthread_mutex_unlock

View file

@ -93,3 +93,5 @@ call_signal_dispatcher:
# 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.
iretq
.size syscall_handler, .-syscall_handler

View file

@ -23,11 +23,9 @@
******************************************************************************/
.globl beginkernel, _beginkernel
.section .text
.text 0x100000
.global beginkernel
.type beginkernel, @function
beginkernel:
# Initialize the stack pointer. The magic value is from kernel.cpp.
@ -47,15 +45,18 @@ beginkernel:
cli
call KernelInit
.size beginkernel, . - beginkernel
.globl HaltKernel
.global HaltKernel
HaltKernel:
cli
hlt
jmp HaltKernel
.size HaltKernel, . - HaltKernel
.globl WaitForInterrupt
.global WaitForInterrupt
.type WaitForInterrupt, @function # void WaitForInterrupt();
WaitForInterrupt:
hlt
ret
.size WaitForInterrupt, . - WaitForInterrupt

View file

@ -23,27 +23,25 @@
******************************************************************************/
.globl start, _start
.section .text
.text 0x100000
.text 0x100000
.global _start
.type _start, @function
start:
_start:
jmp prepare_kernel_execution
# Align 32 bits boundary.
.align 4
.align 4
# Multiboot header.
multiboot_header:
# Magic.
.long 0x1BADB002
.long 0x1BADB002
# Flags.
.long 0x00000003
.long 0x00000003
# Checksum.
.long -(0x1BADB002 + 0x00000003)
.long -(0x1BADB002 + 0x00000003)
prepare_kernel_execution:
# Enable the floating point unit.

View file

@ -51,4 +51,4 @@ calltrace_done:
popl %ebx
popl %ebp
retl
.size calltrace, . - calltrace

View file

@ -44,6 +44,7 @@ gdt_flush:
ljmp *(%eax)
gdt_flush_postjmp:
ret
.size gdt_flush, . - gdt_flush
.global tss_flush
.type tss_flush, @function
@ -56,6 +57,7 @@ tss_flush:
# Load the task state register.
ltr %ax
ret
.size tss_flush, . - tss_flush
.section .data
GDT_FLUSH_POSTJMP:

View file

@ -31,3 +31,4 @@ idt_flush:
mov 4(%esp), %eax
lidt (%eax)
ret
.size idt_flush, . - idt_flush

View file

@ -572,11 +572,13 @@ fixup_switch_stack:
mov -20(%esp), %ecx # restore interrupted ecx value
jmp fixup_switch_stack_complete
.size interrupt_handler_prepare, . - interrupt_handler_prepare
.global interrupt_handler_null
.type interrupt_handler_null, @function
interrupt_handler_null:
iret
.size interrupt_handler_null, . - interrupt_handler_null
.global asm_interrupts_are_enabled
.type asm_interrupts_are_enabled, @function
@ -585,6 +587,7 @@ asm_interrupts_are_enabled:
popl %eax
andl $0x000200, %eax # FLAGS_INTERRUPT
retl
.size asm_interrupts_are_enabled, . - asm_interrupts_are_enabled
.global load_registers
.type load_registers, @function
@ -592,4 +595,4 @@ load_registers:
# Let the register struct become our temporary stack
movl 4(%esp), %esp
jmp load_interrupted_registers
.size load_registers, . - load_registers

View file

@ -35,6 +35,7 @@ kthread_mutex_trylock:
not %eax
leavel
retl
.size kthread_mutex_trylock, . - kthread_mutex_trylock
.global kthread_mutex_lock
.type kthread_mutex_lock, @function
@ -52,6 +53,7 @@ kthread_mutex_lock_retry:
kthread_mutex_lock_failed:
int $0x81 # Yield the CPU.
jmp kthread_mutex_lock_retry
.size kthread_mutex_lock, . - kthread_mutex_lock
.global kthread_mutex_lock_signal
.type kthread_mutex_lock_signal, @function
@ -87,6 +89,7 @@ kthread_mutex_unlock:
movl $0, (%edx)
leavel
retl
.size kthread_mutex_lock_signal, . - kthread_mutex_lock_signal
.global asm_call_BootstrapKernelThread
.type asm_call_BootstrapKernelThread, @function
@ -95,6 +98,7 @@ asm_call_BootstrapKernelThread:
pushl %edi
call BootstrapKernelThread
# BootstrapKernelThread is noreturn, no need for code here.
.size asm_call_BootstrapKernelThread, . - asm_call_BootstrapKernelThread
.global asm_call_Thread__OnSigKill
.type asm_call_Thread__OnSigKill, @function
@ -102,3 +106,4 @@ asm_call_Thread__OnSigKill:
pushl %edi
call Thread__OnSigKill
# Thread__OnSigKill is noreturn, no need for code here.
.size asm_call_Thread__OnSigKill, . - asm_call_Thread__OnSigKill

View file

@ -95,3 +95,5 @@ call_signal_dispatcher:
# 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.
iretl
.size syscall_handler, .-syscall_handler