mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-09 03:21:51 +00:00
powerpc: move set_msr() and get_msr() into .h
set_msr() and get_msr() are defined and used twice. This patch moves them into ppc.h Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
This commit is contained in:
parent
f0eda3cb89
commit
f1cd73674f
3 changed files with 14 additions and 28 deletions
|
@ -96,6 +96,20 @@ static inline ulong get_ddr_freq(ulong dummy)
|
||||||
ulong get_ddr_freq(ulong);
|
ulong get_ddr_freq(ulong);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static inline unsigned long get_msr(void)
|
||||||
|
{
|
||||||
|
unsigned long msr;
|
||||||
|
|
||||||
|
asm volatile ("mfmsr %0" : "=r" (msr) : );
|
||||||
|
|
||||||
|
return msr;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void set_msr(unsigned long msr)
|
||||||
|
{
|
||||||
|
asm volatile ("mtmsr %0" : : "r" (msr));
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* !__ASSEMBLY__ */
|
#endif /* !__ASSEMBLY__ */
|
||||||
|
|
||||||
#ifdef CONFIG_PPC
|
#ifdef CONFIG_PPC
|
||||||
|
|
|
@ -33,20 +33,6 @@ extern void timer_interrupt_cpu (struct pt_regs *);
|
||||||
|
|
||||||
static unsigned decrementer_count; /* count value for 1e6/HZ microseconds */
|
static unsigned decrementer_count; /* count value for 1e6/HZ microseconds */
|
||||||
|
|
||||||
static __inline__ unsigned long get_msr (void)
|
|
||||||
{
|
|
||||||
unsigned long msr;
|
|
||||||
|
|
||||||
asm volatile ("mfmsr %0":"=r" (msr):);
|
|
||||||
|
|
||||||
return msr;
|
|
||||||
}
|
|
||||||
|
|
||||||
static __inline__ void set_msr (unsigned long msr)
|
|
||||||
{
|
|
||||||
asm volatile ("mtmsr %0"::"r" (msr));
|
|
||||||
}
|
|
||||||
|
|
||||||
static __inline__ unsigned long get_dec (void)
|
static __inline__ unsigned long get_dec (void)
|
||||||
{
|
{
|
||||||
unsigned long val;
|
unsigned long val;
|
||||||
|
|
|
@ -38,20 +38,6 @@ kgdb_longjmp(long *buf, int val)
|
||||||
: "=&r"(temp) : "r" (buf), "r" (val));
|
: "=&r"(temp) : "r" (buf), "r" (val));
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline unsigned long
|
|
||||||
get_msr(void)
|
|
||||||
{
|
|
||||||
unsigned long msr;
|
|
||||||
asm volatile("mfmsr %0" : "=r" (msr):);
|
|
||||||
return msr;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void
|
|
||||||
set_msr(unsigned long msr)
|
|
||||||
{
|
|
||||||
asm volatile("mtmsr %0" : : "r" (msr));
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Convert the SPARC hardware trap type code to a unix signal number. */
|
/* Convert the SPARC hardware trap type code to a unix signal number. */
|
||||||
/*
|
/*
|
||||||
* This table contains the mapping between PowerPC hardware trap types, and
|
* This table contains the mapping between PowerPC hardware trap types, and
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue