mem_user.c 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*
  2. * arch/um/kernel/mem_user.c
  3. *
  4. * BRIEF MODULE DESCRIPTION
  5. * user side memory routines for supporting 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. #include <stdio.h>
  32. #include <stdlib.h>
  33. #include <stddef.h>
  34. #include <stdarg.h>
  35. #include <unistd.h>
  36. #include <errno.h>
  37. #include <string.h>
  38. #include <fcntl.h>
  39. #include <sys/types.h>
  40. #include <sys/mman.h>
  41. #include "kern_util.h"
  42. #include "user.h"
  43. #include "user_util.h"
  44. #include "mem_user.h"
  45. #include "init.h"
  46. #include "os.h"
  47. #include "tempfile.h"
  48. #include "kern_constants.h"
  49. struct iomem_region *iomem_regions = NULL;
  50. int iomem_size = 0;
  51. extern int parse_iomem(char *str, int *add) __init;
  52. __uml_setup("iomem=", parse_iomem,
  53. "iomem=<name>,<file>\n"
  54. " Configure <file> as an IO memory region named <name>.\n\n"
  55. );
  56. /*
  57. * Overrides for Emacs so that we follow Linus's tabbing style.
  58. * Emacs will notice this stuff at the end of the file and automatically
  59. * adjust the settings for this buffer only. This must remain at the end
  60. * of the file.
  61. * ---------------------------------------------------------------------------
  62. * Local variables:
  63. * c-file-style: "linux"
  64. * End:
  65. */