Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * arch/um/include/mem_user.h |
| 3 | * |
| 4 | * BRIEF MODULE DESCRIPTION |
| 5 | * user side memory interface for support IO memory inside user mode linux |
| 6 | * |
| 7 | * Copyright (C) 2001 RidgeRun, Inc. |
| 8 | * Author: RidgeRun, Inc. |
| 9 | * Greg Lonnon glonnon@ridgerun.com or info@ridgerun.com |
| 10 | * |
| 11 | * This program is free software; you can redistribute it and/or modify it |
| 12 | * under the terms of the GNU General Public License as published by the |
| 13 | * Free Software Foundation; either version 2 of the License, or (at your |
| 14 | * option) any later version. |
| 15 | * |
| 16 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED |
| 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
| 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN |
| 19 | * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
| 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
| 21 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF |
| 22 | * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON |
| 23 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
| 25 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 26 | * |
| 27 | * You should have received a copy of the GNU General Public License along |
| 28 | * with this program; if not, write to the Free Software Foundation, Inc., |
| 29 | * 675 Mass Ave, Cambridge, MA 02139, USA. |
| 30 | */ |
| 31 | |
| 32 | #ifndef _MEM_USER_H |
| 33 | #define _MEM_USER_H |
| 34 | |
| 35 | struct iomem_region { |
| 36 | struct iomem_region *next; |
| 37 | char *driver; |
| 38 | int fd; |
| 39 | int size; |
| 40 | unsigned long phys; |
| 41 | unsigned long virt; |
| 42 | }; |
| 43 | |
| 44 | extern struct iomem_region *iomem_regions; |
| 45 | extern int iomem_size; |
| 46 | |
| 47 | #define ROUND_4M(n) ((((unsigned long) (n)) + (1 << 22)) & ~((1 << 22) - 1)) |
| 48 | |
| 49 | extern unsigned long host_task_size; |
| 50 | extern unsigned long task_size; |
| 51 | |
| 52 | extern void check_devanon(void); |
| 53 | extern int init_mem_user(void); |
| 54 | extern int create_mem_file(unsigned long len); |
| 55 | extern void setup_memory(void *entry); |
| 56 | extern unsigned long find_iomem(char *driver, unsigned long *len_out); |
| 57 | extern int init_maps(unsigned long physmem, unsigned long iomem, |
| 58 | unsigned long highmem); |
| 59 | extern unsigned long get_vm(unsigned long len); |
| 60 | extern void setup_physmem(unsigned long start, unsigned long usable, |
| 61 | unsigned long len, unsigned long highmem); |
| 62 | extern void add_iomem(char *name, int fd, unsigned long size); |
| 63 | extern unsigned long phys_offset(unsigned long phys); |
| 64 | extern void unmap_physmem(void); |
| 65 | extern void map_memory(unsigned long virt, unsigned long phys, |
| 66 | unsigned long len, int r, int w, int x); |
| 67 | extern int protect_memory(unsigned long addr, unsigned long len, |
| 68 | int r, int w, int x, int must_succeed); |
| 69 | extern unsigned long get_kmem_end(void); |
| 70 | extern void check_tmpexec(void); |
| 71 | |
| 72 | #endif |
| 73 | |
| 74 | /* |
| 75 | * Overrides for Emacs so that we follow Linus's tabbing style. |
| 76 | * Emacs will notice this stuff at the end of the file and automatically |
| 77 | * adjust the settings for this buffer only. This must remain at the end |
| 78 | * of the file. |
| 79 | * --------------------------------------------------------------------------- |
| 80 | * Local variables: |
| 81 | * c-file-style: "linux" |
| 82 | * End: |
| 83 | */ |