memory.c 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * linux/arch/m68knommu/mm/memory.c
  3. *
  4. * Copyright (C) 1998 Kenneth Albanowski <kjahds@kjahds.com>,
  5. * Copyright (C) 1999-2002, Greg Ungerer (gerg@snapgear.com)
  6. *
  7. * Based on:
  8. *
  9. * linux/arch/m68k/mm/memory.c
  10. *
  11. * Copyright (C) 1995 Hamish Macdonald
  12. */
  13. #include <linux/mm.h>
  14. #include <linux/kernel.h>
  15. #include <linux/string.h>
  16. #include <linux/types.h>
  17. #include <linux/slab.h>
  18. #include <asm/segment.h>
  19. #include <asm/page.h>
  20. #include <asm/pgtable.h>
  21. #include <asm/system.h>
  22. /*
  23. * Map some physical address range into the kernel address space.
  24. * The code is copied and adapted from map_chunk().
  25. */
  26. unsigned long kernel_map(unsigned long paddr, unsigned long size,
  27. int nocacheflag, unsigned long *memavailp )
  28. {
  29. return paddr;
  30. }
  31. int is_in_rom(unsigned long addr)
  32. {
  33. extern unsigned long _ramstart, _ramend;
  34. /*
  35. * What we are really trying to do is determine if addr is
  36. * in an allocated kernel memory region. If not then assume
  37. * we cannot free it or otherwise de-allocate it. Ideally
  38. * we could restrict this to really being in a ROM or flash,
  39. * but that would need to be done on a board by board basis,
  40. * not globally.
  41. */
  42. if ((addr < _ramstart) || (addr >= _ramend))
  43. return(1);
  44. /* Default case, not in ROM */
  45. return(0);
  46. }