aboutsummaryrefslogtreecommitdiffstats
path: root/com32/modules/ifcpuhvm.c
diff options
context:
space:
mode:
authorErwan Velu <erwan.velu@free.fr>2009-11-29 20:48:41 +0100
committerErwan Velu <erwan.velu@free.fr>2009-12-04 10:11:15 +0100
commitfe2a772f7c354d00e1bd1c5d0cf101a17b249556 (patch)
tree825899aeca5dc1e64d5a2e994bada84d08c19dbb /com32/modules/ifcpuhvm.c
parent571cdb24787a1c9d5c73f6c831d5f5d8c9c130e6 (diff)
downloadsyslinux.git-fe2a772f7c354d00e1bd1c5d0cf101a17b249556.tar.gz
syslinux.git-fe2a772f7c354d00e1bd1c5d0cf101a17b249556.tar.xz
syslinux.git-fe2a772f7c354d00e1bd1c5d0cf101a17b249556.zip
Adding ifcpu.c32, removing ifcpuhvm
Impact: ifcpu holds more cases ifcpu allow users defining a set of required cpu features for booting an entry
Diffstat (limited to 'com32/modules/ifcpuhvm.c')
-rw-r--r--com32/modules/ifcpuhvm.c90
1 files changed, 0 insertions, 90 deletions
diff --git a/com32/modules/ifcpuhvm.c b/com32/modules/ifcpuhvm.c
deleted file mode 100644
index 4ddba184..00000000
--- a/com32/modules/ifcpuhvm.c
+++ /dev/null
@@ -1,90 +0,0 @@
-/* ----------------------------------------------------------------------- *
- *
- * Copyright 2009 Erwan Velu - All Rights Reserved
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
- * Boston MA 02110-1301, USA; either version 2 of the License, or
- * (at your option) any later version; incorporated herein by reference.
- *
- * ----------------------------------------------------------------------- */
-
-/*
- * ifcpuhvm.c
- *
- * Run one command if the CPU has hardware virtualisation support,
- * and another if it doesn't.
- * Eventually this and other features should get folded into some kind
- * of scripting engine.
- *
- * Usage:
- *
- * label boot_kernel
- * com32 ifcpuhvm.c32
- * append boot_kernel_xen -- boot_kernel_regular
- * label boot_kernel_xen
- * kernel mboot.c32
- * append xen.gz dom0_mem=262144 -- vmlinuz-xen console=tty0 root=/dev/hda1 ro --- initrd.img-xen
- * label boot_kernel_regular
- * kernel vmlinuz_64
- * append ...
- */
-
-#include <alloca.h>
-#include <stdlib.h>
-#include <string.h>
-#include <cpuid.h>
-#include <syslinux/boot.h>
-
-/* XXX: this really should be librarized */
-static void boot_args(char **args)
-{
- int len = 0;
- char **pp;
- const char *p;
- char c, *q, *str;
-
- for (pp = args; *pp; pp++)
- len += strlen(*pp);
-
- q = str = alloca(len + 1);
- for (pp = args; *pp; pp++) {
- p = *pp;
- while ((c = *p++))
- *q++ = c;
- }
- *q = '\0';
-
- if (!str[0])
- syslinux_run_default();
- else
- syslinux_run_command(str);
-}
-
-int main(int argc, char *argv[])
-{
- char **args[3];
- int i;
- int n;
- s_cpu cpu;
- detect_cpu(&cpu);
-
- args[0] = &argv[1];
- n = 1;
- for (i = 1; i < argc; i++) {
- if (!strcmp(argv[i], "--")) {
- argv[i] = NULL;
- args[n++] = &argv[i + 1];
- }
- if (n >= 3)
- break;
- }
- while (n < 3) {
- args[n] = args[n - 1];
- n++;
- }
-
- boot_args((cpu.flags.vmx || cpu.flags.svm) ? args[0] : args[1]);
- return -1;
-}