@@ -165,6 +165,8 @@ elseif Sys.ARCH === :aarch64
165
165
Clong (241 )
166
166
elseif Sys. ARCH === :arm
167
167
Clong (364 )
168
+ elseif Sys. ARCH === :powerpc64le || Sys. ARCH === :ppc64le
169
+ Clong (319 )
168
170
else
169
171
Clong (- 1 ) # sentinel for unknown syscall ID
170
172
end
@@ -179,7 +181,7 @@ function perf_event_open(attr::perf_event_attr, pid, cpu, leader_fd, flags)
179
181
# Have to do a manual conversion, since the ABI is a vararg call
180
182
ptr = Base. unsafe_convert (Ptr{Cvoid}, Base. cconvert (Ptr{Cvoid}, r_attr))
181
183
fd = ccall (:syscall , Cint, (Clong, Clong... ), SYS_perf_event_open,
182
- ptr, pid, cpu, leader_fd, flags)
184
+ reinterpret (Clong, ptr) , pid, cpu, leader_fd, flags)
183
185
end
184
186
return fd
185
187
end
@@ -346,6 +348,8 @@ elseif Sys.ARCH === :aarch64
346
348
Clong (167 )
347
349
elseif Sys. ARCH === :arm
348
350
Clong (172 )
351
+ elseif Sys. ARCH === :powerpc64le || Sys. ARCH === :ppc64le
352
+ Clong (171 )
349
353
else
350
354
Clong (- 1 ) # sentinel for unknown syscall ID
351
355
end
@@ -360,10 +364,18 @@ const PR_TASK_PERF_EVENTS_ENABLE = Cint(32)
360
364
res = Base. llvmcall (""" %val = call i64 asm sideeffect "syscall", "={rax},{rax},{rdi},~{rcx},~{r11},~{memory}"(i64 %0, i64 %1)
361
365
ret i64 %val""" , Int64, Tuple{Int64, Int64}, SYS_prctl, Int64 (op))
362
366
return (res >= 0 ) ? nothing : throw (Base. SystemError (" prctl" , - res, nothing ))
367
+ elseif Sys. ARCH == :i686
368
+ res = Base. llvmcall (""" %val = call i32 asm sideeffect "int \$\$ 0x80", "={eax},{eax},{ebx},~{memory}"(i32 %0, i32 %1)
369
+ ret i32 %val""" , Int32, Tuple{Int32, Int32}, SYS_prctl, Int32 (op))
370
+ return (res >= 0 ) ? nothing : throw (Base. SystemError (" prctl" , - res, nothing ))
363
371
elseif Sys. ARCH == :aarch64
364
372
res = Base. llvmcall (""" %val = call i64 asm sideeffect "svc #0", "={x0},{x8},{x0},~{memory}"(i64 %0, i64 %1)
365
373
ret i64 %val""" , Int64, Tuple{Int64, Int64}, SYS_prctl, Int64 (op))
366
374
return (res >= 0 ) ? nothing : throw (Base. SystemError (" prctl" , - res, nothing ))
375
+ elseif Sys. ARCH == :arm
376
+ res = Base. llvmcall (""" %val = call i32 asm sideeffect "swi 0", "={r0},{r7},{r0},~{memory}"(i32 %0, i32 %1)
377
+ ret i32 %val""" , Int32, Tuple{Int32, Int32}, SYS_prctl, Int32 (op))
378
+ return (res >= 0 ) ? nothing : throw (Base. SystemError (" prctl" , - res, nothing ))
367
379
else
368
380
# syscall is lower overhead than calling libc's prctl
369
381
res = ccall (:syscall , Cint, (Clong, Clong... ), SYS_prctl, op)
0 commit comments