Path: blob/master/arch/um/include/shared/mem_user.h
10819 views
/*1* arch/um/include/mem_user.h2*3* BRIEF MODULE DESCRIPTION4* user side memory interface for support IO memory inside user mode linux5*6* Copyright (C) 2001 RidgeRun, Inc.7* Author: RidgeRun, Inc.8* Greg Lonnon [email protected] or [email protected]9*10* This program is free software; you can redistribute it and/or modify it11* under the terms of the GNU General Public License as published by the12* Free Software Foundation; either version 2 of the License, or (at your13* option) any later version.14*15* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED16* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF17* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN18* NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,19* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT20* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF21* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON22* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT23* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF24* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.25*26* You should have received a copy of the GNU General Public License along27* with this program; if not, write to the Free Software Foundation, Inc.,28* 675 Mass Ave, Cambridge, MA 02139, USA.29*/3031#ifndef _MEM_USER_H32#define _MEM_USER_H3334struct iomem_region {35struct iomem_region *next;36char *driver;37int fd;38int size;39unsigned long phys;40unsigned long virt;41};4243extern struct iomem_region *iomem_regions;44extern int iomem_size;4546#define ROUND_4M(n) ((((unsigned long) (n)) + (1 << 22)) & ~((1 << 22) - 1))4748extern int init_mem_user(void);49extern void setup_memory(void *entry);50extern unsigned long find_iomem(char *driver, unsigned long *len_out);51extern int init_maps(unsigned long physmem, unsigned long iomem,52unsigned long highmem);53extern unsigned long get_vm(unsigned long len);54extern void setup_physmem(unsigned long start, unsigned long usable,55unsigned long len, unsigned long long highmem);56extern void add_iomem(char *name, int fd, unsigned long size);57extern unsigned long phys_offset(unsigned long phys);58extern void map_memory(unsigned long virt, unsigned long phys,59unsigned long len, int r, int w, int x);6061#endif626364