aboutsummaryrefslogtreecommitdiffstats
path: root/com32
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2010-03-29 17:34:22 -0700
committerH. Peter Anvin <hpa@linux.intel.com>2010-03-29 17:34:22 -0700
commitb6e84b7f93c5b4a0cffd132f3c6dbf6bf58ba2b9 (patch)
tree8d4b75e005cd72f67afe31b433c16528f8ce897f /com32
parent4121b9c7962e230f8819645ecb9d5f4eac684ed2 (diff)
parent68a7538d5a80ec8db48c02d4a9de7199df0af9f9 (diff)
downloadsyslinux-b6e84b7f93c5b4a0cffd132f3c6dbf6bf58ba2b9.tar.gz
syslinux-b6e84b7f93c5b4a0cffd132f3c6dbf6bf58ba2b9.tar.xz
syslinux-b6e84b7f93c5b4a0cffd132f3c6dbf6bf58ba2b9.zip
Merge branch 'master' into pathbased
Resolved Conflicts: MCONFIG.embedded com32/MCONFIG com32/include/com32.h core/com32.inc core/pxelinux.asm doc/comboot.txt Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'com32')
-rw-r--r--com32/MCONFIG1
-rw-r--r--com32/gpllib/cpuid.c6
-rw-r--r--com32/include/com32.h7
-rw-r--r--com32/lib/sys/argv.c5
-rw-r--r--com32/lib/sys/entry.S2
-rw-r--r--com32/mboot/Makefile2
-rw-r--r--com32/mboot/mboot.c4
-rw-r--r--com32/mboot/mboot.h6
-rw-r--r--com32/mboot/syslinux.c45
9 files changed, 67 insertions, 11 deletions
diff --git a/com32/MCONFIG b/com32/MCONFIG
index 80f92f6c..0b774d4f 100644
--- a/com32/MCONFIG
+++ b/com32/MCONFIG
@@ -32,6 +32,7 @@ GCCOPT += $(call gcc_ok,-falign-jumps=0,-malign-jumps=0)
GCCOPT += $(call gcc_ok,-falign-labels=0,-malign-labels=0)
GCCOPT += $(call gcc_ok,-falign-loops=0,-malign-loops=0)
GCCOPT += $(call gcc_ok,-mpreferred-stack-boundary=2,)
+GCCOPT += $(call gcc_ok,-incoming-stack-boundary=2,)
com32 := $(topdir)/com32
RELOCS := $(com32)/tools/relocs
diff --git a/com32/gpllib/cpuid.c b/com32/gpllib/cpuid.c
index fa212045..f33e8958 100644
--- a/com32/gpllib/cpuid.c
+++ b/com32/gpllib/cpuid.c
@@ -232,8 +232,10 @@ void generic_identify(struct cpuinfo_x86 *c)
}
break;
case X86_VENDOR_INTEL:
- cpuid(0x4, &eax, &ebx, &ecx, &edx);
- c->x86_num_cores = ((eax & 0xfc000000) >> 26) + 1;
+ if (c->cpuid_level >= 0x00000004) {
+ cpuid(0x4, &eax, &ebx, &ecx, &edx);
+ c->x86_num_cores = ((eax & 0xfc000000) >> 26) + 1;
+ }
break;
default:
c->x86_num_cores = 1;
diff --git a/com32/include/com32.h b/com32/include/com32.h
index 252dab5a..6b142082 100644
--- a/com32/include/com32.h
+++ b/com32/include/com32.h
@@ -97,12 +97,13 @@ struct com32_pmapi;
extern struct com32_sys_args {
uint32_t cs_sysargs;
char *cs_cmdline;
- void __cdecl(*cs_intcall) (uint8_t, const com32sys_t *, com32sys_t *);
+ void __cdecl (*cs_intcall)(uint8_t, const com32sys_t *, com32sys_t *);
void *cs_bounce;
uint32_t cs_bounce_size;
- void __cdecl(*cs_farcall) (uint32_t, const com32sys_t *, com32sys_t *);
- int __cdecl(*cs_cfarcall) (uint32_t, const void *, uint32_t);
+ void __cdecl (*cs_farcall)(uint32_t, const com32sys_t *, com32sys_t *);
+ int __cdecl (*cs_cfarcall)(uint32_t, const void *, uint32_t);
uint32_t cs_memsize;
+ const char *cs_name;
const struct com32_pmapi *cs_pm;
} __com32;
diff --git a/com32/lib/sys/argv.c b/com32/lib/sys/argv.c
index 8e9aabdb..3ff869b7 100644
--- a/com32/lib/sys/argv.c
+++ b/com32/lib/sys/argv.c
@@ -37,13 +37,14 @@
#include <stddef.h>
#include <stdio.h>
#include <syslinux/align.h>
+#include <com32.h>
extern char _end[]; /* Symbol created by linker */
void *__mem_end = &_end; /* Global variable for use by malloc() */
int __parse_argv(char ***argv, const char *str)
{
- char argv0[] = "";
+ char dummy_argv0[] = "";
char *mem = __mem_end;
const char *p = str;
char *q = mem;
@@ -77,7 +78,7 @@ int __parse_argv(char ***argv, const char *str)
/* Now create argv */
arg = (char **)ALIGN_UP_FOR(q, char *);
*argv = arg;
- *arg++ = argv0; /* argv[0] */
+ *arg++ = __com32.cs_name ? __com32.cs_name : dummy_argv0; /* argv[0] */
q--; /* Point q to final null */
if (mem < q)
diff --git a/com32/lib/sys/entry.S b/com32/lib/sys/entry.S
index 629f336a..7bfde8b2 100644
--- a/com32/lib/sys/entry.S
+++ b/com32/lib/sys/entry.S
@@ -30,7 +30,7 @@
*/
/* Number of arguments in our version of the entry structure */
-#define COM32_ARGS 8
+#define COM32_ARGS 9
.section ".init","ax"
.globl _start
diff --git a/com32/mboot/Makefile b/com32/mboot/Makefile
index c1ac76fb..7e6c2e96 100644
--- a/com32/mboot/Makefile
+++ b/com32/mboot/Makefile
@@ -24,7 +24,7 @@ LNXLIBS = ../libutil/libutil_lnx.a
MODULES = mboot.c32
TESTFILES =
-OBJS = mboot.o map.o mem.o initvesa.o apm.o solaris.o
+OBJS = mboot.o map.o mem.o initvesa.o apm.o solaris.o syslinux.o
all: $(MODULES) $(TESTFILES)
diff --git a/com32/mboot/mboot.c b/com32/mboot/mboot.c
index a0b55628..16579e43 100644
--- a/com32/mboot/mboot.c
+++ b/com32/mboot/mboot.c
@@ -1,7 +1,7 @@
/* ----------------------------------------------------------------------- *
*
* Copyright 2007-2008 H. Peter Anvin - All Rights Reserved
- * Copyright 2009 Intel Corporation; author: H. Peter Anvin
+ * Copyright 2009-2010 Intel Corporation; author: H. Peter Anvin
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
@@ -222,6 +222,8 @@ int main(int argc, char *argv[])
/* Add auxilliary information */
mboot_make_memmap();
mboot_apm();
+ mboot_syslinux_info();
+
if (opt.solaris)
mboot_solaris_dhcp_hack();
diff --git a/com32/mboot/mboot.h b/com32/mboot/mboot.h
index 993b31a8..761ac872 100644
--- a/com32/mboot/mboot.h
+++ b/com32/mboot/mboot.h
@@ -1,7 +1,7 @@
/* ----------------------------------------------------------------------- *
*
* Copyright 2007-2008 H. Peter Anvin - All Rights Reserved
- * Copyright 2009 Intel Corporation; author: H. Peter Anvin
+ * Copyright 2009-2010 Intel Corporation; author: H. Peter Anvin
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
@@ -50,6 +50,7 @@
#include <syslinux/loadfile.h>
#include <syslinux/movebits.h>
#include <syslinux/bootpm.h>
+#include <syslinux/config.h>
#include "mb_header.h"
#include "mb_info.h"
@@ -92,6 +93,9 @@ void mboot_apm(void);
/* solaris.c */
void mboot_solaris_dhcp_hack(void);
+/* syslinux.c */
+void mboot_syslinux_info(void);
+
/* initvesa.c */
void set_graphics_mode(const struct multiboot_header *mbh,
struct multiboot_info *mbi);
diff --git a/com32/mboot/syslinux.c b/com32/mboot/syslinux.c
new file mode 100644
index 00000000..7de3853e
--- /dev/null
+++ b/com32/mboot/syslinux.c
@@ -0,0 +1,45 @@
+/* ----------------------------------------------------------------------- *
+ *
+ * Copyright 2010 Intel Corporation; author: H. Peter Anvin
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall
+ * be included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * syslinux.c
+ *
+ * Syslinux-specific information for the kernel
+ */
+
+#include <syslinux/config.h>
+#include "mboot.h"
+
+void mboot_syslinux_info(void)
+{
+ const struct syslinux_version *sv;
+
+ sv = syslinux_version();
+ mbinfo.boot_loader_name = map_string(sv->version_string);
+ if (mbinfo.boot_loader_name)
+ mbinfo.flags |= MB_INFO_BOOT_LOADER_NAME;
+}