ppc: add a get_pc() function
Useful to determine whether sdram has to be setup or not. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
9ff0bf82ad
commit
bbbfb9f4f8
|
@ -21,4 +21,21 @@ void trap_init (ulong);
|
||||||
int cpu_init_board_data(bd_t *bd);
|
int cpu_init_board_data(bd_t *bd);
|
||||||
int init_board_data(bd_t *bd);
|
int init_board_data(bd_t *bd);
|
||||||
|
|
||||||
|
static inline unsigned long get_pc(void)
|
||||||
|
{
|
||||||
|
unsigned long pc;
|
||||||
|
|
||||||
|
__asm__ __volatile__(
|
||||||
|
" mflr 0\n"
|
||||||
|
" bl 1f\n"
|
||||||
|
"1:\n"
|
||||||
|
" mflr %0\n"
|
||||||
|
" mtlr 0\n"
|
||||||
|
: "=r" (pc)
|
||||||
|
:
|
||||||
|
: "0", "memory");
|
||||||
|
|
||||||
|
return pc;
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* __ASM_COMMON_H */
|
#endif /* __ASM_COMMON_H */
|
||||||
|
|
Loading…
Reference in New Issue