summaryrefslogtreecommitdiff
path: root/kern/cpu_number.c
blob: 4101e73c261c1f5e67298b02492a42e8d01e9228 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <kern/cpu_number.h>
#include <i386at/acpi_rsdp.h>
#include <imps/apic.h>
#include <mach/machine.h>

unsigned int master_cpu = 0;	/* 'master' processor - keeps time */

int
cpu_number()
{
	if(lapic == 0 | ncpu == 1) return 0;
	else{ 
		unsigned apic_id = lapic->apic_id.r >>24;

		return apic2kernel[apic_id];

	}
}