#include <efi_selftest.h>
-static struct efi_event *event_notify;
+static struct efi_event *efi_st_event_notify;
static struct efi_event *event_wait;
static unsigned int timer_ticks;
static struct efi_boot_services *boottime;
ret = boottime->create_event(EVT_TIMER | EVT_NOTIFY_SIGNAL,
TPL_CALLBACK, notify, (void *)&timer_ticks,
- &event_notify);
+ &efi_st_event_notify);
if (ret != EFI_SUCCESS) {
efi_st_error("could not create event\n");
return EFI_ST_FAILURE;
{
efi_status_t ret;
- if (event_notify) {
- ret = boottime->close_event(event_notify);
- event_notify = NULL;
+ if (efi_st_event_notify) {
+ ret = boottime->close_event(efi_st_event_notify);
+ efi_st_event_notify = NULL;
if (ret != EFI_SUCCESS) {
efi_st_error("could not close event\n");
return EFI_ST_FAILURE;
/* Set 10 ms timer */
timer_ticks = 0;
- ret = boottime->set_timer(event_notify, EFI_TIMER_PERIODIC, 100000);
+ ret = boottime->set_timer(efi_st_event_notify, EFI_TIMER_PERIODIC,
+ 100000);
if (ret != EFI_SUCCESS) {
efi_st_error("Could not set timer\n");
return EFI_ST_FAILURE;
efi_st_error("Incorrect timing of events\n");
return EFI_ST_FAILURE;
}
- ret = boottime->set_timer(event_notify, EFI_TIMER_STOP, 0);
+ ret = boottime->set_timer(efi_st_event_notify, EFI_TIMER_STOP, 0);
if (ret != EFI_SUCCESS) {
efi_st_error("Could not cancel timer\n");
return EFI_ST_FAILURE;
}
/* Set 10 ms timer */
timer_ticks = 0;
- ret = boottime->set_timer(event_notify, EFI_TIMER_RELATIVE, 100000);
+ ret = boottime->set_timer(efi_st_event_notify, EFI_TIMER_RELATIVE,
+ 100000);
if (ret != EFI_SUCCESS) {
efi_st_error("Could not set timer\n");
return EFI_ST_FAILURE;
};
static struct efi_boot_services *boottime;
-static struct efi_event *event_notify;
+static struct efi_event *efi_st_event_notify;
struct notification_record record;
struct notification_context context_before = {
ret = boottime->create_event(EVT_SIGNAL_EXIT_BOOT_SERVICES,
TPL_CALLBACK, ebs_notify,
&context,
- &event_notify);
+ &efi_st_event_notify);
if (ret != EFI_SUCCESS) {
efi_st_error("could not create event\n");
return EFI_ST_FAILURE;
ret = boottime->create_event_ex(0, TPL_CALLBACK, ebs_notify,
&context_before,
&guid_before_exit_boot_services,
- &event_notify);
+ &efi_st_event_notify);
if (ret != EFI_SUCCESS) {
efi_st_error("could not create event\n");
return EFI_ST_FAILURE;
#include <efi_selftest.h>
-static struct efi_event *event_notify;
-static struct efi_event *event_wait;
+static struct efi_event *efi_st_event_notify;
+static struct efi_event *efi_st_event_wait;
static unsigned int notification_count;
static struct efi_boot_services *boottime;
ret = boottime->create_event(EVT_TIMER | EVT_NOTIFY_SIGNAL,
TPL_CALLBACK, notify,
(void *)¬ification_count,
- &event_notify);
+ &efi_st_event_notify);
if (ret != EFI_SUCCESS) {
efi_st_error("could not create event\n");
return EFI_ST_FAILURE;
}
ret = boottime->create_event(EVT_TIMER | EVT_NOTIFY_WAIT,
- TPL_NOTIFY, notify, NULL, &event_wait);
+ TPL_NOTIFY, notify, NULL,
+ &efi_st_event_wait);
if (ret != EFI_SUCCESS) {
efi_st_error("could not create event\n");
return EFI_ST_FAILURE;
{
efi_status_t ret;
- if (event_notify) {
- ret = boottime->close_event(event_notify);
- event_notify = NULL;
+ if (efi_st_event_notify) {
+ ret = boottime->close_event(efi_st_event_notify);
+ efi_st_event_notify = NULL;
if (ret != EFI_SUCCESS) {
efi_st_error("could not close event\n");
return EFI_ST_FAILURE;
}
}
- if (event_wait) {
- ret = boottime->close_event(event_wait);
- event_wait = NULL;
+ if (efi_st_event_wait) {
+ ret = boottime->close_event(efi_st_event_wait);
+ efi_st_event_wait = NULL;
if (ret != EFI_SUCCESS) {
efi_st_error("could not close event\n");
return EFI_ST_FAILURE;
/* Set 10 ms timer */
notification_count = 0;
- ret = boottime->set_timer(event_notify, EFI_TIMER_PERIODIC, 100000);
+ ret = boottime->set_timer(efi_st_event_notify, EFI_TIMER_PERIODIC,
+ 100000);
if (ret != EFI_SUCCESS) {
efi_st_error("Could not set timer\n");
return EFI_ST_FAILURE;
}
/* Set 100 ms timer */
- ret = boottime->set_timer(event_wait, EFI_TIMER_RELATIVE, 1000000);
+ ret = boottime->set_timer(efi_st_event_wait, EFI_TIMER_RELATIVE,
+ 1000000);
if (ret != EFI_SUCCESS) {
efi_st_error("Could not set timer\n");
return EFI_ST_FAILURE;
}
index = 5;
- ret = boottime->wait_for_event(1, &event_wait, &index);
+ ret = boottime->wait_for_event(1, &efi_st_event_wait, &index);
if (ret != EFI_SUCCESS) {
efi_st_error("Could not wait for event\n");
return EFI_ST_FAILURE;
}
- ret = boottime->check_event(event_wait);
+ ret = boottime->check_event(efi_st_event_wait);
if (ret != EFI_NOT_READY) {
efi_st_error("Signaled state was not cleared.\n");
efi_st_printf("ret = %u\n", (unsigned int)ret);
efi_st_error("Incorrect timing of events\n");
return EFI_ST_FAILURE;
}
- ret = boottime->set_timer(event_notify, EFI_TIMER_STOP, 0);
+ ret = boottime->set_timer(efi_st_event_notify, EFI_TIMER_STOP, 0);
if (ret != EFI_SUCCESS) {
efi_st_error("Could not cancel timer\n");
return EFI_ST_FAILURE;
}
/* Set 10 ms timer */
notification_count = 0;
- ret = boottime->set_timer(event_notify, EFI_TIMER_PERIODIC, 100000);
+ ret = boottime->set_timer(efi_st_event_notify, EFI_TIMER_PERIODIC,
+ 100000);
if (ret != EFI_SUCCESS) {
efi_st_error("Could not set timer\n");
return EFI_ST_FAILURE;
}
/* Set 100 ms timer */
- ret = boottime->set_timer(event_wait, EFI_TIMER_RELATIVE, 1000000);
+ ret = boottime->set_timer(efi_st_event_wait, EFI_TIMER_RELATIVE,
+ 1000000);
if (ret != EFI_SUCCESS) {
efi_st_error("Could not set timer\n");
return EFI_ST_FAILURE;
}
do {
- ret = boottime->check_event(event_wait);
+ ret = boottime->check_event(efi_st_event_wait);
} while (ret == EFI_NOT_READY);
if (ret != EFI_SUCCESS) {
efi_st_error("Could not check event\n");
return EFI_ST_FAILURE;
}
/* Set 1 ms timer */
- ret = boottime->set_timer(event_wait, EFI_TIMER_RELATIVE, 1000);
+ ret = boottime->set_timer(efi_st_event_wait, EFI_TIMER_RELATIVE, 1000);
if (ret != EFI_SUCCESS) {
efi_st_error("Could not set timer\n");
return EFI_ST_FAILURE;
}
/* Restore the old TPL level */
boottime->restore_tpl(TPL_APPLICATION);
- ret = boottime->wait_for_event(1, &event_wait, &index);
+ ret = boottime->wait_for_event(1, &efi_st_event_wait, &index);
if (ret != EFI_SUCCESS) {
efi_st_error("Could not wait for event\n");
return EFI_ST_FAILURE;
efi_st_error("Queued timer event did not fire\n");
return EFI_ST_FAILURE;
}
- ret = boottime->set_timer(event_wait, EFI_TIMER_STOP, 0);
+ ret = boottime->set_timer(efi_st_event_wait, EFI_TIMER_STOP, 0);
if (ret != EFI_SUCCESS) {
efi_st_error("Could not cancel timer\n");
return EFI_ST_FAILURE;
unsigned int timer_ticks;
};
-static struct efi_event *event_notify;
-static struct efi_event *event_wait;
+static struct efi_event *efi_st_event_notify;
+static struct efi_event *efi_st_event_wait;
static struct efi_boot_services *boottime;
static struct notify_context notification_context;
static bool watchdog_reset;
ret = boottime->create_event(EVT_TIMER | EVT_NOTIFY_SIGNAL,
TPL_CALLBACK, notify,
(void *)¬ification_context,
- &event_notify);
+ &efi_st_event_notify);
if (ret != EFI_SUCCESS) {
efi_st_error("could not create event\n");
return EFI_ST_FAILURE;
}
ret = boottime->create_event(EVT_TIMER | EVT_NOTIFY_WAIT,
- TPL_CALLBACK, notify, NULL, &event_wait);
+ TPL_CALLBACK, notify, NULL,
+ &efi_st_event_wait);
if (ret != EFI_SUCCESS) {
efi_st_error("could not create event\n");
return EFI_ST_FAILURE;
efi_st_error("Setting watchdog timer failed\n");
return EFI_ST_FAILURE;
}
- if (event_notify) {
- ret = boottime->close_event(event_notify);
- event_notify = NULL;
+ if (efi_st_event_notify) {
+ ret = boottime->close_event(efi_st_event_notify);
+ efi_st_event_notify = NULL;
if (ret != EFI_SUCCESS) {
efi_st_error("Could not close event\n");
return EFI_ST_FAILURE;
}
}
- if (event_wait) {
- ret = boottime->close_event(event_wait);
- event_wait = NULL;
+ if (efi_st_event_wait) {
+ ret = boottime->close_event(efi_st_event_wait);
+ efi_st_event_wait = NULL;
if (ret != EFI_SUCCESS) {
efi_st_error("Could not close event\n");
return EFI_ST_FAILURE;
}
if (watchdog_reset) {
/* Set 600 ms timer */
- ret = boottime->set_timer(event_notify, EFI_TIMER_PERIODIC,
- 6000000);
+ ret = boottime->set_timer(efi_st_event_notify,
+ EFI_TIMER_PERIODIC, 6000000);
if (ret != EFI_SUCCESS) {
efi_st_error("Could not set timer\n");
return EFI_ST_FAILURE;
}
}
/* Set 1350 ms timer */
- ret = boottime->set_timer(event_wait, EFI_TIMER_RELATIVE, 13500000);
+ ret = boottime->set_timer(efi_st_event_wait, EFI_TIMER_RELATIVE,
+ 13500000);
if (ret != EFI_SUCCESS) {
efi_st_error("Could not set timer\n");
return EFI_ST_FAILURE;
}
- ret = boottime->wait_for_event(1, &event_wait, &index);
+ ret = boottime->wait_for_event(1, &efi_st_event_wait, &index);
if (ret != EFI_SUCCESS) {
efi_st_error("Could not wait for event\n");
return EFI_ST_FAILURE;