Use the new <asm_defs.h> header in x86 assembly files. Particularly
added FUNCTION_END() calls for a good deal of functions. The respective ELF symbols do now have a correct size. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27718 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
4069a00744
commit
8cc146385f
@ -11,6 +11,7 @@
|
||||
#include <arch/x86/arch_cpu.h>
|
||||
#include <arch/x86/arch_kernel.h>
|
||||
#include <arch/x86/descriptors.h>
|
||||
#include <asm_defs.h>
|
||||
#include <commpage_defs.h>
|
||||
#include <thread_types.h>
|
||||
|
||||
@ -21,8 +22,6 @@
|
||||
#include "syscall_table.h"
|
||||
|
||||
|
||||
#define FUNCTION(x) .global x; .type x,@function; x
|
||||
|
||||
#define UPDATE_THREAD_USER_TIME_COMMON() \
|
||||
movl %eax, %ebx; /* save for later */ \
|
||||
movl %edx, %ecx; \
|
||||
@ -168,23 +167,23 @@
|
||||
.text
|
||||
|
||||
#define TRAP_ERRC(name, vector) \
|
||||
.globl name; \
|
||||
.align 8; \
|
||||
name: \
|
||||
FUNCTION(name): \
|
||||
pushl $vector; \
|
||||
pushl $-1; \
|
||||
pushl $-1; \
|
||||
jmp int_bottom
|
||||
jmp int_bottom; \
|
||||
FUNCTION_END(name)
|
||||
|
||||
#define TRAP(name, vector) \
|
||||
.globl name; \
|
||||
.align 8; \
|
||||
name: \
|
||||
FUNCTION(name): \
|
||||
pushl $0; \
|
||||
pushl $vector; \
|
||||
pushl %edx; \
|
||||
pushl %eax; \
|
||||
jmp int_bottom
|
||||
jmp int_bottom; \
|
||||
FUNCTION_END(name)
|
||||
|
||||
TRAP(trap0, 0)
|
||||
TRAP(trap1, 1)
|
||||
@ -195,9 +194,8 @@ TRAP(trap5, 5)
|
||||
TRAP(trap6, 6)
|
||||
TRAP(trap7, 7)
|
||||
|
||||
.globl double_fault;
|
||||
.align 8;
|
||||
double_fault:
|
||||
FUNCTION(double_fault):
|
||||
pushl $-1; // user-ss
|
||||
pushl $-1; // user-esp
|
||||
pushl $-1; // flags
|
||||
@ -208,6 +206,7 @@ double_fault:
|
||||
pushl $-1;
|
||||
pushl $-1;
|
||||
jmp int_bottom
|
||||
FUNCTION_END(double_fault)
|
||||
|
||||
TRAP(trap9, 9)
|
||||
TRAP_ERRC(trap10, 10)
|
||||
@ -254,8 +253,7 @@ TRAP(trap255, 255)
|
||||
|
||||
|
||||
.align 16
|
||||
.globl int_bottom
|
||||
int_bottom:
|
||||
STATIC_FUNCTION(int_bottom):
|
||||
PUSH_IFRAME_BOTTOM(IFRAME_TYPE_OTHER)
|
||||
|
||||
movl %esp, %ebp // frame pointer is the iframe
|
||||
@ -282,9 +280,10 @@ int_bottom:
|
||||
call *gInterruptHandlerTable(, %eax, 4)
|
||||
|
||||
POP_IFRAME_AND_RETURN()
|
||||
FUNCTION_END(int_bottom)
|
||||
|
||||
|
||||
int_bottom_user:
|
||||
STATIC_FUNCTION(int_bottom_user):
|
||||
movl $KERNEL_DATA_SEG,%eax
|
||||
cld
|
||||
movl %eax,%ds
|
||||
@ -327,9 +326,10 @@ int_bottom_user:
|
||||
// update the thread's kernel time and return
|
||||
UPDATE_THREAD_KERNEL_TIME()
|
||||
POP_IFRAME_AND_RETURN()
|
||||
FUNCTION_END(int_bottom_user)
|
||||
|
||||
|
||||
int_bottom_vm86:
|
||||
STATIC_FUNCTION(int_bottom_vm86):
|
||||
movl $KERNEL_DATA_SEG,%eax
|
||||
cld
|
||||
movl %eax,%ds
|
||||
@ -354,27 +354,28 @@ int_bottom_vm86:
|
||||
popa;
|
||||
addl $16,%esp;
|
||||
iret
|
||||
FUNCTION_END(int_bottom_vm86)
|
||||
|
||||
|
||||
// test interrupt handler for performance measurements
|
||||
.align 16
|
||||
.globl trap98
|
||||
trap98:
|
||||
FUNCTION(trap98):
|
||||
iret
|
||||
FUNCTION_END(trap98)
|
||||
|
||||
|
||||
.align 16
|
||||
.globl trap99
|
||||
trap99:
|
||||
FUNCTION(trap99):
|
||||
// push error, vector, orig_edx, orig_eax, and other registers
|
||||
PUSH_IFRAME_BOTTOM_SYSCALL()
|
||||
|
||||
call handle_syscall
|
||||
|
||||
POP_IFRAME_AND_RETURN()
|
||||
FUNCTION_END(trap99)
|
||||
|
||||
|
||||
handle_syscall:
|
||||
STATIC_FUNCTION(handle_syscall):
|
||||
// save %eax, the number of the syscall
|
||||
movl %eax, %esi
|
||||
|
||||
@ -440,8 +441,9 @@ handle_syscall:
|
||||
lea -4(%ebp), %esp // remove all parameters from the stack
|
||||
|
||||
ret
|
||||
FUNCTION_END(handle_syscall)
|
||||
|
||||
do_pre_syscall_debug:
|
||||
STATIC_FUNCTION(do_pre_syscall_debug):
|
||||
movl %esp, %eax // syscall parameters
|
||||
push %eax
|
||||
movl IFRAME_orig_eax(%ebp), %eax // syscall number
|
||||
@ -449,8 +451,9 @@ handle_syscall:
|
||||
call user_debug_pre_syscall
|
||||
addl $8, %esp
|
||||
jmp pre_syscall_debug_done
|
||||
FUNCTION_END(do_pre_syscall_debug)
|
||||
|
||||
post_syscall_work:
|
||||
STATIC_FUNCTION(post_syscall_work):
|
||||
// clear the 64 bit return value and syscall restarted bits
|
||||
testl $(THREAD_FLAGS_64_BIT_SYSCALL_RETURN \
|
||||
| THREAD_FLAGS_SYSCALL_RESTARTED), THREAD_flags(%edi)
|
||||
@ -481,9 +484,10 @@ handle_syscall:
|
||||
call user_debug_post_syscall
|
||||
addl $24, %esp
|
||||
1:
|
||||
FUNCTION_END(post_syscall_work)
|
||||
|
||||
bad_syscall_number:
|
||||
kernel_exit_work:
|
||||
STATIC_FUNCTION(kernel_exit_work):
|
||||
// if no signals are pending and the thread shall not be debugged, we can
|
||||
// use the quick kernel exit function
|
||||
testl $(THREAD_FLAGS_SIGNALS_PENDING | THREAD_FLAGS_DEBUG_THREAD) \
|
||||
@ -511,19 +515,22 @@ handle_syscall:
|
||||
call x86_init_user_debug_at_kernel_exit
|
||||
1:
|
||||
POP_IFRAME_AND_RETURN()
|
||||
FUNCTION_END(kernel_exit_work)
|
||||
|
||||
kernel_exit_handle_signals:
|
||||
STATIC_FUNCTION(kernel_exit_handle_signals):
|
||||
// make sure interrupts are enabled (they are, when coming from a syscall
|
||||
// but otherwise they might be disabled)
|
||||
sti
|
||||
call thread_at_kernel_exit // also disables interrupts
|
||||
jmp kernel_exit_work_done
|
||||
FUNCTION_END(kernel_exit_handle_signals)
|
||||
|
||||
bad_syscall_params:
|
||||
STATIC_FUNCTION(bad_syscall_params):
|
||||
// clear the fault handler and exit normally
|
||||
movl %dr3, %edi
|
||||
movl $0, THREAD_fault_handler(%edi)
|
||||
jmp kernel_exit_work
|
||||
FUNCTION_END(bad_syscall_params)
|
||||
|
||||
|
||||
/*! Handler called by the sysenter instruction
|
||||
@ -569,6 +576,7 @@ FUNCTION(x86_sysenter):
|
||||
popfl
|
||||
|
||||
sysexit
|
||||
FUNCTION_END(x86_sysenter)
|
||||
|
||||
|
||||
/*! Is copied to the signal stack call to restore the original frame when
|
||||
@ -586,6 +594,7 @@ FUNCTION(i386_return_from_signal):
|
||||
lea 4(%esp), %edx
|
||||
int $99
|
||||
ret
|
||||
FUNCTION_END(i386_return_from_signal)
|
||||
FUNCTION(i386_end_return_from_signal):
|
||||
|
||||
|
||||
@ -607,6 +616,7 @@ FUNCTION(i386_restore_frame_from_syscall):
|
||||
// update the thread's kernel time and return
|
||||
UPDATE_THREAD_KERNEL_TIME()
|
||||
POP_IFRAME_AND_RETURN()
|
||||
FUNCTION_END(i386_restore_frame_from_syscall)
|
||||
|
||||
|
||||
/* status_t x86_vm86_enter(struct vm86_iframe *frame) */
|
||||
@ -644,6 +654,7 @@ FUNCTION(x86_vm86_enter):
|
||||
popa
|
||||
addl $16, %esp
|
||||
iret
|
||||
FUNCTION_END(x86_vm86_enter)
|
||||
|
||||
|
||||
/* void x86_vm86_return(struct vm86_iframe *frame, status_t retval) */
|
||||
@ -679,4 +690,4 @@ FUNCTION(x86_vm86_return):
|
||||
popl %edi
|
||||
popf
|
||||
ret
|
||||
|
||||
FUNCTION_END(x86_vm86_return)
|
||||
|
@ -7,9 +7,7 @@
|
||||
# include "asm_offsets.h"
|
||||
#endif
|
||||
|
||||
|
||||
#define FUNCTION(x) .global x; .type x,@function; x
|
||||
#define SYM(x) .global x; x
|
||||
#include <asm_defs.h>
|
||||
|
||||
|
||||
// We don't need the indirection in the boot loader.
|
||||
@ -26,7 +24,7 @@ FUNCTION(memcpy_generic):
|
||||
movl %edi,%eax /* save dest ptr as return address */
|
||||
movl 16(%esp),%esi /* source */
|
||||
movl 20(%esp),%ecx /* count */
|
||||
|
||||
|
||||
/* move by words */
|
||||
cld
|
||||
shrl $2,%ecx
|
||||
@ -38,11 +36,11 @@ FUNCTION(memcpy_generic):
|
||||
andl $3,%ecx
|
||||
rep
|
||||
movsb
|
||||
|
||||
|
||||
popl %edi
|
||||
popl %esi
|
||||
ret
|
||||
SYM(memcpy_generic_end):
|
||||
SYMBOL(memcpy_generic_end):
|
||||
|
||||
|
||||
#if !_BOOT_MODE
|
||||
|
@ -7,11 +7,12 @@
|
||||
* Distributed under the terms of the NewOS License.
|
||||
*/
|
||||
|
||||
#include <asm_defs.h>
|
||||
|
||||
#include <arch/x86/descriptors.h>
|
||||
|
||||
#include "syscall_numbers.h"
|
||||
|
||||
#define FUNCTION(x) .global x; .type x,@function; x
|
||||
|
||||
.text
|
||||
|
||||
@ -20,30 +21,35 @@ FUNCTION(arch_cpu_user_TLB_invalidate):
|
||||
movl %cr3,%eax
|
||||
movl %eax,%cr3
|
||||
ret
|
||||
FUNCTION_END(arch_cpu_user_TLB_invalidate)
|
||||
|
||||
/* void i386_fnsave(void *fpu_state); */
|
||||
FUNCTION(i386_fnsave):
|
||||
movl 4(%esp), %eax
|
||||
fnsave (%eax)
|
||||
ret
|
||||
FUNCTION_END(i386_fnsave)
|
||||
|
||||
/* void i386_fxsave(void *fpu_state); */
|
||||
FUNCTION(i386_fxsave):
|
||||
movl 4(%esp), %eax
|
||||
fxsave (%eax)
|
||||
ret
|
||||
FUNCTION_END(i386_fxsave)
|
||||
|
||||
/* void i386_frstor(const void *fpu_state); */
|
||||
FUNCTION(i386_frstor):
|
||||
movl 4(%esp), %eax
|
||||
frstor (%eax)
|
||||
ret
|
||||
FUNCTION_END(i386_frstor)
|
||||
|
||||
/* void i386_fxrstor(const void *fpu_state); */
|
||||
FUNCTION(i386_fxrstor):
|
||||
movl 4(%esp), %eax
|
||||
fxrstor (%eax)
|
||||
ret
|
||||
FUNCTION_END(i386_fxrstor)
|
||||
|
||||
/* void i386_fsave_swap(void *old_fpu_state, const void *new_fpu_state); */
|
||||
FUNCTION(i386_fnsave_swap):
|
||||
@ -52,6 +58,7 @@ FUNCTION(i386_fnsave_swap):
|
||||
movl 8(%esp),%eax
|
||||
frstor (%eax)
|
||||
ret
|
||||
FUNCTION_END(i386_fnsave_swap)
|
||||
|
||||
/* void i386_fxsave_swap(void *old_fpu_state, const void *new_fpu_state); */
|
||||
FUNCTION(i386_fxsave_swap):
|
||||
@ -60,39 +67,46 @@ FUNCTION(i386_fxsave_swap):
|
||||
movl 8(%esp),%eax
|
||||
fxrstor (%eax)
|
||||
ret
|
||||
FUNCTION_END(i386_fxsave_swap)
|
||||
|
||||
/* uint32 x86_read_ebp(); */
|
||||
FUNCTION(x86_read_ebp):
|
||||
movl %ebp, %eax
|
||||
ret
|
||||
FUNCTION_END(x86_read_ebp)
|
||||
|
||||
/* uint32 x86_read_cr0(); */
|
||||
FUNCTION(x86_read_cr0):
|
||||
movl %cr0, %eax
|
||||
ret
|
||||
FUNCTION_END(x86_read_cr0)
|
||||
|
||||
/* void x86_write_cr0(uint32 value); */
|
||||
FUNCTION(x86_write_cr0):
|
||||
movl 4(%esp), %eax
|
||||
movl %eax, %cr0
|
||||
ret
|
||||
FUNCTION_END(x86_write_cr0)
|
||||
|
||||
/* uint32 x86_read_cr4(); */
|
||||
FUNCTION(x86_read_cr4):
|
||||
movl %cr4, %eax
|
||||
ret
|
||||
FUNCTION_END(x86_read_cr4)
|
||||
|
||||
/* void x86_write_cr4(uint32 value); */
|
||||
FUNCTION(x86_write_cr4):
|
||||
movl 4(%esp), %eax
|
||||
movl %eax, %cr4
|
||||
ret
|
||||
FUNCTION_END(x86_write_cr4)
|
||||
|
||||
/* uint64 x86_read_msr(uint32 register); */
|
||||
FUNCTION(x86_read_msr):
|
||||
movl 4(%esp), %ecx
|
||||
rdmsr
|
||||
ret
|
||||
FUNCTION_END(x86_read_msr)
|
||||
|
||||
/* void x86_write_msr(uint32 register, uint64 value); */
|
||||
FUNCTION(x86_write_msr):
|
||||
@ -101,6 +115,7 @@ FUNCTION(x86_write_msr):
|
||||
movl 12(%esp), %edx
|
||||
wrmsr
|
||||
ret
|
||||
FUNCTION_END(x86_write_msr)
|
||||
|
||||
/* void i386_context_switch(struct arch_thread *old_state, struct arch_thread *new_state, addr new_pgdir); */
|
||||
FUNCTION(i386_context_switch):
|
||||
@ -119,12 +134,14 @@ skip_pgdir_swap:
|
||||
lss (%eax),%esp
|
||||
popa
|
||||
ret
|
||||
FUNCTION_END(i386_context_switch)
|
||||
|
||||
/* void i386_swap_pgdir(addr new_pgdir); */
|
||||
FUNCTION(i386_swap_pgdir):
|
||||
movl 4(%esp),%eax
|
||||
movl %eax,%cr3
|
||||
ret
|
||||
FUNCTION_END(i386_swap_pgdir)
|
||||
|
||||
/* thread exit stub - is copied to the userspace stack in arch_thread_enter_uspace() */
|
||||
.align 4
|
||||
@ -136,6 +153,7 @@ FUNCTION(x86_userspace_thread_exit):
|
||||
movl $SYSCALL_EXIT_THREAD, %eax
|
||||
int $99
|
||||
.align 4
|
||||
FUNCTION_END(x86_userspace_thread_exit)
|
||||
FUNCTION(x86_end_userspace_thread_exit):
|
||||
|
||||
|
||||
@ -157,6 +175,7 @@ FUNCTION(x86_enter_userspace):
|
||||
pushl $USER_CODE_SEG // user code segment
|
||||
pushl %eax // user IP
|
||||
iret
|
||||
FUNCTION_END(x86_enter_userspace)
|
||||
|
||||
/* void i386_switch_stack_and_call(addr stack, void (*func)(void *), void *arg); */
|
||||
FUNCTION(i386_switch_stack_and_call):
|
||||
@ -169,6 +188,7 @@ FUNCTION(i386_switch_stack_and_call):
|
||||
call *%ecx // call the target function
|
||||
_loop:
|
||||
jmp _loop
|
||||
FUNCTION_END(i386_switch_stack_and_call)
|
||||
|
||||
null_idt_descr:
|
||||
.word 0
|
||||
@ -179,6 +199,7 @@ FUNCTION(reboot):
|
||||
int $0
|
||||
done:
|
||||
jmp done
|
||||
FUNCTION_END(reboot)
|
||||
|
||||
|
||||
FUNCTION(arch_debug_save_registers):
|
||||
@ -219,6 +240,7 @@ FUNCTION(arch_debug_save_registers):
|
||||
popl %eax
|
||||
popl %esi
|
||||
ret
|
||||
FUNCTION_END(arch_debug_save_registers)
|
||||
|
||||
/* status_t arch_cpu_user_memcpy(void *to, const void *from, size_t size, addr_t *faultHandler) */
|
||||
FUNCTION(arch_cpu_user_memcpy):
|
||||
@ -231,7 +253,7 @@ FUNCTION(arch_cpu_user_memcpy):
|
||||
/* set the fault handler */
|
||||
movl 24(%esp),%edx /* fault handler */
|
||||
movl (%edx),%eax
|
||||
movl $.L_user_memcpy_error, (%edx)
|
||||
movl $.L_user_memcpy_error, (%edx)
|
||||
|
||||
/* move by words */
|
||||
cld
|
||||
@ -261,4 +283,5 @@ FUNCTION(arch_cpu_user_memcpy):
|
||||
popl %edi
|
||||
popl %esi
|
||||
ret
|
||||
FUNCTION_END(arch_cpu_user_memcpy)
|
||||
|
||||
|
@ -6,8 +6,8 @@
|
||||
* Distributed under the terms of the NewOS License.
|
||||
*/
|
||||
|
||||
#include <asm_defs.h>
|
||||
|
||||
#define FUNCTION(x) .global x; .type x,@function; x
|
||||
|
||||
.text
|
||||
|
||||
@ -26,6 +26,7 @@ FUNCTION(get_current_cpuid):
|
||||
popl %ebx
|
||||
xorl %eax, %eax /* return B_OK */
|
||||
ret
|
||||
FUNCTION_END(get_current_cpuid)
|
||||
|
||||
|
||||
/* unsigned int get_eflags(void) */
|
||||
@ -33,6 +34,7 @@ FUNCTION(get_eflags):
|
||||
pushfl
|
||||
popl %eax
|
||||
ret
|
||||
FUNCTION_END(get_eflags)
|
||||
|
||||
|
||||
/* void set_eflags(unsigned int val) */
|
||||
@ -40,3 +42,4 @@ FUNCTION(set_eflags):
|
||||
pushl 4(%esp)
|
||||
popfl
|
||||
ret
|
||||
FUNCTION_END(set_eflags)
|
||||
|
@ -3,8 +3,8 @@
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
|
||||
#define FUNCTION(x) .global x; .type x,@function; x
|
||||
#define SYM(x) .global x; x
|
||||
#include <asm_defs.h>
|
||||
|
||||
|
||||
.text
|
||||
|
||||
@ -14,7 +14,8 @@
|
||||
FUNCTION(_user_syscall_int):
|
||||
int $99
|
||||
ret
|
||||
SYM(_user_syscall_int_end):
|
||||
FUNCTION_END(_user_syscall_int)
|
||||
SYMBOL(_user_syscall_int_end):
|
||||
|
||||
|
||||
// Intel sysenter/sysexit
|
||||
@ -24,6 +25,7 @@ FUNCTION(_user_syscall_sysenter):
|
||||
movl %esp, %ecx
|
||||
sysenter
|
||||
ret
|
||||
SYM(_user_syscall_sysenter_end):
|
||||
FUNCTION_END(_user_syscall_sysenter)
|
||||
SYMBOL(_user_syscall_sysenter_end):
|
||||
|
||||
|
||||
|
@ -6,7 +6,8 @@
|
||||
** Distributed under the terms of the NewOS License.
|
||||
*/
|
||||
|
||||
#define FUNCTION(x) .global x; .type x,@function; x
|
||||
#include <asm_defs.h>
|
||||
|
||||
|
||||
.text
|
||||
|
||||
@ -17,6 +18,7 @@ FUNCTION(atomic_set):
|
||||
lock
|
||||
xchg %eax,(%edx)
|
||||
ret
|
||||
FUNCTION_END(atomic_set)
|
||||
|
||||
/* int32 atomic_test_and_set(vint32 *value, int32 newValue, int32 testAgainst) */
|
||||
FUNCTION(atomic_test_and_set):
|
||||
@ -26,6 +28,7 @@ FUNCTION(atomic_test_and_set):
|
||||
lock
|
||||
cmpxchgl %ecx,(%edx)
|
||||
ret
|
||||
FUNCTION_END(atomic_test_and_set)
|
||||
|
||||
/* int32 atomic_add(vint32 *value, int32 addValue) */
|
||||
FUNCTION(atomic_add):
|
||||
@ -34,6 +37,7 @@ FUNCTION(atomic_add):
|
||||
lock
|
||||
xaddl %eax,(%edx)
|
||||
ret
|
||||
FUNCTION_END(atomic_add)
|
||||
|
||||
/* int32 atomic_and(vint32 *value, int32 andValue) */
|
||||
FUNCTION(atomic_and):
|
||||
@ -46,6 +50,7 @@ _atomic_and1:
|
||||
cmpxchgl %ecx,(%edx)
|
||||
jnz _atomic_and1
|
||||
ret
|
||||
FUNCTION_END(atomic_and)
|
||||
|
||||
/* int32 atomic_or(vint32 *value, int32 orValue) */
|
||||
FUNCTION(atomic_or):
|
||||
@ -58,7 +63,8 @@ _atomic_or1:
|
||||
cmpxchgl %ecx,(%edx)
|
||||
jnz _atomic_or1
|
||||
ret
|
||||
|
||||
FUNCTION_END(atomic_or)
|
||||
|
||||
/* int32 atomic_get(vint32 *value) */
|
||||
FUNCTION(atomic_get):
|
||||
movl 4(%esp), %edx
|
||||
@ -69,6 +75,7 @@ _atomic_get1:
|
||||
cmpxchgl %ecx, (%edx)
|
||||
jnz _atomic_get1
|
||||
ret
|
||||
FUNCTION_END(atomic_get)
|
||||
|
||||
/* int64 atomic_set64(vint64 *value, int64 newValue) */
|
||||
FUNCTION(atomic_set64):
|
||||
@ -86,6 +93,7 @@ _atomic_set64_1:
|
||||
pop %ebx
|
||||
pop %ebp
|
||||
ret
|
||||
FUNCTION_END(atomic_set64)
|
||||
|
||||
/* int64 atomic_test_and_set64(vint64 *value, int64 newValue, int64 testAgainst) */
|
||||
FUNCTION(atomic_test_and_set64):
|
||||
@ -101,6 +109,7 @@ FUNCTION(atomic_test_and_set64):
|
||||
pop %ebx
|
||||
pop %ebp
|
||||
ret
|
||||
FUNCTION_END(atomic_test_and_set64)
|
||||
|
||||
/* int64 atomic_add64(vint64 *value, int64 addValue) */
|
||||
FUNCTION(atomic_add64):
|
||||
@ -120,6 +129,7 @@ _atomic_add64_1:
|
||||
pop %ebx
|
||||
pop %ebp
|
||||
ret
|
||||
FUNCTION_END(atomic_add64)
|
||||
|
||||
/* int64 atomic_and64(vint64 *value, int64 andValue) */
|
||||
FUNCTION(atomic_and64):
|
||||
@ -139,6 +149,7 @@ _atomic_and64_1:
|
||||
pop %ebx
|
||||
pop %ebp
|
||||
ret
|
||||
FUNCTION_END(atomic_and64)
|
||||
|
||||
/* int64 atomic_or64(vint64 *value, int64 orValue) */
|
||||
FUNCTION(atomic_or64):
|
||||
@ -158,6 +169,7 @@ _atomic_or64_1:
|
||||
pop %ebx
|
||||
pop %ebp
|
||||
ret
|
||||
FUNCTION_END(atomic_or64)
|
||||
|
||||
/* int64 atomic_get64(vint64 *value) */
|
||||
FUNCTION(atomic_get64):
|
||||
@ -175,3 +187,4 @@ _atomic_get64_1:
|
||||
pop %ebx
|
||||
pop %ebp
|
||||
ret
|
||||
FUNCTION_END(atomic_get64)
|
||||
|
@ -3,8 +3,7 @@
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
|
||||
|
||||
#define FUNCTION(x) .global x; .type x,@function; x
|
||||
#include <asm_defs.h>
|
||||
|
||||
|
||||
/* uint16 __swap_int16(uint16 value) */
|
||||
@ -13,6 +12,7 @@ FUNCTION(__swap_int16):
|
||||
bswap %eax
|
||||
shr $16, %eax
|
||||
ret
|
||||
FUNCTION_END(__swap_int16)
|
||||
|
||||
/* this one is much faster on a P4, courtesy of Marcus Overhagen,
|
||||
* a good candidate for per processor optimizations: */
|
||||
@ -28,6 +28,7 @@ FUNCTION(__swap_int32):
|
||||
movl 4(%esp), %eax
|
||||
bswap %eax
|
||||
ret
|
||||
FUNCTION_END(__swap_int32)
|
||||
|
||||
/* uint64 __swap_int64(uint64 value) */
|
||||
FUNCTION(__swap_int64):
|
||||
@ -36,6 +37,7 @@ FUNCTION(__swap_int64):
|
||||
bswap %eax
|
||||
bswap %edx
|
||||
ret
|
||||
FUNCTION_END(__swap_int64)
|
||||
|
||||
/* float __swap_float(float value) */
|
||||
FUNCTION(__swap_float):
|
||||
@ -44,6 +46,7 @@ FUNCTION(__swap_float):
|
||||
movl %eax, 4(%esp)
|
||||
fld 4(%esp)
|
||||
ret
|
||||
FUNCTION_END(__swap_float)
|
||||
|
||||
/* double __swap_double(double value) */
|
||||
FUNCTION(__swap_double):
|
||||
@ -55,3 +58,4 @@ FUNCTION(__swap_double):
|
||||
movl %edx, 8(%esp)
|
||||
fldl 4(%esp)
|
||||
ret
|
||||
FUNCTION_END(__swap_double)
|
||||
|
@ -1,11 +1,13 @@
|
||||
/*
|
||||
/*
|
||||
* Copyright 2005, Ingo Weinhold, bonefish@users.sf.net. All rights reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
|
||||
#define FUNCTION(x) .global x; .type x,@function; x
|
||||
#include <asm_defs.h>
|
||||
|
||||
|
||||
/* void *get_stack_frame() */
|
||||
FUNCTION(get_stack_frame):
|
||||
mov %ebp, %eax
|
||||
ret
|
||||
FUNCTION_END(get_stack_frame)
|
||||
|
@ -14,15 +14,15 @@
|
||||
* branch to the syscall vector in the commpage
|
||||
*/
|
||||
|
||||
#include <asm_defs.h>
|
||||
#include <commpage_defs.h>
|
||||
|
||||
#define _SYSCALL(name, n) \
|
||||
.globl name; \
|
||||
.type name,@function; \
|
||||
.align 8; \
|
||||
name: \
|
||||
movl $n,%eax; \
|
||||
jmp *(USER_COMMPAGE_ADDR + COMMPAGE_ENTRY_X86_SYSCALL * 4)
|
||||
#define _SYSCALL(name, n) \
|
||||
.align 8; \
|
||||
FUNCTION(name): \
|
||||
movl $n,%eax; \
|
||||
jmp *(USER_COMMPAGE_ADDR + COMMPAGE_ENTRY_X86_SYSCALL * 4); \
|
||||
FUNCTION_END(name)
|
||||
|
||||
#define SYSCALL0(name, n) _SYSCALL(name, n)
|
||||
#define SYSCALL1(name, n) _SYSCALL(name, n)
|
||||
|
@ -3,7 +3,8 @@
|
||||
** Distributed under the terms of the NewOS License.
|
||||
*/
|
||||
|
||||
#define FUNCTION(x) .global x; .type x,@function; x
|
||||
#include <asm_defs.h>
|
||||
|
||||
|
||||
.text
|
||||
|
||||
@ -15,6 +16,7 @@ FUNCTION(__x86_setup_system_time):
|
||||
movl 4(%esp),%eax
|
||||
movl %eax,cv_factor
|
||||
ret
|
||||
FUNCTION_END(__x86_setup_system_time)
|
||||
|
||||
/* long long system_time(); */
|
||||
FUNCTION(system_time):
|
||||
@ -36,3 +38,4 @@ FUNCTION(system_time):
|
||||
popl %ecx
|
||||
popl %ebx
|
||||
ret
|
||||
FUNCTION_END(system_time)
|
||||
|
@ -1,5 +1,7 @@
|
||||
SubDir HAIKU_TOP src system libroot posix arch x86 ;
|
||||
|
||||
UsePrivateSystemHeaders ;
|
||||
|
||||
local genericSources =
|
||||
setjmp_save_sigs.c
|
||||
longjmp_return.c
|
||||
|
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
** Copyright 2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
|
||||
** Distributed under the terms of the Haiku License.
|
||||
*/
|
||||
@ -14,6 +14,6 @@
|
||||
#define JMP_REGS_ESP 16
|
||||
#define JMP_REGS_PC 20
|
||||
|
||||
#define FUNCTION(x) .global x; .type x,@function; x
|
||||
#include <asm_defs.h>
|
||||
|
||||
#endif /* SETJMP_INTERNAL_H */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
** Copyright 2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
|
||||
** Distributed under the terms of the Haiku License.
|
||||
*/
|
||||
@ -36,6 +36,7 @@ FUNCTION(_longjmp):
|
||||
add $8, %esp
|
||||
|
||||
ret
|
||||
FUNCTION_END(siglongjmp)
|
||||
|
||||
|
||||
#pragma weak longjmp=siglongjmp
|
||||
|
@ -4,7 +4,6 @@
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
|
||||
|
||||
#include "setjmp_internal.h"
|
||||
|
||||
|
||||
@ -39,6 +38,7 @@ sigsetjmp_setjmp_entry:
|
||||
mov %edx, JMP_REGS_PC(%eax)
|
||||
|
||||
jmp __setjmp_save_sigs
|
||||
FUNCTION_END(sigsetjmp)
|
||||
|
||||
|
||||
/* int setjmp(jmp_buf buffer) */
|
||||
@ -55,6 +55,7 @@ FUNCTION(setjmp):
|
||||
add $8, %esp
|
||||
|
||||
ret
|
||||
FUNCTION_END(setjmp)
|
||||
|
||||
|
||||
#pragma weak _setjmp=setjmp
|
||||
|
Loading…
x
Reference in New Issue
Block a user