efi: Move grub_reboot() into kernel
authorAlexander Graf <agraf@suse.de>
Thu, 31 Aug 2017 14:40:18 +0000 (16:40 +0200)
committerDaniel Kiper <daniel.kiper@oracle.com>
Thu, 7 Sep 2017 21:29:31 +0000 (23:29 +0200)
commit0ba90a7f017889d32a47897d9107ef45cc50a049
tree535c951572c9c2aa4c7e791c0de770dcbc3f4e7b
parentb4d709b6ee789cdaf3fa7a80fd90c721a16f48c2
efi: Move grub_reboot() into kernel

The reboot function calls machine_fini() and then reboots the system.
Currently it lives in lib/ which means it gets compiled into the
reboot module which lives on the heap.

In a following patch, I want to free the heap on machine_fini()
though, so we would free the memory that the code is running in. That
obviously breaks with smarter UEFI implementations.

So this patch moves it into the core. That way we ensure that all
code running after machine_fini() in the UEFI case is running from
memory that got allocated (and gets deallocated) by the UEFI core.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/Makefile.core.def
grub-core/kern/efi/efi.c
grub-core/lib/efi/reboot.c [deleted file]
include/grub/misc.h