File: mcount.S

package info (click to toggle)
linux 4.19.249-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 968,784 kB
  • sloc: ansic: 16,810,930; asm: 272,263; makefile: 38,450; sh: 33,900; perl: 27,702; python: 21,148; cpp: 5,068; yacc: 4,650; lex: 2,584; awk: 1,386; ruby: 25; sed: 5
file content (50 lines) | stat: -rw-r--r-- 775 bytes parent folder | download | duplicates (26)
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
 * arch/xtensa/kernel/mcount.S
 *
 * Xtensa specific mcount support
 *
 * This file is subject to the terms and conditions of the GNU General Public
 * License.  See the file "COPYING" in the main directory of this archive
 * for more details.
 *
 * Copyright (C) 2013 Tensilica Inc.
 */

#include <linux/linkage.h>
#include <asm/ftrace.h>

/*
 * Entry condition:
 *
 *   a2:	a0 of the caller
 */

ENTRY(_mcount)

	entry	a1, 16

	movi	a4, ftrace_trace_function
	l32i	a4, a4, 0
	movi	a3, ftrace_stub
	bne	a3, a4, 1f
	retw

1: 	xor	a7, a2, a1
	movi	a3, 0x3fffffff
	and	a7, a7, a3
	xor	a7, a7, a1

	xor	a6, a0, a1
	and	a6, a6, a3
	xor	a6, a6, a1
	addi	a6, a6, -MCOUNT_INSN_SIZE
	callx4	a4

	retw

ENDPROC(_mcount)

ENTRY(ftrace_stub)
	entry	a1, 16
	retw
ENDPROC(ftrace_stub)