]> git.ipfire.org Git - people/ms/u-boot.git/blob - include/jffs2/load_kernel.h
Initial revision
[people/ms/u-boot.git] / include / jffs2 / load_kernel.h
1 #ifndef load_kernel_h
2 #define load_kernel_h
3 /*-------------------------------------------------------------------------
4 * Filename: load_kernel.h
5 * Version: $Id: load_kernel.h,v 1.3 2002/01/25 01:34:11 nyet Exp $
6 * Copyright: Copyright (C) 2001, Russ Dill
7 * Author: Russ Dill <Russ.Dill@asu.edu>
8 * Description: header for load kernel modules
9 *-----------------------------------------------------------------------*/
10 /*
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 *
26 */
27
28 /* this struct is very similar to mtd_info */
29 struct part_info {
30 u32 size; /* Total size of the Partition */
31
32 /* "Major" erase size for the device. Naïve users may take this
33 * to be the only erase size available, or may use the more detailed
34 * information below if they desire
35 */
36 u32 erasesize;
37
38 /* Where in memory does this partition start? */
39 char *offset;
40
41 /* used by jffs2 set to NULL */
42 void *jffs2_priv;
43
44 /* private filed used by user */
45 void *usr_priv;
46 };
47
48 struct part_info*
49 jffs2_part_info(int part_num);
50
51 struct kernel_loader {
52
53 /* Return true if there is a kernel contained at src */
54 int (* check_magic)(struct part_info *part);
55
56 /* load the kernel from the partition part to dst, return the number
57 * of bytes copied if successful, zero if not */
58 u32 (* load_kernel)(u32 *dst, struct part_info *part, const char *kernel_filename);
59
60 /* A brief description of the module (ie, "cramfs") */
61 char *name;
62 };
63
64 #define ldr_strlen strlen
65 #define ldr_strncmp strncmp
66 #define ldr_memcpy memcpy
67 #define putstr(x) printf("%s", x)
68 #define mmalloc malloc
69 #define UDEBUG printf
70
71 #define putnstr(str, size) printf("%*.*s", size, size, str)
72 #define ldr_output_string(x) puts(x)
73 #define putLabeledWord(x, y) printf("%s %08x\n", x, (unsigned int)y)
74 #define led_blink(x, y, z, a)
75
76 #endif /* load_kernel_h */