summaryrefslogtreecommitdiff
path: root/util/cbfstool/fit.h
blob: 51e3c0fecad5c7c9bc44a4d501dce027fdfa6f8f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
 * Firmware Interface Table support.
 *
 * Copyright (C) 2012 Google Inc.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; version 2 of the License.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc.
 */

#ifndef __CBFSTOOL_FIT_H
#define __CBFSTOOL_FIT_H

#include "cbfs_image.h"
#include "common.h"

/*
 * Converts between offsets from the start of the specified image region and
 * "top-aligned" offsets from the top of the entire flash image. Should work in
 * both directions: accepts either type of offset and produces the other type.
 * The implementation must have some notion of the flash image's total size.
 */
typedef unsigned (*fit_offset_converter_t)(const struct buffer *region,
							unsigned offset);

int fit_update_table(struct buffer *bootblock, struct cbfs_image *image,
		     const char *microcode_blob_name, int empty_entries,
		     fit_offset_converter_t offset_fn);
#endif