Changeset View
Changeset View
Standalone View
Standalone View
sys/boot/uboot/lib/glue.c
Show First 20 Lines • Show All 77 Lines • ▼ Show 20 Lines | api_search_sig(struct api_signature **sig) | ||||
unsigned char *sp, *spend; | unsigned char *sp, *spend; | ||||
if (sig == NULL) | if (sig == NULL) | ||||
return (0); | return (0); | ||||
if (uboot_address == 0) | if (uboot_address == 0) | ||||
uboot_address = 255 * 1024 * 1024; | uboot_address = 255 * 1024 * 1024; | ||||
#ifdef __mips | |||||
sp = (void *)(uboot_address & ~0x0000ffff); | |||||
spend = sp + 0x00010000 - API_SIG_MAGLEN; | |||||
#else | |||||
sp = (void *)(uboot_address & ~0x000fffff); | sp = (void *)(uboot_address & ~0x000fffff); | ||||
spend = sp + 0x00300000 - API_SIG_MAGLEN; | spend = sp + 0x00300000 - API_SIG_MAGLEN; | ||||
#endif | |||||
while (sp < spend) { | while (sp < spend) { | ||||
if (!bcmp(sp, API_SIG_MAGIC, API_SIG_MAGLEN)) { | if (!bcmp(sp, API_SIG_MAGIC, API_SIG_MAGLEN)) { | ||||
*sig = (struct api_signature *)sp; | *sig = (struct api_signature *)sp; | ||||
if (valid_sig(*sig)) | if (valid_sig(*sig)) | ||||
return (1); | return (1); | ||||
} | } | ||||
sp += API_SIG_MAGLEN; | sp += API_SIG_MAGLEN; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 433 Lines • Show Last 20 Lines |