/* Intel recommends to set DFR, LDR and TPR before enabling an APIC. See e.g. "AP-388 82489DX User's Manual" (Intel document number 292116). So here it goes...  */
static void flat_init_apic_ldr(void)
/* Intel recommends to set DFR, LDR and TPR before enabling an APIC. See e.g. "AP-388 82489DX User's Manual" (Intel document number 292116). So here it goes...  */
static void flat_init_apic_ldr(void)
{
	unsigned long val;
	unsigned long num, id;
	num = smp_processor_id();
	id = 1UL << num;
	apic_write(APIC_DFR, APIC_DFR_FLAT);
	val = apic_read(APIC_LDR) & ~APIC_LDR_MASK;
	val |= SET_APIC_LOGICAL_ID(id);
	apic_write(APIC_LDR, val);
}