PageRenderTime 44ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/WindSLIC_EFI/include/efiEbc.h

https://github.com/untermensch/WindSLIC
C Header | 184 lines | 45 code | 13 blank | 126 comment | 0 complexity | c15fe6fb456edb860e0240ae3ae05938 MD5 | raw file
  1. /*++
  2. Copyright (c) 1999 - 2002 Intel Corporation. All rights reserved
  3. This software and associated documentation (if any) is furnished
  4. under a license and may only be used or copied in accordance
  5. with the terms of the license. Except as permitted by such
  6. license, no part of this software or documentation may be
  7. reproduced, stored in a retrieval system, or transmitted in any
  8. form or by any means without the express written consent of
  9. Intel Corporation.
  10. Module Name:
  11. Ebc.h
  12. Abstract:
  13. Describes the protocol interface to the EBC interpreter.
  14. --*/
  15. #ifndef _EBC_H_
  16. #define _EBC_H_
  17. #define EFI_EBC_INTERPRETER_PROTOCOL_GUID \
  18. {0x13AC6DD1, 0x73D0, 0x11D4, 0xB0, 0x6B, 0x00, 0xAA, 0x00, 0xBD, 0x6D, 0xE7}
  19. //
  20. // Define for forward reference.
  21. //
  22. EFI_INTERFACE_DECL(_EFI_EBC_PROTOCOL);
  23. /*++
  24. Routine Description:
  25. Create a thunk for an image entry point. In short, given the physical address
  26. of the entry point for a loaded image, create a thunk that does some
  27. fixup of arguments (and perform any other necessary overhead) and then
  28. calls the original entry point. The caller can then use the returned pointer
  29. to the created thunk as the new entry point to image.
  30. Arguments:
  31. This - protocol instance pointer
  32. ImageHandle - handle to the image. The EBC interpreter may use this to keep
  33. track of any resource allocations performed in loading and
  34. executing the image.
  35. EbcEntryPoint - the entry point for the image (as defined in the file header)
  36. Thunk - pointer to thunk pointer where the address of the created
  37. thunk is returned.
  38. Returns:
  39. Standard EFI_STATUS
  40. --*/
  41. typedef
  42. EFI_STATUS
  43. (EFIAPI *EFI_EBC_CREATE_THUNK) (
  44. IN struct _EFI_EBC_PROTOCOL *This,
  45. IN EFI_HANDLE ImageHandle,
  46. IN VOID *EbcEntryPoint,
  47. OUT VOID **Thunk
  48. );
  49. /*++
  50. Routine Description:
  51. Perform any cleanup necessary when an image is unloaded. Basically it gives
  52. the EBC interpreter the chance to free up any resources allocated during
  53. load and execution of an EBC image.
  54. Arguments:
  55. This - protocol instance pointer
  56. ImageHandle - the handle of the image being unloaded.
  57. Returns:
  58. Standard EFI_STATUS.
  59. --*/
  60. typedef
  61. EFI_STATUS
  62. (EFIAPI *EFI_EBC_UNLOAD_IMAGE) (
  63. IN struct _EFI_EBC_PROTOCOL *This,
  64. IN EFI_HANDLE ImageHandle
  65. );
  66. /*++
  67. Routine Description:
  68. The I-Cache-flush registration service takes a pointer to a function to
  69. call to flush the I-Cache. Here's the prototype for that function pointer.
  70. Arguments:
  71. Start - physical start address of CPU instruction cache to flush.
  72. Length - how many bytes to flush of the instruction cache.
  73. Returns:
  74. Standard EFI_STATUS.
  75. --*/
  76. typedef
  77. EFI_STATUS
  78. (EFIAPI *EBC_ICACHE_FLUSH) (
  79. IN EFI_PHYSICAL_ADDRESS Start,
  80. IN UINT64 Length
  81. );
  82. /*++
  83. Routine Description:
  84. This routine is called by the core firmware to provide the EBC driver with
  85. a function to call to flush the CPU's instruction cache following creation
  86. of a thunk. It is not required.
  87. Arguments:
  88. This - protocol instance pointer
  89. Flush - pointer to the function to call to flush the CPU instruction
  90. cache.
  91. Returns:
  92. Standard EFI_STATUS.
  93. --*/
  94. typedef
  95. EFI_STATUS
  96. (EFIAPI *EFI_EBC_REGISTER_ICACHE_FLUSH) (
  97. IN struct _EFI_EBC_PROTOCOL *This,
  98. IN EBC_ICACHE_FLUSH Flush
  99. );
  100. /*++
  101. Routine Description:
  102. This routine can be called to get the VM revision. It returns the same
  103. value as the EBC BREAK 1 instruction returns.
  104. Arguments:
  105. This - protocol instance pointer
  106. Version - pointer to where to return the VM version
  107. Returns:
  108. Standard EFI_STATUS.
  109. --*/
  110. typedef
  111. EFI_STATUS
  112. (EFIAPI *EFI_EBC_GET_VERSION) (
  113. IN struct _EFI_EBC_PROTOCOL *This,
  114. IN OUT UINT64 *Version
  115. );
  116. //
  117. // Prototype for the actual EBC protocol interface
  118. //
  119. typedef struct _EFI_EBC_PROTOCOL {
  120. EFI_EBC_CREATE_THUNK CreateThunk;
  121. EFI_EBC_UNLOAD_IMAGE UnloadImage;
  122. EFI_EBC_REGISTER_ICACHE_FLUSH RegisterICacheFlush;
  123. EFI_EBC_GET_VERSION GetVersion;
  124. } EFI_EBC_PROTOCOL;
  125. //
  126. // Extern the global EBC protocol GUID
  127. //
  128. extern EFI_GUID EbcProtocol;
  129. #endif