Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 /*
0003  * Access to the shared data page by the vDSO & syscall map
0004  *
0005  * Copyright (C) 2004 Benjamin Herrenschmuidt (benh@kernel.crashing.org), IBM Corp.
0006  */
0007 
0008 #include <asm/processor.h>
0009 #include <asm/ppc_asm.h>
0010 #include <asm/asm-offsets.h>
0011 #include <asm/unistd.h>
0012 #include <asm/vdso.h>
0013 #include <asm/vdso_datapage.h>
0014 
0015     .text
0016 
0017 /*
0018  * void *__kernel_get_syscall_map(unsigned int *syscall_count) ;
0019  *
0020  * returns a pointer to the syscall map. the map is agnostic to the
0021  * size of "long", unlike kernel bitops, it stores bits from top to
0022  * bottom so that memory actually contains a linear bitmap
0023  * check for syscall N by testing bit (0x80000000 >> (N & 0x1f)) of
0024  * 32 bits int at N >> 5.
0025  */
0026 V_FUNCTION_BEGIN(__kernel_get_syscall_map)
0027   .cfi_startproc
0028     mflr    r12
0029   .cfi_register lr,r12
0030     mr. r4,r3
0031     get_datapage    r3
0032     mtlr    r12
0033 #ifdef __powerpc64__
0034     addi    r3,r3,CFG_SYSCALL_MAP64
0035 #else
0036     addi    r3,r3,CFG_SYSCALL_MAP32
0037 #endif
0038     crclr   cr0*4+so
0039     beqlr
0040     li  r0,NR_syscalls
0041     stw r0,0(r4)
0042     blr
0043   .cfi_endproc
0044 V_FUNCTION_END(__kernel_get_syscall_map)
0045 
0046 /*
0047  * void unsigned long long  __kernel_get_tbfreq(void);
0048  *
0049  * returns the timebase frequency in HZ
0050  */
0051 V_FUNCTION_BEGIN(__kernel_get_tbfreq)
0052   .cfi_startproc
0053     mflr    r12
0054   .cfi_register lr,r12
0055     get_datapage    r3
0056 #ifndef __powerpc64__
0057     lwz r4,(CFG_TB_TICKS_PER_SEC + 4)(r3)
0058 #endif
0059     PPC_LL  r3,CFG_TB_TICKS_PER_SEC(r3)
0060     mtlr    r12
0061     crclr   cr0*4+so
0062     blr
0063   .cfi_endproc
0064 V_FUNCTION_END(__kernel_get_tbfreq)