MCPcopy Create free account
hub / github.com/coreboot/coreboot / find_fd

Function find_fd

util/ifdtool/ifdtool.c:130–149  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

128};
129
130static struct fdbar *find_fd(char *image, int size)
131{
132 int i, found = 0;
133
134 /* Scan for FD signature */
135 for (i = 0; i < (size - 4); i += 4) {
136 if (*(uint32_t *)(image + i) == 0x0FF0A55A) {
137 found = 1;
138 break; // signature found.
139 }
140 }
141
142 if (!found) {
143 printf("No Flash Descriptor found in this image\n");
144 return NULL;
145 }
146
147 struct fdbar *fdb = (struct fdbar *)(image + i);
148 return PTR_IN_RANGE(fdb, image, size) ? fdb : NULL;
149}
150
151static char *find_flumap(char *image, int size)
152{

Callers 9

find_fcbaFunction · 0.85
find_fmbaFunction · 0.85
find_frbaFunction · 0.85
find_fpsbaFunction · 0.85
find_fmsbaFunction · 0.85
ifd1_guess_chipsetFunction · 0.85
check_ifd_versionFunction · 0.85
dump_fdFunction · 0.85
mainFunction · 0.85

Calls 1

printfFunction · 0.85

Tested by

no test coverage detected