Split the two usages of __ROMCC__:
__ROMCC__ now means "Don't use prototypes, since romcc doesn't support them." __PRE_RAM__ means "Use simpler versions of functions, and no device tree." There are probably some places where both are tested, but only one is needed. Signed-off-by: Myles Watson <mylesgw@gmail.com> Acked-by: Peter Stuge <peter@stuge.se> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4921 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
// ROMCC doesn't support __FILE__ or __LINE__ :^{
|
||||
|
||||
#if CONFIG_DEBUG
|
||||
#ifdef __ROMCC__
|
||||
#ifdef __PRE_RAM__
|
||||
#define ASSERT(x) { if (!(x)) die("ASSERT failure!\r\n"); }
|
||||
#else
|
||||
#define ASSERT(x) { \
|
||||
@@ -39,7 +39,7 @@
|
||||
#define ASSERT(x) { }
|
||||
#endif
|
||||
|
||||
#ifdef __ROMCC__
|
||||
#ifdef __PRE_RAM__
|
||||
#define BUG() { die("BUG encountered: system halted\r\n"); }
|
||||
#else
|
||||
#define BUG() { \
|
||||
|
@@ -15,7 +15,7 @@ struct node_core_id {
|
||||
struct node_core_id get_node_core_id(unsigned int nb_cfg_54);
|
||||
#endif
|
||||
|
||||
#ifndef __ROMCC__
|
||||
#if !defined( __ROMCC__ ) && !defined(__PRE_RAM__)
|
||||
struct device;
|
||||
unsigned get_apicid_base(unsigned ioapic_num);
|
||||
void amd_sibling_init(struct device *cpu);
|
||||
|
@@ -49,7 +49,7 @@ static inline int is_cpu_e0(void)
|
||||
}
|
||||
|
||||
|
||||
#ifdef __ROMCC__
|
||||
#ifdef __PRE_RAM__
|
||||
static int is_e0_later_in_bsp(int nodeid)
|
||||
{
|
||||
uint32_t val;
|
||||
@@ -96,7 +96,7 @@ static inline int is_cpu_pre_f2(void)
|
||||
return (cpuid_eax(1) & 0xfff0f) < 0x40f02;
|
||||
}
|
||||
|
||||
#ifdef __ROMCC__
|
||||
#ifdef __PRE_RAM__
|
||||
//AMD_F0_SUPPORT
|
||||
static int is_cpu_f0_in_bsp(int nodeid)
|
||||
{
|
||||
|
@@ -31,7 +31,7 @@
|
||||
#define TOP_MEM_MASK 0x007fffff
|
||||
#define TOP_MEM_MASK_KB (TOP_MEM_MASK >> 10)
|
||||
|
||||
#if !defined( __ROMCC__ ) && !defined (ASSEMBLY)
|
||||
#if !defined( __ROMCC__ ) && !defined (ASSEMBLY) && !defined(__PRE_RAM__)
|
||||
void amd_setup_mtrrs(void);
|
||||
#endif /* __ROMCC__ */
|
||||
|
||||
|
@@ -34,7 +34,7 @@ struct node_core_id {
|
||||
struct node_core_id get_node_core_id(u32 nb_cfg_54);
|
||||
#endif
|
||||
|
||||
#ifndef __ROMCC__
|
||||
#if !defined( __ROMCC__ ) && !defined(__PRE_RAM__)
|
||||
struct device;
|
||||
u32 get_apicid_base(u32 ioapic_num);
|
||||
void amd_sibling_init(struct device *cpu);
|
||||
|
@@ -41,7 +41,7 @@ static inline void disable_cache(void)
|
||||
wbinvd();
|
||||
}
|
||||
|
||||
#if !defined( __ROMCC__) && defined (__GNUC__)
|
||||
#if !defined( __ROMCC__) && !defined(__PRE_RAM__) && defined (__GNUC__)
|
||||
void x86_enable_cache(void);
|
||||
#endif /* !__ROMCC__ */
|
||||
|
||||
|
@@ -68,7 +68,7 @@ static inline __attribute__((always_inline)) void stop_this_cpu(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if ! defined (__ROMCC__)
|
||||
#if ! defined (__ROMCC__) && !defined(__PRE_RAM__)
|
||||
|
||||
#define xchg(ptr,v) ((__typeof__(*(ptr)))__xchg((unsigned long)(v),(ptr),sizeof(*(ptr))))
|
||||
|
||||
@@ -157,6 +157,6 @@ int start_cpu(struct device *cpu);
|
||||
#endif /* CONFIG_SMP */
|
||||
|
||||
|
||||
#endif /* !__ROMCC__ */
|
||||
#endif /* !__ROMCC__ && !__PRE_RAM__ */
|
||||
|
||||
#endif /* CPU_X86_LAPIC_H */
|
||||
|
@@ -1,7 +1,7 @@
|
||||
#ifndef CPU_X86_MSR_H
|
||||
#define CPU_X86_MSR_H
|
||||
|
||||
#if defined( __ROMCC__) && !defined (__GNUC__)
|
||||
#if defined( __ROMCC__)
|
||||
|
||||
typedef __builtin_msr_t msr_t;
|
||||
|
||||
@@ -43,7 +43,7 @@ static inline void wrmsr(unsigned index, msr_t msr)
|
||||
);
|
||||
}
|
||||
|
||||
#endif /* ROMCC__ && !__GNUC__ */
|
||||
#endif /* __ROMCC__ */
|
||||
|
||||
|
||||
#endif /* CPU_X86_MSR_H */
|
||||
|
@@ -32,7 +32,7 @@
|
||||
#define MTRRfix4K_F8000_MSR 0x26f
|
||||
|
||||
|
||||
#if !defined(__ROMCC__) && !defined (ASSEMBLY)
|
||||
#if !defined(__ROMCC__) && !defined (ASSEMBLY) && !defined(__PRE_RAM__)
|
||||
|
||||
#include <device/device.h>
|
||||
|
||||
|
@@ -17,7 +17,7 @@ static tsc_t rdtsc(void)
|
||||
return res;
|
||||
}
|
||||
|
||||
#ifndef __ROMCC__
|
||||
#if !defined( __ROMCC__ ) && !defined (__PRE_RAM__)
|
||||
static inline unsigned long long rdtscll(void)
|
||||
{
|
||||
unsigned long long val;
|
||||
|
@@ -11,7 +11,7 @@
|
||||
#define MIN(a,b) ((a) < (b) ? (a) : (b))
|
||||
#define MAX(a,b) ((a) > (b) ? (a) : (b))
|
||||
|
||||
#ifndef __ROMCC__
|
||||
#if !defined( __ROMCC__ ) && !defined(__PRE_RAM__)
|
||||
void *malloc(size_t size);
|
||||
void free(void *ptr);
|
||||
#endif
|
||||
|
@@ -8,7 +8,7 @@ void *memcpy(void *dest, const void *src, size_t n);
|
||||
void *memmove(void *dest, const void *src, size_t n);
|
||||
void *memset(void *s, int c, size_t n);
|
||||
int memcmp(const void *s1, const void *s2, size_t n);
|
||||
#ifndef __ROMCC__
|
||||
#if !defined( __ROMCC__ ) && !defined(__PRE_RAM__)
|
||||
int sprintf(char * buf, const char *fmt, ...);
|
||||
#endif
|
||||
|
||||
@@ -41,7 +41,7 @@ static inline char *strchr(const char *s, int c)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifndef __ROMCC__
|
||||
#if !defined( __ROMCC__ ) && !defined(__PRE_RAM__)
|
||||
static inline char *strdup(const char *s)
|
||||
{
|
||||
size_t sz = strlen(s) + 1;
|
||||
|
Reference in New Issue
Block a user