diff --git a/include/rp_kernel_on_cpu.h b/include/rp_kernel_on_cpu.h index 5b8361a4a..90f29b660 100644 --- a/include/rp_kernel_on_cpu.h +++ b/include/rp_kernel_on_cpu.h @@ -6,7 +6,7 @@ #ifndef _RP_KERNEL_ON_CPU_H #define _RP_KERNEL_ON_CPU_H -#define swap_workaround(n) __builtin_bswap32(n) +u32 swap_workaround (const u32 n); u32 apply_rule (const u32 name, const u32 p0, const u32 p1, u32 buf0[4], u32 buf1[4], const u32 in_len); u32 apply_rules (u32 *cmds, u32 buf0[4], u32 buf1[4], const u32 len); diff --git a/src/rp_kernel_on_cpu.c b/src/rp_kernel_on_cpu.c index 30e46afe3..8a9d37eb1 100644 --- a/src/rp_kernel_on_cpu.c +++ b/src/rp_kernel_on_cpu.c @@ -8,8 +8,14 @@ #include "common.h" #include "types.h" +#include "bitops.h" #include "rp_kernel_on_cpu.h" +u32 swap_workaround (const u32 n) +{ + return byte_swap_32 (n); +} + static u32 generate_cmask (u32 buf) { const u32 rmask = ((buf & 0x40404040) >> 1)