blob: a39a74770f8e65f6ceff77f4355fb49cc70bf842 [file] [log] [blame]
Luc Verhaegen838fe242009-06-17 00:48:02 +02001/*
2 * Copyright 2009 Luc Verhaegen <libv@skynet.be>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2, or (at your option)
7 * any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; see the file COPYING. If not, write to
16 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
17 */
18
19#ifndef BIOS_EXTRACT_H
20#define BIOS_EXTRACT_H
21
22#define Bool int
23#define FALSE 0
24#define TRUE 1
25
Luc Verhaegen9e43c3a2010-03-27 16:56:06 +010026#if !defined(le32toh) || !defined(le16toh)
27#if BYTE_ORDER == LITTLE_ENDIAN
28#define le32toh(x) (x)
29#define le16toh(x) (x)
30#else
31#include <byteswap.h>
32#define le32toh(x) bswap_32(x)
33#define le16toh(x) bswap_16(x)
34#endif
35#endif
36
Luc Verhaegen838fe242009-06-17 00:48:02 +020037/* bios_extract.c */
38unsigned char *MMapOutputFile(char *filename, int size);
39
40/* ami.c */
41Bool AMI95Extract(unsigned char *BIOSImage, int BIOSLength, int BIOSOffset,
Luc Verhaegen15587352009-06-26 10:00:29 +020042 uint32_t Offset1, uint32_t Offset2);
Luc Verhaegen038e6a52009-06-24 14:18:29 +020043
44/* phoenix.c */
45Bool PhoenixExtract(unsigned char *BIOSImage, int BIOSLength, int BIOSOffset,
Luc Verhaegen15587352009-06-26 10:00:29 +020046 uint32_t Offset1, uint32_t Offset2);
Luc Verhaegendd939162009-12-17 15:17:36 +010047Bool PhoenixTrustedExtract(unsigned char *BIOSImage, int BIOSLength,
48 int BIOSOffset, uint32_t Offset1,
49 uint32_t BCPSegmentOffset);
Luc Verhaegen5c343ad2009-07-13 11:46:37 +020050/* award.c */
51Bool AwardExtract(unsigned char *BIOSImage, int BIOSLength, int BIOSOffset,
52 uint32_t Offset1, uint32_t Offset2);
53
Luc Verhaegen838fe242009-06-17 00:48:02 +020054#endif /* BIOS_EXTRACT_H */