pmap.h (211197) | pmap.h (212715) |
---|---|
1/*- 2 * Copyright (C) 2006 Semihalf, Marian Balakowicz <m8@semihalf.com> 3 * All rights reserved. 4 * 5 * Adapted for Freescale's e500 core CPUs. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 12 unchanged lines hidden (view full) --- 21 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 23 * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 24 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 25 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * | 1/*- 2 * Copyright (C) 2006 Semihalf, Marian Balakowicz <m8@semihalf.com> 3 * All rights reserved. 4 * 5 * Adapted for Freescale's e500 core CPUs. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 12 unchanged lines hidden (view full) --- 21 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 23 * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 24 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 25 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * |
29 * $FreeBSD: head/sys/powerpc/include/pmap.h 211197 2010-08-11 23:22:53Z jhb $ | 29 * $FreeBSD: head/sys/powerpc/include/pmap.h 212715 2010-09-16 00:22:25Z nwhitehorn $ |
30 */ 31/*- 32 * Copyright (C) 1995, 1996 Wolfgang Solfrank. 33 * Copyright (C) 1995, 1996 TooLs GmbH. 34 * All rights reserved. 35 * 36 * Redistribution and use in source and binary forms, with or without 37 * modification, are permitted provided that the following conditions --- 43 unchanged lines hidden (view full) --- 81}; 82 83#if defined(AIM) 84 85#if !defined(NPMAPS) 86#define NPMAPS 32768 87#endif /* !defined(NPMAPS) */ 88 | 30 */ 31/*- 32 * Copyright (C) 1995, 1996 Wolfgang Solfrank. 33 * Copyright (C) 1995, 1996 TooLs GmbH. 34 * All rights reserved. 35 * 36 * Redistribution and use in source and binary forms, with or without 37 * modification, are permitted provided that the following conditions --- 43 unchanged lines hidden (view full) --- 81}; 82 83#if defined(AIM) 84 85#if !defined(NPMAPS) 86#define NPMAPS 32768 87#endif /* !defined(NPMAPS) */ 88 |
89struct slbcontainer; | 89struct slbtnode; |
90 | 90 |
91SPLAY_HEAD(slb_tree, slbcontainer); 92 | |
93struct pmap { 94 struct mtx pm_mtx; 95 96 #ifdef __powerpc64__ | 91struct pmap { 92 struct mtx pm_mtx; 93 94 #ifdef __powerpc64__ |
97 struct slb_tree pm_slbtree; | 95 struct slbtnode *pm_slb_tree_root; |
98 struct slb *pm_slb; 99 #else 100 register_t pm_sr[16]; 101 #endif 102 cpumask_t pm_active; 103 uint32_t pm_gen_count; /* generation count (pmap lock dropped) */ 104 u_int pm_retries; 105 --- 28 unchanged lines hidden (view full) --- 134/* 135 * Return the VSID corresponding to a given virtual address. 136 * If no VSID is currently defined, it will allocate one, and add 137 * it to a free slot if available. 138 * 139 * NB: The PMAP MUST be locked already. 140 */ 141uint64_t va_to_vsid(pmap_t pm, vm_offset_t va); | 96 struct slb *pm_slb; 97 #else 98 register_t pm_sr[16]; 99 #endif 100 cpumask_t pm_active; 101 uint32_t pm_gen_count; /* generation count (pmap lock dropped) */ 102 u_int pm_retries; 103 --- 28 unchanged lines hidden (view full) --- 132/* 133 * Return the VSID corresponding to a given virtual address. 134 * If no VSID is currently defined, it will allocate one, and add 135 * it to a free slot if available. 136 * 137 * NB: The PMAP MUST be locked already. 138 */ 139uint64_t va_to_vsid(pmap_t pm, vm_offset_t va); |
142int va_to_slb_entry(pmap_t pm, vm_offset_t va, struct slb *); | |
143 | 140 |
141/* Lock-free, non-allocating lookup routines */ 142uint64_t kernel_va_to_slbv(vm_offset_t va); 143struct slb *user_va_to_slb_entry(pmap_t pm, vm_offset_t va); 144 |
|
144uint64_t allocate_vsid(pmap_t pm, uint64_t esid, int large); | 145uint64_t allocate_vsid(pmap_t pm, uint64_t esid, int large); |
145void slb_insert(pmap_t pm, struct slb *dst, struct slb *); 146int vsid_to_esid(pmap_t pm, uint64_t vsid, uint64_t *esid); 147void free_vsids(pmap_t pm); | 146void free_vsid(pmap_t pm, uint64_t esid, int large); 147void slb_insert(pmap_t pm, struct slb *dst, struct slb *); 148 149struct slbtnode *slb_alloc_tree(void); 150void slb_free_tree(pmap_t pm); |
148struct slb *slb_alloc_user_cache(void); 149void slb_free_user_cache(struct slb *); 150 151#else 152 153struct pmap { 154 struct mtx pm_mtx; /* pmap mutex */ 155 tlbtid_t pm_tid[MAXCPU]; /* TID to identify this pmap entries in TLB */ --- 78 unchanged lines hidden --- | 151struct slb *slb_alloc_user_cache(void); 152void slb_free_user_cache(struct slb *); 153 154#else 155 156struct pmap { 157 struct mtx pm_mtx; /* pmap mutex */ 158 tlbtid_t pm_tid[MAXCPU]; /* TID to identify this pmap entries in TLB */ --- 78 unchanged lines hidden --- |