85 * . Set by default for platforms that don't support kpm large pages or
86 * where large pages cannot be used for other reasons (e.g. there are
87 * only few full associative TLB entries available for large pages).
88 *
89 * segmap_kpm -- separate on/off switch for segmap using segkpm:
90 * . Set by default.
91 * . Will be disabled when kpm_enable is zero.
92 * . Will be disabled when MAXBSIZE != PAGESIZE.
93 * . Can be disabled via /etc/system.
94 *
95 */
96 int kpm_enable = 1;
97 int kpm_smallpages = 0;
98 int segmap_kpm = 1;
99
100 /*
101 * Private seg op routines.
102 */
103 faultcode_t segkpm_fault(struct hat *hat, struct seg *seg, caddr_t addr,
104 size_t len, enum fault_type type, enum seg_rw rw);
105 static void segkpm_dump(struct seg *);
106 static void segkpm_badop(void);
107 static int segkpm_notsup(void);
108
109 #define SEGKPM_BADOP(t) (t(*)())segkpm_badop
110 #define SEGKPM_NOTSUP (int(*)())segkpm_notsup
111
112 static struct seg_ops segkpm_ops = {
113 .dup = SEGKPM_BADOP(int),
114 .unmap = SEGKPM_BADOP(int),
115 .free = SEGKPM_BADOP(void),
116 .fault = segkpm_fault,
117 .faulta = SEGKPM_BADOP(int),
118 .setprot = SEGKPM_BADOP(int),
119 .checkprot = SEGKPM_BADOP(int),
120 .kluster = SEGKPM_BADOP(int),
121 .swapout = SEGKPM_BADOP(size_t),
122 .sync = SEGKPM_BADOP(int),
123 .incore = SEGKPM_BADOP(size_t),
124 .lockop = SEGKPM_BADOP(int),
125 .getprot = SEGKPM_BADOP(int),
126 .getoffset = SEGKPM_BADOP(u_offset_t),
127 .gettype = SEGKPM_BADOP(int),
128 .getvp = SEGKPM_BADOP(int),
129 .advise = SEGKPM_BADOP(int),
130 .dump = segkpm_dump,
131 .pagelock = SEGKPM_NOTSUP,
132 .setpagesize = SEGKPM_BADOP(int),
133 .getmemid = SEGKPM_BADOP(int),
134 .getpolicy = SEGKPM_BADOP(lgrp_mem_policy_info_t *),
135 };
136
137 /*
138 * kpm_pgsz and kpm_pgshft are set by platform layer.
139 */
140 size_t kpm_pgsz; /* kpm page size */
141 uint_t kpm_pgshft; /* kpm page shift */
142 u_offset_t kpm_pgoff; /* kpm page offset mask */
143 uint_t kpmp2pshft; /* kpm page to page shift */
144 pgcnt_t kpmpnpgs; /* how many pages per kpm page */
145
146
147 #ifdef SEGKPM_SUPPORT
148
149 int
150 segkpm_create(struct seg *seg, void *argsp)
301 {
302 return ((faultcode_t)0);
303 }
304
305 /* ARGSUSED */
306 caddr_t segkpm_create_va(u_offset_t off) { return (NULL); }
307
308 /* ARGSUSED */
309 void segkpm_mapout_validkpme(struct kpme *kpme) {}
310
311 static void
312 segkpm_badop() {}
313
314 #endif /* SEGKPM_SUPPORT */
315
316 static int
317 segkpm_notsup()
318 {
319 return (ENOTSUP);
320 }
321
322 /*
323 * segkpm pages are not dumped, so we just return
324 */
325 /*ARGSUSED*/
326 static void
327 segkpm_dump(struct seg *seg)
328 {}
|
85 * . Set by default for platforms that don't support kpm large pages or
86 * where large pages cannot be used for other reasons (e.g. there are
87 * only few full associative TLB entries available for large pages).
88 *
89 * segmap_kpm -- separate on/off switch for segmap using segkpm:
90 * . Set by default.
91 * . Will be disabled when kpm_enable is zero.
92 * . Will be disabled when MAXBSIZE != PAGESIZE.
93 * . Can be disabled via /etc/system.
94 *
95 */
96 int kpm_enable = 1;
97 int kpm_smallpages = 0;
98 int segmap_kpm = 1;
99
100 /*
101 * Private seg op routines.
102 */
103 faultcode_t segkpm_fault(struct hat *hat, struct seg *seg, caddr_t addr,
104 size_t len, enum fault_type type, enum seg_rw rw);
105 static void segkpm_badop(void);
106 static int segkpm_notsup(void);
107
108 #define SEGKPM_BADOP(t) (t(*)())segkpm_badop
109 #define SEGKPM_NOTSUP (int(*)())segkpm_notsup
110
111 static struct seg_ops segkpm_ops = {
112 .dup = SEGKPM_BADOP(int),
113 .unmap = SEGKPM_BADOP(int),
114 .free = SEGKPM_BADOP(void),
115 .fault = segkpm_fault,
116 .faulta = SEGKPM_BADOP(int),
117 .setprot = SEGKPM_BADOP(int),
118 .checkprot = SEGKPM_BADOP(int),
119 .kluster = SEGKPM_BADOP(int),
120 .swapout = SEGKPM_BADOP(size_t),
121 .sync = SEGKPM_BADOP(int),
122 .incore = SEGKPM_BADOP(size_t),
123 .lockop = SEGKPM_BADOP(int),
124 .getprot = SEGKPM_BADOP(int),
125 .getoffset = SEGKPM_BADOP(u_offset_t),
126 .gettype = SEGKPM_BADOP(int),
127 .getvp = SEGKPM_BADOP(int),
128 .advise = SEGKPM_BADOP(int),
129 .pagelock = SEGKPM_NOTSUP,
130 .setpagesize = SEGKPM_BADOP(int),
131 .getmemid = SEGKPM_BADOP(int),
132 .getpolicy = SEGKPM_BADOP(lgrp_mem_policy_info_t *),
133 };
134
135 /*
136 * kpm_pgsz and kpm_pgshft are set by platform layer.
137 */
138 size_t kpm_pgsz; /* kpm page size */
139 uint_t kpm_pgshft; /* kpm page shift */
140 u_offset_t kpm_pgoff; /* kpm page offset mask */
141 uint_t kpmp2pshft; /* kpm page to page shift */
142 pgcnt_t kpmpnpgs; /* how many pages per kpm page */
143
144
145 #ifdef SEGKPM_SUPPORT
146
147 int
148 segkpm_create(struct seg *seg, void *argsp)
299 {
300 return ((faultcode_t)0);
301 }
302
303 /* ARGSUSED */
304 caddr_t segkpm_create_va(u_offset_t off) { return (NULL); }
305
306 /* ARGSUSED */
307 void segkpm_mapout_validkpme(struct kpme *kpme) {}
308
309 static void
310 segkpm_badop() {}
311
312 #endif /* SEGKPM_SUPPORT */
313
314 static int
315 segkpm_notsup()
316 {
317 return (ENOTSUP);
318 }
|