Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 157414 Details for
Bug 241810
rt kernel needs the crash module for i686
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
patch
linux-2.6-x86-crash-driver.patch (text/plain), 6.40 KB, created by
Guy Streeter
on 2007-06-19 20:12:00 UTC
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Guy Streeter
Created:
2007-06-19 20:12:00 UTC
Size:
6.40 KB
patch
obsolete
>diff -urNp --exclude-from=/home/davej/.exclude linux-1050/arch/i386/mm/init.c linux-1060/arch/i386/mm/init.c >--- linux-1050/arch/i386/mm/init.c >+++ linux-1060/arch/i386/mm/init.c >@@ -248,6 +248,8 @@ int devmem_is_allowed(unsigned long page > return 0; > } > >+EXPORT_SYMBOL_GPL(page_is_ram); >+ > #ifdef CONFIG_HIGHMEM > pte_t *kmap_pte; > pgprot_t kmap_prot; >diff -urNp --exclude-from=/home/davej/.exclude linux-1050/drivers/char/crash.c linux-1060/drivers/char/crash.c >--- linux-1050/drivers/char/crash.c >+++ linux-1060/drivers/char/crash.c >@@ -0,0 +1,128 @@ >+/* >+ * linux/drivers/char/crash.c >+ * >+ * Copyright (C) 2004 Dave Anderson <anderson@redhat.com> >+ * Copyright (C) 2004 Red Hat, Inc. >+ */ >+ >+/****************************************************************************** >+ * >+ * 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; either version 2, or (at your option) >+ * any later version. >+ * >+ * This program is distributed in the hope that it will be useful, >+ * but WITHOUT ANY WARRANTY; without even the implied warranty of >+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+ * GNU General Public License for more details. >+ * >+ * You should have received a copy of the GNU General Public License >+ * along with this program; if not, write to the Free Software >+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. >+ * >+ *****************************************************************************/ >+ >+#include <linux/module.h> >+#include <linux/types.h> >+#include <linux/miscdevice.h> >+#include <linux/init.h> >+#include <asm/io.h> >+#include <asm/uaccess.h> >+#include <asm/types.h> >+#include <asm/crash.h> >+ >+#define CRASH_VERSION "1.0" >+ >+/* >+ * These are the file operation functions that allow crash utility >+ * access to physical memory. >+ */ >+ >+static loff_t >+crash_llseek(struct file * file, loff_t offset, int orig) >+{ >+ switch (orig) { >+ case 0: >+ file->f_pos = offset; >+ return file->f_pos; >+ case 1: >+ file->f_pos += offset; >+ return file->f_pos; >+ default: >+ return -EINVAL; >+ } >+} >+ >+/* >+ * Determine the page address for an address offset value, >+ * get a virtual address for it, and copy it out. >+ * Accesses must fit within a page. >+ */ >+static ssize_t >+crash_read(struct file *file, char *buf, size_t count, loff_t *poff) >+{ >+ void *vaddr; >+ struct page *page; >+ u64 offset; >+ ssize_t read; >+ >+ offset = *poff; >+ if (offset >> PAGE_SHIFT != (offset+count-1) >> PAGE_SHIFT) >+ return -EINVAL; >+ >+ vaddr = map_virtual(offset, &page); >+ if (!vaddr) >+ return -EFAULT; >+ >+ if (copy_to_user(buf, vaddr, count)) { >+ unmap_virtual(page); >+ return -EFAULT; >+ } >+ unmap_virtual(page); >+ >+ read = count; >+ *poff += read; >+ return read; >+} >+ >+static struct file_operations crash_fops = { >+ .owner = THIS_MODULE, >+ .llseek = crash_llseek, >+ .read = crash_read, >+}; >+ >+static struct miscdevice crash_dev = { >+ MISC_DYNAMIC_MINOR, >+ "crash", >+ &crash_fops >+}; >+ >+static int __init >+crash_init(void) >+{ >+ int ret; >+ >+ ret = misc_register(&crash_dev); >+ if (ret) { >+ printk(KERN_ERR >+ "crash memory driver: cannot misc_register (MISC_DYNAMIC_MINOR)\n"); >+ goto out; >+ } >+ >+ ret = 0; >+ printk(KERN_INFO "crash memory driver: version %s\n", CRASH_VERSION); >+out: >+ return ret; >+} >+ >+static void __exit >+crash_cleanup_module(void) >+{ >+ misc_deregister(&crash_dev); >+} >+ >+module_init(crash_init); >+module_exit(crash_cleanup_module); >+ >+MODULE_LICENSE("GPL"); >diff -urNp --exclude-from=/home/davej/.exclude linux-1050/drivers/char/Kconfig linux-1060/drivers/char/Kconfig >--- linux-1050/drivers/char/Kconfig >+++ linux-1060/drivers/char/Kconfig >@@ -441,6 +441,8 @@ config LEGACY_PTYS > security. This option enables these legacy devices; on most > systems, it is safe to say N. > >+config CRASH >+ tristate "Crash Utility memory driver" > > config LEGACY_PTY_COUNT > int "Maximum number of legacy PTY in use" >--- linux-2.6.16.noarch/drivers/char/Makefile~ 2006-03-25 18:50:42.000000000 -0500 >+++ linux-2.6.16.noarch/drivers/char/Makefile 2006-03-25 18:50:59.000000000 -0500 >@@ -95,6 +95,7 @@ obj-$(CONFIG_IPMI_HANDLER) += ipmi/ > > obj-$(CONFIG_HANGCHECK_TIMER) += hangcheck-timer.o > obj-$(CONFIG_TCG_TPM) += tpm/ >+obj-$(CONFIG_CRASH) += crash.o > > # Files generated that shall be removed upon make clean > clean-files := consolemap_deftbl.c defkeymap.c qtronixmap.c >diff -urNp --exclude-from=/home/davej/.exclude linux-1050/include/asm-i386/crash.h linux-1060/include/asm-i386/crash.h >--- linux-1050/include/asm-i386/crash.h >+++ linux-1060/include/asm-i386/crash.h >@@ -0,0 +1,75 @@ >+#ifndef _ASM_I386_CRASH_H >+#define _ASM_I386_CRASH_H >+ >+/* >+ * linux/include/asm-i386/crash.h >+ * >+ * Copyright (c) 2004 Red Hat, Inc. 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; either version 2, or (at your option) >+ * any later version. >+ * >+ * This program is distributed in the hope that it will be useful, >+ * but WITHOUT ANY WARRANTY; without even the implied warranty of >+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+ * GNU General Public License for more details. >+ * >+ * You should have received a copy of the GNU General Public License >+ * along with this program; if not, write to the Free Software >+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. >+ * >+ */ >+ >+#ifdef __KERNEL__ >+ >+#include <linux/mm.h> >+#include <linux/highmem.h> >+#include <asm/mmzone.h> >+ >+extern int page_is_ram(unsigned long); >+ >+static inline void * >+map_virtual(u64 offset, struct page **pp) >+{ >+ struct page *page; >+ unsigned long pfn; >+ void *vaddr; >+ >+ pfn = (unsigned long)(offset >> PAGE_SHIFT); >+ >+ if (!page_is_ram(pfn)) { >+ printk(KERN_INFO >+ "crash memory driver: !page_is_ram(pfn: %lx)\n", pfn); >+ return NULL; >+ } >+ >+ if (!pfn_valid(pfn)) { >+ printk(KERN_INFO >+ "crash memory driver: invalid pfn: %lx )\n", pfn); >+ return NULL; >+ } >+ >+ page = pfn_to_page(pfn); >+ >+ vaddr = kmap(page); >+ if (!vaddr) { >+ printk(KERN_INFO >+ "crash memory driver: pfn: %lx kmap(page: %lx) failed\n", >+ pfn, (unsigned long)page); >+ return NULL; >+ } >+ >+ *pp = page; >+ return (vaddr + (offset & (PAGE_SIZE-1))); >+} >+ >+static inline void unmap_virtual(struct page *page) >+{ >+ kunmap(page); >+} >+ >+#endif /* __KERNEL__ */ >+ >+#endif /* _ASM_I386_CRASH_H */
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 241810
: 157414