2 * General SMRAM manipulation utility
3 * NetWatch system management mode administration console
5 * Copyright (c) 2008 Jacob Potter and Joshua Wise. All rights reserved.
6 * This program is free software; you can redistribute and/or modify it under
7 * the terms found in the file LICENSE in the root of this source tree.
18 static struct option longopts[] = {
19 { "open", no_argument, NULL, 'o' },
20 { "close", no_argument, NULL, 'c' },
21 { "dump", no_argument, NULL, 'd' },
28 void usage(int argc, char **argv)
30 printf("Usage: %s [ --dump ] [ --open | --close ]\n",
35 int main(int argc, char **argv)
39 printf("%s: This program must be run as root.\n", argv[0]);
46 while ((ch = getopt_long(argc, argv, "ocsd:", longopts, NULL)) != -1)
51 if (op & OP_SET) usage(argc, argv);
56 if (op & OP_SET) usage(argc, argv);
67 if (!op) usage(argc, argv);
76 smram_aseg_set_state(do_open ? SMRAM_ASEG_OPEN : SMRAM_ASEG_SMMONLY);