Aaron Durbin | 6b0d0d6 | 2012-12-14 17:16:21 -0600 | [diff] [blame] | 1 | /* |
| 2 | * Firmware Interface Table support. |
| 3 | * |
| 4 | * Copyright (C) 2012 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. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program; if not, write to the Free Software |
Patrick Georgi | b890a12 | 2015-03-26 15:17:45 +0100 | [diff] [blame] | 17 | * Foundation, Inc. |
Aaron Durbin | 6b0d0d6 | 2012-12-14 17:16:21 -0600 | [diff] [blame] | 18 | */ |
| 19 | |
| 20 | #ifndef __CBFSTOOL_FIT_H |
| 21 | #define __CBFSTOOL_FIT_H |
| 22 | |
Sol Boucher | 32532ac | 2015-05-06 14:44:40 -0700 | [diff] [blame^] | 23 | #include "cbfs_image.h" |
| 24 | #include "common.h" |
| 25 | |
| 26 | /* |
| 27 | * Converts between offsets from the start of the specified image region and |
| 28 | * "top-aligned" offsets from the top of the entire flash image. Should work in |
| 29 | * both directions: accepts either type of offset and produces the other type. |
| 30 | * The implementation must have some notion of the flash image's total size. |
| 31 | */ |
| 32 | typedef unsigned (*fit_offset_converter_t)(const struct buffer *region, |
| 33 | unsigned offset); |
| 34 | |
| 35 | int fit_update_table(struct buffer *bootblock, struct cbfs_image *image, |
| 36 | const char *microcode_blob_name, int empty_entries, |
| 37 | fit_offset_converter_t offset_fn); |
Aaron Durbin | 6b0d0d6 | 2012-12-14 17:16:21 -0600 | [diff] [blame] | 38 | #endif |