Deleted Added
full compact
tte.h (97027) tte.h (97446)
1/*-
2 * Copyright (c) 1997 Berkeley Software Design, Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.

--- 12 unchanged lines hidden (view full) ---

21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 *
28 * from: BSDI: pmap.v9.h,v 1.10.2.6 1999/08/23 22:18:44 cp Exp
1/*-
2 * Copyright (c) 1997 Berkeley Software Design, Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.

--- 12 unchanged lines hidden (view full) ---

21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 *
28 * from: BSDI: pmap.v9.h,v 1.10.2.6 1999/08/23 22:18:44 cp Exp
29 * $FreeBSD: head/sys/sparc64/include/tte.h 97027 2002-05-21 00:29:02Z jake $
29 * $FreeBSD: head/sys/sparc64/include/tte.h 97446 2002-05-29 05:56:05Z jake $
30 */
31
32#ifndef _MACHINE_TTE_H_
33#define _MACHINE_TTE_H_
34
30 */
31
32#ifndef _MACHINE_TTE_H_
33#define _MACHINE_TTE_H_
34
35#define TTE_SHIFT (4)
35#define TTE_SHIFT (5)
36
37#define TD_SIZE_SHIFT (61)
38#define TD_SOFT2_SHIFT (50)
39#define TD_DIAG_SHIFT (41)
40#define TD_PA_SHIFT (13)
41#define TD_SOFT_SHIFT (7)
42
43#define TD_SIZE_BITS (2)

--- 49 unchanged lines hidden (view full) ---

93 (TTE_GET_PAGE_SIZE(tp) - 1)
94
95#define TTE_GET_PA(tp) \
96 ((tp)->tte_data & (TD_PA_MASK << TD_PA_SHIFT))
97#define TTE_GET_TLB(tp) \
98 (((tp)->tte_data & TD_EXEC) ? (TLB_DTLB | TLB_ITLB) : TLB_DTLB)
99#define TTE_GET_VA(tp) \
100 ((tp)->tte_vpn << PAGE_SHIFT)
36
37#define TD_SIZE_SHIFT (61)
38#define TD_SOFT2_SHIFT (50)
39#define TD_DIAG_SHIFT (41)
40#define TD_PA_SHIFT (13)
41#define TD_SOFT_SHIFT (7)
42
43#define TD_SIZE_BITS (2)

--- 49 unchanged lines hidden (view full) ---

93 (TTE_GET_PAGE_SIZE(tp) - 1)
94
95#define TTE_GET_PA(tp) \
96 ((tp)->tte_data & (TD_PA_MASK << TD_PA_SHIFT))
97#define TTE_GET_TLB(tp) \
98 (((tp)->tte_data & TD_EXEC) ? (TLB_DTLB | TLB_ITLB) : TLB_DTLB)
99#define TTE_GET_VA(tp) \
100 ((tp)->tte_vpn << PAGE_SHIFT)
101#define TTE_GET_PMAP(tp) \
102 ((tp)->tte_pmap)
103#define TTE_ZERO(tp) \
104 bzero(tp, sizeof(*tp))
101
102struct tte {
103 u_long tte_vpn;
104 u_long tte_data;
105
106struct tte {
107 u_long tte_vpn;
108 u_long tte_data;
109 STAILQ_ENTRY(tte) tte_link;
110 struct pmap *tte_pmap;
105};
106
107static __inline int
108tte_match_vpn(struct tte *tp, vm_offset_t vpn)
109{
110 return ((tp->tte_data & TD_V) != 0 && tp->tte_vpn == vpn);
111}
112
113static __inline int
114tte_match(struct tte *tp, vm_offset_t va)
115{
116 return (tte_match_vpn(tp, va >> PAGE_SHIFT));
117}
118
119#endif /* !_MACHINE_TTE_H_ */
111};
112
113static __inline int
114tte_match_vpn(struct tte *tp, vm_offset_t vpn)
115{
116 return ((tp->tte_data & TD_V) != 0 && tp->tte_vpn == vpn);
117}
118
119static __inline int
120tte_match(struct tte *tp, vm_offset_t va)
121{
122 return (tte_match_vpn(tp, va >> PAGE_SHIFT));
123}
124
125#endif /* !_MACHINE_TTE_H_ */