summaryrefslogtreecommitdiff
path: root/kern/cpu_number.c
blob: d9adc58403cb11b4c7b411b7110c17721287d1e8 (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;

		return apic2kernel[apic_id];

	}
}