blob: 5f1b80bf0b4da76e5eada3ef38fff9cff9b11f28 [file] [log] [blame]
Aaron Durbin6b0d0d62012-12-14 17:16:21 -06001/*
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 Durbin6b0d0d62012-12-14 17:16:21 -060014 */
15
16#ifndef __CBFSTOOL_FIT_H
17#define __CBFSTOOL_FIT_H
18
Sol Boucher32532ac2015-05-06 14:44:40 -070019#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 */
28typedef unsigned (*fit_offset_converter_t)(const struct buffer *region,
29 unsigned offset);
30
31int 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 Durbin6b0d0d62012-12-14 17:16:21 -060034#endif