Stefan Reinauer | 6540ae5 | 2007-07-12 16:35:42 +0000 | [diff] [blame] | 1 | /*****************************************************************************\ |
| 2 | * opts.h |
Uwe Hermann | 1a6177b | 2008-01-25 15:08:37 +0000 | [diff] [blame] | 3 | * $Id$ |
Stefan Reinauer | 6540ae5 | 2007-07-12 16:35:42 +0000 | [diff] [blame] | 4 | ***************************************************************************** |
| 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 Hermann | 6e56594 | 2008-03-01 19:06:32 +0000 | [diff] [blame^] | 11 | * This file is part of nvramtool, a utility for reading/writing coreboot |
Stefan Reinauer | f527e70 | 2008-01-18 15:33:49 +0000 | [diff] [blame] | 12 | * parameters and displaying information from the coreboot table. |
Uwe Hermann | 6e56594 | 2008-03-01 19:06:32 +0000 | [diff] [blame^] | 13 | * For details, see http://coreboot.org/nvramtool. |
Stefan Reinauer | 6540ae5 | 2007-07-12 16:35:42 +0000 | [diff] [blame] | 14 | * |
| 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 Hermann | 6e56594 | 2008-03-01 19:06:32 +0000 | [diff] [blame^] | 32 | #ifndef OPTS_H |
| 33 | #define OPTS_H |
Stefan Reinauer | 6540ae5 | 2007-07-12 16:35:42 +0000 | [diff] [blame] | 34 | |
| 35 | #include "common.h" |
| 36 | |
| 37 | typedef enum |
Uwe Hermann | 6e56594 | 2008-03-01 19:06:32 +0000 | [diff] [blame^] | 38 | { 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 Reinauer | 6540ae5 | 2007-07-12 16:35:42 +0000 | [diff] [blame] | 54 | } |
Uwe Hermann | 6e56594 | 2008-03-01 19:06:32 +0000 | [diff] [blame^] | 55 | nvramtool_op_t; |
Stefan Reinauer | 6540ae5 | 2007-07-12 16:35:42 +0000 | [diff] [blame] | 56 | |
| 57 | typedef struct |
Uwe Hermann | 6e56594 | 2008-03-01 19:06:32 +0000 | [diff] [blame^] | 58 | { nvramtool_op_t op; |
Stefan Reinauer | 6540ae5 | 2007-07-12 16:35:42 +0000 | [diff] [blame] | 59 | char *param; |
| 60 | } |
Uwe Hermann | 6e56594 | 2008-03-01 19:06:32 +0000 | [diff] [blame^] | 61 | nvramtool_op_info_t; |
Stefan Reinauer | 6540ae5 | 2007-07-12 16:35:42 +0000 | [diff] [blame] | 62 | |
| 63 | typedef enum |
Uwe Hermann | 6e56594 | 2008-03-01 19:06:32 +0000 | [diff] [blame^] | 64 | { 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 Reinauer | 6540ae5 | 2007-07-12 16:35:42 +0000 | [diff] [blame] | 68 | } |
Uwe Hermann | 6e56594 | 2008-03-01 19:06:32 +0000 | [diff] [blame^] | 69 | nvramtool_op_modifier_t; |
Stefan Reinauer | 6540ae5 | 2007-07-12 16:35:42 +0000 | [diff] [blame] | 70 | |
| 71 | typedef struct |
| 72 | { int found; |
| 73 | int found_seq; |
| 74 | char *param; |
| 75 | } |
Uwe Hermann | 6e56594 | 2008-03-01 19:06:32 +0000 | [diff] [blame^] | 76 | nvramtool_op_modifier_info_t; |
Stefan Reinauer | 6540ae5 | 2007-07-12 16:35:42 +0000 | [diff] [blame] | 77 | |
Uwe Hermann | 6e56594 | 2008-03-01 19:06:32 +0000 | [diff] [blame^] | 78 | extern nvramtool_op_info_t nvramtool_op; |
Stefan Reinauer | 6540ae5 | 2007-07-12 16:35:42 +0000 | [diff] [blame] | 79 | |
Uwe Hermann | 6e56594 | 2008-03-01 19:06:32 +0000 | [diff] [blame^] | 80 | extern nvramtool_op_modifier_info_t nvramtool_op_modifiers[]; |
Stefan Reinauer | 6540ae5 | 2007-07-12 16:35:42 +0000 | [diff] [blame] | 81 | |
Uwe Hermann | 6e56594 | 2008-03-01 19:06:32 +0000 | [diff] [blame^] | 82 | void parse_nvramtool_args (int argc, char *argv[]); |
Stefan Reinauer | 6540ae5 | 2007-07-12 16:35:42 +0000 | [diff] [blame] | 83 | |
Uwe Hermann | 6e56594 | 2008-03-01 19:06:32 +0000 | [diff] [blame^] | 84 | #endif /* OPTS_H */ |