mem-layout.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /* mem-layout.h: memory layout
  2. *
  3. * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved.
  4. * Written by David Howells (dhowells@redhat.com)
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License
  8. * as published by the Free Software Foundation; either version
  9. * 2 of the License, or (at your option) any later version.
  10. */
  11. #ifndef _ASM_MEM_LAYOUT_H
  12. #define _ASM_MEM_LAYOUT_H
  13. #ifndef __ASSEMBLY__
  14. #define __UL(X) ((unsigned long) (X))
  15. #else
  16. #define __UL(X) (X)
  17. #endif
  18. /*
  19. * PAGE_SHIFT determines the page size
  20. */
  21. #define PAGE_SHIFT 14
  22. #ifndef __ASSEMBLY__
  23. #define PAGE_SIZE (1UL << PAGE_SHIFT)
  24. #else
  25. #define PAGE_SIZE (1 << PAGE_SHIFT)
  26. #endif
  27. #define PAGE_MASK (~(PAGE_SIZE-1))
  28. /*****************************************************************************/
  29. /*
  30. * virtual memory layout from kernel's point of view
  31. */
  32. #define PAGE_OFFSET ((unsigned long) &__page_offset)
  33. #ifdef CONFIG_MMU
  34. /* see Documentation/fujitsu/frv/mmu-layout.txt */
  35. #define KERNEL_LOWMEM_START __UL(0xc0000000)
  36. #define KERNEL_LOWMEM_END __UL(0xd0000000)
  37. #define VMALLOC_START __UL(0xd0000000)
  38. #define VMALLOC_END __UL(0xd8000000)
  39. #define PKMAP_BASE __UL(0xd8000000)
  40. #define PKMAP_END __UL(0xdc000000)
  41. #define KMAP_ATOMIC_SECONDARY_FRAME __UL(0xdc000000)
  42. #define KMAP_ATOMIC_PRIMARY_FRAME __UL(0xdd000000)
  43. #endif
  44. #define KERNEL_IO_START __UL(0xe0000000)
  45. /*****************************************************************************/
  46. /*
  47. * memory layout from userspace's point of view
  48. */
  49. #define BRK_BASE __UL(2 * 1024 * 1024 + PAGE_SIZE)
  50. #define STACK_TOP __UL(2 * 1024 * 1024)
  51. /* userspace process size */
  52. #ifdef CONFIG_MMU
  53. #define TASK_SIZE (PAGE_OFFSET)
  54. #else
  55. #define TASK_SIZE __UL(0xFFFFFFFFUL)
  56. #endif
  57. /* base of area at which unspecified mmaps will start */
  58. #ifdef CONFIG_BINFMT_ELF_FDPIC
  59. #define TASK_UNMAPPED_BASE __UL(16 * 1024 * 1024)
  60. #else
  61. #define TASK_UNMAPPED_BASE __UL(TASK_SIZE / 3)
  62. #endif
  63. #endif /* _ASM_MEM_LAYOUT_H */