|
Lines 243-248
Link Here
|
| 243 |
/** XXX FIXME: what system files declare these??? */ |
243 |
/** XXX FIXME: what system files declare these??? */ |
| 244 |
extern struct region_descriptor r_gdt, r_idt; |
244 |
extern struct region_descriptor r_gdt, r_idt; |
| 245 |
|
245 |
|
|
|
246 |
extern long sys_time[NCPUSTATES]; |
| 247 |
#ifndef SMP |
| 248 |
extern long cpu_time[NCPUSTATES]; |
| 249 |
#endif |
| 250 |
|
| 246 |
int bsp_apic_ready = 0; /* flags useability of BSP apic */ |
251 |
int bsp_apic_ready = 0; /* flags useability of BSP apic */ |
| 247 |
int mp_ncpus; /* # of CPUs, including BSP */ |
252 |
int mp_ncpus; /* # of CPUs, including BSP */ |
| 248 |
int mp_naps; /* # of Applications processors */ |
253 |
int mp_naps; /* # of Applications processors */ |
|
Lines 1862-1867
Link Here
|
| 1862 |
SMPpt[pg + 3] = 0; /* *prv_CMAP3 */ |
1867 |
SMPpt[pg + 3] = 0; /* *prv_CMAP3 */ |
| 1863 |
SMPpt[pg + 4] = 0; /* *prv_PMAP1 */ |
1868 |
SMPpt[pg + 4] = 0; /* *prv_PMAP1 */ |
| 1864 |
|
1869 |
|
|
|
1870 |
/* space for cpu time */ |
| 1871 |
gd->gd_cpu_time = (long *) kmem_alloc(kernel_map, sizeof(long) |
| 1872 |
* NCPUSTATES); |
| 1873 |
|
| 1865 |
/* prime data page for it to use */ |
1874 |
/* prime data page for it to use */ |
| 1866 |
gd->gd_cpuid = x; |
1875 |
gd->gd_cpuid = x; |
| 1867 |
gd->gd_cpu_lockid = x << 24; |
1876 |
gd->gd_cpu_lockid = x << 24; |
|
Lines 2286-2293
Link Here
|
| 2286 |
int checkstate_cpustate[NCPU]; |
2295 |
int checkstate_cpustate[NCPU]; |
| 2287 |
u_long checkstate_pc[NCPU]; |
2296 |
u_long checkstate_pc[NCPU]; |
| 2288 |
|
2297 |
|
| 2289 |
extern long cp_time[CPUSTATES]; |
|
|
| 2290 |
|
| 2291 |
#define PC_TO_INDEX(pc, prof) \ |
2298 |
#define PC_TO_INDEX(pc, prof) \ |
| 2292 |
((int)(((u_quad_t)((pc) - (prof)->pr_off) * \ |
2299 |
((int)(((u_quad_t)((pc) - (prof)->pr_off) * \ |
| 2293 |
(u_quad_t)((prof)->pr_scale)) >> 16) & ~1) |
2300 |
(u_quad_t)((prof)->pr_scale)) >> 16) & ~1) |
|
Lines 2336-2345
Link Here
|
| 2336 |
if (pscnt > 1) |
2343 |
if (pscnt > 1) |
| 2337 |
return; |
2344 |
return; |
| 2338 |
p->p_uticks++; |
2345 |
p->p_uticks++; |
| 2339 |
if (p->p_nice > NZERO) |
2346 |
if (p->p_nice > NZERO) { |
| 2340 |
cp_time[CP_NICE]++; |
2347 |
cpu_time[CPU_NICE]++; |
| 2341 |
else |
2348 |
sys_time[CPU_NICE]++; |
| 2342 |
cp_time[CP_USER]++; |
2349 |
} else { |
|
|
2350 |
cpu_time[CPU_USER]++; |
| 2351 |
sys_time[CPU_NICE]++; |
| 2352 |
} |
| 2343 |
break; |
2353 |
break; |
| 2344 |
case CHECKSTATE_SYS: |
2354 |
case CHECKSTATE_SYS: |
| 2345 |
#ifdef GPROF |
2355 |
#ifdef GPROF |
|
Lines 2358-2368
Link Here
|
| 2358 |
if (pscnt > 1) |
2368 |
if (pscnt > 1) |
| 2359 |
return; |
2369 |
return; |
| 2360 |
|
2370 |
|
| 2361 |
if (!p) |
2371 |
if (!p) { |
| 2362 |
cp_time[CP_IDLE]++; |
2372 |
cpu_time[CPU_IDLE]++; |
| 2363 |
else { |
2373 |
sys_time[CPU_IDLE]++; |
|
|
2374 |
} else { |
| 2364 |
p->p_sticks++; |
2375 |
p->p_sticks++; |
| 2365 |
cp_time[CP_SYS]++; |
2376 |
cpu_time[CPU_SYS]++; |
|
|
2377 |
sys_time[CPU_SYS]++; |
| 2366 |
} |
2378 |
} |
| 2367 |
break; |
2379 |
break; |
| 2368 |
case CHECKSTATE_INTR: |
2380 |
case CHECKSTATE_INTR: |
|
Lines 2384-2390
Link Here
|
| 2384 |
return; |
2396 |
return; |
| 2385 |
if (p) |
2397 |
if (p) |
| 2386 |
p->p_iticks++; |
2398 |
p->p_iticks++; |
| 2387 |
cp_time[CP_INTR]++; |
2399 |
cpu_time[CPU_INTR]++; |
|
|
2400 |
sys_time[CPU_INTR]++; |
| 2388 |
} |
2401 |
} |
| 2389 |
if (p != NULL) { |
2402 |
if (p != NULL) { |
| 2390 |
schedclock(p); |
2403 |
schedclock(p); |