diff options
author | Rik van Riel <riel@redhat.com> | 2008-07-24 00:27:05 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-24 13:47:15 -0400 |
commit | 28b2ee20c7cba812b6f2ccf6d722cf86d00a84dc (patch) | |
tree | e8f1efd05c38c1cb26ca3ee051a454eb685fd122 /include | |
parent | 0d71d10a4252a3938e6b70189bc776171c02e076 (diff) |
access_process_vm device memory infrastructure
In order to be able to debug things like the X server and programs using
the PPC Cell SPUs, the debugger needs to be able to access device memory
through ptrace and /proc/pid/mem.
This patch:
Add the generic_access_phys access function and put the hooks in place
to allow access_process_vm to access device or PPC Cell SPU memory.
[riel@redhat.com: Add documentation for the vm_ops->access function]
Signed-off-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Benjamin Herrensmidt <benh@kernel.crashing.org>
Cc: Dave Airlie <airlied@linux.ie>
Cc: Hugh Dickins <hugh@veritas.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-x86/io_32.h | 2 | ||||
-rw-r--r-- | include/asm-x86/io_64.h | 2 | ||||
-rw-r--r-- | include/linux/mm.h | 8 |
3 files changed, 12 insertions, 0 deletions
diff --git a/include/asm-x86/io_32.h b/include/asm-x86/io_32.h index 4df44ed54077..e876d89ac156 100644 --- a/include/asm-x86/io_32.h +++ b/include/asm-x86/io_32.h | |||
@@ -110,6 +110,8 @@ static inline void *phys_to_virt(unsigned long address) | |||
110 | */ | 110 | */ |
111 | extern void __iomem *ioremap_nocache(resource_size_t offset, unsigned long size); | 111 | extern void __iomem *ioremap_nocache(resource_size_t offset, unsigned long size); |
112 | extern void __iomem *ioremap_cache(resource_size_t offset, unsigned long size); | 112 | extern void __iomem *ioremap_cache(resource_size_t offset, unsigned long size); |
113 | extern void __iomem *ioremap_prot(resource_size_t offset, unsigned long size, | ||
114 | unsigned long prot_val); | ||
113 | 115 | ||
114 | /* | 116 | /* |
115 | * The default ioremap() behavior is non-cached: | 117 | * The default ioremap() behavior is non-cached: |
diff --git a/include/asm-x86/io_64.h b/include/asm-x86/io_64.h index ddd8058a5026..22995c5c5adc 100644 --- a/include/asm-x86/io_64.h +++ b/include/asm-x86/io_64.h | |||
@@ -175,6 +175,8 @@ extern void early_iounmap(void *addr, unsigned long size); | |||
175 | */ | 175 | */ |
176 | extern void __iomem *ioremap_nocache(resource_size_t offset, unsigned long size); | 176 | extern void __iomem *ioremap_nocache(resource_size_t offset, unsigned long size); |
177 | extern void __iomem *ioremap_cache(resource_size_t offset, unsigned long size); | 177 | extern void __iomem *ioremap_cache(resource_size_t offset, unsigned long size); |
178 | extern void __iomem *ioremap_prot(resource_size_t offset, unsigned long size, | ||
179 | unsigned long prot_val); | ||
178 | 180 | ||
179 | /* | 181 | /* |
180 | * The default ioremap() behavior is non-cached: | 182 | * The default ioremap() behavior is non-cached: |
diff --git a/include/linux/mm.h b/include/linux/mm.h index eb815cfc1b35..5c7f8f64f70e 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -170,6 +170,12 @@ struct vm_operations_struct { | |||
170 | /* notification that a previously read-only page is about to become | 170 | /* notification that a previously read-only page is about to become |
171 | * writable, if an error is returned it will cause a SIGBUS */ | 171 | * writable, if an error is returned it will cause a SIGBUS */ |
172 | int (*page_mkwrite)(struct vm_area_struct *vma, struct page *page); | 172 | int (*page_mkwrite)(struct vm_area_struct *vma, struct page *page); |
173 | |||
174 | /* called by access_process_vm when get_user_pages() fails, typically | ||
175 | * for use by special VMAs that can switch between memory and hardware | ||
176 | */ | ||
177 | int (*access)(struct vm_area_struct *vma, unsigned long addr, | ||
178 | void *buf, int len, int write); | ||
173 | #ifdef CONFIG_NUMA | 179 | #ifdef CONFIG_NUMA |
174 | /* | 180 | /* |
175 | * set_policy() op must add a reference to any non-NULL @new mempolicy | 181 | * set_policy() op must add a reference to any non-NULL @new mempolicy |
@@ -771,6 +777,8 @@ int copy_page_range(struct mm_struct *dst, struct mm_struct *src, | |||
771 | struct vm_area_struct *vma); | 777 | struct vm_area_struct *vma); |
772 | void unmap_mapping_range(struct address_space *mapping, | 778 | void unmap_mapping_range(struct address_space *mapping, |
773 | loff_t const holebegin, loff_t const holelen, int even_cows); | 779 | loff_t const holebegin, loff_t const holelen, int even_cows); |
780 | int generic_access_phys(struct vm_area_struct *vma, unsigned long addr, | ||
781 | void *buf, int len, int write); | ||
774 | 782 | ||
775 | static inline void unmap_shared_mapping_range(struct address_space *mapping, | 783 | static inline void unmap_shared_mapping_range(struct address_space *mapping, |
776 | loff_t const holebegin, loff_t const holelen) | 784 | loff_t const holebegin, loff_t const holelen) |