Subversion Repositories freemyipod

Rev

Rev 658 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
469 theseven 1
//
2
//
3
//    Copyright 2010 TheSeven
4
//
5
//
6
//    This file is part of emCORE.
7
//
8
//    emCORE is free software: you can redistribute it and/or
9
//    modify it under the terms of the GNU General Public License as
10
//    published by the Free Software Foundation, either version 2 of the
11
//    License, or (at your option) any later version.
12
//
13
//    emCORE is distributed in the hope that it will be useful,
14
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
15
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16
//    See the GNU General Public License for more details.
17
//
18
//    You should have received a copy of the GNU General Public License along
19
//    with emCORE.  If not, see <http://www.gnu.org/licenses/>.
20
//
21
//
22
 
23
 
504 theseven 24
#ifndef __EXPORT_LIBBOOT_H__
25
#define __EXPORT_LIBBOOT_H__
469 theseven 26
 
27
#include "emcorelib.h"
28
 
29
 
30
int verify_rockbox_checksum(void* image, size_t size);
658 theseven 31
void check_firmware(void** firmware, int* size, bool verify,
32
                    void* buf, int maxsize, bool compressed);
33
void load_from_file(void** firmware, int* size, bool verify, const char* filename, int maxsize);
34
void load_from_flash(void** firmware, int* size, bool verify, const char* filename, int maxsize);
469 theseven 35
 
36
 
651 theseven 37
/* emCORE library identifier */
38
#define LIBBOOT_IDENTIFIER 0x4c424365
39
 
469 theseven 40
/* increase this every time the api struct changes */
674 theseven 41
#define LIBBOOT_API_VERSION 2
469 theseven 42
 
43
/* update this to latest version if a change to the api struct breaks
44
   backwards compatibility (and please take the opportunity to sort in any
45
   new function which are "waiting" at the end of the function table) */
674 theseven 46
#define LIBBOOT_MIN_API_VERSION 2
469 theseven 47
 
48
/* NOTE: To support backwards compatibility, only add new functions at
49
         the end of the structure.  Every time you add a new function,
50
         remember to increase LIBBOOT_API_VERSION. If you make changes to the
51
         existing APIs, also update LIBBOOT_MIN_API_VERSION to current version */
52
 
53
struct libboot_api
54
{
55
    typeof(verify_rockbox_checksum)* verify_rockbox_checksum;
658 theseven 56
    typeof(check_firmware)* check_firmware;
57
    typeof(load_from_file)* load_from_file;
58
    typeof(load_from_flash)* load_from_flash;
469 theseven 59
};
60
 
61
 
62
#endif