aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/mem.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/mem.c')
-rw-r--r--drivers/char/mem.c47
1 files changed, 0 insertions, 47 deletions
diff --git a/drivers/char/mem.c b/drivers/char/mem.c
index 2ca6d7844ad9..f895a8c8a244 100644
--- a/drivers/char/mem.c
+++ b/drivers/char/mem.c
@@ -21,7 +21,6 @@
21#include <linux/ptrace.h> 21#include <linux/ptrace.h>
22#include <linux/device.h> 22#include <linux/device.h>
23#include <linux/highmem.h> 23#include <linux/highmem.h>
24#include <linux/crash_dump.h>
25#include <linux/backing-dev.h> 24#include <linux/backing-dev.h>
26#include <linux/bootmem.h> 25#include <linux/bootmem.h>
27#include <linux/splice.h> 26#include <linux/splice.h>
@@ -357,40 +356,6 @@ static int mmap_kmem(struct file *file, struct vm_area_struct *vma)
357} 356}
358#endif 357#endif
359 358
360#ifdef CONFIG_CRASH_DUMP
361/*
362 * Read memory corresponding to the old kernel.
363 */
364static ssize_t read_oldmem(struct file *file, char __user *buf,
365 size_t count, loff_t *ppos)
366{
367 unsigned long pfn, offset;
368 size_t read = 0, csize;
369 int rc = 0;
370
371 while (count) {
372 pfn = *ppos / PAGE_SIZE;
373 if (pfn > saved_max_pfn)
374 return read;
375
376 offset = (unsigned long)(*ppos % PAGE_SIZE);
377 if (count > PAGE_SIZE - offset)
378 csize = PAGE_SIZE - offset;
379 else
380 csize = count;
381
382 rc = copy_oldmem_page(pfn, buf, csize, offset, 1);
383 if (rc < 0)
384 return rc;
385 buf += csize;
386 *ppos += csize;
387 read += csize;
388 count -= csize;
389 }
390 return read;
391}
392#endif
393
394#ifdef CONFIG_DEVKMEM 359#ifdef CONFIG_DEVKMEM
395/* 360/*
396 * This function reads the *virtual* memory as seen by the kernel. 361 * This function reads the *virtual* memory as seen by the kernel.
@@ -772,7 +737,6 @@ static int open_port(struct inode *inode, struct file *filp)
772#define aio_write_zero aio_write_null 737#define aio_write_zero aio_write_null
773#define open_mem open_port 738#define open_mem open_port
774#define open_kmem open_mem 739#define open_kmem open_mem
775#define open_oldmem open_mem
776 740
777static const struct file_operations mem_fops = { 741static const struct file_operations mem_fops = {
778 .llseek = memory_lseek, 742 .llseek = memory_lseek,
@@ -837,14 +801,6 @@ static const struct file_operations full_fops = {
837 .write = write_full, 801 .write = write_full,
838}; 802};
839 803
840#ifdef CONFIG_CRASH_DUMP
841static const struct file_operations oldmem_fops = {
842 .read = read_oldmem,
843 .open = open_oldmem,
844 .llseek = default_llseek,
845};
846#endif
847
848static const struct memdev { 804static const struct memdev {
849 const char *name; 805 const char *name;
850 umode_t mode; 806 umode_t mode;
@@ -866,9 +822,6 @@ static const struct memdev {
866#ifdef CONFIG_PRINTK 822#ifdef CONFIG_PRINTK
867 [11] = { "kmsg", 0644, &kmsg_fops, NULL }, 823 [11] = { "kmsg", 0644, &kmsg_fops, NULL },
868#endif 824#endif
869#ifdef CONFIG_CRASH_DUMP
870 [12] = { "oldmem", 0, &oldmem_fops, NULL },
871#endif
872}; 825};
873 826
874static int memory_open(struct inode *inode, struct file *filp) 827static int memory_open(struct inode *inode, struct file *filp)