/arch/ppc64/kernel/vdso64/datapage.S

https://bitbucket.org/evzijst/gittest · Assembly · 68 lines · 40 code · 6 blank · 22 comment · 0 complexity · d2b4b6e829e19492110eca946edb64e4 MD5 · raw file

  1. /*
  2. * Access to the shared data page by the vDSO & syscall map
  3. *
  4. * Copyright (C) 2004 Benjamin Herrenschmuidt (benh@kernel.crashing.org), IBM Corp.
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License
  8. * as published by the Free Software Foundation; either version
  9. * 2 of the License, or (at your option) any later version.
  10. */
  11. #include <linux/config.h>
  12. #include <asm/processor.h>
  13. #include <asm/ppc_asm.h>
  14. #include <asm/offsets.h>
  15. #include <asm/unistd.h>
  16. #include <asm/vdso.h>
  17. .text
  18. V_FUNCTION_BEGIN(__get_datapage)
  19. .cfi_startproc
  20. /* We don't want that exposed or overridable as we want other objects
  21. * to be able to bl directly to here
  22. */
  23. .protected __get_datapage
  24. .hidden __get_datapage
  25. mflr r0
  26. .cfi_register lr,r0
  27. bcl 20,31,1f
  28. .global __kernel_datapage_offset;
  29. __kernel_datapage_offset:
  30. .long 0
  31. 1:
  32. mflr r3
  33. mtlr r0
  34. lwz r0,0(r3)
  35. add r3,r0,r3
  36. blr
  37. .cfi_endproc
  38. V_FUNCTION_END(__get_datapage)
  39. /*
  40. * void *__kernel_get_syscall_map(unsigned int *syscall_count) ;
  41. *
  42. * returns a pointer to the syscall map. the map is agnostic to the
  43. * size of "long", unlike kernel bitops, it stores bits from top to
  44. * bottom so that memory actually contains a linear bitmap
  45. * check for syscall N by testing bit (0x80000000 >> (N & 0x1f)) of
  46. * 32 bits int at N >> 5.
  47. */
  48. V_FUNCTION_BEGIN(__kernel_get_syscall_map)
  49. .cfi_startproc
  50. mflr r12
  51. .cfi_register lr,r12
  52. mr r4,r3
  53. bl V_LOCAL_FUNC(__get_datapage)
  54. mtlr r12
  55. addi r3,r3,CFG_SYSCALL_MAP64
  56. cmpli cr0,r4,0
  57. beqlr
  58. li r0,__NR_syscalls
  59. stw r0,0(r4)
  60. blr
  61. .cfi_endproc
  62. V_FUNCTION_END(__kernel_get_syscall_map)