cbfstool: add get8/put8 variants to xdr structures
In order to provide consistent usage provide the get8() and put8() callbacks to xdr operations. That way no futzing needs to be done to handle 8-bit reads and writes. Change-Id: I1233d25df67134dc5c3bbd1a84206be77f0da417 Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/5365 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
This commit is contained in:
parent
fae75172d1
commit
01650045f4
|
@ -100,9 +100,11 @@ void do_lzma_compress(char *in, int in_len, char *out, int *out_len);
|
||||||
void do_lzma_uncompress(char *dst, int dst_len, char *src, int src_len);
|
void do_lzma_uncompress(char *dst, int dst_len, char *src, int src_len);
|
||||||
/* xdr.c */
|
/* xdr.c */
|
||||||
struct xdr {
|
struct xdr {
|
||||||
|
uint8_t (*get8)(struct buffer *input);
|
||||||
uint16_t (*get16)(struct buffer *input);
|
uint16_t (*get16)(struct buffer *input);
|
||||||
uint32_t (*get32)(struct buffer *input);
|
uint32_t (*get32)(struct buffer *input);
|
||||||
uint64_t (*get64)(struct buffer *input);
|
uint64_t (*get64)(struct buffer *input);
|
||||||
|
void (*put8)(struct buffer *input, uint8_t val);
|
||||||
void (*put16)(struct buffer *input, uint16_t val);
|
void (*put16)(struct buffer *input, uint16_t val);
|
||||||
void (*put32)(struct buffer *input, uint32_t val);
|
void (*put32)(struct buffer *input, uint32_t val);
|
||||||
void (*put64)(struct buffer *input, uint64_t val);
|
void (*put64)(struct buffer *input, uint64_t val);
|
||||||
|
|
|
@ -139,11 +139,11 @@ static void put64le(struct buffer *input, uint64_t val)
|
||||||
}
|
}
|
||||||
|
|
||||||
struct xdr xdr_be = {
|
struct xdr xdr_be = {
|
||||||
get16be, get32be, get64be,
|
get8, get16be, get32be, get64be,
|
||||||
put16be, put32be, put64be
|
put8, put16be, put32be, put64be
|
||||||
};
|
};
|
||||||
|
|
||||||
struct xdr xdr_le = {
|
struct xdr xdr_le = {
|
||||||
get16le, get32le, get64le,
|
get8, get16le, get32le, get64le,
|
||||||
put16le, put32le, put64le
|
put8, put16le, put32le, put64le
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue