Cleanup access to vendor/part # info
Instead of macros to access MAINBOARD record, use convenience functions. Store pointers to MAINBOARD and HEADER for use outside of CB code. Change-Id: I074e3a0df7d25726cbd942538bfdc5a63dd17e12 Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com> Reviewed-on: http://review.coreboot.org/502 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
This commit is contained in:
committed by
Patrick Georgi
parent
d0ac789e21
commit
9a7c246767
@ -228,6 +228,16 @@ static inline u16 cb_checksum(const void *ptr, unsigned len)
|
||||
return ipchksum(ptr, len);
|
||||
}
|
||||
|
||||
static inline const char *cb_mb_vendor_string(const struct cb_mainboard *cbm)
|
||||
{
|
||||
return (char *)(cbm->strings + cbm->vendor_idx);
|
||||
}
|
||||
|
||||
static inline const char *cb_mb_part_string(const struct cb_mainboard *cbm)
|
||||
{
|
||||
return (char *)(cbm->strings + cbm->part_number_idx);
|
||||
}
|
||||
|
||||
/* Helpful macros */
|
||||
|
||||
#define MEM_RANGE_COUNT(_rec) \
|
||||
@ -237,10 +247,4 @@ static inline u16 cb_checksum(const void *ptr, unsigned len)
|
||||
(void *)(((u8 *) (_rec)) + sizeof(*(_rec)) \
|
||||
+ (sizeof((_rec)->map[0]) * (_idx)))
|
||||
|
||||
#define MB_VENDOR_STRING(_mb) \
|
||||
(((unsigned char *) ((_mb)->strings)) + (_mb)->vendor_idx)
|
||||
|
||||
#define MB_PART_STRING(_mb) \
|
||||
(((unsigned char *) ((_mb)->strings)) + (_mb)->part_number_idx)
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user