Changeset 776f2e6 in mainline for uspace/lib/libc
- Timestamp:
- 2008-04-03T20:46:47Z (17 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 12ab886
- Parents:
- 5d494b3
- Location:
- uspace/lib/libc
- Files:
-
- 4 added
- 4 deleted
- 6 moved
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/libc/arch/amd64/include/byteorder.h
r5d494b3 r776f2e6 1 1 /* 2 * Copyright (c) 200 6 Josef Cejka2 * Copyright (c) 2005 Jakub Jermar 3 3 * All rights reserved. 4 4 * … … 33 33 */ 34 34 35 #ifndef LIBC_amd64_ ENDIAN_H_36 #define LIBC_amd64_ ENDIAN_H_35 #ifndef LIBC_amd64_BYTEORDER_H_ 36 #define LIBC_amd64_BYTEORDER_H_ 37 37 38 #ifndef LIBC_ENDIAN_H_ 39 # error "Never use <libarch/endian.h> directly - use <endian.h> instead." 40 #endif 41 42 #define __BYTE_ORDER __LITTLE_ENDIAN 38 /* AMD64 is little-endian */ 39 #define ARCH_IS_LITTLE_ENDIAN 43 40 44 41 #endif -
uspace/lib/libc/arch/arm32/include/byteorder.h
r5d494b3 r776f2e6 1 1 /* 2 * Copyright (c) 200 6 Josef Cejka2 * Copyright (c) 2005 Jakub Jermar 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 /** @addtogroup libc ia3229 /** @addtogroup libcarm32 30 30 * @{ 31 31 */ 32 32 /** @file 33 * @brief Endianness definitions. 33 34 */ 34 35 35 #ifndef LIBC_ ia32_ENDIAN_H_36 #define LIBC_ ia32_ENDIAN_H_36 #ifndef LIBC_arm32_BYTEORDER_H_ 37 #define LIBC_arm32_BYTEORDER_H_ 37 38 38 #ifndef LIBC_ENDIAN_H_ 39 # error "Never use <libarch/endian.h> directly - use <endian.h> instead." 40 #endif 41 42 #define __BYTE_ORDER __LITTLE_ENDIAN 39 #define ARCH_IS_BIG_ENDIAN 43 40 44 41 #endif -
uspace/lib/libc/arch/ia32/include/byteorder.h
r5d494b3 r776f2e6 1 1 /* 2 * Copyright (c) 200 6 Josef Cejka2 * Copyright (c) 2005 Jakub Jermar 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 /** @addtogroup libc ppc6429 /** @addtogroup libcia32 30 30 * @{ 31 31 */ … … 33 33 */ 34 34 35 #ifndef LIBC_ ppc64_ENDIAN_H_36 #define LIBC_ ppc64_ENDIAN_H_35 #ifndef LIBC_ia32_BYTEORDER_H_ 36 #define LIBC_ia32_BYTEORDER_H_ 37 37 38 #ifndef LIBC_ENDIAN_H_ 39 # error "Never use <libarch/endian.h> directly - use <endian.h> instead." 40 #endif 41 42 #define __BYTE_ORDER __BIG_ENDIAN 38 /* IA-32 is little-endian */ 39 #define ARCH_IS_LITTLE_ENDIAN 43 40 44 41 #endif -
uspace/lib/libc/arch/ia64/include/byteorder.h
r5d494b3 r776f2e6 1 1 /* 2 * Copyright (c) 200 6 Josef Cejka2 * Copyright (c) 2005 Jakub Jermar 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 /** @addtogroup libc ppc3229 /** @addtogroup libcia64 30 30 * @{ 31 31 */ … … 33 33 */ 34 34 35 #ifndef LIBC_ ppc32_ENDIAN_H_36 #define LIBC_ ppc32_ENDIAN_H_35 #ifndef LIBC_ia64_BYTEORDER_H_ 36 #define LIBC_ia64_BYTEORDER_H_ 37 37 38 #ifndef LIBC_ENDIAN_H_ 39 # error "Never use <libarch/endian.h> directly - use <endian.h> instead." 40 #endif 41 42 #define __BYTE_ORDER __BIG_ENDIAN 38 /* IA-64 is little-endian */ 39 #define ARCH_IS_LITTLE_ENDIAN 43 40 44 41 #endif -
uspace/lib/libc/arch/mips32/include/byteorder.h
r5d494b3 r776f2e6 1 1 /* 2 * Copyright (c) 200 6 Josef Cejka2 * Copyright (c) 2005 Jakub Jermar 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 /** @addtogroup libc ia6429 /** @addtogroup libcmips32 30 30 * @{ 31 31 */ … … 33 33 */ 34 34 35 #ifndef LIBC_ ia64_ENDIAN_H_36 #define LIBC_ ia64_ENDIAN_H_35 #ifndef LIBC_mips32_BYTEORDER_H_ 36 #define LIBC_mips32_BYTEORDER_H_ 37 37 38 #ifndef LIBC_ENDIAN_H_ 39 # error "Never use <libarch/endian.h> directly - use <endian.h> instead." 40 #endif 41 42 #define __BYTE_ORDER __LITTLE_ENDIAN 38 #define ARCH_IS_LITTLE_ENDIAN 43 39 44 40 #endif -
uspace/lib/libc/include/byteorder.h
r5d494b3 r776f2e6 1 1 /* 2 * Copyright (c) 200 6 Josef Cejka2 * Copyright (c) 2005 Jakub Jermar 3 3 * All rights reserved. 4 4 * … … 33 33 */ 34 34 35 #ifndef LIBC_ ENDIAN_H_36 #define LIBC_ ENDIAN_H_35 #ifndef LIBC_BYTEORDER_H_ 36 #define LIBC_BYTEORDER_H_ 37 37 38 # define __LITTLE_ENDIAN 123439 # define __BIG_ENDIAN 432138 #include <libarch/byteorder.h> 39 #include <stdint.h> 40 40 41 #include <stdint.h> 42 #include <libarch/endian.h> 41 #if !(defined(ARCH_IS_BIG_ENDIAN) ^ defined(ARCH_IS_LITTLE_ENDIAN)) 42 #error The architecture must be either big-endian or little-endian. 43 #endif 43 44 44 #if (__BYTE_ORDER == __BIG_ENDIAN)45 #ifdef ARCH_IS_BIG_ENDIAN 45 46 46 47 #define uint16_t_le2host(n) uint16_t_byteorder_swap(n) … … 63 64 64 65 #endif 65 66 66 67 67 static inline uint64_t uint64_t_byteorder_swap(uint64_t n)
Note:
See TracChangeset
for help on using the changeset viewer.