Changeset View
Changeset View
Standalone View
Standalone View
head/sys/boot/uboot/common/main.c
Show First 20 Lines • Show All 381 Lines • ▼ Show 20 Lines | if ((currdev.d_unit = uboot_diskgetunit(load_type, load_unit)) != -1) { | ||||
printf("\n"); | printf("\n"); | ||||
} | } | ||||
printf(" Requested disk type/unit/slice/partition not found\n"); | printf(" Requested disk type/unit/slice/partition not found\n"); | ||||
return (-1); | return (-1); | ||||
} | } | ||||
int | int | ||||
main(void) | main(int argc, char **argv) | ||||
{ | { | ||||
struct api_signature *sig = NULL; | struct api_signature *sig = NULL; | ||||
int load_type, load_unit, load_slice, load_partition; | int load_type, load_unit, load_slice, load_partition; | ||||
int i; | int i; | ||||
const char *ldev; | const char *ldev; | ||||
/* | /* | ||||
* We first check if a command line argument was passed to us containing | |||||
* API's signature address. If it wasn't then we try to search for the | |||||
* API signature via the usual hinted address. | |||||
* If we can't find the magic signature and related info, exit with a | * If we can't find the magic signature and related info, exit with a | ||||
* unique error code that U-Boot reports as "## Application terminated, | * unique error code that U-Boot reports as "## Application terminated, | ||||
* rc = 0xnnbadab1". Hopefully 'badab1' looks enough like "bad api" to | * rc = 0xnnbadab1". Hopefully 'badab1' looks enough like "bad api" to | ||||
* provide a clue. It's better than 0xffffffff anyway. | * provide a clue. It's better than 0xffffffff anyway. | ||||
*/ | */ | ||||
if (!api_search_sig(&sig)) | if (!api_parse_cmdline_sig(argc, argv, &sig) && !api_search_sig(&sig)) | ||||
return (0x01badab1); | return (0x01badab1); | ||||
syscall_ptr = sig->syscall; | syscall_ptr = sig->syscall; | ||||
if (syscall_ptr == NULL) | if (syscall_ptr == NULL) | ||||
return (0x02badab1); | return (0x02badab1); | ||||
if (sig->version > API_SIG_VERSION) | if (sig->version > API_SIG_VERSION) | ||||
return (0x03badab1); | return (0x03badab1); | ||||
▲ Show 20 Lines • Show All 269 Lines • Show Last 20 Lines |