Page MenuHomeFreeBSD

linux(4): Preserve %rcx (return address) like a Linux do
ClosedPublic

Authored by dchagin on May 18 2023, 7:30 PM.
Referenced Files
Unknown Object (File)
Sat, Nov 8, 12:04 AM
Unknown Object (File)
Wed, Nov 5, 9:35 AM
Unknown Object (File)
Sat, Nov 1, 3:44 AM
Unknown Object (File)
Wed, Oct 29, 10:54 PM
Unknown Object (File)
Wed, Oct 29, 10:54 PM
Unknown Object (File)
Wed, Oct 29, 10:52 PM
Unknown Object (File)
Oct 28 2025, 1:41 AM
Unknown Object (File)
Oct 7 2025, 9:04 PM
Subscribers

Details

Summary

Perhaps, this does not makes much sense as destroyng %rcx declared by
the x86_64 Linux syscall ABI. However,:
a) if we get a signal while we are in the kernel, we should restore

tf_rcx when preparing machine context for signal handlers.

b) the Linux world is strange, someone can depend on %rcx value

after syscall, something like go.

MFC after: 1 week

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable