1// Copyright 2016 The Fuchsia Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#pragma once
6
7#include <efi/types.h>
8#include <efi/system-table.h>
9#include <efi/protocol/device-path.h>
10
11#define EFI_LOADED_IMAGE_PROTOCOL_GUID \
12    {0x5b1b31a1, 0x9562, 0x11d2, {0x8e, 0x3f, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b}}
13extern efi_guid LoadedImageProtocol;
14
15#define EFI_LOADED_IMAGE_PROTOCOL_REVISION 0x1000
16
17typedef struct {
18    uint32_t Revision;
19    efi_handle ParentHandle;
20    efi_system_table* SystemTable;
21    efi_handle DeviceHandle;
22    efi_device_path_protocol* FilePath;
23    void* Reserved;
24    uint32_t LoadOptionsSize;
25    void* LoadOptions;
26    void* ImageBase;
27    uint64_t ImageSize;
28    efi_memory_type ImageCodeType;
29    efi_memory_type ImageDataType;
30
31    efi_status (*Unload) (efi_handle img) EFIAPI;
32} efi_loaded_image_protocol;
33