Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  1) /* SPDX-License-Identifier: GPL-2.0-or-later */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  3)  * Access to the shared data page by the vDSO & syscall map
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  4)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  5)  * Copyright (C) 2004 Benjamin Herrenschmuidt (benh@kernel.crashing.org), IBM Corp.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  6)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  7) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  8) #include <asm/processor.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  9) #include <asm/ppc_asm.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) #include <asm/asm-offsets.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #include <asm/unistd.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #include <asm/vdso.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) #include <asm/vdso_datapage.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) 	.text
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) 	.global	__kernel_datapage_offset;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) __kernel_datapage_offset:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) 	.long	0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21)  * void *__kernel_get_syscall_map(unsigned int *syscall_count) ;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23)  * returns a pointer to the syscall map. the map is agnostic to the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24)  * size of "long", unlike kernel bitops, it stores bits from top to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25)  * bottom so that memory actually contains a linear bitmap
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26)  * check for syscall N by testing bit (0x80000000 >> (N & 0x1f)) of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27)  * 32 bits int at N >> 5.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) V_FUNCTION_BEGIN(__kernel_get_syscall_map)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30)   .cfi_startproc
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) 	mflr	r12
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32)   .cfi_register lr,r12
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) 	mr.	r4,r3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) 	get_datapage	r3, r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) 	mtlr	r12
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) 	addi	r3,r3,CFG_SYSCALL_MAP32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) 	beqlr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) 	li	r0,NR_syscalls
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) 	stw	r0,0(r4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) 	crclr	cr0*4+so
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) 	blr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42)   .cfi_endproc
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) V_FUNCTION_END(__kernel_get_syscall_map)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46)  * void unsigned long long  __kernel_get_tbfreq(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48)  * returns the timebase frequency in HZ
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) V_FUNCTION_BEGIN(__kernel_get_tbfreq)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51)   .cfi_startproc
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) 	mflr	r12
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53)   .cfi_register lr,r12
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) 	get_datapage	r3, r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) 	lwz	r4,(CFG_TB_TICKS_PER_SEC + 4)(r3)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) 	lwz	r3,CFG_TB_TICKS_PER_SEC(r3)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) 	mtlr	r12
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) 	crclr	cr0*4+so
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) 	blr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60)   .cfi_endproc
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) V_FUNCTION_END(__kernel_get_tbfreq)