| // SPDX-License-Identifier: GPL-2.0 |
| #include <bpf/bpf_helpers.h> |
| #if (defined(__TARGET_ARCH_arm64) || defined(__TARGET_ARCH_x86) || \ |
| (defined(__TARGET_ARCH_riscv) && __riscv_xlen == 64) || \ |
| defined(__TARGET_ARCH_arm) || defined(__TARGET_ARCH_s390) || \ |
| defined(__TARGET_ARCH_loongarch)) && \ |
| __description("BSWAP, 16") |
| __success __success_unpriv __retval(0x23ff) |
| __naked void bswap_16(void) |
| __description("BSWAP, 32") |
| __success __success_unpriv __retval(0x23ff0000) |
| __naked void bswap_32(void) |
| __description("BSWAP, 64") |
| __success __success_unpriv __retval(0x34ff12ff) |
| __naked void bswap_64(void) |
| : [u64_val]"i"(0xff12ff34ff56ff78ull) |
| __description("cpuv4 is not supported by compiler or jit, use a dummy test") |
| char _license[] SEC("license") = "GPL"; |