FreeBSD/sys/boot/uboot/lib/glue.c
/*
 * Searches for the U-Boot API signature
 *
 * returns 1/0 depending on found/not found result
 */
Searches for the U-Boot API signature
returns 1/0 depending on found/not found result
Searches for the U - Boot API signature returns 1 / 0 depending on found / not found result
int
api_search_sig(struct api_signature **sig)
{
	unsigned char *sp, *spend;
	if (sig == NULL)
		return (0);
	if (uboot_address == 0)
		uboot_address = 255 * 1024 * 1024;
	sp = (void *)(uboot_address & API_SIG_SEARCH_MASK);
	spend = sp + API_SIG_SEARCH_LEN - API_SIG_MAGLEN;
	while (sp < spend) {
		if (!bcmp(sp, API_SIG_MAGIC, API_SIG_MAGLEN)) {
			*sig = (struct api_signature *)sp;
			if (valid_sig(*sig))
				return (1);
		}
		sp += API_SIG_MAGLEN;
	}
	*sig = NULL;
	return (0);
}
int api_search_sig ( struct api_signature * * sig ) { unsigned char * sp , * spend ; if ( sig == NULL ) return ( 0 ) ; if ( uboot_address == 0 ) uboot_address = 255 * 1024 * 1024 ; sp = ( void * ) ( uboot_address & API_SIG_SEARCH_MASK ) ; spend = sp + API_SIG_SEARCH_LEN - API_SIG_MAGLEN ; while ( sp < spend ) { if ( ! bcmp ( sp , API_SIG_MAGIC , API_SIG_MAGLEN ) ) { * sig = ( struct api_signature * ) sp ; if ( valid_sig ( * sig ) ) return ( 1 ) ; } sp += API_SIG_MAGLEN ; } * sig = NULL ; return ( 0 ) ; }
Searches for the U-Boot API signature
 returns 1/0 depending on found/not found result
Searches for the U - Boot API signature returns 1 / 0 depending on found / not found result