mem-layout.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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. * the slab must be aligned such that load- and store-double instructions don't
  30. * fault if used
  31. */
  32. #define ARCH_DMA_MINALIGN L1_CACHE_BYTES
  33. #define ARCH_SLAB_MINALIGN L1_CACHE_BYTES
  34. /*****************************************************************************/
  35. /*
  36. * virtual memory layout from kernel's point of view
  37. */
  38. #define PAGE_OFFSET ((unsigned long) &__page_offset)
  39. #ifdef CONFIG_MMU
  40. /* see Documentation/frv/mmu-layout.txt */
  41. #define KERNEL_LOWMEM_START __UL(0xc0000000)
  42. #define KERNEL_LOWMEM_END __UL(0xd0000000)
  43. #define VMALLOC_START __UL(0xd0000000)
  44. #define VMALLOC_END __UL(0xd8000000)
  45. #define PKMAP_BASE __UL(0xd8000000)
  46. #define PKMAP_END __UL(0xdc000000)
  47. #define KMAP_ATOMIC_SECONDARY_FRAME __UL(0xdc000000)
  48. #define KMAP_ATOMIC_PRIMARY_FRAME __UL(0xdd000000)
  49. #endif
  50. #define KERNEL_IO_START __UL(0xe0000000)
  51. /*****************************************************************************/
  52. /*
  53. * memory layout from userspace's point of view
  54. */
  55. #define BRK_BASE __UL(2 * 1024 * 1024 + PAGE_SIZE)
  56. #define STACK_TOP __UL(2 * 1024 * 1024)
  57. #define STACK_TOP_MAX __UL(0xc0000000)
  58. /* userspace process size */
  59. #ifdef CONFIG_MMU
  60. #define TASK_SIZE (PAGE_OFFSET)
  61. #else
  62. #define TASK_SIZE __UL(0xFFFFFFFFUL)
  63. #endif
  64. /* base of area at which unspecified mmaps will start */
  65. #ifdef CONFIG_BINFMT_ELF_FDPIC
  66. #define TASK_UNMAPPED_BASE __UL(16 * 1024 * 1024)
  67. #else
  68. #define TASK_UNMAPPED_BASE __UL(TASK_SIZE / 3)
  69. #endif
  70. #endif /* _ASM_MEM_LAYOUT_H */