annotate config.h @ 2:da946b5ff948

implement page table init.
author taiki
date Sat, 16 Feb 2013 05:47:59 +0900
parents 7ac2a177e25d
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
7ac2a177e25d add elilo source.
taiki
parents:
diff changeset
1 /*
7ac2a177e25d add elilo source.
taiki
parents:
diff changeset
2 * Copyright (C) 2001-2003 Hewlett-Packard Co.
7ac2a177e25d add elilo source.
taiki
parents:
diff changeset
3 * Contributed by Stephane Eranian <eranian@hpl.hp.com>
7ac2a177e25d add elilo source.
taiki
parents:
diff changeset
4 *
7ac2a177e25d add elilo source.
taiki
parents:
diff changeset
5 * This file is part of the ELILO, the EFI Linux boot loader.
7ac2a177e25d add elilo source.
taiki
parents:
diff changeset
6 *
7ac2a177e25d add elilo source.
taiki
parents:
diff changeset
7 * ELILO is free software; you can redistribute it and/or modify
7ac2a177e25d add elilo source.
taiki
parents:
diff changeset
8 * it under the terms of the GNU General Public License as published by
7ac2a177e25d add elilo source.
taiki
parents:
diff changeset
9 * the Free Software Foundation; either version 2, or (at your option)
7ac2a177e25d add elilo source.
taiki
parents:
diff changeset
10 * any later version.
7ac2a177e25d add elilo source.
taiki
parents:
diff changeset
11 *
7ac2a177e25d add elilo source.
taiki
parents:
diff changeset
12 * ELILO is distributed in the hope that it will be useful,
7ac2a177e25d add elilo source.
taiki
parents:
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
7ac2a177e25d add elilo source.
taiki
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7ac2a177e25d add elilo source.
taiki
parents:
diff changeset
15 * GNU General Public License for more details.
7ac2a177e25d add elilo source.
taiki
parents:
diff changeset
16 *
7ac2a177e25d add elilo source.
taiki
parents:
diff changeset
17 * You should have received a copy of the GNU General Public License
7ac2a177e25d add elilo source.
taiki
parents:
diff changeset
18 * along with ELILO; see the file COPYING. If not, write to the Free
7ac2a177e25d add elilo source.
taiki
parents:
diff changeset
19 * Software Foundation, 59 Temple Place - Suite 330, Boston, MA
7ac2a177e25d add elilo source.
taiki
parents:
diff changeset
20 * 02111-1307, USA.
7ac2a177e25d add elilo source.
taiki
parents:
diff changeset
21 *
7ac2a177e25d add elilo source.
taiki
parents:
diff changeset
22 * Please check out the elilo.txt for complete documentation on how
7ac2a177e25d add elilo source.
taiki
parents:
diff changeset
23 * to use this program.
7ac2a177e25d add elilo source.
taiki
parents:
diff changeset
24 */
7ac2a177e25d add elilo source.
taiki
parents:
diff changeset
25
7ac2a177e25d add elilo source.
taiki
parents:
diff changeset
26 #ifndef __ELILO_CONFIG_H__
7ac2a177e25d add elilo source.
taiki
parents:
diff changeset
27 #define __ELILO_CONFIG_H__
7ac2a177e25d add elilo source.
taiki
parents:
diff changeset
28
7ac2a177e25d add elilo source.
taiki
parents:
diff changeset
29 #define opt_offsetof(opt) (&((boot_image_t *)(0x0))->opt)
7ac2a177e25d add elilo source.
taiki
parents:
diff changeset
30
7ac2a177e25d add elilo source.
taiki
parents:
diff changeset
31 typedef enum { OPT_NOTUSED, OPT_STR, OPT_CMD, OPT_BOOL, OPT_NUM, OPT_FILE } config_option_type_t;
7ac2a177e25d add elilo source.
taiki
parents:
diff changeset
32
7ac2a177e25d add elilo source.
taiki
parents:
diff changeset
33 typedef enum { OPT_GLOBAL, /* global and shared among architectures */
7ac2a177e25d add elilo source.
taiki
parents:
diff changeset
34 OPT_IMAGE, /* per image only and shared among architectures */
7ac2a177e25d add elilo source.
taiki
parents:
diff changeset
35 OPT_IMAGE_SYS /* per image and architecture specific (offset base in sys_img_opts) */
7ac2a177e25d add elilo source.
taiki
parents:
diff changeset
36 } config_option_scope_t;
7ac2a177e25d add elilo source.
taiki
parents:
diff changeset
37
7ac2a177e25d add elilo source.
taiki
parents:
diff changeset
38 typedef enum { OPTIONS_GROUP_GLOBAL, /* group must be added to global set of options */
7ac2a177e25d add elilo source.
taiki
parents:
diff changeset
39 OPTIONS_GROUP_IMAGE, /* group must be added to per-image set of options */
7ac2a177e25d add elilo source.
taiki
parents:
diff changeset
40 } config_option_group_scope_t;
7ac2a177e25d add elilo source.
taiki
parents:
diff changeset
41
7ac2a177e25d add elilo source.
taiki
parents:
diff changeset
42 struct _config_option_t;
7ac2a177e25d add elilo source.
taiki
parents:
diff changeset
43 typedef INTN option_action_t(struct _config_option_t *, VOID *);
7ac2a177e25d add elilo source.
taiki
parents:
diff changeset
44
7ac2a177e25d add elilo source.
taiki
parents:
diff changeset
45 typedef struct _config_option_t {
7ac2a177e25d add elilo source.
taiki
parents:
diff changeset
46 config_option_type_t type; /* option type: OPT_CMD, OPT_BOOL, ... */
7ac2a177e25d add elilo source.
taiki
parents:
diff changeset
47 config_option_scope_t scope; /* option scope: global, per image, per image_sys */
7ac2a177e25d add elilo source.
taiki
parents:
diff changeset
48 CHAR16 *name; /* unicode string for the option */
7ac2a177e25d add elilo source.
taiki
parents:
diff changeset
49 option_action_t *action; /* option specific action */
7ac2a177e25d add elilo source.
taiki
parents:
diff changeset
50 INTN (*check)(void *); /* check valid arguments, NULL=don't need */
7ac2a177e25d add elilo source.
taiki
parents:
diff changeset
51 VOID *data; /* which data structure to record the option */
7ac2a177e25d add elilo source.
taiki
parents:
diff changeset
52 } config_option_t;
7ac2a177e25d add elilo source.
taiki
parents:
diff changeset
53
7ac2a177e25d add elilo source.
taiki
parents:
diff changeset
54 extern INTN register_config_options(config_option_t *opt, UINTN nentries, config_option_group_scope_t);
7ac2a177e25d add elilo source.
taiki
parents:
diff changeset
55
7ac2a177e25d add elilo source.
taiki
parents:
diff changeset
56 #endif /* __ELILO_CONFIG_H__ */