<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/sys/dev/speaker/spkr.c, branch main</title>
<subtitle>FreeBSD source tree</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/'/>
<entry>
<title>speaker(4): move static data to text</title>
<updated>2026-04-24T22:04:43+00:00</updated>
<author>
<name>Raphael 'kena' Poss</name>
<email>knz@thaumogen.net</email>
</author>
<published>2026-01-11T21:07:35+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=f31e6b198faa98c4f8a7b681b4e01218f8468411'/>
<id>f31e6b198faa98c4f8a7b681b4e01218f8468411</id>
<content type='text'>
Make this data const (it doesn't change) which will also move it to
a text section.

Signed-off-by: Raphael Poss &lt;knz@thaumogen.net&gt;
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1922
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Make this data const (it doesn't change) which will also move it to
a text section.

Signed-off-by: Raphael Poss &lt;knz@thaumogen.net&gt;
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1922
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "speaker(4): move static data to bss"</title>
<updated>2026-04-24T22:04:14+00:00</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2026-04-24T22:04:14+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=45a12d8a2656bdf38e95f8e481c72aea0db6997f'/>
<id>45a12d8a2656bdf38e95f8e481c72aea0db6997f</id>
<content type='text'>
This reverts commit 690ef95b3354ac7a80aa469fa7a8f15f07962f83.

The commit message was wrong.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 690ef95b3354ac7a80aa469fa7a8f15f07962f83.

The commit message was wrong.
</pre>
</div>
</content>
</entry>
<entry>
<title>speaker(4): enable concurrent opens from different threads</title>
<updated>2026-04-24T16:23:07+00:00</updated>
<author>
<name>Raphael 'kena' Poss</name>
<email>knz@thaumogen.net</email>
</author>
<published>2026-01-11T21:47:43+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=d76523a318d79767225ae020422a8f10046084af'/>
<id>d76523a318d79767225ae020422a8f10046084af</id>
<content type='text'>
Prior to this patch, a thread would get EBUSY on open(2) if another
thread had the speaker open.

With this patch, two or more threads/processes can use the speaker
device at the same time. When two or more threads write to the speaker
concurrently, individual melodies--single strings, as written by
write(2) or ioctl(2) with command SPKRTONE/SPKRTUNE--are played
atomically.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1922
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Prior to this patch, a thread would get EBUSY on open(2) if another
thread had the speaker open.

With this patch, two or more threads/processes can use the speaker
device at the same time. When two or more threads write to the speaker
concurrently, individual melodies--single strings, as written by
write(2) or ioctl(2) with command SPKRTONE/SPKRTUNE--are played
atomically.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1922
</pre>
</div>
</content>
</entry>
<entry>
<title>speaker(4): move static data to bss</title>
<updated>2026-04-24T16:23:06+00:00</updated>
<author>
<name>Raphael 'kena' Poss</name>
<email>knz@thaumogen.net</email>
</author>
<published>2026-01-11T21:07:35+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=690ef95b3354ac7a80aa469fa7a8f15f07962f83'/>
<id>690ef95b3354ac7a80aa469fa7a8f15f07962f83</id>
<content type='text'>
Signed-off-by: Raphael Poss &lt;knz@thaumogen.net&gt;
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1922
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Raphael Poss &lt;knz@thaumogen.net&gt;
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1922
</pre>
</div>
</content>
</entry>
<entry>
<title>speaker(4): one ioctl / write at a time</title>
<updated>2026-04-24T16:23:06+00:00</updated>
<author>
<name>Raphael 'kena' Poss</name>
<email>knz@thaumogen.net</email>
</author>
<published>2026-01-01T16:45:45+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=e2199dc33f16332b3e138da3059ba57c25ef713d'/>
<id>e2199dc33f16332b3e138da3059ba57c25ef713d</id>
<content type='text'>
If two processes are holding a spkr fd, we want orderly access to the
allocated tone buffer and the speaker itself.

Signed-off-by: Raphael Poss &lt;knz@thaumogen.net&gt;
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1922
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If two processes are holding a spkr fd, we want orderly access to the
allocated tone buffer and the speaker itself.

Signed-off-by: Raphael Poss &lt;knz@thaumogen.net&gt;
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1922
</pre>
</div>
</content>
</entry>
<entry>
<title>speaker(4): make spkropen thread-safe</title>
<updated>2026-04-24T16:23:06+00:00</updated>
<author>
<name>Raphael 'kena' Poss</name>
<email>knz@thaumogen.net</email>
</author>
<published>2026-01-01T16:34:44+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=a80ec2b51ac6b8f2588b927913e40c7a3d2862e6'/>
<id>a80ec2b51ac6b8f2588b927913e40c7a3d2862e6</id>
<content type='text'>
Signed-off-by: Raphael Poss &lt;knz@thaumogen.net&gt;
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1922
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Raphael Poss &lt;knz@thaumogen.net&gt;
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1922
</pre>
</div>
</content>
</entry>
<entry>
<title>speaker(4): drop NEEDGIANT</title>
<updated>2026-04-24T16:23:06+00:00</updated>
<author>
<name>Raphael Poss</name>
<email>knz@thaumogen.net</email>
</author>
<published>2025-12-10T20:12:22+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=43b7cf42d425abc84a1313b7eed933438804a051'/>
<id>43b7cf42d425abc84a1313b7eed933438804a051</id>
<content type='text'>
When the frequency configuration logic was moved to clock.c in 2008, a
mutex lock was added there (timer_spkr_setfreq) to serialize accesses
to the I/O register.

Since then, no more calls to disable/enable_intr were needed in spkr.c
than they were needed in the other callers to the same timer_spkr
functions in syscons / kern_cons, that is, not at all. This is because
there are no other accesses remaining in the kernel to the i8254
timers after boot than through clock.c.

For context, see commits
e46598588587b4897f6604489364f83fffd4d033
and
93f5134aaf829826dbcbea457bfeb27389761854.

Signed-off-by: Raphael Poss &lt;knz@thaumogen.net&gt;
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1922
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When the frequency configuration logic was moved to clock.c in 2008, a
mutex lock was added there (timer_spkr_setfreq) to serialize accesses
to the I/O register.

Since then, no more calls to disable/enable_intr were needed in spkr.c
than they were needed in the other callers to the same timer_spkr
functions in syscons / kern_cons, that is, not at all. This is because
there are no other accesses remaining in the kernel to the i8254
timers after boot than through clock.c.

For context, see commits
e46598588587b4897f6604489364f83fffd4d033
and
93f5134aaf829826dbcbea457bfeb27389761854.

Signed-off-by: Raphael Poss &lt;knz@thaumogen.net&gt;
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1922
</pre>
</div>
</content>
</entry>
<entry>
<title>speaker(4): Update outdated comments</title>
<updated>2026-04-24T16:23:06+00:00</updated>
<author>
<name>Raphael Poss</name>
<email>knz@thaumogen.net</email>
</author>
<published>2025-12-10T19:53:21+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=03a515e9890b0c6844457254e26dc34333b85127'/>
<id>03a515e9890b0c6844457254e26dc34333b85127</id>
<content type='text'>
The comments in tone() were referring to pre-2000 logic that does not
exist any more. This patch updates them.

Signed-off-by: Raphael Poss &lt;knz@thaumogen.net&gt;
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1922
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The comments in tone() were referring to pre-2000 logic that does not
exist any more. This patch updates them.

Signed-off-by: Raphael Poss &lt;knz@thaumogen.net&gt;
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1922
</pre>
</div>
</content>
</entry>
<entry>
<title>speaker: Use standard C bool</title>
<updated>2024-02-05T23:45:32+00:00</updated>
<author>
<name>John Baldwin</name>
<email>jhb@FreeBSD.org</email>
</author>
<published>2024-02-05T23:40:34+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=c83d83206a39c7c47139acac46885bea54ee4876'/>
<id>c83d83206a39c7c47139acac46885bea54ee4876</id>
<content type='text'>
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D43717
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D43717
</pre>
</div>
</content>
</entry>
<entry>
<title>sys: Automated cleanup of cdefs and other formatting</title>
<updated>2023-11-27T05:24:00+00:00</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-11-24T20:12:57+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=fdafd315ad0d0f28a11b9fb4476a9ab059c62b92'/>
<id>fdafd315ad0d0f28a11b9fb4476a9ab059c62b92</id>
<content type='text'>
Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

Remove /^#if.*\n#endif.*\n#include\s+&lt;sys/cdefs.h&gt;.*\n/
Remove /\n+#include\s+&lt;sys/cdefs.h&gt;.*\n+#if.*\n#endif.*\n+/
Remove /\n+#if.*\n#endif.*\n+/
Remove /^#if.*\n#endif.*\n/
Remove /\n+#include\s+&lt;sys/cdefs.h&gt;\n#include\s+&lt;sys/types.h&gt;/
Remove /\n+#include\s+&lt;sys/cdefs.h&gt;\n#include\s+&lt;sys/param.h&gt;/
Remove /\n+#include\s+&lt;sys/cdefs.h&gt;\n#include\s+&lt;sys/capsicum.h&gt;/

Sponsored by:		Netflix
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

Remove /^#if.*\n#endif.*\n#include\s+&lt;sys/cdefs.h&gt;.*\n/
Remove /\n+#include\s+&lt;sys/cdefs.h&gt;.*\n+#if.*\n#endif.*\n+/
Remove /\n+#if.*\n#endif.*\n+/
Remove /^#if.*\n#endif.*\n/
Remove /\n+#include\s+&lt;sys/cdefs.h&gt;\n#include\s+&lt;sys/types.h&gt;/
Remove /\n+#include\s+&lt;sys/cdefs.h&gt;\n#include\s+&lt;sys/param.h&gt;/
Remove /\n+#include\s+&lt;sys/cdefs.h&gt;\n#include\s+&lt;sys/capsicum.h&gt;/

Sponsored by:		Netflix
</pre>
</div>
</content>
</entry>
</feed>
