Changeset 2711914f in rtems


Ignore:
Timestamp:
Jan 23, 2017, 7:06:41 AM (3 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
4aa23c96
Parents:
dc9b704
git-author:
Sebastian Huber <sebastian.huber@…> (01/23/17 07:06:41)
git-committer:
Sebastian Huber <sebastian.huber@…> (01/24/17 07:39:22)
Message:

Use <sys/endian.h>

Update #2803.

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • c/src/libchip/ide/ata_internal.h

    rdc9b704 r2711914f  
    1717
    1818#include <sys/param.h>
     19#include <sys/endian.h>
    1920#include <rtems.h>
    2021#include <sys/types.h>
     
    3536 * BE = big-endian, c: W = word (16 bits), L = longword (32 bits)
    3637 */
    37 #if (CPU_BIG_ENDIAN == TRUE)
    38 #    define CF_LE_W(v) CPU_swap_u16(v)
    39 #    define CF_LE_L(v) CPU_swap_u32(v)
    40 #    define CT_LE_W(v) CPU_swap_u16(v)
    41 #    define CT_LE_L(v) CPU_swap_u32(v)
    42 #else
    43 #    define CF_LE_W(v) (v)
    44 #    define CF_LE_L(v) (v)
    45 #    define CT_LE_W(v) (v)
    46 #    define CT_LE_L(v) (v)
    47 #endif
     38#define CF_LE_W(v) le16toh(v)
     39#define CF_LE_L(v) le32toh(v)
     40#define CT_LE_W(v) htole16(v)
     41#define CT_LE_L(v) htole32(v)
    4842
    4943#define ATA_UNDEFINED_VALUE   (-1)
  • cpukit/libblock/include/rtems/ide_part_table.h

    rdc9b704 r2711914f  
    2727#include <sys/ioctl.h>
    2828#include <sys/types.h>
     29#include <sys/endian.h>
    2930#include <sys/stat.h>
    3031#include <unistd.h>
     
    5859 * Conversion from and to little-endian byte order. (no-op on i386/i486)
    5960 */
    60 
    61 #if (CPU_BIG_ENDIAN == TRUE)
    62 #   define LE_TO_CPU_U16(v) CPU_swap_u16(v)
    63 #   define LE_TO_CPU_U32(v) CPU_swap_u32(v)
    64 #   define CPU_TO_LE_U16(v) CPU_swap_u16(v)
    65 #   define CPU_TO_LE_U32(v) CPU_swap_u32(v)
    66 #else
    67 #   define LE_TO_CPU_U16(v) (v)
    68 #   define LE_TO_CPU_U32(v) (v)
    69 #   define CPU_TO_LE_U16(v) (v)
    70 #   define CPU_TO_LE_U32(v) (v)
    71 #endif
    72 
     61#define LE_TO_CPU_U16(v) le16toh(v)
     62#define LE_TO_CPU_U32(v) le32toh(v)
     63#define CPU_TO_LE_U16(v) htole16(v)
     64#define CPU_TO_LE_U32(v) htole32(v)
    7365
    7466/*
  • cpukit/libfs/src/dosfs/fat.h

    rdc9b704 r2711914f  
    2424
    2525#include <sys/param.h>
     26#include <sys/endian.h>
    2627#include <string.h>
    2728
    2829#include <rtems/seterr.h>
    2930
    30 #include <rtems/score/cpu.h>
    3131#include <errno.h>
    3232#include <rtems/bdbuf.h>
     
    5757 * BE = big-endian, c: W = word (16 bits), L = longword (32 bits)
    5858 */
    59 
    60 #if (CPU_BIG_ENDIAN == TRUE)
    61 #    define CF_LE_W(v) CPU_swap_u16((uint16_t)(v))
    62 #    define CF_LE_L(v) CPU_swap_u32((uint32_t)(v))
    63 #    define CT_LE_W(v) CPU_swap_u16((uint16_t)(v))
    64 #    define CT_LE_L(v) CPU_swap_u32((uint32_t)(v))
    65 #else
    66 #    define CF_LE_W(v) (v)
    67 #    define CF_LE_L(v) (v)
    68 #    define CT_LE_W(v) (v)
    69 #    define CT_LE_L(v) (v)
    70 #endif
     59#define CF_LE_W(v) le16toh(v)
     60#define CF_LE_L(v) le32toh(v)
     61#define CT_LE_W(v) htole16(v)
     62#define CT_LE_L(v) htole32(v)
    7163
    7264#define FAT_HASH_SIZE   2
  • cpukit/libmisc/shell/main_pci.c

    rdc9b704 r2711914f  
    2020#include <pci/cfg.h>
    2121#include <pci/access.h>
    22 #include <rtems/endian.h>
     22#include <sys/endian.h>
    2323#include <bsp.h> /* For PCI endianness config */
    2424
     
    417417        printf(" NO. PCI BUSES:     %d buses\n", pci_bus_count());
    418418        printf(" PCI ENDIAN:        %s\n", pci_endian ? "Big" : "Little");
    419 #if (CPU_LITTLE_ENDIAN == TRUE)
     419#if BYTE_ORDER == LITTLE_ENDIAN
    420420        puts(" MACHINE ENDIAN:    Little");
    421421#else
Note: See TracChangeset for help on using the changeset viewer.