]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blame - arch/powerpc/kernel/vdso32/datapage.S
Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[mirror_ubuntu-jammy-kernel.git] / arch / powerpc / kernel / vdso32 / datapage.S
CommitLineData
2874c5fd 1/* SPDX-License-Identifier: GPL-2.0-or-later */
1da177e4
LT
2/*
3 * Access to the shared data page by the vDSO & syscall map
4 *
5 * Copyright (C) 2004 Benjamin Herrenschmuidt (benh@kernel.crashing.org), IBM Corp.
1da177e4
LT
6 */
7
1da177e4
LT
8#include <asm/processor.h>
9#include <asm/ppc_asm.h>
0013a854 10#include <asm/asm-offsets.h>
1da177e4
LT
11#include <asm/unistd.h>
12#include <asm/vdso.h>
13
14 .text
c974809a
MN
15 .global __kernel_datapage_offset;
16__kernel_datapage_offset:
17 .long 0
18
1da177e4
LT
19V_FUNCTION_BEGIN(__get_datapage)
20 .cfi_startproc
21 /* We don't want that exposed or overridable as we want other objects
22 * to be able to bl directly to here
23 */
24 .protected __get_datapage
25 .hidden __get_datapage
26
27 mflr r0
28 .cfi_register lr,r0
29
c974809a
MN
30 bcl 20,31,data_page_branch
31data_page_branch:
1da177e4
LT
32 mflr r3
33 mtlr r0
c974809a 34 addi r3, r3, __kernel_datapage_offset-data_page_branch
1da177e4 35 lwz r0,0(r3)
56d20861 36 .cfi_restore lr
1da177e4
LT
37 add r3,r0,r3
38 blr
39 .cfi_endproc
40V_FUNCTION_END(__get_datapage)
41
42/*
43 * void *__kernel_get_syscall_map(unsigned int *syscall_count) ;
44 *
45 * returns a pointer to the syscall map. the map is agnostic to the
46 * size of "long", unlike kernel bitops, it stores bits from top to
47 * bottom so that memory actually contains a linear bitmap
48 * check for syscall N by testing bit (0x80000000 >> (N & 0x1f)) of
49 * 32 bits int at N >> 5.
50 */
51V_FUNCTION_BEGIN(__kernel_get_syscall_map)
52 .cfi_startproc
53 mflr r12
54 .cfi_register lr,r12
1da177e4
LT
55 mr r4,r3
56 bl __get_datapage@local
57 mtlr r12
58 addi r3,r3,CFG_SYSCALL_MAP32
59 cmpli cr0,r4,0
60 beqlr
f43194e4 61 li r0,NR_syscalls
1da177e4 62 stw r0,0(r4)
5d66da3d 63 crclr cr0*4+so
1da177e4
LT
64 blr
65 .cfi_endproc
66V_FUNCTION_END(__kernel_get_syscall_map)
a7f290da
BH
67
68/*
69 * void unsigned long long __kernel_get_tbfreq(void);
70 *
71 * returns the timebase frequency in HZ
72 */
73V_FUNCTION_BEGIN(__kernel_get_tbfreq)
74 .cfi_startproc
75 mflr r12
76 .cfi_register lr,r12
77 bl __get_datapage@local
a7f290da 78 lwz r4,(CFG_TB_TICKS_PER_SEC + 4)(r3)
0c37ec2a 79 lwz r3,CFG_TB_TICKS_PER_SEC(r3)
a7f290da 80 mtlr r12
5d66da3d 81 crclr cr0*4+so
0c37ec2a 82 blr
a7f290da
BH
83 .cfi_endproc
84V_FUNCTION_END(__kernel_get_tbfreq)