datapage.S 1.4 KB

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