84 static int segmap_gettype(struct seg *seg, caddr_t addr);
85 static int segmap_getvp(struct seg *seg, caddr_t addr, struct vnode **vpp);
86 static void segmap_dump(struct seg *seg);
87 static int segmap_pagelock(struct seg *seg, caddr_t addr, size_t len,
88 struct page ***ppp, enum lock_type type,
89 enum seg_rw rw);
90 static void segmap_badop(void);
91 static int segmap_getmemid(struct seg *seg, caddr_t addr, memid_t *memidp);
92 static lgrp_mem_policy_info_t *segmap_getpolicy(struct seg *seg,
93 caddr_t addr);
94 static int segmap_capable(struct seg *seg, segcapability_t capability);
95
96 /* segkpm support */
97 static caddr_t segmap_pagecreate_kpm(struct seg *, vnode_t *, u_offset_t,
98 struct smap *, enum seg_rw);
99 struct smap *get_smap_kpm(caddr_t, page_t **);
100
101 #define SEGMAP_BADOP(t) (t(*)())segmap_badop
102
103 static struct seg_ops segmap_ops = {
104 SEGMAP_BADOP(int), /* dup */
105 SEGMAP_BADOP(int), /* unmap */
106 segmap_free,
107 segmap_fault,
108 segmap_faulta,
109 SEGMAP_BADOP(int), /* setprot */
110 segmap_checkprot,
111 segmap_kluster,
112 SEGMAP_BADOP(int), /* sync */
113 SEGMAP_BADOP(size_t), /* incore */
114 SEGMAP_BADOP(int), /* lockop */
115 segmap_getprot,
116 segmap_getoffset,
117 segmap_gettype,
118 segmap_getvp,
119 SEGMAP_BADOP(int), /* advise */
120 segmap_dump,
121 segmap_pagelock, /* pagelock */
122 SEGMAP_BADOP(int), /* setpgsz */
123 segmap_getmemid, /* getmemid */
124 segmap_getpolicy, /* getpolicy */
125 segmap_capable, /* capable */
126 seg_inherit_notsup /* inherit */
127 };
128
129 /*
130 * Private segmap routines.
131 */
132 static void segmap_unlock(struct hat *hat, struct seg *seg, caddr_t addr,
133 size_t len, enum seg_rw rw, struct smap *smp);
134 static void segmap_smapadd(struct smap *smp);
135 static struct smap *segmap_hashin(struct smap *smp, struct vnode *vp,
136 u_offset_t off, int hashid);
137 static void segmap_hashout(struct smap *smp);
138
139
140 /*
141 * Statistics for segmap operations.
142 *
143 * No explicit locking to protect these stats.
144 */
145 struct segmapcnt segmapcnt = {
146 { "fault", KSTAT_DATA_ULONG },
|
84 static int segmap_gettype(struct seg *seg, caddr_t addr);
85 static int segmap_getvp(struct seg *seg, caddr_t addr, struct vnode **vpp);
86 static void segmap_dump(struct seg *seg);
87 static int segmap_pagelock(struct seg *seg, caddr_t addr, size_t len,
88 struct page ***ppp, enum lock_type type,
89 enum seg_rw rw);
90 static void segmap_badop(void);
91 static int segmap_getmemid(struct seg *seg, caddr_t addr, memid_t *memidp);
92 static lgrp_mem_policy_info_t *segmap_getpolicy(struct seg *seg,
93 caddr_t addr);
94 static int segmap_capable(struct seg *seg, segcapability_t capability);
95
96 /* segkpm support */
97 static caddr_t segmap_pagecreate_kpm(struct seg *, vnode_t *, u_offset_t,
98 struct smap *, enum seg_rw);
99 struct smap *get_smap_kpm(caddr_t, page_t **);
100
101 #define SEGMAP_BADOP(t) (t(*)())segmap_badop
102
103 static struct seg_ops segmap_ops = {
104 .dup = SEGMAP_BADOP(int),
105 .unmap = SEGMAP_BADOP(int),
106 .free = segmap_free,
107 .fault = segmap_fault,
108 .faulta = segmap_faulta,
109 .setprot = SEGMAP_BADOP(int),
110 .checkprot = segmap_checkprot,
111 .kluster = segmap_kluster,
112 .sync = SEGMAP_BADOP(int),
113 .incore = SEGMAP_BADOP(size_t),
114 .lockop = SEGMAP_BADOP(int),
115 .getprot = segmap_getprot,
116 .getoffset = segmap_getoffset,
117 .gettype = segmap_gettype,
118 .getvp = segmap_getvp,
119 .advise = SEGMAP_BADOP(int),
120 .dump = segmap_dump,
121 .pagelock = segmap_pagelock,
122 .setpagesize = SEGMAP_BADOP(int),
123 .getmemid = segmap_getmemid,
124 .getpolicy = segmap_getpolicy,
125 .capable = segmap_capable,
126 .inherit = seg_inherit_notsup,
127 };
128
129 /*
130 * Private segmap routines.
131 */
132 static void segmap_unlock(struct hat *hat, struct seg *seg, caddr_t addr,
133 size_t len, enum seg_rw rw, struct smap *smp);
134 static void segmap_smapadd(struct smap *smp);
135 static struct smap *segmap_hashin(struct smap *smp, struct vnode *vp,
136 u_offset_t off, int hashid);
137 static void segmap_hashout(struct smap *smp);
138
139
140 /*
141 * Statistics for segmap operations.
142 *
143 * No explicit locking to protect these stats.
144 */
145 struct segmapcnt segmapcnt = {
146 { "fault", KSTAT_DATA_ULONG },
|