libspdm icon indicating copy to clipboard operation
libspdm copied to clipboard

consider big endian system architecture

Open jyao1 opened this issue 4 years ago • 5 comments

Currently, some libspdm code uses *(uint64 *) for a buffer. It wont work for a big endian system.

We need use byte array access to reconstruct the uint64.

jyao1 avatar Nov 09 '21 10:11 jyao1

Also help avoid getting yelled at by Mr. Torvalds. https://lkml.org/lkml/2021/9/1/1175

steven-bellock avatar Nov 13 '21 19:11 steven-bellock

11/15/2021 - approved. Also consider alignment issue - TBD in another issue.

jyao1 avatar Nov 15 '21 15:11 jyao1

I will check it.

Wenxing-hou avatar Dec 03 '21 02:12 Wenxing-hou

Unless anyone objects we should require that endianness is determined at compile time via spdm_lib_config.h and that we default to little-endian (sorry IBM!). Something like

#define LIBSPDM_ENDIAN_LITTLE 0
#define LIBSPDM_ENDIAN_BIG 1

#define LIBSPDM_ENDIAN LIBSPDM_ENDIAN_LITTLE 

steven-bellock avatar Dec 06 '21 18:12 steven-bellock

Will defer to STABLE 0.2.

steven-bellock avatar Dec 13 '21 15:12 steven-bellock

Since nobody has been asking for this I will close this issue for now. If someone needs libspdm to support big-endianness then they can file a new and fresher issue.

steven-bellock avatar Jul 12 '24 14:07 steven-bellock