diff options
Diffstat (limited to 'src/include/cpu')
-rw-r--r-- | src/include/cpu/amd/dualcore.h | 16 | ||||
-rw-r--r-- | src/include/cpu/x86/lapic.h | 11 |
2 files changed, 19 insertions, 8 deletions
diff --git a/src/include/cpu/amd/dualcore.h b/src/include/cpu/amd/dualcore.h index a38565b01f..fb53c92909 100644 --- a/src/include/cpu/amd/dualcore.h +++ b/src/include/cpu/amd/dualcore.h @@ -1,14 +1,24 @@ #ifndef CPU_AMD_DUALCORE_H #define CPU_AMD_DUALCORE_H -struct device; +#if defined(__GNUC__) +unsigned int read_nb_cfg_54(void); +#endif struct node_core_id { unsigned nodeid; unsigned coreid; }; -void amd_sibling_init(struct device *cpu, struct node_core_id id); -struct node_core_id get_node_core_id(void); +#if defined(__GNUC__) +// it can be used to get unitid and coreid it running only +struct node_core_id get_node_core_id(unsigned int nb_cfg_54); +#endif + +#ifndef __ROMCC__ +struct device; +unsigned get_apicid_base(unsigned ioapic_num); +void amd_sibling_init(struct device *cpu); +#endif #endif /* CPU_AMD_DUALCORE_H */ diff --git a/src/include/cpu/x86/lapic.h b/src/include/cpu/x86/lapic.h index 12ca518f66..5d696dce18 100644 --- a/src/include/cpu/x86/lapic.h +++ b/src/include/cpu/x86/lapic.h @@ -10,17 +10,17 @@ # define NEED_LAPIC 1 #endif -static inline unsigned long lapic_read(unsigned long reg) +static inline __attribute__((always_inline)) unsigned long lapic_read(unsigned long reg) { return *((volatile unsigned long *)(LAPIC_DEFAULT_BASE+reg)); } -static inline void lapic_write(unsigned long reg, unsigned long v) +static inline __attribute__((always_inline)) void lapic_write(unsigned long reg, unsigned long v) { *((volatile unsigned long *)(LAPIC_DEFAULT_BASE+reg)) = v; } -static inline void lapic_wait_icr_idle(void) +static inline __attribute__((always_inline)) void lapic_wait_icr_idle(void) { do { } while ( lapic_read( LAPIC_ICR ) & LAPIC_ICR_BUSY ); } @@ -46,13 +46,14 @@ static inline void disable_lapic(void) wrmsr(LAPIC_BASE_MSR, msr); } -static inline unsigned long lapicid(void) +static inline __attribute__((always_inline)) unsigned long lapicid(void) { return lapic_read(LAPIC_ID) >> 24; } -static inline void stop_this_cpu(void) +static inline __attribute__((always_inline)) void stop_this_cpu(void) { + unsigned apicid; apicid = lapicid(); |