The additional function is straightforward, since endianness is a compile time constant in the Or1ksim ISS.
int or1ksim_is_le();
or1ksim_is_le
returns 1 if Or1ksim is
modeling a little endian
architecture, 0 otherwise. It is needed to ensure the payload is
packed with the correct byte ordering.
This function is a standard part of the Or1ksim 0.3.0 and Or1ksim 0.4.0 libraries.