Commit b521d29eb1b0dd7be8ee306729f93d964c4c0288

Authored by xypron.glpk@gmx.de
Committed by Alexander Graf
1 parent 7cbc12415d

efi_loader: parameter types for CreateEvent, SetTimer

The first argument 'type' of CreateEvent is an 32bit unsigned
integer bitmap and not an enum.

The second argument 'type' of SetTimer take values of an
enum which is called EFI_TIMER_DELAY in the UEFI standard.
To avoid confusion rename efi_event_type to efi_timer_delay.

Reported-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

Showing 3 changed files with 15 additions and 13 deletions Side-by-side Diff

... ... @@ -22,7 +22,7 @@
22 22 #endif
23 23  
24 24 /* Types and defines for EFI CreateEvent */
25   -enum efi_event_type {
  25 +enum efi_timer_delay {
26 26 EFI_TIMER_STOP = 0,
27 27 EFI_TIMER_PERIODIC = 1,
28 28 EFI_TIMER_RELATIVE = 2
29 29  
... ... @@ -59,14 +59,15 @@
59 59 efi_status_t (EFIAPI *allocate_pool)(int, unsigned long, void **);
60 60 efi_status_t (EFIAPI *free_pool)(void *);
61 61  
62   - efi_status_t (EFIAPI *create_event)(enum efi_event_type type,
  62 + efi_status_t (EFIAPI *create_event)(uint32_t type,
63 63 UINTN notify_tpl,
64 64 void (EFIAPI *notify_function) (
65 65 struct efi_event *event,
66 66 void *context),
67 67 void *notify_context, struct efi_event **event);
68   - efi_status_t (EFIAPI *set_timer)(struct efi_event *event, int type,
69   - uint64_t trigger_time);
  68 + efi_status_t (EFIAPI *set_timer)(struct efi_event *event,
  69 + enum efi_timer_delay type,
  70 + uint64_t trigger_time);
70 71 efi_status_t (EFIAPI *wait_for_event)(unsigned long number_of_events,
71 72 struct efi_event **event, unsigned long *index);
72 73 efi_status_t (EFIAPI *signal_event)(struct efi_event *event);
include/efi_loader.h
... ... @@ -76,13 +76,13 @@
76 76 * @signaled: The notify function was already called
77 77 */
78 78 struct efi_event {
79   - u32 type;
  79 + uint32_t type;
80 80 UINTN notify_tpl;
81 81 void (EFIAPI *notify_function)(struct efi_event *event, void *context);
82 82 void *notify_context;
83 83 u64 trigger_next;
84 84 u64 trigger_time;
85   - enum efi_event_type trigger_type;
  85 + enum efi_timer_delay trigger_type;
86 86 int signaled;
87 87 };
88 88  
89 89  
... ... @@ -119,13 +119,13 @@
119 119 /* Call this to set the current device name */
120 120 void efi_set_bootdev(const char *dev, const char *devnr, const char *path);
121 121 /* Call this to create an event */
122   -efi_status_t efi_create_event(enum efi_event_type type, UINTN notify_tpl,
  122 +efi_status_t efi_create_event(uint32_t type, UINTN notify_tpl,
123 123 void (EFIAPI *notify_function) (
124 124 struct efi_event *event,
125 125 void *context),
126 126 void *notify_context, struct efi_event **event);
127 127 /* Call this to set a timer */
128   -efi_status_t efi_set_timer(struct efi_event *event, int type,
  128 +efi_status_t efi_set_timer(struct efi_event *event, enum efi_timer_delay type,
129 129 uint64_t trigger_time);
130 130 /* Call this to signal an event */
131 131 void efi_signal_event(struct efi_event *event);
lib/efi_loader/efi_boottime.c
... ... @@ -207,7 +207,7 @@
207 207 */
208 208 static struct efi_event efi_events[16];
209 209  
210   -efi_status_t efi_create_event(enum efi_event_type type, UINTN notify_tpl,
  210 +efi_status_t efi_create_event(uint32_t type, UINTN notify_tpl,
211 211 void (EFIAPI *notify_function) (
212 212 struct efi_event *event,
213 213 void *context),
... ... @@ -242,7 +242,7 @@
242 242 }
243 243  
244 244 static efi_status_t EFIAPI efi_create_event_ext(
245   - enum efi_event_type type, UINTN notify_tpl,
  245 + uint32_t type, UINTN notify_tpl,
246 246 void (EFIAPI *notify_function) (
247 247 struct efi_event *event,
248 248 void *context),
... ... @@ -280,7 +280,7 @@
280 280 WATCHDOG_RESET();
281 281 }
282 282  
283   -efi_status_t efi_set_timer(struct efi_event *event, int type,
  283 +efi_status_t efi_set_timer(struct efi_event *event, enum efi_timer_delay type,
284 284 uint64_t trigger_time)
285 285 {
286 286 int i;
... ... @@ -316,8 +316,9 @@
316 316 return EFI_INVALID_PARAMETER;
317 317 }
318 318  
319   -static efi_status_t EFIAPI efi_set_timer_ext(struct efi_event *event, int type,
320   - uint64_t trigger_time)
  319 +static efi_status_t EFIAPI efi_set_timer_ext(struct efi_event *event,
  320 + enum efi_timer_delay type,
  321 + uint64_t trigger_time)
321 322 {
322 323 EFI_ENTRY("%p, %d, %"PRIx64, event, type, trigger_time);
323 324 return EFI_EXIT(efi_set_timer(event, type, trigger_time));