arch: Replace __builtin_bswapxx with bswapxx
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
6eb0ef618d
commit
739210708a
@ -33,6 +33,7 @@
|
||||
#include <assert.h>
|
||||
#include <debug.h>
|
||||
#include <errno.h>
|
||||
#include <endian.h>
|
||||
|
||||
#include <arpa/inet.h>
|
||||
|
||||
@ -321,8 +322,8 @@ static inline void imx_enet_modifyreg32(struct imx_driver_s *priv,
|
||||
static inline uint32_t imx_swap32(uint32_t value);
|
||||
static inline uint16_t imx_swap16(uint16_t value);
|
||||
#else
|
||||
# define imx_swap32 __builtin_bswap32
|
||||
# define imx_swap16 __builtin_bswap16
|
||||
# define imx_swap32 swap32
|
||||
# define imx_swap16 swap16
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
@ -33,6 +33,7 @@
|
||||
#include <assert.h>
|
||||
#include <debug.h>
|
||||
#include <errno.h>
|
||||
#include <endian.h>
|
||||
|
||||
#include <arpa/inet.h>
|
||||
|
||||
@ -364,8 +365,8 @@ static inline void imxrt_enet_modifyreg32(struct imxrt_driver_s *priv,
|
||||
static inline uint32_t imxrt_swap32(uint32_t value);
|
||||
static inline uint16_t imxrt_swap16(uint16_t value);
|
||||
#else
|
||||
# define imxrt_swap32 __builtin_bswap32
|
||||
# define imxrt_swap16 __builtin_bswap16
|
||||
# define imxrt_swap32 swap32
|
||||
# define imxrt_swap16 swap16
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
@ -32,6 +32,7 @@
|
||||
#include <assert.h>
|
||||
#include <debug.h>
|
||||
#include <errno.h>
|
||||
#include <endian.h>
|
||||
|
||||
#include <arpa/inet.h>
|
||||
|
||||
@ -299,8 +300,8 @@ static uint8_t g_buffer_pool[NENET_NBUFFERS * S32K1XX_BUF_SIZE]
|
||||
static inline uint32_t s32k1xx_swap32(uint32_t value);
|
||||
static inline uint16_t s32k1xx_swap16(uint16_t value);
|
||||
#else
|
||||
# define s32k1xx_swap32 __builtin_bswap32
|
||||
# define s32k1xx_swap16 __builtin_bswap16
|
||||
# define s32k1xx_swap32 swap32
|
||||
# define s32k1xx_swap16 swap16
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
@ -61,6 +61,7 @@
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <debug.h>
|
||||
#include <endian.h>
|
||||
|
||||
#include <nuttx/irq.h>
|
||||
#include <nuttx/arch.h>
|
||||
@ -1655,7 +1656,7 @@ static void s32k1xx_lpspi_exchange_nodma(struct spi_dev_s *dev,
|
||||
|
||||
if (src)
|
||||
{
|
||||
word = __builtin_bswap16(*src++);
|
||||
word = swap16(*src++);
|
||||
|
||||
/* read the required number of bytes */
|
||||
}
|
||||
@ -1672,7 +1673,7 @@ static void s32k1xx_lpspi_exchange_nodma(struct spi_dev_s *dev,
|
||||
|
||||
if (dest)
|
||||
{
|
||||
*dest++ = __builtin_bswap16(word);
|
||||
*dest++ = swap16(word);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -57,6 +57,7 @@
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <debug.h>
|
||||
#include <endian.h>
|
||||
|
||||
#include <nuttx/irq.h>
|
||||
#include <nuttx/arch.h>
|
||||
@ -1705,7 +1706,7 @@ static void s32k3xx_lpspi_exchange_nodma(struct spi_dev_s *dev,
|
||||
|
||||
if (src)
|
||||
{
|
||||
word = __builtin_bswap16(*src++);
|
||||
word = swap16(*src++);
|
||||
|
||||
/* read the required number of bytes */
|
||||
}
|
||||
@ -1722,7 +1723,7 @@ static void s32k3xx_lpspi_exchange_nodma(struct spi_dev_s *dev,
|
||||
|
||||
if (dest)
|
||||
{
|
||||
*dest++ = __builtin_bswap16(word);
|
||||
*dest++ = swap16(word);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user