Skip to content

Commit 3015e51

Browse files
author
Andrew Haley
committed
Use TLS descriptors to access otel_thread_ctx_v1
1 parent 027ca0a commit 3015e51

1 file changed

Lines changed: 9 additions & 12 deletions

File tree

  • src/hotspot/os_cpu/linux_x86

src/hotspot/os_cpu/linux_x86/otel.S

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,17 @@
66
writeOpenTelemetryTLS0:
77
.LFB0:
88
.cfi_startproc
9-
push rbx
9+
sub rsp, 8
1010
.cfi_def_cfa_offset 16
11-
.cfi_offset 3, -16
12-
mov rbx, rdi
13-
.byte 0x66
14-
lea rdi, otel_thread_ctx_v1@tlsgd[rip]
15-
.value 0x6666
16-
rex64
17-
call __tls_get_addr@PLT
18-
mov rcx, rax
19-
mov rax, QWORD PTR [rax]
20-
mov QWORD PTR [rcx], rbx
21-
pop rbx
11+
lea rax, otel_thread_ctx_v1@TLSDESC[rip]
12+
mov rcx, rdi
13+
call [QWORD PTR [rax+otel_thread_ctx_v1@TLSCALL]]
14+
add rax, QWORD PTR fs:0
15+
mov rdx, QWORD PTR [rax]
16+
mov QWORD PTR [rax], rcx
17+
add rsp, 8
2218
.cfi_def_cfa_offset 8
19+
mov rax, rdx
2320
ret
2421
.cfi_endproc
2522
.LFE0:

0 commit comments

Comments
 (0)