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. |
Aaron Durbin | 6b0d0d6 | 2012-12-14 17:16:21 -0600 | [diff] [blame] | 14 | */ |
| 15 | |
| 16 | #ifndef __CBFSTOOL_FIT_H |
| 17 | #define __CBFSTOOL_FIT_H |
| 18 | |
Sol Boucher | 32532ac | 2015-05-06 14:44:40 -0700 | [diff] [blame] | 19 | #include "cbfs_image.h" |
| 20 | #include "common.h" |
| 21 | |
| 22 | /* |
| 23 | * Converts between offsets from the start of the specified image region and |
| 24 | * "top-aligned" offsets from the top of the entire flash image. Should work in |
| 25 | * both directions: accepts either type of offset and produces the other type. |
| 26 | * The implementation must have some notion of the flash image's total size. |
| 27 | */ |
| 28 | typedef unsigned (*fit_offset_converter_t)(const struct buffer *region, |
| 29 | unsigned offset); |
| 30 | |
| 31 | int fit_update_table(struct buffer *bootblock, struct cbfs_image *image, |
| 32 | const char *microcode_blob_name, int empty_entries, |
| 33 | fit_offset_converter_t offset_fn); |
Aaron Durbin | 6b0d0d6 | 2012-12-14 17:16:21 -0600 | [diff] [blame] | 34 | #endif |