2
0

s390xcpuid.S 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. .text
  2. .globl OPENSSL_s390x_facilities
  3. .type OPENSSL_s390x_facilities,@function
  4. .align 16
  5. OPENSSL_s390x_facilities:
  6. lghi %r0,0
  7. larl %r2,OPENSSL_s390xcap_P
  8. stg %r0,8(%r2)
  9. .long 0xb2b02000 # stfle 0(%r2)
  10. brc 8,.Ldone
  11. lghi %r0,1
  12. .long 0xb2b02000 # stfle 0(%r2)
  13. .Ldone:
  14. lg %r2,0(%r2)
  15. br %r14
  16. .size OPENSSL_s390x_facilities,.-OPENSSL_s390x_facilities
  17. .globl OPENSSL_rdtsc
  18. .type OPENSSL_rdtsc,@function
  19. .align 16
  20. OPENSSL_rdtsc:
  21. stck 16(%r15)
  22. lg %r2,16(%r15)
  23. br %r14
  24. .size OPENSSL_rdtsc,.-OPENSSL_rdtsc
  25. .globl OPENSSL_atomic_add
  26. .type OPENSSL_atomic_add,@function
  27. .align 16
  28. OPENSSL_atomic_add:
  29. l %r1,0(%r2)
  30. .Lspin: lr %r0,%r1
  31. ar %r0,%r3
  32. cs %r1,%r0,0(%r2)
  33. brc 4,.Lspin
  34. lgfr %r2,%r0 # OpenSSL expects the new value
  35. br %r14
  36. .size OPENSSL_atomic_add,.-OPENSSL_atomic_add
  37. .globl OPENSSL_wipe_cpu
  38. .type OPENSSL_wipe_cpu,@function
  39. .align 16
  40. OPENSSL_wipe_cpu:
  41. xgr %r0,%r0
  42. xgr %r1,%r1
  43. lgr %r2,%r15
  44. xgr %r3,%r3
  45. xgr %r4,%r4
  46. lzdr %f0
  47. lzdr %f1
  48. lzdr %f2
  49. lzdr %f3
  50. lzdr %f4
  51. lzdr %f5
  52. lzdr %f6
  53. lzdr %f7
  54. br %r14
  55. .size OPENSSL_wipe_cpu,.-OPENSSL_wipe_cpu
  56. .globl OPENSSL_cleanse
  57. .type OPENSSL_cleanse,@function
  58. .align 16
  59. OPENSSL_cleanse:
  60. #if !defined(__s390x__) && !defined(__s390x)
  61. llgfr %r3,%r3
  62. #endif
  63. lghi %r4,15
  64. lghi %r0,0
  65. clgr %r3,%r4
  66. jh .Lot
  67. clgr %r3,%r0
  68. bcr 8,%r14
  69. .Little:
  70. stc %r0,0(%r2)
  71. la %r2,1(%r2)
  72. brctg %r3,.Little
  73. br %r14
  74. .align 4
  75. .Lot: tmll %r2,7
  76. jz .Laligned
  77. stc %r0,0(%r2)
  78. la %r2,1(%r2)
  79. brctg %r3,.Lot
  80. .Laligned:
  81. srlg %r4,%r3,3
  82. .Loop: stg %r0,0(%r2)
  83. la %r2,8(%r2)
  84. brctg %r4,.Loop
  85. lghi %r4,7
  86. ngr %r3,%r4
  87. jnz .Little
  88. br %r14
  89. .size OPENSSL_cleanse,.-OPENSSL_cleanse
  90. .globl OPENSSL_instrument_bus
  91. .type OPENSSL_instrument_bus,@function
  92. .align 16
  93. OPENSSL_instrument_bus:
  94. lghi %r2,0
  95. br %r14
  96. .size OPENSSL_instrument_bus,.-OPENSSL_instrument_bus
  97. .globl OPENSSL_instrument_bus2
  98. .type OPENSSL_instrument_bus2,@function
  99. .align 16
  100. OPENSSL_instrument_bus2:
  101. lghi %r2,0
  102. br %r14
  103. .size OPENSSL_instrument_bus2,.-OPENSSL_instrument_bus2
  104. .section .init
  105. brasl %r14,OPENSSL_cpuid_setup
  106. .comm OPENSSL_s390xcap_P,16,8