Aaron Durbin | 04ebf59 | 2015-09-30 17:49:04 -0500 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright 2015 Google Inc. |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; version 2 of the License. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
Aaron Durbin | 04ebf59 | 2015-09-30 17:49:04 -0500 | [diff] [blame] | 14 | */ |
| 15 | |
| 16 | #ifndef _COMMONLIB_FSP1_1_H_ |
| 17 | #define _COMMONLIB_FSP1_1_H_ |
| 18 | |
| 19 | #include <stddef.h> |
| 20 | #include <stdint.h> |
| 21 | |
| 22 | /* |
| 23 | * Intel's code does not have a handle on changing global packing state. |
| 24 | * Therefore, one needs to protect against packing policies that are set |
| 25 | * globally for a compliation unit just by including a header file. |
| 26 | */ |
| 27 | #pragma pack(push) |
| 28 | |
| 29 | /* Default bind FSP 1.1 API to edk2 UEFI 2.4 types. */ |
| 30 | #include <vendorcode/intel/edk2/uefi_2.4/uefi_types.h> |
| 31 | |
| 32 | #include <vendorcode/intel/fsp/fsp1_1/IntelFspPkg/Include/FspApi.h> |
| 33 | #include <vendorcode/intel/fsp/fsp1_1/IntelFspPkg/Include/FspInfoHeader.h> |
| 34 | |
| 35 | /* Restore original packing policy. */ |
| 36 | #pragma pack(pop) |
| 37 | |
| 38 | /* |
| 39 | * Relocate FSP held within buffer defined by size to new_addr. Returns < 0 |
| 40 | * on error, offset to FSP_INFO_HEADER on success. |
| 41 | */ |
| 42 | ssize_t fsp1_1_relocate(uintptr_t new_addr, void *fsp, size_t size); |
| 43 | |
| 44 | #endif |