[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[2462] 2009-08-01 Vladimir Serbinenko <address@hidden>
From: |
Vladimir Serbinenko |
Subject: |
[2462] 2009-08-01 Vladimir Serbinenko <address@hidden> |
Date: |
Sat, 01 Aug 2009 14:30:59 +0000 |
Revision: 2462
http://svn.sv.gnu.org/viewvc/?view=rev&root=grub&revision=2462
Author: phcoder
Date: 2009-08-01 14:30:59 +0000 (Sat, 01 Aug 2009)
Log Message:
-----------
2009-08-01 Vladimir Serbinenko <address@hidden>
2009-08-01 Robert Millan <address@hidden>
Fix cpuid command.
* commands/i386/cpuid.c (options): New variable.
(grub_cmd_cpuid): Return real error.
(GRUB_MOD_INIT(cpuid)): Declare options.
Modified Paths:
--------------
trunk/grub2/ChangeLog
trunk/grub2/commands/i386/cpuid.c
Modified: trunk/grub2/ChangeLog
===================================================================
--- trunk/grub2/ChangeLog 2009-07-31 16:14:03 UTC (rev 2461)
+++ trunk/grub2/ChangeLog 2009-08-01 14:30:59 UTC (rev 2462)
@@ -1,3 +1,12 @@
+2009-08-01 Vladimir Serbinenko <address@hidden>
+2009-08-01 Robert Millan <address@hidden>
+
+ Fix cpuid command.
+
+ * commands/i386/cpuid.c (options): New variable.
+ (grub_cmd_cpuid): Return real error.
+ (GRUB_MOD_INIT(cpuid)): Declare options.
+
2009-07-31 Vladimir Serbinenko <address@hidden>
* partmap/pc.c (pc_partition_map_iterate): Check that boot flags are
Modified: trunk/grub2/commands/i386/cpuid.c
===================================================================
--- trunk/grub2/commands/i386/cpuid.c 2009-07-31 16:14:03 UTC (rev 2461)
+++ trunk/grub2/commands/i386/cpuid.c 2009-08-01 14:30:59 UTC (rev 2462)
@@ -23,25 +23,33 @@
#include <grub/mm.h>
#include <grub/env.h>
#include <grub/command.h>
+#include <grub/extcmd.h>
#define cpuid(num,a,b,c,d) \
asm volatile ("xchgl %%ebx, %1; cpuid; xchgl %%ebx, %1" \
: "=a" (a), "=r" (b), "=c" (c), "=d" (d) \
: "0" (num))
+static const struct grub_arg_option options[] =
+ {
+ {"long-mode", 'l', 0, "check for long mode flag (default)", 0, 0},
+ {0, 0, 0, 0, 0, 0}
+ };
+
#define bit_LM (1 << 29)
static unsigned char has_longmode = 0;
static grub_err_t
-grub_cmd_cpuid (struct grub_command *cmd __attribute__ ((unused)),
- int argc __attribute__ ((unused)),
- char **args __attribute__ ((unused)))
+grub_cmd_cpuid (grub_extcmd_t cmd __attribute__ ((unused)),
+ int argc __attribute__ ((unused)),
+ char **args __attribute__ ((unused)))
{
- return !has_longmode;
+ return has_longmode ? GRUB_ERR_NONE
+ : grub_error (GRUB_ERR_TEST_FAILURE, "false");
}
-static grub_command_t cmd;
+static grub_extcmd_t cmd;
GRUB_MOD_INIT(cpuid)
{
@@ -78,11 +86,11 @@
done:
#endif
- cmd = grub_register_command ("cpuid", grub_cmd_cpuid,
- 0, "Check for CPU features");
+ cmd = grub_register_extcmd ("cpuid", grub_cmd_cpuid, GRUB_COMMAND_FLAG_BOTH,
+ "cpuid [-l]", "Check for CPU features", options);
}
GRUB_MOD_FINI(cpuid)
{
- grub_unregister_command (cmd);
+ grub_unregister_extcmd (cmd);
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [2462] 2009-08-01 Vladimir Serbinenko <address@hidden>,
Vladimir Serbinenko <=