File: vdso_user_wrapper.S

package info (click to toggle)
linux 5.10.46-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,191,996 kB
  • sloc: ansic: 19,502,768; asm: 263,759; sh: 73,960; makefile: 44,724; perl: 34,644; python: 32,387; cpp: 6,070; yacc: 4,755; lex: 2,742; awk: 1,214; ruby: 25; sed: 5
file content (38 lines) | stat: -rw-r--r-- 1,044 bytes parent folder | download | duplicates (3)
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
/* SPDX-License-Identifier: GPL-2.0 */
#include <asm/vdso.h>
#include <asm/unistd.h>
#include <asm/asm-offsets.h>
#include <asm/dwarf.h>
#include <asm/ptrace.h>

#define WRAPPER_FRAME_SIZE (STACK_FRAME_OVERHEAD+8)

/*
 * Older glibc version called vdso without allocating a stackframe. This wrapper
 * is just used to allocate a stackframe. See
 * https://sourceware.org/git/?p=glibc.git;a=commit;h=478593e6374f3818da39332260dc453cb19cfa1e
 * for details.
 */
.macro vdso_func func
	.globl __kernel_\func
	.type  __kernel_\func,@function
	.align 8
__kernel_\func:
	CFI_STARTPROC
	aghi	%r15,-WRAPPER_FRAME_SIZE
	CFI_DEF_CFA_OFFSET (STACK_FRAME_OVERHEAD + WRAPPER_FRAME_SIZE)
	CFI_VAL_OFFSET 15, -STACK_FRAME_OVERHEAD
	stg	%r14,STACK_FRAME_OVERHEAD(%r15)
	brasl	%r14,__s390_vdso_\func
	lg	%r14,STACK_FRAME_OVERHEAD(%r15)
	aghi	%r15,WRAPPER_FRAME_SIZE
	CFI_DEF_CFA_OFFSET STACK_FRAME_OVERHEAD
	CFI_RESTORE 15
	br	%r14
	CFI_ENDPROC
	.size	__kernel_\func,.-__kernel_\func
.endm

vdso_func gettimeofday
vdso_func clock_getres
vdso_func clock_gettime