Implemented __swap_int16/32/64() (float/double are missing right now, but should
be the same as __swap_int32/64()). git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4527 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
bc981e9a90
commit
7cde8a9d7f
@ -2,6 +2,7 @@ SubDir OBOS_TOP src kernel libroot os arch x86 ;
|
||||
|
||||
KernelMergeObject os_arch_$(OBOS_ARCH).o :
|
||||
<$(SOURCE_GRIST)>atomic.S
|
||||
<$(SOURCE_GRIST)>byteorder.S
|
||||
<$(SOURCE_GRIST)>cpuid.S
|
||||
<$(SOURCE_GRIST)>systeminfo.c
|
||||
<$(SOURCE_GRIST)>system_time.S
|
||||
@ -13,6 +14,7 @@ KernelMergeObject os_arch_$(OBOS_ARCH).o :
|
||||
|
||||
MergeObjectFromObjects kernel_os_arch_$(OBOS_ARCH).o :
|
||||
<$(SOURCE_GRIST)>atomic.o
|
||||
<$(SOURCE_GRIST)>byteorder.S
|
||||
<$(SOURCE_GRIST)>cpuid.o
|
||||
<$(SOURCE_GRIST)>system_time.o
|
||||
;
|
||||
|
33
src/kernel/libroot/os/arch/x86/byteorder.S
Normal file
33
src/kernel/libroot/os/arch/x86/byteorder.S
Normal file
@ -0,0 +1,33 @@
|
||||
/*
|
||||
** Copyright 2003, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
|
||||
** Distributed under the terms of the OpenBeOS License.
|
||||
*/
|
||||
|
||||
|
||||
#define FUNCTION(x) .global x; .type x,@function; x
|
||||
|
||||
|
||||
/* uint16 __swap_int16(uint16 value) */
|
||||
FUNCTION(__swap_int16):
|
||||
movl 4(%esp), %eax
|
||||
bswap %eax
|
||||
shr $16, %eax
|
||||
ret
|
||||
|
||||
/* uint32 __swap_int32(uint32 value) */
|
||||
FUNCTION(__swap_int32):
|
||||
movl 4(%esp), %eax
|
||||
bswap %eax
|
||||
ret
|
||||
|
||||
/* uint64 __swap_int64(uint64 value) */
|
||||
FUNCTION(__swap_int64):
|
||||
movl 4(%esp), %edx /* the 32-bits registers are swapped here */
|
||||
movl 8(%esp), %eax
|
||||
bswap %eax
|
||||
bswap %edx
|
||||
ret
|
||||
|
||||
/* float __swap_float(float value) */
|
||||
|
||||
/* double __swap_double(double value) */
|
Loading…
Reference in New Issue
Block a user