Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 80192
b: refs/heads/master
c: 6d7d743
h: refs/heads/master
v: v3
  • Loading branch information
Huang, Ying authored and Ingo Molnar committed Jan 30, 2008
1 parent ca4dfd2 commit a07a0de
Show file tree
Hide file tree
Showing 6 changed files with 82 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4d022e35fd7e07c522c7863fee6f07e53cf3fc14
refs/heads/master: 6d7d7433750c7c6eec93d7b3206019e329228686
7 changes: 7 additions & 0 deletions trunk/arch/x86/Kconfig.debug
Original file line number Diff line number Diff line change
Expand Up @@ -185,4 +185,11 @@ config DEFAULT_IO_DELAY_TYPE
default IO_DELAY_TYPE_NONE
endif

config DEBUG_BOOT_PARAMS
bool "Debug boot parameters"
depends on DEBUG_KERNEL
depends on DEBUG_FS
help
This option will cause struct boot_params to be exported via debugfs.

endmenu
2 changes: 1 addition & 1 deletion trunk/arch/x86/kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ obj-$(CONFIG_X86_32) += sys_i386_32.o i386_ksyms_32.o
obj-$(CONFIG_X86_64) += sys_x86_64.o x8664_ksyms_64.o
obj-$(CONFIG_X86_64) += syscall_64.o vsyscall_64.o setup64.o
obj-y += pci-dma_$(BITS).o bootflag.o e820_$(BITS).o
obj-y += quirks.o i8237.o topology.o
obj-y += quirks.o i8237.o topology.o kdebugfs.o
obj-y += alternative.o i8253.o
obj-$(CONFIG_X86_64) += pci-nommu_64.o bugs_64.o
obj-y += tsc_$(BITS).o io_delay.o rtc.o
Expand Down
65 changes: 65 additions & 0 deletions trunk/arch/x86/kernel/kdebugfs.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/*
* Architecture specific debugfs files
*
* Copyright (C) 2007, Intel Corp.
* Huang Ying <ying.huang@intel.com>
*
* This file is released under the GPLv2.
*/

#include <linux/debugfs.h>
#include <linux/stat.h>
#include <linux/init.h>

#include <asm/setup.h>

#ifdef CONFIG_DEBUG_BOOT_PARAMS
static struct debugfs_blob_wrapper boot_params_blob = {
.data = &boot_params,
.size = sizeof(boot_params),
};

static int __init boot_params_kdebugfs_init(void)
{
int error;
struct dentry *dbp, *version, *data;

dbp = debugfs_create_dir("boot_params", NULL);
if (!dbp) {
error = -ENOMEM;
goto err_return;
}
version = debugfs_create_x16("version", S_IRUGO, dbp,
&boot_params.hdr.version);
if (!version) {
error = -ENOMEM;
goto err_dir;
}
data = debugfs_create_blob("data", S_IRUGO, dbp,
&boot_params_blob);
if (!data) {
error = -ENOMEM;
goto err_version;
}
return 0;
err_version:
debugfs_remove(version);
err_dir:
debugfs_remove(dbp);
err_return:
return error;
}
#endif

static int __init arch_kdebugfs_init(void)
{
int error = 0;

#ifdef CONFIG_DEBUG_BOOT_PARAMS
error = boot_params_kdebugfs_init();
#endif

return error;
}

arch_initcall(arch_kdebugfs_init);
4 changes: 4 additions & 0 deletions trunk/arch/x86/kernel/setup64.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@
#include <asm/sections.h>
#include <asm/setup.h>

#ifndef CONFIG_DEBUG_BOOT_PARAMS
struct boot_params __initdata boot_params;
#else
struct boot_params boot_params;
#endif

cpumask_t cpu_initialized __cpuinitdata = CPU_MASK_NONE;

Expand Down
4 changes: 4 additions & 0 deletions trunk/arch/x86/kernel/setup_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,11 @@ unsigned long saved_videomode;

static char __initdata command_line[COMMAND_LINE_SIZE];

#ifndef CONFIG_DEBUG_BOOT_PARAMS
struct boot_params __initdata boot_params;
#else
struct boot_params boot_params;
#endif

#if defined(CONFIG_EDD) || defined(CONFIG_EDD_MODULE)
struct edd edd;
Expand Down

0 comments on commit a07a0de

Please sign in to comment.