summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include/asm/common.h
blob: 1e1ea4601dcc77260252d33c5259754f6fbf33e5 (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
/* SPDX-License-Identifier: GPL-2.0-only */

#ifndef __ASM_COMMON_H
#define __ASM_COMMON_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 */