mirror of
https://github.com/ipmitool/ipmitool.git
synced 2025-05-10 10:37:22 +00:00
delloem: Fix the unalign bug in arm64
For computers using the arm64 of the Apple chip, the link requires strict alignment of pointers in 32-bit form. Replace the struct vFlashstr to valstr. Replace the Function get_vFlash_compcode_str to val2str. Resolves ipmitool/ipmitool#332 Signed-off-by: SliderLu <314238828@qq.com>
This commit is contained in:
parent
8f0946a81e
commit
206dba615d
@ -343,10 +343,6 @@ typedef struct _power_headroom
|
||||
uint16_t peakheadroom;
|
||||
} __attribute__ ((packed)) POWER_HEADROOM;
|
||||
|
||||
struct vFlashstr {
|
||||
uint8_t val;
|
||||
const char * str;
|
||||
};
|
||||
typedef struct ipmi_vFlash_extended_info
|
||||
{
|
||||
uint8_t vflashcompcode;
|
||||
|
@ -115,7 +115,7 @@ char NIC_Selection_Mode_String_12g[] [50] = {
|
||||
"shared with failover all loms"
|
||||
};
|
||||
|
||||
const struct vFlashstr vFlash_completion_code_vals[] = {
|
||||
const struct valstr vFlash_completion_code_vals[] = {
|
||||
{0x00, "SUCCESS"},
|
||||
{0x01, "NO_SD_CARD"},
|
||||
{0x63, "UNKNOWN_ERROR"},
|
||||
@ -232,8 +232,6 @@ static void ipmi_powermonitor_usage(void);
|
||||
/* vFlash Function prototypes */
|
||||
static int ipmi_delloem_vFlash_main(struct ipmi_intf *intf, int argc,
|
||||
char **argv);
|
||||
const char *get_vFlash_compcode_str(uint8_t vflashcompcode,
|
||||
const struct vFlashstr *vs);
|
||||
static int ipmi_get_sd_card_info(struct ipmi_intf *intf);
|
||||
static int ipmi_delloem_vFlash_process(struct ipmi_intf *intf, int current_arg,
|
||||
char **argv);
|
||||
@ -3756,28 +3754,6 @@ ipmi_delloem_vFlash_main(struct ipmi_intf * intf, int __UNUSED__(argc), char **
|
||||
rc = ipmi_delloem_vFlash_process(intf, current_arg, argv);
|
||||
return rc;
|
||||
}
|
||||
/*
|
||||
* Function Name: get_vFlash_compcode_str
|
||||
*
|
||||
* Description: This function maps the vFlash completion code
|
||||
* to a string
|
||||
* Input : vFlash completion code and static array of codes vs strings
|
||||
* Output: -
|
||||
* Return: returns the mapped string
|
||||
*/
|
||||
const char *
|
||||
get_vFlash_compcode_str(uint8_t vflashcompcode, const struct vFlashstr *vs)
|
||||
{
|
||||
static char un_str[32];
|
||||
int i;
|
||||
for (i = 0; vs[i].str; i++) {
|
||||
if (vs[i].val == vflashcompcode)
|
||||
return vs[i].str;
|
||||
}
|
||||
memset(un_str, 0, 32);
|
||||
snprintf(un_str, 32, "Unknown (0x%02X)", vflashcompcode);
|
||||
return un_str;
|
||||
}
|
||||
/*
|
||||
* Function Name: ipmi_get_sd_card_info
|
||||
*
|
||||
@ -3822,7 +3798,7 @@ ipmi_get_sd_card_info(struct ipmi_intf * intf) {
|
||||
return -1;
|
||||
} else if (sdcardinfoblock->vflashcompcode != 0x00) {
|
||||
lprintf(LOG_ERR, "Error in getting SD Card Extended Information (%s)",
|
||||
get_vFlash_compcode_str(sdcardinfoblock->vflashcompcode,
|
||||
val2str(sdcardinfoblock->vflashcompcode,
|
||||
vFlash_completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user