[Git][hardenedbsd/HardenedBSD][hardened/15-stable/main] 4 commits: sigreturn.2: refresh the man page

0 views
Skip to first unread message

HardenedBSD Services (@hardenedbsd-services)

unread,
Mar 14, 2026, 2:00:02 PM (2 days ago) Mar 14
to src-com...@hardenedbsd.org


HardenedBSD Services pushed to branch hardened/15-stable/main at HardenedBSD / HardenedBSD


Commits:
75668923 by Konstantin Belousov at 2026-03-14T14:02:34+02:00
sigreturn.2: refresh the man page

(cherry picked from commit 9da4a804f0916b24519b8baa7ed460a7ba23d8c8)

- - - - -
c4e303fb by Christos Margiolis at 2026-03-14T15:03:30+01:00
virtual_oss: Use virtual_oss_delay_ns() to avoid duplication

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

(cherry picked from commit 3a410851bf02c247e71bcd06fdeec2706c6b6070)

- - - - -
9c49c393 by Christos Margiolis at 2026-03-14T15:03:30+01:00
virtual_oss: Use virtual_oss_timestamp() to avoid duplication

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

(cherry picked from commit e75c8faf277dded0a80d469cb8182583716a2211)

- - - - -
d20bc0e0 by HardenedBSD Sync Services at 2026-03-14T12:03:03-06:00
Merge branch 'freebsd/15-stable/main' into hardened/15-stable/main

- - - - -


2 changed files:

- lib/libsys/sigreturn.2
- usr.sbin/virtual_oss/virtual_oss/virtual_oss.c


Changes:

=====================================
lib/libsys/sigreturn.2
=====================================
@@ -25,7 +25,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd September 6, 2013
+.Dd March 11, 2026
.Dt SIGRETURN 2
.Os
.Sh NAME
@@ -47,17 +47,25 @@ The thread's signal mask and stack status are
restored from the context structure pointed to by
.Fa scp .
The system call does not return;
-the users stack pointer, frame pointer, argument pointer,
-and processor status longword are restored from the context.
-Execution resumes at the specified pc.
-This system call is used by the trampoline code and
-.Xr longjmp 3
+the whole userspace context as specified by
+.Fa scp ,
+including the userspace stack pointer, all general-purpose registers,
+coprocessor state, process status register, and program counter
+are restored from the context.
+Execution resumes at the program counter from the specified context.
+.Pp
+This system call is used by the kernel-provided signal trampoline code,
+located in the virtual DSO (VDSO) on some architectures or as raw code
+in the shared page if VDSO is not provided,
when returning from a signal to the previously executing program.
.Sh RETURN VALUES
If successful, the system call does not return.
-Otherwise, a value of -1 is returned and
+Otherwise, a value of -1 may be returned, with
.Va errno
-is set to indicate the error.
+set to indicate the error.
+Some conditions detected by hardware result in the delivery of
+a synchronous trap signal to the thread, in addition to or instead of
+setting the system call error code.
.Sh ERRORS
The
.Fn sigreturn


=====================================
usr.sbin/virtual_oss/virtual_oss/virtual_oss.c
=====================================
@@ -39,6 +39,18 @@
#include "backend.h"
#include "int.h"

+uint64_t
+virtual_oss_timestamp(void)
+{
+ struct timespec ts;
+ uint64_t nsec;
+
+ clock_gettime(CLOCK_MONOTONIC, &ts);
+
+ nsec = ts.tv_sec * 1000000000ULL + ts.tv_nsec;
+ return (nsec);
+}
+
uint64_t
virtual_oss_delay_ns(void)
{
@@ -54,34 +66,16 @@ virtual_oss_delay_ns(void)
void
virtual_oss_wait(void)
{
- struct timespec ts;
uint64_t delay;
uint64_t nsec;

- clock_gettime(CLOCK_MONOTONIC, &ts);
+ nsec = virtual_oss_timestamp();

- nsec = ts.tv_sec * 1000000000ULL + ts.tv_nsec;
-
- /* TODO use virtual_oss_delay_ns() */
- delay = voss_dsp_samples;
- delay *= 1000000000ULL;
- delay /= voss_dsp_sample_rate;
+ delay = virtual_oss_delay_ns();

usleep((delay - (nsec % delay)) / 1000);
}

-uint64_t
-virtual_oss_timestamp(void)
-{
- struct timespec ts;
- uint64_t nsec;
-
- clock_gettime(CLOCK_MONOTONIC, &ts);
-
- nsec = ts.tv_sec * 1000000000ULL + ts.tv_nsec;
- return (nsec);
-}
-
static size_t
vclient_read_linear(struct virtual_client *pvc, struct virtual_ring *pvr,
int64_t *dst, size_t total) __requires_exclusive(atomic_mtx)



View it on GitLab: https://git.hardenedbsd.org/hardenedbsd/HardenedBSD/-/compare/7df7171dfac381159db7b0d685e52e40fe6ce6a6...d20bc0e0511a22fb485086f6e9d8d366cc7be136

--
View it on GitLab: https://git.hardenedbsd.org/hardenedbsd/HardenedBSD/-/compare/7df7171dfac381159db7b0d685e52e40fe6ce6a6...d20bc0e0511a22fb485086f6e9d8d366cc7be136
You're receiving this email because of your account on git.hardenedbsd.org.


Reply all
Reply to author
Forward
0 new messages