summaryrefslogtreecommitdiffstats
path: root/arch/ppc/include/asm/common.h
blob: 045817bed226d2b2919fcf2fdca81bbd82cdb8f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#ifndef __ASM_COMMON_H
#define __ASM_COMMON_H

#include <asm/barebox.h>

extern unsigned long _text_base;

unsigned long long get_ticks(void);

int	cpu_init      (void);

uint	get_pvr	      (void);
uint	get_svr	      (void);

void	trap_init     (ulong);

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;
}

extern unsigned long search_exception_table(unsigned long);
#endif /* __ASM_COMMON_H */