19. EFI Byte Code Virtual Machine Test#

19.1. EFI_EBC_PROTOCOL Test#

Reference Document:

UEFI Specification, EFI_EBC_PROTOCOL Section.

19.1.1. CreateThunk()#

Number GUID Assertion Test Description
5.15.1.1.1 0x5de39abd, 0xe9d4, 0x4fee, 0xb4, 0xdd, 0x31, 0x73, 0xb7, 0x35, 0xe3, 0x20 EFI_EBC_PROTOCOL.CreateThunk - Calling CreateThunk() with an invalid Parameters returns EFI_INVALID_PARAMETER.

Call CreateThunk() when the EBC image entry point is not 2-byte aligned.

The return code should be EFI_INVALID_PARAMETER.

5.15.1.1.2 0x6f19a253, 0xc6ff, 0x41a3, 0xa5, 0x8b, 0xa4, 0x57, 0x16, 0xe1, 0x2f, 0x4c EFI_EBC_PROTOCOL.CreateThunk - Calling CreateThunk() to create ebc thunk returns EFI_SUCCESS.

Call CreateThunk() to create thunk for the EBC image.

The return code should be EFI_SUCCESS.

5.15.1.1.3 0xcabc5c1e, 0x75a0, 0x4349, 0xab, 0xd8, 0x41, 0x17, 0x7b, 0x25, 0x9e, 0x8a EFI_EBC_PROTOCOL.CreateThunk – Calling CreateThunk() invokes the Ebc entry point.

Call CreateThunk() to create thunk for the EBC image and invokes the thunk.

The entry point of EBC image must be invoked.

19.1.2. UnloadIImage()#

Number GUID Assertion Test Description
5.15.1.2.1 0x99c53b53, 0x0998, 0x4fda, 0xaa, 0x4e, 0x9c, 0xc4, 0x9a, 0x1c, 0x8a, 0x19 EFI_EBC_PROTOCOL.UnloadImage - Calling UnloadImage() with an invalid Parameters returns EFI_INVALID_PARAMETER.

Call UnloadImage() when the image handle is not recognized as belonging to an EBC image that has been executed.

The return code should be EFI_INVALID_PARAMETER.

5.15.1.2.2 0xecea2853, 0xe14e, 0x493b, 0x9a, 0xb3, 0xcd, 0xa4, 0xc8, 0x32, 0x2c, 0x3e EFI_EBC_PROTOCOL.UnloadImage - Calling UnloadImage() unloads ebc thunk.

Call UnloadImage() to unload the EBC image from memory.

The return code should be EFI_SUCCESS.

19.1.3. RegisterICacheFlush()#

Number GUID Assertion Test Description
5.15.1.3.1 0xf362b36f, 0x819d, 0x45a4, 0xa5, 0xc7, 0xa0, 0x0a, 0x81, 0x2b, 0xf3, 0x5f EFI_EBC_PROTOCOL.RegisterICacheFlush - Calling RegisterICacheFlush() registers an ebc callback function.

Call RegisterICacheFlush() to register a callback function.

The return code should be EFI_SUCCESS.

5.15.1.3.2 0x26480c1d, 0xac79, 0x46e5, 0xa4, 0xff, 0xec, 0x3e, 0xd5, 0x99, 0x87, 0xec EFI_EBC_PROTOCOL.RegisterICacheFlush - Callback function is invoked after calling CreateThunk().

1. Call RegisterICacheFlush() to register a callback function.

2. Call CreateThunk() to create thunk for an EBC image.

The callback function should be invoked.

19.1.4. GetVersion()#

Number GUID Assertion Test Description
5.15.1.4.1 0xce787a92, 0x1ee8, 0x4f65, 0xb7, 0x7c, 0xb4, 0xcd, 0xcf, 0xcd, 0xd3, 0xf2 EFI_EBC_PROTOCOL.GetVersion - Calling GetVersion() when version pointer is NULL and returns EFI_INVALID_PARAMETER.

Call GetVersion() when version pointer is NULL.

The return code should be EFI_INVALID_PARAMETER.

5.15.1.4.2 0x57100f81, 0xe05a, 0x4abf, 0x93, 0xc2, 0x49, 0x1c, 0xf8, 0xd4, 0xb6, 0x7c EFI_EBC_PROTOCOL.GetVersion - Calling GetVersion() to get ebc interpreter version returns EFI_SUCCESS.

Call GetVersion() to get the version of the EBC interpreter.

The return code should be EFI_SUCCESS.