blob: b335b16165cbc5e1ac761050debb07bbaf31e42a [file] [log] [blame]
Stefan Reinauer6540ae52007-07-12 16:35:42 +00001/*****************************************************************************\
2 * opts.h
Uwe Hermann1a6177b2008-01-25 15:08:37 +00003 * $Id$
Stefan Reinauer6540ae52007-07-12 16:35:42 +00004 *****************************************************************************
5 * Copyright (C) 2002-2005 The Regents of the University of California.
6 * Produced at the Lawrence Livermore National Laboratory.
7 * Written by Dave Peterson <dsp@llnl.gov> <dave_peterson@pobox.com>.
8 * UCRL-CODE-2003-012
9 * All rights reserved.
10 *
Uwe Hermann6e565942008-03-01 19:06:32 +000011 * This file is part of nvramtool, a utility for reading/writing coreboot
Stefan Reinauerf527e702008-01-18 15:33:49 +000012 * parameters and displaying information from the coreboot table.
Uwe Hermann6e565942008-03-01 19:06:32 +000013 * For details, see http://coreboot.org/nvramtool.
Stefan Reinauer6540ae52007-07-12 16:35:42 +000014 *
15 * Please also read the file DISCLAIMER which is included in this software
16 * distribution.
17 *
18 * This program is free software; you can redistribute it and/or modify it
19 * under the terms of the GNU General Public License (as published by the
20 * Free Software Foundation) version 2, dated June 1991.
21 *
22 * This program is distributed in the hope that it will be useful, but
23 * WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
25 * conditions of the GNU General Public License for more details.
26 *
27 * You should have received a copy of the GNU General Public License along
28 * with this program; if not, write to the Free Software Foundation, Inc.,
29 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
30\*****************************************************************************/
31
Uwe Hermann6e565942008-03-01 19:06:32 +000032#ifndef OPTS_H
33#define OPTS_H
Stefan Reinauer6540ae52007-07-12 16:35:42 +000034
35#include "common.h"
36
37typedef enum
Uwe Hermann6e565942008-03-01 19:06:32 +000038 { NVRAMTOOL_OP_SHOW_VERSION = 0,
39 NVRAMTOOL_OP_SHOW_USAGE,
40 NVRAMTOOL_OP_LBTABLE_SHOW_INFO,
41 NVRAMTOOL_OP_LBTABLE_DUMP,
42 NVRAMTOOL_OP_SHOW_PARAM_VALUES,
43 NVRAMTOOL_OP_CMOS_SHOW_ONE_PARAM,
44 NVRAMTOOL_OP_CMOS_SHOW_ALL_PARAMS,
45 NVRAMTOOL_OP_CMOS_SET_ONE_PARAM,
46 NVRAMTOOL_OP_CMOS_SET_PARAMS_STDIN,
47 NVRAMTOOL_OP_CMOS_SET_PARAMS_FILE,
48 NVRAMTOOL_OP_CMOS_CHECKSUM,
49 NVRAMTOOL_OP_SHOW_LAYOUT,
50 NVRAMTOOL_OP_WRITE_CMOS_DUMP,
51 NVRAMTOOL_OP_READ_CMOS_DUMP,
52 NVRAMTOOL_OP_SHOW_CMOS_HEX_DUMP,
53 NVRAMTOOL_OP_SHOW_CMOS_DUMPFILE
Stefan Reinauer6540ae52007-07-12 16:35:42 +000054 }
Uwe Hermann6e565942008-03-01 19:06:32 +000055nvramtool_op_t;
Stefan Reinauer6540ae52007-07-12 16:35:42 +000056
57typedef struct
Uwe Hermann6e565942008-03-01 19:06:32 +000058 { nvramtool_op_t op;
Stefan Reinauer6540ae52007-07-12 16:35:42 +000059 char *param;
60 }
Uwe Hermann6e565942008-03-01 19:06:32 +000061nvramtool_op_info_t;
Stefan Reinauer6540ae52007-07-12 16:35:42 +000062
63typedef enum
Uwe Hermann6e565942008-03-01 19:06:32 +000064 { NVRAMTOOL_MOD_SHOW_VALUE_ONLY = 0,
65 NVRAMTOOL_MOD_USE_CMOS_LAYOUT_FILE,
66 NVRAMTOOL_MOD_USE_CMOS_OPT_TABLE,
67 NVRAMTOOL_NUM_OP_MODIFIERS /* must always be last */
Stefan Reinauer6540ae52007-07-12 16:35:42 +000068 }
Uwe Hermann6e565942008-03-01 19:06:32 +000069nvramtool_op_modifier_t;
Stefan Reinauer6540ae52007-07-12 16:35:42 +000070
71typedef struct
72 { int found;
73 int found_seq;
74 char *param;
75 }
Uwe Hermann6e565942008-03-01 19:06:32 +000076nvramtool_op_modifier_info_t;
Stefan Reinauer6540ae52007-07-12 16:35:42 +000077
Uwe Hermann6e565942008-03-01 19:06:32 +000078extern nvramtool_op_info_t nvramtool_op;
Stefan Reinauer6540ae52007-07-12 16:35:42 +000079
Uwe Hermann6e565942008-03-01 19:06:32 +000080extern nvramtool_op_modifier_info_t nvramtool_op_modifiers[];
Stefan Reinauer6540ae52007-07-12 16:35:42 +000081
Uwe Hermann6e565942008-03-01 19:06:32 +000082void parse_nvramtool_args (int argc, char *argv[]);
Stefan Reinauer6540ae52007-07-12 16:35:42 +000083
Uwe Hermann6e565942008-03-01 19:06:32 +000084#endif /* OPTS_H */