]>
Commit | Line | Data |
---|---|---|
98e39e09 | 1 | /* |
4284af58 | 2 | * The PCI Utilities -- Declarations |
98e39e09 | 3 | * |
a0407443 | 4 | * Copyright (c) 1997--2008 Martin Mares <mj@ucw.cz> |
98e39e09 MM |
5 | * |
6 | * Can be freely distributed and used under the terms of the GNU GPL. | |
7 | */ | |
8 | ||
727ce158 | 9 | #include "lib/pci.h" |
489233b4 | 10 | #include "lib/sysdep.h" |
98e39e09 | 11 | |
ee7d8384 MM |
12 | #ifdef PCI_OS_WINDOWS |
13 | #include "compat/getopt.h" | |
14 | #endif | |
15 | ||
727ce158 | 16 | #define PCIUTILS_VERSION PCILIB_VERSION |
98e39e09 | 17 | |
81afa98c MM |
18 | extern const char program_name[]; |
19 | ||
4f6b38ca | 20 | void die(char *msg, ...) NONRET PCI_PRINTF(1,2); |
727ce158 | 21 | void *xmalloc(unsigned int howmuch); |
ec25b52d | 22 | void *xrealloc(void *ptr, unsigned int howmuch); |
d3f768e2 | 23 | char *xstrdup(char *str); |
727ce158 | 24 | int parse_generic_option(int i, struct pci_access *pacc, char *optarg); |
e4842ff3 | 25 | |
489233b4 | 26 | #ifdef PCI_HAVE_PM_INTEL_CONF |
727ce158 MM |
27 | #define GENOPT_INTEL "H:" |
28 | #define GENHELP_INTEL "-H <mode>\tUse direct hardware access (<mode> = 1 or 2)\n" | |
29 | #else | |
30 | #define GENOPT_INTEL | |
31 | #define GENHELP_INTEL | |
32 | #endif | |
1b99a704 | 33 | #if defined(PCI_HAVE_PM_DUMP) && !defined(PCIUTILS_SETPCI) |
727ce158 | 34 | #define GENOPT_DUMP "F:" |
1b99a704 | 35 | #define GENHELP_DUMP "-F <file>\tRead PCI configuration dump from a given file\n" |
727ce158 MM |
36 | #else |
37 | #define GENOPT_DUMP | |
38 | #define GENHELP_DUMP | |
39 | #endif | |
e4842ff3 | 40 | |
f2b31663 | 41 | #define GENERIC_OPTIONS "A:GO:" GENOPT_INTEL GENOPT_DUMP |
1b99a704 | 42 | #define GENERIC_HELP \ |
a0407443 | 43 | "-A <method>\tUse the specified PCI access method (see `-A help' for a list)\n" \ |
1b99a704 | 44 | "-O <par>=<val>\tSet PCI access parameter (see `-O help' for a list)\n" \ |
553d12c8 | 45 | "-G\t\tEnable PCI access debugging\n" \ |
1b99a704 | 46 | GENHELP_INTEL GENHELP_DUMP |