32 IN EFI_HANDLE ImageHandle,
33 IN EFI_SYSTEM_TABLE *SystemTable
46 gBS->SetWatchdogTimer (0, 0, 0, NULL);
55 if (EFI_ERROR (Status) || (Argc < 5)) {
56 Print (L
"Usage: ChipTune <any|hda|beep> <count> <signal> <silence> [<frequency>]\n");
60 Status = StrDecimalToUintnS (Argv[2], NULL, &Count);
61 if (EFI_ERROR (Status)) {
62 Print (L
"Invalid count value - %r\n", Status);
66 Status = StrDecimalToUintnS (Argv[3], NULL, &Signal);
67 if (EFI_ERROR (Status)) {
68 Print (L
"Invalid signal length value - %r\n", Status);
72 Status = StrDecimalToUintnS (Argv[4], NULL, &Silence);
73 if (EFI_ERROR (Status)) {
74 Print (L
"Invalid silence length value - %r\n", Status);
79 Status = StrDecimalToUintnS (Argv[5], NULL, &Frequency);
80 if (EFI_ERROR (Status)) {
81 Print (L
"Invalid frequency value - %r\n", Status);
89 BeepGenProtocol = NULL;
92 Status =
gBS->LocateProtocol (
95 (VOID **)&BeepGenProtocol
97 if (EFI_ERROR (Status) || (BeepGenProtocol->GenBeep == NULL)) {
98 Print (L
"Beep protocol is unusable - %r\n", Status);
99 BeepGenProtocol = NULL;
103 if ((BeepGenProtocol == NULL) && ((
OcStriCmp (Argv[1], L
"any") == 0) || (
OcStriCmp (Argv[1], L
"hda") == 0))) {
104 Status =
gBS->LocateProtocol (
107 (VOID **)&HdaProtocol
109 if (EFI_ERROR (Status) || (HdaProtocol->PlayTone == NULL)) {
110 Print (L
"HDA protocol is unusable - %r\n", Status);
116 L
"Trying playback %u %Lu %Lu %d\n",
123 if (BeepGenProtocol != NULL) {
124 Status = BeepGenProtocol->
GenBeep (
129 }
else if (HdaProtocol != NULL) {
138 Status = EFI_UNSUPPORTED;
141 if (EFI_ERROR (Status)) {
142 Print (L
"Playback failure - %r\n", Status);