kvm_pcpu.c (19b5cffe0b8aea1b378d354091d000a5b4f23d9f) kvm_pcpu.c (9292aad4c9f2a604199cc6829f9fd48d1f692e6f)
1/*-
2 * Copyright (c) 2013 Gleb Smirnoff <glebius@FreeBSD.org>
3 * Copyright (c) 2010 Juniper Networks, Inc.
4 * Copyright (c) 2009 Robert N. M. Watson
5 * Copyright (c) 2009 Bjoern A. Zeeb <bz@FreeBSD.org>
6 * Copyright (c) 2008 Yahoo!, Inc.
7 * All rights reserved.
8 *

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

168 }
169
170 if (maxcpu == 0)
171 if (_kvm_pcpu_init(kd) < 0)
172 return (-1);
173 return (maxcpu);
174}
175
1/*-
2 * Copyright (c) 2013 Gleb Smirnoff <glebius@FreeBSD.org>
3 * Copyright (c) 2010 Juniper Networks, Inc.
4 * Copyright (c) 2009 Robert N. M. Watson
5 * Copyright (c) 2009 Bjoern A. Zeeb <bz@FreeBSD.org>
6 * Copyright (c) 2008 Yahoo!, Inc.
7 * All rights reserved.
8 *

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

168 }
169
170 if (maxcpu == 0)
171 if (_kvm_pcpu_init(kd) < 0)
172 return (-1);
173 return (maxcpu);
174}
175
176int
177kvm_getncpus(kvm_t *kd)
178{
179
180 if (mp_ncpus == 0)
181 if (_kvm_pcpu_init(kd) < 0)
182 return (-1);
183 return (mp_ncpus);
184}
185
176static int
177_kvm_dpcpu_setcpu(kvm_t *kd, u_int cpu, int report_error)
178{
179
180 if (!kd->dpcpu_initialized) {
181 if (report_error)
182 _kvm_err(kd, kd->program, "%s: not initialized",
183 __func__);

--- 153 unchanged lines hidden ---
186static int
187_kvm_dpcpu_setcpu(kvm_t *kd, u_int cpu, int report_error)
188{
189
190 if (!kd->dpcpu_initialized) {
191 if (report_error)
192 _kvm_err(kd, kd->program, "%s: not initialized",
193 __func__);

--- 153 unchanged lines hidden ---