xferc.c 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. /*++
  2. Copyright (c) 2017 Minoca Corp.
  3. This file is licensed under the terms of the GNU General Public License
  4. version 3. Alternative licensing terms are available. Contact
  5. info@minocacorp.com for details. See the LICENSE file at the root of this
  6. project for complete licensing information.
  7. Module Name:
  8. xferc.c
  9. Abstract:
  10. This module implements the trampoline that transfers control to another
  11. 32-bit boot application.
  12. Author:
  13. Evan Green 31-May-2017
  14. Environment:
  15. Boot
  16. --*/
  17. //
  18. // ------------------------------------------------------------------- Includes
  19. //
  20. #include <minoca/kernel/kernel.h>
  21. #include "firmware.h"
  22. #include "bootlib.h"
  23. #include "../../bootman.h"
  24. //
  25. // --------------------------------------------------------------------- Macros
  26. //
  27. //
  28. // ---------------------------------------------------------------- Definitions
  29. //
  30. //
  31. // ------------------------------------------------------ Data Type Definitions
  32. //
  33. //
  34. // ----------------------------------------------- Internal Function Prototypes
  35. //
  36. //
  37. // -------------------------------------------------------------------- Globals
  38. //
  39. //
  40. // ------------------------------------------------------------------ Functions
  41. //
  42. INT
  43. BmpFwTransferToBootApplication (
  44. PBOOT_INITIALIZATION_BLOCK Parameters,
  45. PBOOT_APPLICATION_ENTRY EntryPoint
  46. )
  47. /*++
  48. Routine Description:
  49. This routine transfers control to another boot application.
  50. Arguments:
  51. Parameters - Supplies a pointer to the initialization block.
  52. EntryPoint - Supplies tne address of the entry point routine of the new
  53. application.
  54. Return Value:
  55. Returns the integer return value from the application. Often does not
  56. return on success.
  57. --*/
  58. {
  59. INT Result;
  60. if ((Parameters->Flags & BOOT_INITIALIZATION_FLAG_64BIT) != 0) {
  61. FwPrintString(0,
  62. 0,
  63. "Cannot launch 64-bit loader with 32-bit boot manager");
  64. return STATUS_NOT_CONFIGURED;
  65. }
  66. Result = EntryPoint(Parameters);
  67. return Result;
  68. }
  69. //
  70. // --------------------------------------------------------- Internal Functions
  71. //