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

Commit ca6c8ed4 authored by Ingo Molnar's avatar Ingo Molnar
Browse files

x86, apic: refactor ->get_apic_id() & GET_APIC_ID()



- spread out the namespace on a per driver basis

 - get rid of macro wrappers

 - small cleanups

Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 9c764247
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -3,11 +3,9 @@

#define		APIC_ID_MASK		(0xFF<<24)

static inline unsigned get_apic_id(unsigned long x)
static inline unsigned bigsmp_get_apic_id(unsigned long x)
{
	return (((x)>>24)&0xFF);
	return (x >> 24) & 0xFF;
}

#define		GET_APIC_ID(x)	get_apic_id(x)

#endif
+2 −4
Original line number Diff line number Diff line
@@ -3,11 +3,9 @@

#define		APIC_ID_MASK		(0xFF<<24)

static inline unsigned get_apic_id(unsigned long x)
static inline unsigned int es7000_get_apic_id(unsigned long x)
{
	return (((x)>>24)&0xFF);
	return (x >> 24) & 0xFF;
}

#define		GET_APIC_ID(x)	get_apic_id(x)

#endif
+1 −1
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@ static inline const struct cpumask *default_target_cpus(void)
#include <asm/genapic.h>
#define cpu_mask_to_apicid (apic->cpu_mask_to_apicid)
#define cpu_mask_to_apicid_and (apic->cpu_mask_to_apicid_and)
#define read_apic_id()  (GET_APIC_ID(apic_read(APIC_ID)))
#define read_apic_id()  (apic->get_apic_id(apic_read(APIC_ID)))
#define send_IPI_self (apic->send_IPI_self)
#define wakeup_secondary_cpu (apic->wakeup_cpu)
extern void default_setup_apic_routing(void);
+5 −5
Original line number Diff line number Diff line
@@ -5,20 +5,20 @@

#ifdef CONFIG_X86_64
#define	APIC_ID_MASK		(apic->apic_id_mask)
#define GET_APIC_ID(x)		(apic->get_apic_id(x))
#define	SET_APIC_ID(x)		(apic->set_apic_id(x))
#else
#define		APIC_ID_MASK		(0xF<<24)
static inline unsigned get_apic_id(unsigned long x) 

static inline unsigned default_get_apic_id(unsigned long x) 
{
	unsigned int ver = GET_APIC_VERSION(apic_read(APIC_LVR));

	if (APIC_XAPIC(ver))
		return (((x)>>24)&0xFF);
		return (x >> 24) & 0xFF;
	else
		return (((x)>>24)&0xF);
		return (x >> 24) & 0x0F;
} 

#define		GET_APIC_ID(x)	get_apic_id(x)
#endif

#endif /* _ASM_X86_MACH_DEFAULT_MACH_APICDEF_H */
+0 −1
Original line number Diff line number Diff line
@@ -4,7 +4,6 @@
#ifndef APIC_DEFINITION
#include <asm/genapic.h>

#define GET_APIC_ID (apic->get_apic_id)
#define APIC_ID_MASK (apic->apic_id_mask)
#endif

Loading