root/arch/s390/kernel/vdso32/getcpu.S

/* [<][>][^][v][top][bottom][index][help] */
   1 /* SPDX-License-Identifier: GPL-2.0 */
   2 /*
   3  * Userland implementation of getcpu() for 32 bits processes in a
   4  * s390 kernel for use in the vDSO
   5  *
   6  *  Copyright IBM Corp. 2016
   7  *  Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com>
   8  */
   9 #include <asm/vdso.h>
  10 #include <asm/asm-offsets.h>
  11 #include <asm/dwarf.h>
  12 
  13         .text
  14         .align 4
  15         .globl __kernel_getcpu
  16         .type  __kernel_getcpu,@function
  17 __kernel_getcpu:
  18         CFI_STARTPROC
  19         la      %r4,0
  20         sacf    256
  21         l       %r5,__VDSO_CPU_NR(%r4)
  22         l       %r4,__VDSO_NODE_ID(%r4)
  23         sacf    0
  24         ltr     %r2,%r2
  25         jz      2f
  26         st      %r5,0(%r2)
  27 2:      ltr     %r3,%r3
  28         jz      3f
  29         st      %r4,0(%r3)
  30 3:      lhi     %r2,0
  31         br      %r14
  32         CFI_ENDPROC
  33         .size   __kernel_getcpu,.-__kernel_getcpu

/* [<][>][^][v][top][bottom][index][help] */