efi_loader: EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE

Implement the EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE event.

This requires allocating the event and the event list from runtime data.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
diff --git a/lib/efi_loader/efi_runtime.c b/lib/efi_loader/efi_runtime.c
index 9476556..9f4ba2f 100644
--- a/lib/efi_loader/efi_runtime.c
+++ b/lib/efi_loader/efi_runtime.c
@@ -391,8 +391,10 @@
  */
 static bool efi_is_runtime_service_pointer(void *p)
 {
-	return p >= (void *)&efi_runtime_services.get_time &&
-	       p <= (void *)&efi_runtime_services.query_variable_info;
+	return (p >= (void *)&efi_runtime_services.get_time &&
+		p <= (void *)&efi_runtime_services.query_variable_info) ||
+	       p == (void *)&efi_events.prev ||
+	       p == (void *)&efi_events.next;
 }
 
 /**
@@ -577,6 +579,7 @@
 	int n = memory_map_size / descriptor_size;
 	int i;
 	int rt_code_sections = 0;
+	struct efi_event *event;
 
 	EFI_ENTRY("%lx %lx %x %p", memory_map_size, descriptor_size,
 		  descriptor_version, virtmap);
@@ -610,6 +613,13 @@
 		return EFI_EXIT(EFI_INVALID_PARAMETER);
 	}
 
+	/* Notify EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE */
+	list_for_each_entry(event, &efi_events, link) {
+		if (event->notify_function)
+			EFI_CALL_VOID(event->notify_function(
+					event, event->notify_context));
+	}
+
 	/* Rebind mmio pointers */
 	for (i = 0; i < n; i++) {
 		struct efi_mem_desc *map = (void*)virtmap +