You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /*
  2. * Copyright (C) 2009 Michael Brown <mbrown@fensystems.co.uk>.
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License as
  6. * published by the Free Software Foundation; either version 2 of the
  7. * License, or any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful, but
  10. * WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  17. * 02110-1301, USA.
  18. */
  19. FILE_LICENCE ( GPL2_OR_LATER );
  20. #include <stdlib.h>
  21. #include <ipxe/init.h>
  22. #include <ipxe/device.h>
  23. #include <ipxe/efi/efi.h>
  24. #include <ipxe/efi/efi_driver.h>
  25. /**
  26. * EFI entry point
  27. *
  28. * @v image_handle Image handle
  29. * @v systab System table
  30. * @ret efirc EFI return status code
  31. */
  32. EFI_STATUS EFIAPI _efidrv_start ( EFI_HANDLE image_handle,
  33. EFI_SYSTEM_TABLE *systab ) {
  34. EFI_STATUS efirc;
  35. /* Initialise EFI environment */
  36. if ( ( efirc = efi_init ( image_handle, systab ) ) != 0 )
  37. return efirc;
  38. /* Initialise iPXE environment */
  39. initialise();
  40. startup();
  41. return 0;
  42. }
  43. /**
  44. * Probe EFI root bus
  45. *
  46. * @v rootdev EFI root device
  47. */
  48. static int efi_probe ( struct root_device *rootdev __unused ) {
  49. /* Do nothing */
  50. return 0;
  51. }
  52. /**
  53. * Remove EFI root bus
  54. *
  55. * @v rootdev EFI root device
  56. */
  57. static void efi_remove ( struct root_device *rootdev __unused ) {
  58. efi_driver_disconnect_all();
  59. }
  60. /** EFI root device driver */
  61. static struct root_driver efi_root_driver = {
  62. .probe = efi_probe,
  63. .remove = efi_remove,
  64. };
  65. /** EFI root device */
  66. struct root_device efi_root_device __root_device = {
  67. .dev = { .name = "EFI" },
  68. .driver = &efi_root_driver,
  69. };