MCPcopy Create free account
hub / github.com/F-Stack/f-stack / bios_sigsearch

Function bios_sigsearch

freebsd/i386/i386/bios.c:207–234  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

205 */
206
207u_int32_t
208bios_sigsearch(u_int32_t start, u_char *sig, int siglen, int paralen, int sigofs)
209{
210 u_char *sp, *end;
211
212 /* compute the starting address */
213 if ((start >= BIOS_START) && (start <= (BIOS_START + BIOS_SIZE))) {
214 sp = (char *)BIOS_PADDRTOVADDR(start);
215 } else if (start == 0) {
216 sp = (char *)BIOS_PADDRTOVADDR(BIOS_START);
217 } else {
218 return 0; /* bogus start address */
219 }
220
221 /* compute the end address */
222 end = (u_char *)BIOS_PADDRTOVADDR(BIOS_START + BIOS_SIZE);
223
224 /* loop searching */
225 while ((sp + sigofs + siglen) < end) {
226 /* compare here */
227 if (!bcmp(sp + sigofs, sig, siglen)) {
228 /* convert back to physical address */
229 return((u_int32_t)BIOS_VADDRTOPADDR(sp));
230 }
231 sp += paralen;
232 }
233 return(0);
234}
235
236/*
237 * do not staticize, used by bioscall.s

Callers 6

bios32_initFunction · 0.70
pci_pir_openFunction · 0.50
smapi_identifyFunction · 0.50
pn_decode_pstFunction · 0.50
smbios_identifyFunction · 0.50
vpd_identifyFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected