Skip to content

Commit 26375b4

Browse files
author
Stefan Reinauer
committed
romheaders v1.0.2, contribution by David Paktor <[email protected]>
git-svn-id: svn://coreboot.org/openbios/fcode-utils@101 f158a5a8-5612-0410-a976-696ce0be7e32
1 parent 60c9c19 commit 26375b4

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

romheaders/romheaders.c

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,23 +35,30 @@
3535
#include <sys/stat.h>
3636
#include <unistd.h>
3737

38+
/* We needn't be concerned with the endian-ness of the host,
39+
* only with the endian-ness of the data.
40+
*/
41+
42+
#include "types.h"
3843
#include "pcihdr.h"
3944

45+
4046
char *rom=NULL;
4147
size_t romlen=0;
4248

43-
/* Prototypes for functions exported from shared/classcodes.c */
49+
50+
/* Prototypes for functions exported from devsupp/pci/classcodes.c */
4451

4552
char *pci_device_class_name(u32 code);
4653
char *pci_code_type_name(unsigned char code);
4754

4855
/* Functions local to this file:
49-
int dump_rom_header(rom_header_t *data);
50-
int dump_pci_data(pci_data_t *data);
56+
bool dump_rom_header(rom_header_t *data);
57+
bool dump_pci_data(pci_data_t *data);
5158
void dump_platform_extensions(u8 type, rom_header_t *data);
5259
*/
5360

54-
static int dump_rom_header(rom_header_t *data)
61+
static bool dump_rom_header(rom_header_t *data)
5562
{ /* Return TRUE for "no problem" */
5663
const u16 pci_header_signature = 0x55aa;
5764
u16 sig=BIG_ENDIAN_WORD_FETCH(data->signature);
@@ -71,10 +78,10 @@ static int dump_rom_header(rom_header_t *data)
7178
printf ("\n Pointer to PCI Data Structure: 0x%04x\n\n",
7279
LITTLE_ENDIAN_WORD_FETCH(data->data_ptr));
7380

74-
return (sig == pci_header_signature);
81+
return (BOOLVAL(sig == pci_header_signature) );
7582
}
7683

77-
static int dump_pci_data(pci_data_t *data)
84+
static bool dump_pci_data(pci_data_t *data)
7885
{ /* Return TRUE for "no problem" */
7986
const u32 pci_data_hdr = PCI_DATA_HDR ;
8087

@@ -106,7 +113,7 @@ static int dump_pci_data(pci_data_t *data)
106113
data->last_image_flag&0x80?"":"not ");
107114
printf(" Reserved: 0x%04x\n\n", little_word(data->reserved_2));
108115

109-
return (sig==PCI_DATA_HDR);
116+
return (BOOLVAL(sig==PCI_DATA_HDR) );
110117
}
111118

112119
static void dump_platform_extensions(u8 type, rom_header_t *data)

0 commit comments

Comments
 (0)