Skip to content

Commit 2d9fb56

Browse files
authored
Fix the noinfo signal-handler return functions on x86 and arm. (#138)
1 parent 84c6cf8 commit 2d9fb56

2 files changed

Lines changed: 6 additions & 20 deletions

File tree

src/arch/arm.rs

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -311,25 +311,18 @@ fn test_rt_sigreturn() {
311311
assert_eq!(__NR_rt_sigreturn, 173);
312312
}
313313

314-
/// Invoke the appropriate system call to return control from a signal
315-
/// handler that does not use `SA_SIGINFO`.
316-
///
317-
/// # Safety
318-
///
319-
/// This function must never be called other than by the `sa_restorer`
320-
/// mechanism.
321314
#[cfg(feature = "signal")]
322315
naked!(
323316
"
324-
Invoke the `__NR_sigreturn` system call to return control from a signal
325-
handler.
317+
Invoke the appropriate system call to return control from a signal
318+
handler that does not use `SA_SIGINFO`.
326319
327320
# Safety
328321
329322
This function must never be called other than by the `sa_restorer`
330323
mechanism.
331324
";
332-
pub(super) fn return_from_signal_handler() -> ();
325+
pub(super) fn return_from_signal_handler_noinfo() -> ();
333326

334327
"mov r7, 119", // TODO: use {__NR_sigreturn}
335328
"swi 0",

src/arch/x86.rs

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -402,25 +402,18 @@ fn test_rt_sigreturn() {
402402
assert_eq!(__NR_rt_sigreturn, 173);
403403
}
404404

405-
/// Invoke the appropriate system call to return control from a signal
406-
/// handler that does not use `SA_SIGINFO`.
407-
///
408-
/// # Safety
409-
///
410-
/// This function must never be called other than by the `sa_restorer`
411-
/// mechanism.
412405
#[cfg(feature = "signal")]
413406
naked!(
414407
"
415-
Invoke the `__NR_sigreturn` system call to return control from a signal
416-
handler.
408+
Invoke the appropriate system call to return control from a signal
409+
handler that does not use `SA_SIGINFO`.
417410
418411
# Safety
419412
420413
This function must never be called other than by the `sa_restorer`
421414
mechanism.
422415
";
423-
pub(super) fn return_from_signal_handler() -> ();
416+
pub(super) fn return_from_signal_handler_noinfo() -> ();
424417

425418
"pop eax",
426419
"mov eax, 119", // TODO: use {__NR_sigreturn}

0 commit comments

Comments
 (0)