mirror of
https://github.com/ipmitool/ipmitool.git
synced 2025-05-10 10:37:22 +00:00
Add a helper htoipmi24() function
The function converts a host 32-bit integer into an IPMI 24-bit value (LSB first). Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
This commit is contained in:
parent
e11f463b4e
commit
c9510635d7
@ -169,6 +169,13 @@ static inline uint32_t ipmi24toh(void *ipmi24)
|
||||
return h;
|
||||
}
|
||||
|
||||
static inline void htoipmi24(uint32_t h, uint8_t *ipmi)
|
||||
{
|
||||
ipmi[0] = h & 0xFF; /* LSB */
|
||||
ipmi[1] = (h >> 8) & 0xFF;
|
||||
ipmi[2] = (h >> 16) & 0xFF; /* MSB */
|
||||
}
|
||||
|
||||
static inline uint32_t ipmi32toh(void *ipmi32)
|
||||
{
|
||||
uint8_t *ipmi = ipmi32;
|
||||
|
Loading…
x
Reference in New Issue
Block a user