home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1999 March B / SCO_CASTOR4RRT.iso / update701 / root.17 / usr / include / sys / vmparam.h / vmparam.h
Encoding:
C/C++ Source or Header  |  1998-08-18  |  16.4 KB  |  547 lines

  1. /*
  2.  * Copyright (c) 1998 The Santa Cruz Operation, Inc.. All Rights Reserved. 
  3.  *                                                                         
  4.  *        THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF THE               
  5.  *                   SANTA CRUZ OPERATION INC.                             
  6.  *                                                                         
  7.  *   The copyright notice above does not evidence any actual or intended   
  8.  *   publication of such source code.                                      
  9.  */
  10.  
  11. #ifndef _MEM_VMPARAM_H    /* wrapper symbol for kernel use */
  12. #define _MEM_VMPARAM_H    /* subject to change without notice */
  13.  
  14. #ident    "@(#)kern-i386:mem/vmparam.h    1.60.11.1"
  15. #ident    "$Header: $"
  16.  
  17. #if defined(__cplusplus)
  18. extern "C" {
  19. #endif
  20.  
  21. /*
  22.  *    Copyright (c) 1982, 1986, 1988
  23.  *    The Regents of the University of California
  24.  *    All Rights Reserved.
  25.  *    Portions of this document are derived from
  26.  *    software developed by the University of
  27.  *    California, Berkeley, and its contributors.
  28.  */
  29.  
  30. /*
  31.  * +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  32.  *         PROPRIETARY NOTICE (Combined)
  33.  * 
  34.  * This source code is unpublished proprietary information
  35.  * constituting, or derived under license from AT&T's UNIX(r) System V.
  36.  * In addition, portions of such source code were derived from Berkeley
  37.  * 4.3 BSD under license from the Regents of the University of
  38.  * California.
  39.  * 
  40.  * 
  41.  * 
  42.  *         Copyright Notice 
  43.  * 
  44.  * Notice of copyright on this source code product does not indicate 
  45.  * publication.
  46.  * 
  47.  *     (c) 1986,1987,1988,1989  Sun Microsystems, Inc
  48.  *     (c) 1983,1984,1985,1986,1987,1988,1989  AT&T.
  49.  *               All rights reserved.
  50.  *  
  51.  */
  52.  
  53. #ifdef _KERNEL_HEADERS
  54. #include <proc/user.h>        /* PORTABILITY */
  55. #include <svc/cpu.h>        /* PORTABILITY */
  56. #include <util/types.h>        /* REQUIRED */
  57. #include <util/ksynch.h>    /* REQUIRED */
  58. #include <util/param.h>        /* PORTABILITY */
  59.  
  60. #elif defined(_KERNEL) || defined(_KMEMUSER)
  61.  
  62. #include <sys/user.h>        /* PORTABILITY */
  63. #include <sys/types.h>        /* REQUIRED */
  64. #include <sys/param.h>        /* PORTABILITY */
  65.  
  66. /*
  67.  * cpu.h not installed in usr/include, but is only needed by VM itself,
  68.  * which is always the _KERNEL_HEADERS case.
  69.  */
  70.  
  71. #ifdef    _KERNEL
  72.  
  73. #include <sys/ksynch.h>        /* REQUIRED */
  74.  
  75. #endif
  76.  
  77. #endif /* _KERNEL_HEADERS */
  78.  
  79. /*
  80.  * This file contains architecture family specific VM definitions.
  81.  * Platform specific VM definitions are contained in <mem/vm_mdep.h>.
  82.  */
  83.  
  84. #if defined(_KERNEL) || defined(_KMEMUSER)
  85.  
  86. /*
  87.  * Lower bound of end of user virtual address range as guaranteed
  88.  * by the ABI
  89.  */
  90. #define MINUVEND ((vaddr_t)0xC0000000L)
  91.  
  92. #ifdef    _KERNEL
  93.  
  94. /*
  95.  * Division of virtual addresses between user and kernel.
  96.  */
  97.  
  98. #define UVBASE     ((vaddr_t)0x00000000L)    /* base user virtual address */
  99. extern const vaddr_t uvend;        /* end of user virtual address range */
  100. extern const vaddr_t kvbase;        /* base of kernel virtual range */
  101. extern char _end[];
  102. #define KVEND     ((vaddr_t)0x00000000L) /* end of kernel virtual range */
  103.  
  104. /*
  105.  * Determine whether vaddr is a kernel virtual address.
  106.  */
  107. #define KADDR(vaddr)        ((vaddr_t)(vaddr) >= kvbase)
  108. /*
  109.  * Macro to execute a statement for each cg. The statement
  110.  * should be formulated in terms of ptep. This macro is
  111.  * useful for manipulating replicated kernel page tables.
  112.  */
  113. #endif    /* _KERNEL */
  114.  
  115. #ifdef CCNUMA
  116.  
  117. #define FOR_EACH_CG_PTE(addr) {                    \
  118.     cgnum_t cgnum;                        \
  119.     pte64_t *cg_ptep;                    \
  120.                                 \
  121.     ASSERT(!hat_static_callocup);                \
  122.     ASSERT(!KADDR_PER_ENG(addr));                \
  123.                                 \
  124.     for (cgnum = 0; cgnum < Ncg; cgnum++) {            \
  125.         cg_ptep = kvtol2ptep64_g(addr, cgnum);    \
  126.  
  127. #define END_FOR_EACH_CG_PTE    \
  128.     }            \
  129. }
  130.  
  131. #endif /* CCNUMA */
  132.  
  133. /*
  134.  * Functions which return a physical page ID return NOPAGE if
  135.  * there is no valid physical page ID.
  136.  * This is required for the DDI.
  137.  */
  138.  
  139. #define NOPAGE        ((ppid_t)-1)
  140.  
  141. /*
  142.  * This is to maintain backward compatibility for DDI function hat_getppfnum.
  143.  * PSPACE_MAINSTORE is the code for the physical address space which
  144.  * includes, at least, "mainstore" system memory, which is the memory that
  145.  * programs (and the kernel) execute out of.  See hat_getppfnum(D3K).
  146.  */
  147.  
  148. #define PSPACE_MAINSTORE    0
  149.  
  150. #define    SYSDAT_PAGES    1    /* for now */
  151.  
  152. /*
  153.  * Fixed kernel virtual addresses.
  154.  *
  155.  * These addresses are all mapped by a level 2 page table which is
  156.  * replicated for each engine to allow some of these mappings to
  157.  * be different on a per-engine basis.  The rest of these mappings
  158.  * are statically defined for the life of the system at boot.
  159.  *
  160.  * Each of these addresses must begin on a page boundary.
  161.  *
  162.  * WARNING: Since USER_DS must include UVUVWIN, any pages below this
  163.  * address will be visible to the user if they have user page permissions.
  164.  */
  165.  
  166. #define KVPER_ENG_END    ((vaddr_t)0xFFFFF000)
  167.     /* high end of per-engine range (inclusive) */
  168.  
  169. #define KVTMPPG3    KVPER_ENG_END
  170. #define KVTMPPG2    (KVTMPPG3 - MMU_PAGESIZE)
  171.     /* per-engine temporary page slot for pagezero(), ppcopy() */
  172.  
  173. #define KVTMPPG1    (KVTMPPG2 - MMU_PAGESIZE)
  174.     /* per-engine temporary page slot for pagezero(), ppcopy();
  175.      * KVTMPPG1 and KVTMPPG2 must be contiguous, with KVTMPPG1 first */
  176.  
  177. #define KVTMPPT2    (KVTMPPG1 - MMU_PAGESIZE)
  178.     /* per-engine temporary page slot for page table mappings */
  179.  
  180. #define KVTMPPT1    (KVTMPPT2 - MMU_PAGESIZE)
  181.     /* per-engine temporary page slot for page table mappings */
  182.  
  183. #define KVPHYSMAP1    (KVTMPPT1 - MMU_PAGESIZE)
  184.     /* per-engine temporary page slot for physmap1() */
  185.  
  186. #define KVMET        (KVPHYSMAP1 - (MET_PAGES * PAGESIZE))
  187.     /* global kernel metrics */
  188.  
  189. #define KVPLOCALMET    (KVMET - (PLMET_PAGES * PAGESIZE))
  190.     /* per-engine struct plocalmet; also mapped at e_local->pp_localmet  */
  191.  
  192. #define KVSYSDAT    (KVPLOCALMET - (SYSDAT_PAGES * PAGESIZE))
  193.     /* system read-only data: eg; hrt timer */
  194.  
  195. #define KVPLOCAL    (KVSYSDAT - (PL_PAGES * MMU_PAGESIZE))
  196.     /* per-engine struct plocal; also mapped at e_local->pp_local;
  197.      * must be beyond USER_DS */
  198.  
  199. #define KVCGLOCAL       (KVPLOCAL - (CGL_PAGES * MMU_PAGESIZE))
  200.         /* per-CG struct cglocal */
  201. #define KVENG_L2PT      (KVCGLOCAL - MMU_PAGESIZE)
  202.     /* per-engine level 2 page table; also mapped at e_local->pp_pmap */
  203.  
  204. #define    PDPTSHFT    2
  205. #define    PDPTSZ        (1 << PDPTSHFT)
  206. #define KVENG_L1PT    (KVENG_L2PT - PDPTSZ * MMU_PAGESIZE)
  207.     /* per-engine level 1 page table; also mapped at e_local->pp_kl1pt */
  208.  
  209. #define FPEMUL_PAGES    16    /* max # pages for FPU emulator */
  210.  
  211. #define KVFPEMUL    (KVENG_L1PT - (FPEMUL_PAGES * MMU_PAGESIZE))
  212.     /* FPU emulator code/data; must be beyond USER_DS */
  213.  
  214. #define KVUENG        (KVFPEMUL - (USIZE * PAGESIZE))
  215.     /* per-engine idle ublock; also mapped at e_local->pp_ublock;
  216.      * must be beyond USER_DS */
  217.  
  218. #define KVUENG_EXT    (KVUENG - (KSE_PAGES * MMU_PAGESIZE))
  219.     /* stack extension page for per-engine ublock */
  220.  
  221. #define KVUENG_REDZONE    (KVUENG_EXT - MMU_PAGESIZE)
  222.     /* red zone (unmapped) to catch per-engine kernel stack overflow */
  223.  
  224. #define KVUVWIN        (KVUENG_REDZONE - MMU_PAGESIZE)
  225.     /* kernel-writeable mapping to UVUVWIN page
  226.      * also mapped at e_local->pp_uvwin */
  227.  
  228. #define UVUVWIN        (KVUVWIN - MMU_PAGESIZE)
  229.     /* per-engine page to contain user-visible read-only data;
  230.      * included in USER_DS so user progs can access directly */
  231.  
  232. #define KVENG_PAGES    (UVUVWIN - SZPPRIV_PAGES_PAE * MMU_PAGESIZE)
  233.     /* all of per-engine pages of a SBSP mapped at this address for
  234.      * later use in scg_sysinit */
  235.  
  236. #define KVLAST_ARCH    KVENG_PAGES
  237.     /* KVLAST_ARCH is the last fixed kernel virtual address (working 
  238.      * down from high memory) allocated by architecture-specific but
  239.      * platform-independent code.  This symbol can be used by
  240.      * platform-specific code to begin allocating additional
  241.      * fixed kernel virtual addresses.
  242.      */
  243.  
  244.     /* start of 4 Meg per-engine static area */
  245. #define KVPER_ENG_STATIC    ((vaddr_t)0xFFC00000)
  246.  
  247.     /* start of 2 Meg per-engine static area */
  248. #define KVPER_ENG_STATIC_PAE    (KVPER_ENG_STATIC + pae_ptbltob(1))
  249.  
  250. extern vaddr_t    kvper_eng;
  251. #define    KVPER_ENG        kvper_eng
  252.  
  253. /*
  254.  * Space for per-CG KL2PTEs in the CCNUMA kernel.
  255.  */
  256. extern vaddr_t            kl2ptes;
  257. #define KL2PTES            kl2ptes
  258.  
  259. /*
  260.  * The following defines indicate the limits of allocatable kernel virtual.
  261.  * That is, the range [KVAVBASE,KVAVEND) is available for general use.
  262.  */
  263. #define KVAVBASE    kvbase
  264. #define KVAVEND        KL2PTES
  265.  
  266. /*
  267.  * Other misc virtual addresses.
  268.  */
  269.  
  270. #define UVSTACK     ((vaddr_t)0x80000000L)    /* default user stack location */
  271. #define UVMAX_STKSIZE    0x1000000
  272.  
  273. /*
  274.  * Determine whether kernel address vaddr is in the per-engine range.
  275.  */
  276.  
  277. #define KADDR_PER_ENG(vaddr)    ((vaddr_t)(vaddr) >= KVPER_ENG)
  278.  
  279.  
  280. /*
  281.  * Determine whether [addr, addr+len) are valid user address.
  282.  */
  283.  
  284. #define VALID_USR_RANGE(addr, len) \
  285.     ((vaddr_t)(addr) + (len) > (vaddr_t)(addr) && \
  286.      (vaddr_t)(addr) >= UVBASE && (vaddr_t)(addr) + (len) <= uvend)
  287.  
  288. /*
  289.  * Given an address, addr, which is in or just past a valid user range,
  290.  * return the (first invalid) address just past that user range.
  291.  */
  292. #define VALID_USR_END(addr)    uvend
  293.  
  294. #ifdef _KERNEL
  295.  
  296. /*
  297.  * WRITEABLE_USR_RANGE() checks that an address range is within the
  298.  * valid user address range, and that it is user-writeable.
  299.  * On machines where read/write page permissions are enforced on kernel
  300.  * accesses as well as user accesses, this can be simply defined as
  301.  * VALID_USR_RANGE(addr, len), since the appropriate checks will be done
  302.  * at the time of the actual writes.  Otherwise, this must also call a
  303.  * routine to simulate a user write fault on the address range.
  304.  */
  305.  
  306. #define WRITEABLE_USR_RANGE(addr, len) \
  307.         VALID_USR_RANGE(addr, len)
  308.  
  309. /*
  310.  * END_USER_WRITE() is called after writing to user address space
  311.  * to perform any necessary clean-up from the previous WRITEABLE_USR_RANGE().
  312.  */
  313.  
  314. #define END_USER_WRITE(addr, len)
  315.  
  316. /*
  317.  * Function prototypes for entry points visible to FSKI-conformant fstypes.
  318.  */
  319.  
  320. #ifdef _FSKI
  321. extern void map_addr(vaddr_t *, uint_t, off_t, int);
  322. #else
  323. extern void map_addr(vaddr_t *, uint_t, off64_t, int);
  324. #endif
  325.  
  326. #endif /* _KERNEL */
  327.  
  328. /*
  329.  * KVPTE:
  330.  *
  331.  * The level 2 ptes are now accessed by reserving a fixed kernel virtual
  332.  * that references back to the L1. In an out of context access temporary
  333.  * mappings are setup to access the L2 ptes. This allows us to save the
  334.  * precious kernel virtual needed for large memory systems.
  335.  *
  336.  * (See the plocal structure for pointers into KVPTEs).
  337.  *
  338.  * For the ccNUMA kernel:
  339.  *
  340.  * KL2PTES is a two dimensional array of all the CG-local kernel level 2 ptes
  341.  * (the PTEs for the [KVAVBASE,KVAVEND) range of kernel virtual addresses). It
  342.  * provides kernel virtual addresses for these PTEs so that they can be
  343.  * read/written easily by the kernel when it is retrieving/changing page
  344.  * mappings.
  345.  * 
  346.  * Each CG maps it own level2 page tables into KL2PTES by establishing
  347.  * a second back pointer to the L1. Each CG maps the other CGs into
  348.  * KL2PTES by actually allocating level 2 page tables. This allocation
  349.  * of memory is required by the assymetric physical model.
  350.  *
  351.  * For simplicity, we just use the first available virtual address for
  352.  * both KVPTE. KL2PTES immediately follows this.
  353.  */
  354.  
  355. /* num. (virtual) bytes in KL2PTES */
  356. #define KL2PTES_SIZE(num_cg)    (PTESPERCG * sizeof(pte64_t) * (num_cg))
  357.  
  358. /* Index into KL2PTES[] for a kernel virtual address */
  359.  
  360. #define kl2ptesndx(va)    pae_ptnum((vaddr_t)(va) - KVAVBASE)
  361.  
  362. #define    PDPTNDXSHFT    30
  363. #define    PDPTNDX(addr)    0
  364. #define    PDPTNDX64(addr)        ((vaddr_t)(addr) >> PDPTNDXSHFT)
  365.  
  366.  
  367. /*
  368.  * pte_t *
  369.  * kvtol1ptep(vaddr_t addr)
  370.  *    Return pointer to level 1 pte for the given kernel virtual address.
  371.  *
  372.  * Calling/Exit State:
  373.  *    None.
  374.  */
  375. #define    vtol1ptep(addr) \
  376.     (kvtol2ptep((l.kvpte[PDPTNDX((addr))]) + (ptnum((addr)) << PNUMSHFT)))
  377. #define kvtol1ptep    vtol1ptep
  378.  
  379. #define    vtol1ptep64(addr) \
  380.     (kvtol2ptep64((l.kvpte64[PDPTNDX64((addr))]) + (pae_ptnum((addr)) << PNUMSHFT)))
  381. #define kvtol1ptep64    vtol1ptep64
  382.  
  383. /*
  384.  * vaddr_t
  385.  * vtoptkv(vaddr_t addr)
  386.  *    Convert virtual address to corressponding page table kernel virtual. 
  387.  *
  388.  * Calling/Exit State:
  389.  *    This is only called from the hat layer to optimize usage of
  390.  *    the kernel virtual (per-address space page tables).
  391.  */
  392. #define    vtoptkv(addr)    ((l.kvpte[PDPTNDX((addr))]) + (ptnum((addr)) << PNUMSHFT))
  393. #define    vtoptkv64(addr)    ((l.kvpte64[PDPTNDX64((addr))]) + (pae_ptnum((addr)) << PNUMSHFT))
  394.  
  395.  
  396. /*
  397.  * pte_t *
  398.  * kvtol2ptep(vaddr_t addr)
  399.  *    Return pointer to level 2 pte for the given kernel virtual address.
  400.  *
  401.  * Description:
  402.  *    If addr is in the range mapped by the per-engine level 2 page table,
  403.  *    KVENG_L2PT, return a pointer into it.  Otherwise, return a pointer
  404.  *    to level 2 page table on this CG into the global set of level 2 pages.
  405.  */
  406. /* We need not determine if the address is in a per-engine range */
  407. #define    vtol2ptep(addr) \
  408.     (&((pte_t *)l.kvpte[PDPTNDX((addr))])[pfnum((vaddr_t)(addr))])
  409. #define kvtol2ptep(addr)    vtol2ptep(addr)
  410.  
  411. #define    vtol2ptep64(addr) \
  412.     (&((pte64_t *)l.kvpte64[PDPTNDX64((addr))])[pae_pfndx((vaddr_t)(addr))])
  413. #define kvtol2ptep64    vtol2ptep64
  414.  
  415. /*
  416.  * one page of PTEs per CG in the KL2PTES
  417.  *
  418.  * XXX: This formula is derived from the pkl2ptes based code in mmu.c
  419.  *    (which requires each CGs KL2PTES to begin with a new page table),
  420.  *    not from the actual requirement to cover [KVAVBASE, KVAVEND).
  421.  */
  422. #define    PTESPERCG    (pae_ptbltob(1) / sizeof(pte64_t))
  423.  
  424. #define kvtol2ptep64_g(addr, cgnum) \
  425.         (ASSERT(KADDR(addr)), \
  426.          ASSERT(!KADDR_PER_ENG(addr)), \
  427.          &((pte64_t *)KL2PTES)[pae_pfnum((vaddr_t)(addr) - \
  428.             KVAVBASE) + cgnum * PTESPERCG])
  429. #define    kvtol2ptepCG    kvtol2ptep64_g
  430.  
  431. /*
  432.  * vaddr_t
  433.  * pteptokv(ptep)
  434.  *    It is used for kernel visible mapping for lazy shootdown
  435.  *    evaluation.
  436.  *
  437.  * Calling/Exit State:
  438.  *    None.
  439.  */
  440. #define    pteptokv(ptep) \
  441.       (((ulong_t)((ptep) - (pte_t *)l.kvpte[PDPTNDX((vaddr_t)(ptep))]) << MMU_PAGESHIFT))
  442.  
  443. #define    pteptokv64(ptep) \
  444.       (((ulong_t)((ptep) - (pte64_t *)l.kvpte64[PDPTNDX64((vaddr_t)(ptep))]) << MMU_PAGESHIFT))
  445.  
  446. #define kvtol2pteptep64_g(addr, cgnum) \
  447.         kvtol2ptep64(kvtol2ptep64_g(addr, cgnum))
  448. #define    kvtol2pteptepCG    kvtol2ptepte64_g
  449.  
  450. #define kvtol2pteptep64(addr) kvtol2pteptep64_g(addr, mycg)
  451. #define    kvtol2pteptep    kvtol2pteptep64
  452.  
  453.  
  454. /*
  455.  * paddr_t
  456.  * kvtophys(vaddr_t addr)
  457.  *    Return the physical address equivalent of given kernel
  458.  *    virtual address.
  459.  *
  460.  * Calling/Exit State:
  461.  *    The caller must ensure that the given kernel virtual address
  462.  *    is currently mapped.
  463.  */
  464.  
  465. #define _KVTOPHYS(addr) \
  466.         (ASSERT(PG_ISVALID(kvtol1ptep(addr))), \
  467.         (kvtol1ptep(addr)->pgm.pg_ps ? \
  468.         (paddr_t) ((kvtol1ptep(addr)->pg_pte & PAGE4MASK) + \
  469.             ((vaddr_t)(addr) & PAGE4OFFSET)) : \
  470.          (ASSERT(PG_ISVALID(kvtol2ptep(addr))), \
  471.         (paddr_t) ((kvtol2ptep(addr)->pg_pte & MMU_PAGEMASK) + \
  472.                ((vaddr_t)(addr) & MMU_PAGEOFFSET)))))
  473. #define kvtophys(addr)        _KVTOPHYS(addr)
  474.  
  475. #define _KVTOPHYS64(addr) \
  476.         (ASSERT(PG_ISVALID(kvtol1ptep64(addr))), \
  477.         (kvtol1ptep64(addr)->pgm.pg_ps ? \
  478.         (paddr_t) ((kvtol1ptep64(addr)->pg_pte & PAGE4MASK) + \
  479.             ((vaddr_t)(addr) & PAGE4OFFSET)) : \
  480.          (ASSERT(PG_ISVALID(kvtol2ptep64(addr))), \
  481.         (paddr_t) (((kvtol2ptep64(addr))->pg_pte & MMU_PAGEMASK) + \
  482.                ((vaddr_t)(addr) & MMU_PAGEOFFSET)))))
  483. #define kvtophys64(addr)    _KVTOPHYS64(addr)
  484.  
  485. /*
  486.  * struct page *
  487.  * kvtopp(vaddr_t addr)
  488.  *    Return the page struct for the physical page corresponding to
  489.  *    a given kernel virtual address.
  490.  *
  491.  * Calling/Exit State:
  492.  *    The caller must ensure that the given kernel virtual address
  493.  *    is currently mapped to a page with a page struct.
  494.  */
  495.  
  496. #define kvtopp32(addr)     (ASSERT(!PG_ISPSE(kvtol1ptep(addr))), \
  497.                 pteptopp(kvtol2ptep(addr)))
  498.  
  499. #define kvtopp64(addr)     (ASSERT(!PG_ISPSE(kvtol1ptep64(addr))), \
  500.                 pteptopp(kvtol2ptep64(addr)))
  501.  
  502. #define kvtopp(addr)     ((PAE_ENABLED() ? kvtopp64((addr)) : kvtopp32((addr))))
  503.  
  504.  
  505. /*
  506.  * vaddr_t
  507.  * STK_LOWADDR(proc_t *p)
  508.  *    Return the lowest address which is part of the autogrow stack.
  509.  *
  510.  * Calling/Exit State:
  511.  *    Caller must insure that p is stabilized and cannot be deallocated
  512.  *    out from underneath us. This is usually guaranteed by the fact that
  513.  *    this p is that of the caller. Of the fields referenced, p_stkbase
  514.  *    never changes and p_stksize is stabilized by the AS lock for p->p_as,
  515.  *    which the caller must hold.
  516.  */
  517.  
  518. #define STK_LOWADDR(p)    ((p)->p_stkbase - (p)->p_stksize)
  519.  
  520. /*
  521.  * vaddr_t
  522.  * STK_HIGHADDR(proc_t *p)
  523.  *    Return the highest address which is part of the autogrow stack.
  524.  *
  525.  * Calling/Exit State:
  526.  *    Caller must insure that p is stabilized and cannot be deallocated
  527.  *    out from underneath us. This is usually guaranteed by the fact that
  528.  *    this p is that of the caller. Although this implemenation doesn't
  529.  *    require it, the caller must hold the AS lock for p->p_as, since
  530.  *    for some implementations this may be the grow end of the stack.
  531.  */
  532.  
  533. #define STK_HIGHADDR(p)    ((p)->p_stkbase)
  534.  
  535. #define HI_TO_LOW    0
  536. #define LO_TO_HI    1
  537.  
  538. #define STK_GROWTH_DIR    HI_TO_LOW
  539.  
  540. #endif /* _KERNEL || _KMEMUSER */
  541.  
  542. #if defined(__cplusplus)
  543.     }
  544. #endif
  545.  
  546. #endif /* _MEM_VMPARAM_H */
  547.