Changeset 776f2e6 in mainline


Ignore:
Timestamp:
2008-04-03T20:46:47Z (17 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
12ab886
Parents:
5d494b3
Message:

Replace all endian.h in uspace with a copy of the kernel's respective byteorder.h.

Location:
uspace
Files:
4 added
4 deleted
2 edited
6 moved

Legend:

Unmodified
Added
Removed
  • uspace/lib/libc/arch/amd64/include/byteorder.h

    r5d494b3 r776f2e6  
    11/*
    2  * Copyright (c) 2006 Josef Cejka
     2 * Copyright (c) 2005 Jakub Jermar
    33 * All rights reserved.
    44 *
     
    3333 */
    3434
    35 #ifndef LIBC_amd64_ENDIAN_H_
    36 #define LIBC_amd64_ENDIAN_H_
     35#ifndef LIBC_amd64_BYTEORDER_H_
     36#define LIBC_amd64_BYTEORDER_H_
    3737
    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
    4340
    4441#endif
  • uspace/lib/libc/arch/arm32/include/byteorder.h

    r5d494b3 r776f2e6  
    11/*
    2  * Copyright (c) 2006 Josef Cejka
     2 * Copyright (c) 2005 Jakub Jermar
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 /** @addtogroup libcia32
     29/** @addtogroup libcarm32
    3030 * @{
    3131 */
    3232/** @file
     33 *  @brief Endianness definitions.
    3334 */
    3435
    35 #ifndef LIBC_ia32_ENDIAN_H_
    36 #define LIBC_ia32_ENDIAN_H_
     36#ifndef LIBC_arm32_BYTEORDER_H_
     37#define LIBC_arm32_BYTEORDER_H_
    3738
    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
    4340
    4441#endif
  • uspace/lib/libc/arch/ia32/include/byteorder.h

    r5d494b3 r776f2e6  
    11/*
    2  * Copyright (c) 2006 Josef Cejka
     2 * Copyright (c) 2005 Jakub Jermar
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 /** @addtogroup libcppc64       
     29/** @addtogroup libcia32       
    3030 * @{
    3131 */
     
    3333 */
    3434
    35 #ifndef LIBC_ppc64_ENDIAN_H_
    36 #define LIBC_ppc64_ENDIAN_H_
     35#ifndef LIBC_ia32_BYTEORDER_H_
     36#define LIBC_ia32_BYTEORDER_H_
    3737
    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
    4340
    4441#endif
  • uspace/lib/libc/arch/ia64/include/byteorder.h

    r5d494b3 r776f2e6  
    11/*
    2  * Copyright (c) 2006 Josef Cejka
     2 * Copyright (c) 2005 Jakub Jermar
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 /** @addtogroup libcppc32       
     29/** @addtogroup libcia64
    3030 * @{
    3131 */
     
    3333 */
    3434
    35 #ifndef LIBC_ppc32_ENDIAN_H_
    36 #define LIBC_ppc32_ENDIAN_H_
     35#ifndef LIBC_ia64_BYTEORDER_H_
     36#define LIBC_ia64_BYTEORDER_H_
    3737
    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
    4340
    4441#endif
  • uspace/lib/libc/arch/mips32/include/byteorder.h

    r5d494b3 r776f2e6  
    11/*
    2  * Copyright (c) 2006 Josef Cejka
     2 * Copyright (c) 2005 Jakub Jermar
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 /** @addtogroup libcia64       
     29/** @addtogroup libcmips32
    3030 * @{
    3131 */
     
    3333 */
    3434
    35 #ifndef LIBC_ia64_ENDIAN_H_
    36 #define LIBC_ia64_ENDIAN_H_
     35#ifndef LIBC_mips32_BYTEORDER_H_
     36#define LIBC_mips32_BYTEORDER_H_
    3737
    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
    4339
    4440#endif
  • uspace/lib/libc/include/byteorder.h

    r5d494b3 r776f2e6  
    11/*
    2  * Copyright (c) 2006 Josef Cejka
     2 * Copyright (c) 2005 Jakub Jermar
    33 * All rights reserved.
    44 *
     
    3333 */
    3434
    35 #ifndef LIBC_ENDIAN_H_
    36 #define LIBC_ENDIAN_H_
     35#ifndef LIBC_BYTEORDER_H_
     36#define LIBC_BYTEORDER_H_
    3737
    38 #define __LITTLE_ENDIAN 1234
    39 #define __BIG_ENDIAN    4321
     38#include <libarch/byteorder.h>
     39#include <stdint.h>
    4040
    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
    4344
    44 #if (__BYTE_ORDER == __BIG_ENDIAN)
     45#ifdef ARCH_IS_BIG_ENDIAN
    4546
    4647#define uint16_t_le2host(n)             uint16_t_byteorder_swap(n)
     
    6364
    6465#endif
    65 
    6666
    6767static inline uint64_t uint64_t_byteorder_swap(uint64_t n)
  • uspace/lib/softfloat/include/sftypes.h

    r5d494b3 r776f2e6  
    3636#define __SFTYPES_H__
    3737
    38 #include <endian.h>
     38#include <byteorder.h>
    3939#include <stdint.h>
    4040
     
    4444
    4545        struct  {
    46                 #if __BYTE_ORDER == __BIG_ENDIAN
     46#if defined(ARCH_IS_BIG_ENDIAN)
    4747                uint32_t sign:1;
    4848                uint32_t exp:8;
    4949                uint32_t fraction:23;
    50                 #elif __BYTE_ORDER == __LITTLE_ENDIAN
     50#elif defined(ARCH_IS_LITTLE_ENDIAN)
    5151                uint32_t fraction:23;
    5252                uint32_t exp:8;
    5353                uint32_t sign:1;
    54                 #else
    55                         #error "Unknown endians."
    56                 #endif
     54#else
     55#error "Unknown endians."
     56#endif
    5757                } parts __attribute__ ((packed));
    5858        } float32;
     
    6363       
    6464        struct  {
    65                 #if __BYTE_ORDER == __BIG_ENDIAN
     65#if defined(ARCH_IS_BIG_ENDIAN)
    6666                uint64_t sign:1;
    6767                uint64_t exp:11;
    6868                uint64_t fraction:52;
    69                 #elif __BYTE_ORDER == __LITTLE_ENDIAN
     69#elif defined(ARCH_IS_LITTLE_ENDIAN)
    7070                uint64_t fraction:52;
    7171                uint64_t exp:11;
    7272                uint64_t sign:1;
    73                 #else
    74                         #error "Unknown endians."
    75                 #endif
     73#else
     74#error "Unknown endians."
     75#endif
    7676                } parts __attribute__ ((packed));
    7777        } float64;
     
    8282#define FLOAT64_MIN
    8383
    84 /* For recognizing NaNs or infinity use isFloat32NaN and is Float32Inf, comparing with this constants is not sufficient */
     84/*
     85 * For recognizing NaNs or infinity use isFloat32NaN and is Float32Inf,
     86 * comparing with these constants is not sufficient.
     87 */
    8588#define FLOAT32_NAN 0x7FC00001
    8689#define FLOAT32_SIGNAN 0x7F800001
  • uspace/srv/fs/fat/fat_ops.c

    r5d494b3 r776f2e6  
    4343#include <errno.h>
    4444#include <string.h>
    45 #include <endian.h>
     45#include <byteorder.h>
    4646
    4747#define FAT_NAME_LEN            8
Note: See TracChangeset for help on using the changeset viewer.