/
githubmirror
/
ipxe
Обзор
Документация
Войти
/
githubmirror
/
ipxe
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/arch/loong64/include/bits/byteswap.h
48 строк
1 KB
Michael Brown
[build] Mark core loong64 headers as permitted for UEFI Secure Boot
21 май 2026, 13:36
21 май 2026, 13:36
28b4b70
Код
Авторство
О чём код?
#ifndef _BITS_BYTESWAP_H #define _BITS_BYTESWAP_H /** @file * * Byte-order swapping functions * */ #include <stdint.h> FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); FILE_SECBOOT ( PERMITTED ); static inline __attribute__ (( always_inline, const )) uint16_t __bswap_variable_16 ( uint16_t x ) { __asm__ ( "revb.2h %0, %1" : "=r" ( x ) : "r" ( x ) ); return x; } static inline __attribute__ (( always_inline )) void __bswap_16s ( uint16_t *x ) { *x = __bswap_variable_16 ( *x ); } static inline __attribute__ (( always_inline, const )) uint32_t __bswap_variable_32 ( uint32_t x ) { __asm__ ( "revb.2w %0, %1" : "=r" ( x ) : "r" ( x ) ); return x; } static inline __attribute__ (( always_inline )) void __bswap_32s ( uint32_t *x ) { *x = __bswap_variable_32 ( *x ); } static inline __attribute__ (( always_inline, const )) uint64_t __bswap_variable_64 ( uint64_t x ) { __asm__ ( "revb.d %0, %1" : "=r" ( x ) : "r" ( x ) ); return x; } static inline __attribute__ (( always_inline )) void __bswap_64s ( uint64_t *x ) { *x = __bswap_variable_64 ( *x ); } #endif