Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 05f2d12c authored by Jack Steiner's avatar Jack Steiner Committed by Ingo Molnar
Browse files

x86: change GET_APIC_ID() from an inline function to an out-of-line function



Introduce a function to read the local APIC_ID.

This change is in preparation for additional changes to
the APICID functions that will come in a later patch.

Signed-off-by: default avatarJack Steiner <steiner@sgi.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent a5c15d41
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1195,7 +1195,7 @@ void __init init_apic_mappings(void)
	 * default configuration (or the MP table is broken).
	 */
	if (boot_cpu_physical_apicid == -1U)
		boot_cpu_physical_apicid = GET_APIC_ID(apic_read(APIC_ID));
		boot_cpu_physical_apicid = GET_APIC_ID(read_apic_id());

#ifdef CONFIG_X86_IO_APIC
	{
@@ -1265,7 +1265,7 @@ int __init APIC_init_uniprocessor(void)
	 * might be zero if read from MP tables. Get it from LAPIC.
	 */
#ifdef CONFIG_CRASH_DUMP
	boot_cpu_physical_apicid = GET_APIC_ID(apic_read(APIC_ID));
	boot_cpu_physical_apicid = GET_APIC_ID(read_apic_id());
#endif
	phys_cpu_present_map = physid_mask_of_physid(boot_cpu_physical_apicid);

+5 −5
Original line number Diff line number Diff line
@@ -650,10 +650,10 @@ int __init verify_local_APIC(void)
	/*
	 * The ID register is read/write in a real APIC.
	 */
	reg0 = apic_read(APIC_ID);
	reg0 = read_apic_id();
	apic_printk(APIC_DEBUG, "Getting ID: %x\n", reg0);
	apic_write(APIC_ID, reg0 ^ APIC_ID_MASK);
	reg1 = apic_read(APIC_ID);
	reg1 = read_apic_id();
	apic_printk(APIC_DEBUG, "Getting ID: %x\n", reg1);
	apic_write(APIC_ID, reg0);
	if (reg1 != (reg0 ^ APIC_ID_MASK))
@@ -892,7 +892,7 @@ void __init early_init_lapic_mapping(void)
	 * Fetch the APIC ID of the BSP in case we have a
	 * default configuration (or the MP table is broken).
	 */
	boot_cpu_physical_apicid = GET_APIC_ID(apic_read(APIC_ID));
	boot_cpu_physical_apicid = GET_APIC_ID(read_apic_id());
}

/**
@@ -919,7 +919,7 @@ void __init init_apic_mappings(void)
	 * Fetch the APIC ID of the BSP in case we have a
	 * default configuration (or the MP table is broken).
	 */
	boot_cpu_physical_apicid = GET_APIC_ID(apic_read(APIC_ID));
	boot_cpu_physical_apicid = GET_APIC_ID(read_apic_id());
}

/*
@@ -1140,7 +1140,7 @@ static int lapic_suspend(struct sys_device *dev, pm_message_t state)

	maxlvt = lapic_get_maxlvt();

	apic_pm_state.apic_id = apic_read(APIC_ID);
	apic_pm_state.apic_id = read_apic_id();
	apic_pm_state.apic_taskpri = apic_read(APIC_TASKPRI);
	apic_pm_state.apic_ldr = apic_read(APIC_LDR);
	apic_pm_state.apic_dfr = apic_read(APIC_DFR);
+1 −1
Original line number Diff line number Diff line
@@ -97,7 +97,7 @@ static void flat_send_IPI_all(int vector)

static int flat_apic_id_registered(void)
{
	return physid_isset(GET_APIC_ID(apic_read(APIC_ID)), phys_cpu_present_map);
	return physid_isset(GET_APIC_ID(read_apic_id()), phys_cpu_present_map);
}

static unsigned int flat_cpu_mask_to_apicid(cpumask_t cpumask)
+3 −3
Original line number Diff line number Diff line
@@ -1482,8 +1482,8 @@ void /*__init*/ print_local_APIC(void * dummy)

	printk("\n" KERN_DEBUG "printing local APIC contents on CPU#%d/%d:\n",
		smp_processor_id(), hard_smp_processor_id());
	v = apic_read(APIC_ID);
	printk(KERN_INFO "... APIC ID:      %08x (%01x)\n", v, GET_APIC_ID(v));
	printk(KERN_INFO "... APIC ID:      %08x (%01x)\n", v,
			GET_APIC_ID(read_apic_id()));
	v = apic_read(APIC_LVR);
	printk(KERN_INFO "... APIC VERSION: %08x\n", v);
	ver = GET_APIC_VERSION(v);
@@ -1692,7 +1692,7 @@ void disable_IO_APIC(void)
		entry.delivery_mode   = dest_ExtINT; /* ExtInt */
		entry.vector          = 0;
		entry.dest.physical.physical_dest =
					GET_APIC_ID(apic_read(APIC_ID));
					GET_APIC_ID(read_apic_id());

		/*
		 * Add it to the IO-APIC irq-routing table:
+2 −3
Original line number Diff line number Diff line
@@ -1068,8 +1068,7 @@ void __apicdebuginit print_local_APIC(void * dummy)

	printk("\n" KERN_DEBUG "printing local APIC contents on CPU#%d/%d:\n",
		smp_processor_id(), hard_smp_processor_id());
	v = apic_read(APIC_ID);
	printk(KERN_INFO "... APIC ID:      %08x (%01x)\n", v, GET_APIC_ID(v));
	printk(KERN_INFO "... APIC ID:      %08x (%01x)\n", v, GET_APIC_ID(read_apic_id()));
	v = apic_read(APIC_LVR);
	printk(KERN_INFO "... APIC VERSION: %08x\n", v);
	ver = GET_APIC_VERSION(v);
@@ -1263,7 +1262,7 @@ void disable_IO_APIC(void)
		entry.dest_mode       = 0; /* Physical */
		entry.delivery_mode   = dest_ExtINT; /* ExtInt */
		entry.vector          = 0;
		entry.dest          = GET_APIC_ID(apic_read(APIC_ID));
		entry.dest          = GET_APIC_ID(read_apic_id());

		/*
		 * Add it to the IO-APIC irq-routing table:
Loading