Lines Matching +full:5 +full:kd
58 _kvm_vnet_selectpid(kvm_t *kd, pid_t pid) in _kvm_vnet_selectpid() argument
79 #define NLIST_PROC0 5 in _kvm_vnet_selectpid()
94 if (!kvm_native(kd)) in _kvm_vnet_selectpid()
103 if (_kvm_nlist(kd, nl, 0) != 0) { in _kvm_vnet_selectpid()
112 /* _kvm_err(kd, kd->program, "%s: no namelist", __func__); */ in _kvm_vnet_selectpid()
121 if (kvm_read(kd, nl[NLIST_DUMPTID].n_value, &dumptid, in _kvm_vnet_selectpid()
123 _kvm_err(kd, kd->program, "%s: dumptid", __func__); in _kvm_vnet_selectpid()
143 if (kvm_read(kd, procp, &proc, sizeof(proc)) != sizeof(proc)) { in _kvm_vnet_selectpid()
144 _kvm_err(kd, kd->program, "%s: proc", __func__); in _kvm_vnet_selectpid()
151 if (kvm_read(kd, tdp, &td, sizeof(td)) != in _kvm_vnet_selectpid()
153 _kvm_err(kd, kd->program, "%s: thread", in _kvm_vnet_selectpid()
172 _kvm_err(kd, kd->program, "%s: pid/tid not found", __func__); in _kvm_vnet_selectpid()
175 if (kvm_read(kd, (uintptr_t)credp, &cred, sizeof(cred)) != in _kvm_vnet_selectpid()
177 _kvm_err(kd, kd->program, "%s: cred", __func__); in _kvm_vnet_selectpid()
181 _kvm_err(kd, kd->program, "%s: no jail", __func__); in _kvm_vnet_selectpid()
184 if (kvm_read(kd, (uintptr_t)cred.cr_prison, &prison, sizeof(prison)) != in _kvm_vnet_selectpid()
186 _kvm_err(kd, kd->program, "%s: prison", __func__); in _kvm_vnet_selectpid()
190 _kvm_err(kd, kd->program, "%s: no vnet", __func__); in _kvm_vnet_selectpid()
193 if (kvm_read(kd, (uintptr_t)prison.pr_vnet, &vnet, sizeof(vnet)) != in _kvm_vnet_selectpid()
195 _kvm_err(kd, kd->program, "%s: vnet", __func__); in _kvm_vnet_selectpid()
199 _kvm_err(kd, kd->program, "%s: invalid vnet magic#", __func__); in _kvm_vnet_selectpid()
202 kd->vnet_initialized = 1; in _kvm_vnet_selectpid()
203 kd->vnet_start = nl[NLIST_START_VNET].n_value; in _kvm_vnet_selectpid()
204 kd->vnet_stop = nl[NLIST_STOP_VNET].n_value; in _kvm_vnet_selectpid()
205 kd->vnet_current = (uintptr_t)prison.pr_vnet; in _kvm_vnet_selectpid()
206 kd->vnet_base = vnet.vnet_data_base; in _kvm_vnet_selectpid()
215 _kvm_vnet_initialized(kvm_t *kd, int intialize) in _kvm_vnet_initialized() argument
218 if (kd->vnet_initialized || !intialize) in _kvm_vnet_initialized()
219 return (kd->vnet_initialized); in _kvm_vnet_initialized()
221 (void) _kvm_vnet_selectpid(kd, getpid()); in _kvm_vnet_initialized()
223 return (kd->vnet_initialized); in _kvm_vnet_initialized()
231 _kvm_vnet_validaddr(kvm_t *kd, kvaddr_t value) in _kvm_vnet_validaddr() argument
237 if (!kd->vnet_initialized) in _kvm_vnet_validaddr()
240 if (value < kd->vnet_start || value >= kd->vnet_stop) in _kvm_vnet_validaddr()
243 return (kd->vnet_base + value); in _kvm_vnet_validaddr()