- if (TempValue >= 0x10000) {\r
- Error (NULL, 0, 2000, "Invalid option value", "Device Id %s out of range!", Argv[1]);\r
- ReturnStatus = 1;\r
- goto Done;\r
+\r
+ //\r
+ // Process until another dash-argument parameter or the end of the list\r
+ //\r
+ while (Argc > 1 && Argv[1][0] != '-') {\r
+ Status = AsciiStringToUint64(Argv[1], FALSE, &TempValue);\r
+ if (EFI_ERROR (Status)) {\r
+ Error (NULL, 0, 2000, "Invalid option value", "%s = %s", OptionName, Argv[1]);\r
+ ReturnStatus = 1;\r
+ goto Done;\r
+ }\r
+ //\r
+ // Don't allow device IDs greater than 16 bits\r
+ // Don't allow 0, since it is used as a list terminator\r
+ //\r
+ if (TempValue >= 0x10000 || TempValue == 0) {\r
+ Error (NULL, 0, 2000, "Invalid option value", "Device Id %s out of range!", Argv[1]);\r
+ ReturnStatus = 1;\r
+ goto Done;\r
+ }\r
+\r
+ DevIdList = (UINT16*) realloc (Options->DevIdList, (Options->DevIdCount + 1) * sizeof (UINT16));\r
+ if (DevIdList == NULL) {\r
+ Error (NULL, 0, 4001, "Resource", "memory cannot be allocated!", NULL);\r
+ ReturnStatus = 1;\r
+ goto Done;\r
+ }\r
+ Options->DevIdList = DevIdList;\r
+\r
+ Options->DevIdList[Options->DevIdCount++] = (UINT16) TempValue;\r
+\r
+ Argv++;\r
+ Argc--;\r