From f09cea36ca086c7b5df372bdf38168c2ce5609ca Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Tue, 21 May 2019 18:19:01 +0200 Subject: efi_loader: correct notification of protocol installation When a protocol is installed the handle should be queued for the registration key of each registered event. LocateHandle() should return the first handle from the queue for the registration key and delete it from the queue. Implement the queueing. Correct the selftest. With the patch the UEFI SCT tests for LocateHandle() are passed without failure. Signed-off-by: Heinrich Schuchardt --- include/efi_loader.h | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/efi_loader.h b/include/efi_loader.h index 43d3a08428..77b2f60bdc 100644 --- a/include/efi_loader.h +++ b/include/efi_loader.h @@ -286,20 +286,38 @@ extern struct list_head efi_obj_list; /* List of all events */ extern struct list_head efi_events; +/** + * struct efi_protocol_notification - handle for notified protocol + * + * When a protocol interface is installed for which an event was registered with + * the RegisterProtocolNotify() service this structure is used to hold the + * handle on which the protocol interface was installed. + * + * @link: link to list of all handles notified for this event + * @handle: handle on which the notified protocol interface was installed + */ +struct efi_protocol_notification { + struct list_head link; + efi_handle_t handle; +}; + /** * efi_register_notify_event - event registered by RegisterProtocolNotify() * * The address of this structure serves as registration value. * - * @link: link to list of all registered events - * @event: registered event. The same event may registered for - * multiple GUIDs. - * @protocol: protocol for which the event is registered + * @link: link to list of all registered events + * @event: registered event. The same event may registered for multiple + * GUIDs. + * @protocol: protocol for which the event is registered + * @handles: linked list of all handles on which the notified protocol was + * installed */ struct efi_register_notify_event { struct list_head link; struct efi_event *event; efi_guid_t protocol; + struct list_head handles; }; /* List of all events registered by RegisterProtocolNotify() */ -- cgit From 3c1889e6399a0455bb5056f614be046a0b9cf053 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Fri, 31 May 2019 07:21:03 +0200 Subject: rtc: export rtc_month_days() Export function rtc_month_days() for reuse in the UEFI subsystem. Signed-off-by: Heinrich Schuchardt --- include/rtc.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include') diff --git a/include/rtc.h b/include/rtc.h index 2c3a5743e3..b255bdc7a3 100644 --- a/include/rtc.h +++ b/include/rtc.h @@ -258,4 +258,12 @@ void rtc_to_tm(u64 time_t, struct rtc_time *time); */ unsigned long rtc_mktime(const struct rtc_time *time); +/** + * rtc_month_days() - The number of days in the month + * + * @month: month (January = 0) + * @year: year (4 digits) + */ +int rtc_month_days(unsigned int month, unsigned int year); + #endif /* _RTC_H_ */ -- cgit From 656f17106b870ed42ff3e00fc6c5e41e779dd934 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Fri, 31 May 2019 07:38:29 +0200 Subject: efi_loader: export efi_set_time() To let a board implement the runtime version of SetTime() we have to provide the definition of the weak function in an include. Signed-off-by: Heinrich Schuchardt --- include/efi_loader.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/efi_loader.h b/include/efi_loader.h index 77b2f60bdc..23ce732267 100644 --- a/include/efi_loader.h +++ b/include/efi_loader.h @@ -594,6 +594,8 @@ efi_status_t __efi_runtime EFIAPI efi_get_time( struct efi_time *time, struct efi_time_cap *capabilities); +efi_status_t __efi_runtime EFIAPI efi_set_time(struct efi_time *time); + #ifdef CONFIG_CMD_BOOTEFI_SELFTEST /* * Entry point for the tests of the EFI API. -- cgit