while (1) { }
}
-void efi_reset_system_init(void)
+efi_status_t efi_reset_system_init(void)
{
- efi_add_runtime_mmio(&rstcr, sizeof(*rstcr));
+ return efi_add_runtime_mmio(&rstcr, sizeof(*rstcr));
}
#endif
while (1) { }
}
-void efi_reset_system_init(void)
+efi_status_t efi_reset_system_init(void)
{
- efi_add_runtime_mmio(&wdog_regs, sizeof(*wdog_regs));
+ return efi_add_runtime_mmio(&wdog_regs, sizeof(*wdog_regs));
}
#endif
/* Call this with mmio_ptr as the _pointer_ to a pointer to an MMIO region
* to make it available at runtime */
-void efi_add_runtime_mmio(void *mmio_ptr, u64 len);
+efi_status_t efi_add_runtime_mmio(void *mmio_ptr, u64 len);
/* Boards may provide the functions below to implement RTS functionality */
enum efi_reset_type reset_type,
efi_status_t reset_status,
unsigned long data_size, void *reset_data);
-void efi_reset_system_init(void);
+
+/* Architecture specific initialization of the EFI subsystem */
+efi_status_t efi_reset_system_init(void);
efi_status_t __efi_runtime EFIAPI efi_get_time(
struct efi_time *time,
/* Without CONFIG_EFI_LOADER we don't have a runtime section, stub it out */
#define __efi_runtime_data
#define __efi_runtime
-static inline void efi_add_runtime_mmio(void *mmio_ptr, u64 len) { }
+static inline efi_status_t efi_add_runtime_mmio(void *mmio_ptr, u64 len)
+{
+ return EFI_SUCCESS;
+}
/* No loader configured, stub out EFI_ENTRY */
static inline void efi_restore_gd(void) { }
while (1) { }
}
-void __weak efi_reset_system_init(void)
+efi_status_t __weak efi_reset_system_init(void)
{
+ return EFI_SUCCESS;
}
efi_status_t __weak __efi_runtime EFIAPI efi_get_time(
return EFI_EXIT(EFI_INVALID_PARAMETER);
}
-void efi_add_runtime_mmio(void *mmio_ptr, u64 len)
+efi_status_t efi_add_runtime_mmio(void *mmio_ptr, u64 len)
{
struct efi_runtime_mmio_list *newmmio;
+ efi_status_t ret;
u64 pages = (len + EFI_PAGE_MASK) >> EFI_PAGE_SHIFT;
- efi_add_memory_map(*(uintptr_t *)mmio_ptr, pages, EFI_MMAP_IO, false);
+ ret = efi_add_memory_map(*(uintptr_t *)mmio_ptr, pages, EFI_MMAP_IO,
+ false);
+ if (ret != EFI_SUCCESS)
+ return ret;
newmmio = calloc(1, sizeof(*newmmio));
+ if (!newmmio)
+ return EFI_OUT_OF_RESOURCES;
newmmio->ptr = mmio_ptr;
newmmio->paddr = *(uintptr_t *)mmio_ptr;
newmmio->len = len;
list_add_tail(&newmmio->link, &efi_runtime_mmio);
+
+ return ret;
}
/*