vmparam.h 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. /* $OpenBSD: vmparam.h,v 1.46 2015/06/02 04:31:53 miod Exp $ */
  2. /* $NetBSD: vmparam.h,v 1.13 1997/07/12 16:20:03 perry Exp $ */
  3. /*
  4. * Copyright (c) 1992, 1993
  5. * The Regents of the University of California. All rights reserved.
  6. *
  7. * This software was developed by the Computer Systems Engineering group
  8. * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
  9. * contributed to Berkeley.
  10. *
  11. * All advertising materials mentioning features or use of this software
  12. * must display the following acknowledgement:
  13. * This product includes software developed by the University of
  14. * California, Lawrence Berkeley Laboratory.
  15. *
  16. * Redistribution and use in source and binary forms, with or without
  17. * modification, are permitted provided that the following conditions
  18. * are met:
  19. * 1. Redistributions of source code must retain the above copyright
  20. * notice, this list of conditions and the following disclaimer.
  21. * 2. Redistributions in binary form must reproduce the above copyright
  22. * notice, this list of conditions and the following disclaimer in the
  23. * documentation and/or other materials provided with the distribution.
  24. * 3. Neither the name of the University nor the names of its contributors
  25. * may be used to endorse or promote products derived from this software
  26. * without specific prior written permission.
  27. *
  28. * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  29. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  30. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  31. * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  32. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  33. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  34. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  35. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  36. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  37. * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  38. * SUCH DAMAGE.
  39. *
  40. * @(#)vmparam.h 8.1 (Berkeley) 6/11/93
  41. */
  42. #ifndef _MACHINE_VMPARAM_H_
  43. #define _MACHINE_VMPARAM_H_
  44. /*
  45. * Machine dependent constants for SPARC
  46. */
  47. /*
  48. * Virtual memory related constants, all in bytes
  49. */
  50. #ifndef MAXTSIZ
  51. #define MAXTSIZ (32*1024*1024) /* max text size */
  52. #endif
  53. #ifndef DFLDSIZ
  54. #define DFLDSIZ (64*1024*1024) /* initial data size limit */
  55. #endif
  56. #ifndef MAXDSIZ
  57. #define MAXDSIZ (256*1024*1024) /* max data size */
  58. #endif
  59. #ifndef BRKSIZ
  60. #define BRKSIZ MAXDSIZ /* heap gap size */
  61. #endif
  62. #ifndef DFLSSIZ
  63. #define DFLSSIZ (2*1024*1024) /* initial stack size limit */
  64. #endif
  65. #ifndef MAXSSIZ
  66. #define MAXSSIZ (32*1024*1024) /* max stack size */
  67. #endif
  68. #define STACKGAP_RANDOM 64*1024
  69. #define STACKGAP_RANDOM_SUN4M 256*1024
  70. /*
  71. * Size of shared memory map
  72. */
  73. #ifndef SHMMAXPGS
  74. #define SHMMAXPGS 1024
  75. #endif
  76. /*
  77. * User/kernel map constants. Note that sparc/vaddrs.h defines the
  78. * IO space virtual base, which must be the same as VM_MAX_KERNEL_ADDRESS:
  79. * tread with care.
  80. */
  81. #define VM_MIN_KERNEL_ADDRESS_OLD ((vaddr_t)KERNBASE)
  82. #define VM_MIN_KERNEL_ADDRESS_SUN4 ((vaddr_t)0xf0000000)
  83. #define VM_MIN_KERNEL_ADDRESS_SRMMU ((vaddr_t)0xc0000000)
  84. #if defined(SMALL_KERNEL)
  85. /* limit to small KVA regardless of the cpu type */
  86. #define VM_MIN_KERNEL_ADDRESS VM_MIN_KERNEL_ADDRESS_OLD
  87. #define VM_MAXUSER_ADDRESS VM_MIN_KERNEL_ADDRESS
  88. #define VM_MAX_ADDRESS VM_MIN_KERNEL_ADDRESS
  89. #define USRSTACK VM_MIN_KERNEL_ADDRESS
  90. #elif (defined(SUN4) || defined(SUN4C) || defined(SUN4E)) && \
  91. (defined(SUN4D) || defined(SUN4M))
  92. /* user/kernel bound will de determined at run time */
  93. extern vsize_t vm_kernel_space_size;
  94. #define VM_KERNEL_SPACE_SIZE vm_kernel_space_size
  95. #define VM_MAXUSER_ADDRESS vm_min_kernel_address
  96. #define VM_MAX_ADDRESS vm_min_kernel_address
  97. #define USRSTACK vm_min_kernel_address
  98. #elif (defined(SUN4) || defined(SUN4C) || defined(SUN4E))
  99. /* old Sun MMU with address hole */
  100. #define VM_MIN_KERNEL_ADDRESS VM_MIN_KERNEL_ADDRESS_SUN4
  101. #define VM_MAXUSER_ADDRESS VM_MIN_KERNEL_ADDRESS
  102. #define VM_MAX_ADDRESS VM_MIN_KERNEL_ADDRESS
  103. #define USRSTACK VM_MIN_KERNEL_ADDRESS
  104. #else
  105. /* SRMMU without address hole */
  106. #define VM_MIN_KERNEL_ADDRESS VM_MIN_KERNEL_ADDRESS_SRMMU
  107. #define VM_MAXUSER_ADDRESS VM_MIN_KERNEL_ADDRESS
  108. #define VM_MAX_ADDRESS VM_MIN_KERNEL_ADDRESS
  109. #define USRSTACK VM_MIN_KERNEL_ADDRESS
  110. #endif
  111. #define VM_MIN_ADDRESS ((vaddr_t)0x2000)
  112. #define VM_MAX_KERNEL_ADDRESS ((vaddr_t)0xfe000000)
  113. extern vaddr_t vm_pie_max_addr;
  114. #define VM_PIE_MAX_ADDR vm_pie_max_addr
  115. #define IOSPACE_BASE VM_MAX_KERNEL_ADDRESS
  116. #define IOSPACE_LEN 0x01000000 /* 16 MB of iospace */
  117. #define VM_PHYSSEG_MAX 32 /* we only have one "hole" */
  118. #define VM_PHYSSEG_STRAT VM_PSTRAT_BSEARCH
  119. #define VM_PHYSSEG_NOADD /* can't add RAM after vm_mem_init */
  120. #if defined (_KERNEL)
  121. void dvma_mapout(vaddr_t, vaddr_t, int);
  122. #endif
  123. #endif /* _MACHINE_VMPARAM_H_ */