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

Commit 1b000843 authored by Glauber Costa's avatar Glauber Costa Committed by Ingo Molnar
Browse files

x86: merge hard/logical_smp_processor_id



The code is now the same between i386 and x86_64. We already
know what happens when it reaches this point: They go away
from the arch-specific headers, and suddenly appears in the common
header.

Signed-off-by: default avatarGlauber Costa <gcosta@redhat.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 2ba95bcb
Loading
Loading
Loading
Loading
+27 −0
Original line number Original line Diff line number Diff line
@@ -123,6 +123,33 @@ void smp_store_cpu_info(int id);
# include "smp_64.h"
# include "smp_64.h"
#endif
#endif


#ifdef CONFIG_X86_LOCAL_APIC

static inline int logical_smp_processor_id(void)
{
	/* we don't want to mark this access volatile - bad code generation */
	return GET_APIC_LOGICAL_ID(*(u32 *)(APIC_BASE + APIC_LDR));
}

# ifdef APIC_DEFINITION
extern int hard_smp_processor_id(void);
# else
#  include <mach_apicdef.h>
static inline int hard_smp_processor_id(void)
{
	/* we don't want to mark this access volatile - bad code generation */
	return GET_APIC_ID(*(u32 *)(APIC_BASE + APIC_ID));
}
# endif /* APIC_DEFINITION */

#else /* CONFIG_X86_LOCAL_APIC */

# ifndef CONFIG_SMP
#  define hard_smp_processor_id()	0
# endif

#endif /* CONFIG_X86_LOCAL_APIC */

#ifdef CONFIG_HOTPLUG_CPU
#ifdef CONFIG_HOTPLUG_CPU
extern void cpu_exit_clear(void);
extern void cpu_exit_clear(void);
extern void cpu_uninit(void);
extern void cpu_uninit(void);
+0 −27
Original line number Original line Diff line number Diff line
@@ -42,32 +42,5 @@ static inline int num_booting_cpus(void)
#define safe_smp_processor_id()		0
#define safe_smp_processor_id()		0
#endif /* !CONFIG_SMP */
#endif /* !CONFIG_SMP */


#ifdef CONFIG_X86_LOCAL_APIC

static inline int logical_smp_processor_id(void)
{
	/* we don't want to mark this access volatile - bad code generation */
	return GET_APIC_LOGICAL_ID(*(u32 *)(APIC_BASE + APIC_LDR));
}

# ifdef APIC_DEFINITION
extern int hard_smp_processor_id(void);
# else
#  include <mach_apicdef.h>
static inline int hard_smp_processor_id(void)
{
	/* we don't want to mark this access volatile - bad code generation */
	return GET_APIC_ID(*(u32 *)(APIC_BASE + APIC_ID));
}
# endif /* APIC_DEFINITION */

#else /* CONFIG_X86_LOCAL_APIC */

# ifndef CONFIG_SMP
#  define hard_smp_processor_id()	0
# endif

#endif /* CONFIG_X86_LOCAL_APIC */

#endif /* !ASSEMBLY */
#endif /* !ASSEMBLY */
#endif
#endif
+0 −27
Original line number Original line Diff line number Diff line
@@ -46,32 +46,5 @@ static inline int num_booting_cpus(void)


#define safe_smp_processor_id()		smp_processor_id()
#define safe_smp_processor_id()		smp_processor_id()


#ifdef CONFIG_X86_LOCAL_APIC

static inline int logical_smp_processor_id(void)
{
	/* we don't want to mark this access volatile - bad code generation */
	return GET_APIC_LOGICAL_ID(*(u32 *)(APIC_BASE + APIC_LDR));
}

# ifdef APIC_DEFINITION
extern int hard_smp_processor_id(void);
# else
#  include <mach_apicdef.h>
static inline int hard_smp_processor_id(void)
{
	/* we don't want to mark this access volatile - bad code generation */
	return GET_APIC_ID(*(u32 *)(APIC_BASE + APIC_ID));
}
# endif /* APIC_DEFINITION */

#else /* CONFIG_X86_LOCAL_APIC */

# ifndef CONFIG_SMP
#  define hard_smp_processor_id()	0
# endif

#endif /* CONFIG_X86_LOCAL_APIC */

#endif
#endif