History log of /openbsd-current/sys/dev/pci/bktr/bktr_core.c
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.44 22-Jun-2024 jsg

remove space between function names and argument list


Revision tags: OPENBSD_7_1_BASE OPENBSD_7_2_BASE OPENBSD_7_3_BASE OPENBSD_7_4_BASE OPENBSD_7_5_BASE
# 1.43 09-Jan-2022 jsg

spelling
feedback and ok tb@ jmc@ ok ratchov@


Revision tags: OPENBSD_6_8_BASE OPENBSD_6_9_BASE OPENBSD_7_0_BASE
# 1.42 29-May-2020 deraadt

dev/rndvar.h no longer has statistical interfaces (removed during various
conversion steps). it only contains kernel prototypes for 4 interfaces,
all of which legitimately belong in sys/systm.h, which are already included
by all enqueue_randomness() users.


Revision tags: OPENBSD_6_7_BASE
# 1.41 16-Dec-2019 cheloha

bktr(4): tsleep(9) -> tsleep_nsec(9)

ok deraadt@


Revision tags: OPENBSD_6_5_BASE OPENBSD_6_6_BASE
# 1.40 22-Nov-2018 fcambus

Remove useless assignment, value is overwritten right after being set.

Both assignements are in our tree since the driver got imported from
FreeBSD in 2001 and remained untouched since import.

The second assignment in its current form got introduced in FreeBSD in
1997 with r29233 [1], when syncinc the driver. The first assignment got
removed in 2017 with r314147 [2].

[1]: https://svnweb.freebsd.org/base?view=revision&revision=29233
[2]: https://svnweb.freebsd.org/base?view=revision&revision=314147

Coverity CID 1453008.

OK deraadt@


Revision tags: OPENBSD_6_4_BASE
# 1.39 28-Apr-2018 jasper

replace add_*_randomness with enqueue_randomness()

this gets rid of the source annotation which doesn't really add
anything other than adding complexitiy. randomess is generally
good enough that the few extra bits that the source type would
add are not worth it.

ok mikeb@ deraadt@


Revision tags: OPENBSD_6_0_BASE OPENBSD_6_1_BASE OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.38 14-Mar-2016 krw

Change a bunch of (<blah> *)0 to NULL.

ok beck@ deraadt@


Revision tags: OPENBSD_5_9_BASE
# 1.37 15-Feb-2016 stefan

Convert to uiomove. From Martin Natano.


Revision tags: OPENBSD_5_8_BASE
# 1.36 14-Mar-2015 jsg

Remove some includes include-what-you-use claims don't
have any direct symbols used. Tested for indirect use by compiling
amd64/i386/sparc64 kernels.

ok tedu@ deraadt@


Revision tags: OPENBSD_5_7_BASE
# 1.35 10-Feb-2015 miod

First step towards making uiomove() take a size_t size argument:
- rename uiomove() to uiomovei() and update all its users.
- introduce uiomove(), which is similar to uiomovei() but with a size_t.
- rewrite uiomovei() as an uiomove() wrapper.
ok kettenis@


# 1.34 16-Dec-2014 tedu

primary change: move uvm_vnode out of vnode, keeping only a pointer.
objective: vnode.h doesn't include uvm_extern.h anymore.
followup changes: include uvm_extern.h or lock.h where necessary.
ok and help from deraadt


Revision tags: OPENBSD_5_6_BASE
# 1.33 04-May-2014 sf

format string fixes for bus_addr_t and bus_size_t

bus_addr_t and bus_size_t are u_long everywhere

ok kettenis@


Revision tags: OPENBSD_5_5_BASE
# 1.32 26-Nov-2013 deraadt

1 << 31 cleanup. Eitan Adler pointed out that there has been a
resurrection of the bad idiom in the tree.
sufficient review by miod, kettenis, tedu


# 1.31 04-Oct-2013 brad

Fix tuner ioctl TVTUNER_SETFREQ after rev 1.30.

Pointed out by Pedro
ok krw@


Revision tags: OPENBSD_5_4_BASE
# 1.30 05-Jul-2013 brad

Use tmp_int to be able to pass back the -1 upon error and check for it properly
but the value passed forward throughout the ioctl handler otherwise is an
unsigned value.

Pointed out by LLVM.

bktr_core.c:1737:13: error: comparison of unsigned expression < 0 is always false
bktr_core.c:1779:13: error: comparison of unsigned expression < 0 is always false
bktr_core.c:2063:16: error: comparison of unsigned expression < 0 is always false

ok krw@


Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.29 06-Aug-2010 miod

don't return (potential errno) + (potential errno), instead only perform
the second errno-capable function if the first one didn't fail.
ok deraadt@


Revision tags: OPENBSD_4_7_BASE
# 1.28 09-Nov-2009 nicm

Every selwakeup() should have a matching KNOTE() (even if kqueue isn't
supported it doesn't do any harm), so put the KNOTE() in selwakeup() itself and
remove it from any occurences where both are used, except one for kqueue itself
and one in sys_pipe.c (where the selwakeup is under a PIPE_SEL flag).

Based on a diff from tedu.

ok deraadt


# 1.27 31-Oct-2009 deraadt

Add missing KNOTE() calls after selwakeup(), until we decide if the KNOTE()
calls can go directly into selwakeup() safely
long discussion with nicm, murmers of consent from tedu and miod, noone
else seems to care of kqueue is busted as long as it makes their sockets
move data fast... pretty sad.


Revision tags: OPENBSD_4_3_BASE OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE
# 1.26 26-Nov-2007 martynas

typos; ok jmc@
sys/netinet/in_pcb.c and sys/net/bridgestp.c ok henning@
sys/dev/pci/bktr/* ok jakemsr@


# 1.25 15-Sep-2007 martin

replace ctob and btoc with ptoa and atop respectively

help and ok miod@ thib@


Revision tags: OPENBSD_4_2_BASE
# 1.24 25-Jul-2007 art

Back out the tracking of procs in struct selinfo. There's one serious
bug in the code, but as soon as I try to fix it, it seems to trigger
some other bugs. Instead of trying to figure out what's going on
while everyone suffers, it's better to back out and figure out
the bugs outside the tree.


# 1.23 11-Jun-2007 robert

remove all FreeBSD/NetBSD specific code because we will
never use them and the code is much more readable now

ok jakemsr@


# 1.22 24-Mar-2007 art

Kill the horrible hack of storing the pid in struct selinfo.

Instead, keep the proc pointer in it and put the selinfo on a list
in struct proc in selrecord. Then clean up the list when leaving
sys_select and sys_poll.

miod@ ok, testing by many, including Bobs spamd boxes.


Revision tags: OPENBSD_4_1_BASE
# 1.21 11-Feb-2007 miod

Remove _KERNEL_OPT leftovers.


# 1.20 29-Dec-2006 pedro

Avoid void * arithmetic, okay deraadt@, suggestions from millert@


Revision tags: OPENBSD_3_9_BASE OPENBSD_4_0_BASE
# 1.19 20-Jan-2006 millert

Include sys/stdint.h instead of defining uintptr_t ourselves.
OK mickey@


# 1.18 15-Nov-2005 robert

Undefine STATUS_SUM, because it is not needed, and it makes
bktr(4) work on alpha.

ok mickey@


Revision tags: OPENBSD_3_8_BASE
# 1.17 23-Jun-2005 robert

Use proper type for 32 bit entity. s/long/int
This is needed for bktr(4) to work on sparc64.

testing and ok by mickey and Jacob Meuser <jakemsr@jakemsr.com>


# 1.16 22-Jun-2005 mickey

apparently i got the last one reversed; from jakemsr@


# 1.15 19-May-2005 mickey

no need for BKTR_NO_OPEN_RESET option now that all tuners sw has been fixed; from jakemsr@


# 1.14 14-Apr-2005 mickey

do not reset tuner and audio settings on open/close; from jakemsr@


Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE
# 1.13 29-Jun-2004 mickey

do not use u_long for 32bit data; found by Jacob Meuser


Revision tags: SMP_SYNC_A SMP_SYNC_B
# 1.12 24-May-2004 mickey

cummulative update from freebsd an netbsd:
PCI_VENROD_PINNACLE -> PCI_VENDOR_PINNACLE_ALT;
correct brightness ioctl; missing htole32s;
fix "set chroma comb" command in yuv422_prog();
use defines instead of magic numbers; fix statics and comments.
from jakemsr@jakemsr.com


Revision tags: OPENBSD_3_3_BASE OPENBSD_3_4_BASE OPENBSD_3_5_BASE UBC_SYNC_A
# 1.11 12-Mar-2003 mickey

a missing htole32 and a pasto; from netbsd


# 1.10 11-Feb-2003 mickey

be consistant on Hz vs hz


# 1.9 21-Jan-2003 mickey

fix cut and paste piece in dma programming, caused jumpieness in animation; good diagnose by Kamil Andrusz <wizz@mniam.net>


# 1.8 15-Jan-2003 art

Get rid of vm_offset_t in bktr.


# 1.7 05-Jan-2003 mickey

proper endianess handling in 16 and 32 bit video modes, 24 bit is not supported by the card


# 1.6 05-Jan-2003 mickey

endianess-free, works on macppc now, except for the fb endianess


Revision tags: OPENBSD_3_2_BASE UBC_SYNC_B
# 1.5 30-Apr-2002 mickey

constify a few structs


Revision tags: OPENBSD_3_1_BASE
# 1.4 14-Mar-2002 millert

Final __P removal plus some cosmetic fixups


Revision tags: UBC_BASE
# 1.3 06-Nov-2001 miod

branches: 1.3.2;
Replace inclusion of <vm/foo.h> with the correct <uvm/bar.h> when necessary.
(Look ma, I might have broken the tree)


Revision tags: OPENBSD_3_0_BASE
# 1.2 22-Sep-2001 mickey

supply some entropy from here


Revision tags: OPENBSD_2_9_BASE
# 1.1 28-Mar-2001 fgsch

branches: 1.1.4;
Latest bktr driver from FreeBSD; thanks to Andres Gunnarsson
<andreas@crt.se> for testing.


# 1.43 09-Jan-2022 jsg

spelling
feedback and ok tb@ jmc@ ok ratchov@


Revision tags: OPENBSD_6_8_BASE OPENBSD_6_9_BASE OPENBSD_7_0_BASE
# 1.42 29-May-2020 deraadt

dev/rndvar.h no longer has statistical interfaces (removed during various
conversion steps). it only contains kernel prototypes for 4 interfaces,
all of which legitimately belong in sys/systm.h, which are already included
by all enqueue_randomness() users.


Revision tags: OPENBSD_6_7_BASE
# 1.41 16-Dec-2019 cheloha

bktr(4): tsleep(9) -> tsleep_nsec(9)

ok deraadt@


Revision tags: OPENBSD_6_5_BASE OPENBSD_6_6_BASE
# 1.40 22-Nov-2018 fcambus

Remove useless assignment, value is overwritten right after being set.

Both assignements are in our tree since the driver got imported from
FreeBSD in 2001 and remained untouched since import.

The second assignment in its current form got introduced in FreeBSD in
1997 with r29233 [1], when syncinc the driver. The first assignment got
removed in 2017 with r314147 [2].

[1]: https://svnweb.freebsd.org/base?view=revision&revision=29233
[2]: https://svnweb.freebsd.org/base?view=revision&revision=314147

Coverity CID 1453008.

OK deraadt@


Revision tags: OPENBSD_6_4_BASE
# 1.39 28-Apr-2018 jasper

replace add_*_randomness with enqueue_randomness()

this gets rid of the source annotation which doesn't really add
anything other than adding complexitiy. randomess is generally
good enough that the few extra bits that the source type would
add are not worth it.

ok mikeb@ deraadt@


Revision tags: OPENBSD_6_0_BASE OPENBSD_6_1_BASE OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.38 14-Mar-2016 krw

Change a bunch of (<blah> *)0 to NULL.

ok beck@ deraadt@


Revision tags: OPENBSD_5_9_BASE
# 1.37 15-Feb-2016 stefan

Convert to uiomove. From Martin Natano.


Revision tags: OPENBSD_5_8_BASE
# 1.36 14-Mar-2015 jsg

Remove some includes include-what-you-use claims don't
have any direct symbols used. Tested for indirect use by compiling
amd64/i386/sparc64 kernels.

ok tedu@ deraadt@


Revision tags: OPENBSD_5_7_BASE
# 1.35 10-Feb-2015 miod

First step towards making uiomove() take a size_t size argument:
- rename uiomove() to uiomovei() and update all its users.
- introduce uiomove(), which is similar to uiomovei() but with a size_t.
- rewrite uiomovei() as an uiomove() wrapper.
ok kettenis@


# 1.34 16-Dec-2014 tedu

primary change: move uvm_vnode out of vnode, keeping only a pointer.
objective: vnode.h doesn't include uvm_extern.h anymore.
followup changes: include uvm_extern.h or lock.h where necessary.
ok and help from deraadt


Revision tags: OPENBSD_5_6_BASE
# 1.33 04-May-2014 sf

format string fixes for bus_addr_t and bus_size_t

bus_addr_t and bus_size_t are u_long everywhere

ok kettenis@


Revision tags: OPENBSD_5_5_BASE
# 1.32 26-Nov-2013 deraadt

1 << 31 cleanup. Eitan Adler pointed out that there has been a
resurrection of the bad idiom in the tree.
sufficient review by miod, kettenis, tedu


# 1.31 04-Oct-2013 brad

Fix tuner ioctl TVTUNER_SETFREQ after rev 1.30.

Pointed out by Pedro
ok krw@


Revision tags: OPENBSD_5_4_BASE
# 1.30 05-Jul-2013 brad

Use tmp_int to be able to pass back the -1 upon error and check for it properly
but the value passed forward throughout the ioctl handler otherwise is an
unsigned value.

Pointed out by LLVM.

bktr_core.c:1737:13: error: comparison of unsigned expression < 0 is always false
bktr_core.c:1779:13: error: comparison of unsigned expression < 0 is always false
bktr_core.c:2063:16: error: comparison of unsigned expression < 0 is always false

ok krw@


Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.29 06-Aug-2010 miod

don't return (potential errno) + (potential errno), instead only perform
the second errno-capable function if the first one didn't fail.
ok deraadt@


Revision tags: OPENBSD_4_7_BASE
# 1.28 09-Nov-2009 nicm

Every selwakeup() should have a matching KNOTE() (even if kqueue isn't
supported it doesn't do any harm), so put the KNOTE() in selwakeup() itself and
remove it from any occurences where both are used, except one for kqueue itself
and one in sys_pipe.c (where the selwakeup is under a PIPE_SEL flag).

Based on a diff from tedu.

ok deraadt


# 1.27 31-Oct-2009 deraadt

Add missing KNOTE() calls after selwakeup(), until we decide if the KNOTE()
calls can go directly into selwakeup() safely
long discussion with nicm, murmers of consent from tedu and miod, noone
else seems to care of kqueue is busted as long as it makes their sockets
move data fast... pretty sad.


Revision tags: OPENBSD_4_3_BASE OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE
# 1.26 26-Nov-2007 martynas

typos; ok jmc@
sys/netinet/in_pcb.c and sys/net/bridgestp.c ok henning@
sys/dev/pci/bktr/* ok jakemsr@


# 1.25 15-Sep-2007 martin

replace ctob and btoc with ptoa and atop respectively

help and ok miod@ thib@


Revision tags: OPENBSD_4_2_BASE
# 1.24 25-Jul-2007 art

Back out the tracking of procs in struct selinfo. There's one serious
bug in the code, but as soon as I try to fix it, it seems to trigger
some other bugs. Instead of trying to figure out what's going on
while everyone suffers, it's better to back out and figure out
the bugs outside the tree.


# 1.23 11-Jun-2007 robert

remove all FreeBSD/NetBSD specific code because we will
never use them and the code is much more readable now

ok jakemsr@


# 1.22 24-Mar-2007 art

Kill the horrible hack of storing the pid in struct selinfo.

Instead, keep the proc pointer in it and put the selinfo on a list
in struct proc in selrecord. Then clean up the list when leaving
sys_select and sys_poll.

miod@ ok, testing by many, including Bobs spamd boxes.


Revision tags: OPENBSD_4_1_BASE
# 1.21 11-Feb-2007 miod

Remove _KERNEL_OPT leftovers.


# 1.20 29-Dec-2006 pedro

Avoid void * arithmetic, okay deraadt@, suggestions from millert@


Revision tags: OPENBSD_3_9_BASE OPENBSD_4_0_BASE
# 1.19 20-Jan-2006 millert

Include sys/stdint.h instead of defining uintptr_t ourselves.
OK mickey@


# 1.18 15-Nov-2005 robert

Undefine STATUS_SUM, because it is not needed, and it makes
bktr(4) work on alpha.

ok mickey@


Revision tags: OPENBSD_3_8_BASE
# 1.17 23-Jun-2005 robert

Use proper type for 32 bit entity. s/long/int
This is needed for bktr(4) to work on sparc64.

testing and ok by mickey and Jacob Meuser <jakemsr@jakemsr.com>


# 1.16 22-Jun-2005 mickey

apparently i got the last one reversed; from jakemsr@


# 1.15 19-May-2005 mickey

no need for BKTR_NO_OPEN_RESET option now that all tuners sw has been fixed; from jakemsr@


# 1.14 14-Apr-2005 mickey

do not reset tuner and audio settings on open/close; from jakemsr@


Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE
# 1.13 29-Jun-2004 mickey

do not use u_long for 32bit data; found by Jacob Meuser


Revision tags: SMP_SYNC_A SMP_SYNC_B
# 1.12 24-May-2004 mickey

cummulative update from freebsd an netbsd:
PCI_VENROD_PINNACLE -> PCI_VENDOR_PINNACLE_ALT;
correct brightness ioctl; missing htole32s;
fix "set chroma comb" command in yuv422_prog();
use defines instead of magic numbers; fix statics and comments.
from jakemsr@jakemsr.com


Revision tags: OPENBSD_3_3_BASE OPENBSD_3_4_BASE OPENBSD_3_5_BASE UBC_SYNC_A
# 1.11 12-Mar-2003 mickey

a missing htole32 and a pasto; from netbsd


# 1.10 11-Feb-2003 mickey

be consistant on Hz vs hz


# 1.9 21-Jan-2003 mickey

fix cut and paste piece in dma programming, caused jumpieness in animation; good diagnose by Kamil Andrusz <wizz@mniam.net>


# 1.8 15-Jan-2003 art

Get rid of vm_offset_t in bktr.


# 1.7 05-Jan-2003 mickey

proper endianess handling in 16 and 32 bit video modes, 24 bit is not supported by the card


# 1.6 05-Jan-2003 mickey

endianess-free, works on macppc now, except for the fb endianess


Revision tags: OPENBSD_3_2_BASE UBC_SYNC_B
# 1.5 30-Apr-2002 mickey

constify a few structs


Revision tags: OPENBSD_3_1_BASE
# 1.4 14-Mar-2002 millert

Final __P removal plus some cosmetic fixups


Revision tags: UBC_BASE
# 1.3 06-Nov-2001 miod

branches: 1.3.2;
Replace inclusion of <vm/foo.h> with the correct <uvm/bar.h> when necessary.
(Look ma, I might have broken the tree)


Revision tags: OPENBSD_3_0_BASE
# 1.2 22-Sep-2001 mickey

supply some entropy from here


Revision tags: OPENBSD_2_9_BASE
# 1.1 28-Mar-2001 fgsch

branches: 1.1.4;
Latest bktr driver from FreeBSD; thanks to Andres Gunnarsson
<andreas@crt.se> for testing.


# 1.42 29-May-2020 deraadt

dev/rndvar.h no longer has statistical interfaces (removed during various
conversion steps). it only contains kernel prototypes for 4 interfaces,
all of which legitimately belong in sys/systm.h, which are already included
by all enqueue_randomness() users.


Revision tags: OPENBSD_6_7_BASE
# 1.41 16-Dec-2019 cheloha

bktr(4): tsleep(9) -> tsleep_nsec(9)

ok deraadt@


Revision tags: OPENBSD_6_5_BASE OPENBSD_6_6_BASE
# 1.40 22-Nov-2018 fcambus

Remove useless assignment, value is overwritten right after being set.

Both assignements are in our tree since the driver got imported from
FreeBSD in 2001 and remained untouched since import.

The second assignment in its current form got introduced in FreeBSD in
1997 with r29233 [1], when syncinc the driver. The first assignment got
removed in 2017 with r314147 [2].

[1]: https://svnweb.freebsd.org/base?view=revision&revision=29233
[2]: https://svnweb.freebsd.org/base?view=revision&revision=314147

Coverity CID 1453008.

OK deraadt@


Revision tags: OPENBSD_6_4_BASE
# 1.39 28-Apr-2018 jasper

replace add_*_randomness with enqueue_randomness()

this gets rid of the source annotation which doesn't really add
anything other than adding complexitiy. randomess is generally
good enough that the few extra bits that the source type would
add are not worth it.

ok mikeb@ deraadt@


Revision tags: OPENBSD_6_0_BASE OPENBSD_6_1_BASE OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.38 14-Mar-2016 krw

Change a bunch of (<blah> *)0 to NULL.

ok beck@ deraadt@


Revision tags: OPENBSD_5_9_BASE
# 1.37 15-Feb-2016 stefan

Convert to uiomove. From Martin Natano.


Revision tags: OPENBSD_5_8_BASE
# 1.36 14-Mar-2015 jsg

Remove some includes include-what-you-use claims don't
have any direct symbols used. Tested for indirect use by compiling
amd64/i386/sparc64 kernels.

ok tedu@ deraadt@


Revision tags: OPENBSD_5_7_BASE
# 1.35 10-Feb-2015 miod

First step towards making uiomove() take a size_t size argument:
- rename uiomove() to uiomovei() and update all its users.
- introduce uiomove(), which is similar to uiomovei() but with a size_t.
- rewrite uiomovei() as an uiomove() wrapper.
ok kettenis@


# 1.34 16-Dec-2014 tedu

primary change: move uvm_vnode out of vnode, keeping only a pointer.
objective: vnode.h doesn't include uvm_extern.h anymore.
followup changes: include uvm_extern.h or lock.h where necessary.
ok and help from deraadt


Revision tags: OPENBSD_5_6_BASE
# 1.33 04-May-2014 sf

format string fixes for bus_addr_t and bus_size_t

bus_addr_t and bus_size_t are u_long everywhere

ok kettenis@


Revision tags: OPENBSD_5_5_BASE
# 1.32 26-Nov-2013 deraadt

1 << 31 cleanup. Eitan Adler pointed out that there has been a
resurrection of the bad idiom in the tree.
sufficient review by miod, kettenis, tedu


# 1.31 04-Oct-2013 brad

Fix tuner ioctl TVTUNER_SETFREQ after rev 1.30.

Pointed out by Pedro
ok krw@


Revision tags: OPENBSD_5_4_BASE
# 1.30 05-Jul-2013 brad

Use tmp_int to be able to pass back the -1 upon error and check for it properly
but the value passed forward throughout the ioctl handler otherwise is an
unsigned value.

Pointed out by LLVM.

bktr_core.c:1737:13: error: comparison of unsigned expression < 0 is always false
bktr_core.c:1779:13: error: comparison of unsigned expression < 0 is always false
bktr_core.c:2063:16: error: comparison of unsigned expression < 0 is always false

ok krw@


Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.29 06-Aug-2010 miod

don't return (potential errno) + (potential errno), instead only perform
the second errno-capable function if the first one didn't fail.
ok deraadt@


Revision tags: OPENBSD_4_7_BASE
# 1.28 09-Nov-2009 nicm

Every selwakeup() should have a matching KNOTE() (even if kqueue isn't
supported it doesn't do any harm), so put the KNOTE() in selwakeup() itself and
remove it from any occurences where both are used, except one for kqueue itself
and one in sys_pipe.c (where the selwakeup is under a PIPE_SEL flag).

Based on a diff from tedu.

ok deraadt


# 1.27 31-Oct-2009 deraadt

Add missing KNOTE() calls after selwakeup(), until we decide if the KNOTE()
calls can go directly into selwakeup() safely
long discussion with nicm, murmers of consent from tedu and miod, noone
else seems to care of kqueue is busted as long as it makes their sockets
move data fast... pretty sad.


Revision tags: OPENBSD_4_3_BASE OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE
# 1.26 26-Nov-2007 martynas

typos; ok jmc@
sys/netinet/in_pcb.c and sys/net/bridgestp.c ok henning@
sys/dev/pci/bktr/* ok jakemsr@


# 1.25 15-Sep-2007 martin

replace ctob and btoc with ptoa and atop respectively

help and ok miod@ thib@


Revision tags: OPENBSD_4_2_BASE
# 1.24 25-Jul-2007 art

Back out the tracking of procs in struct selinfo. There's one serious
bug in the code, but as soon as I try to fix it, it seems to trigger
some other bugs. Instead of trying to figure out what's going on
while everyone suffers, it's better to back out and figure out
the bugs outside the tree.


# 1.23 11-Jun-2007 robert

remove all FreeBSD/NetBSD specific code because we will
never use them and the code is much more readable now

ok jakemsr@


# 1.22 24-Mar-2007 art

Kill the horrible hack of storing the pid in struct selinfo.

Instead, keep the proc pointer in it and put the selinfo on a list
in struct proc in selrecord. Then clean up the list when leaving
sys_select and sys_poll.

miod@ ok, testing by many, including Bobs spamd boxes.


Revision tags: OPENBSD_4_1_BASE
# 1.21 11-Feb-2007 miod

Remove _KERNEL_OPT leftovers.


# 1.20 29-Dec-2006 pedro

Avoid void * arithmetic, okay deraadt@, suggestions from millert@


Revision tags: OPENBSD_3_9_BASE OPENBSD_4_0_BASE
# 1.19 20-Jan-2006 millert

Include sys/stdint.h instead of defining uintptr_t ourselves.
OK mickey@


# 1.18 15-Nov-2005 robert

Undefine STATUS_SUM, because it is not needed, and it makes
bktr(4) work on alpha.

ok mickey@


Revision tags: OPENBSD_3_8_BASE
# 1.17 23-Jun-2005 robert

Use proper type for 32 bit entity. s/long/int
This is needed for bktr(4) to work on sparc64.

testing and ok by mickey and Jacob Meuser <jakemsr@jakemsr.com>


# 1.16 22-Jun-2005 mickey

apparently i got the last one reversed; from jakemsr@


# 1.15 19-May-2005 mickey

no need for BKTR_NO_OPEN_RESET option now that all tuners sw has been fixed; from jakemsr@


# 1.14 14-Apr-2005 mickey

do not reset tuner and audio settings on open/close; from jakemsr@


Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE
# 1.13 29-Jun-2004 mickey

do not use u_long for 32bit data; found by Jacob Meuser


Revision tags: SMP_SYNC_A SMP_SYNC_B
# 1.12 24-May-2004 mickey

cummulative update from freebsd an netbsd:
PCI_VENROD_PINNACLE -> PCI_VENDOR_PINNACLE_ALT;
correct brightness ioctl; missing htole32s;
fix "set chroma comb" command in yuv422_prog();
use defines instead of magic numbers; fix statics and comments.
from jakemsr@jakemsr.com


Revision tags: OPENBSD_3_3_BASE OPENBSD_3_4_BASE OPENBSD_3_5_BASE UBC_SYNC_A
# 1.11 12-Mar-2003 mickey

a missing htole32 and a pasto; from netbsd


# 1.10 11-Feb-2003 mickey

be consistant on Hz vs hz


# 1.9 21-Jan-2003 mickey

fix cut and paste piece in dma programming, caused jumpieness in animation; good diagnose by Kamil Andrusz <wizz@mniam.net>


# 1.8 15-Jan-2003 art

Get rid of vm_offset_t in bktr.


# 1.7 05-Jan-2003 mickey

proper endianess handling in 16 and 32 bit video modes, 24 bit is not supported by the card


# 1.6 05-Jan-2003 mickey

endianess-free, works on macppc now, except for the fb endianess


Revision tags: OPENBSD_3_2_BASE UBC_SYNC_B
# 1.5 30-Apr-2002 mickey

constify a few structs


Revision tags: OPENBSD_3_1_BASE
# 1.4 14-Mar-2002 millert

Final __P removal plus some cosmetic fixups


Revision tags: UBC_BASE
# 1.3 06-Nov-2001 miod

branches: 1.3.2;
Replace inclusion of <vm/foo.h> with the correct <uvm/bar.h> when necessary.
(Look ma, I might have broken the tree)


Revision tags: OPENBSD_3_0_BASE
# 1.2 22-Sep-2001 mickey

supply some entropy from here


Revision tags: OPENBSD_2_9_BASE
# 1.1 28-Mar-2001 fgsch

branches: 1.1.4;
Latest bktr driver from FreeBSD; thanks to Andres Gunnarsson
<andreas@crt.se> for testing.


# 1.41 16-Dec-2019 cheloha

bktr(4): tsleep(9) -> tsleep_nsec(9)

ok deraadt@


Revision tags: OPENBSD_6_5_BASE OPENBSD_6_6_BASE
# 1.40 22-Nov-2018 fcambus

Remove useless assignment, value is overwritten right after being set.

Both assignements are in our tree since the driver got imported from
FreeBSD in 2001 and remained untouched since import.

The second assignment in its current form got introduced in FreeBSD in
1997 with r29233 [1], when syncinc the driver. The first assignment got
removed in 2017 with r314147 [2].

[1]: https://svnweb.freebsd.org/base?view=revision&revision=29233
[2]: https://svnweb.freebsd.org/base?view=revision&revision=314147

Coverity CID 1453008.

OK deraadt@


Revision tags: OPENBSD_6_4_BASE
# 1.39 28-Apr-2018 jasper

replace add_*_randomness with enqueue_randomness()

this gets rid of the source annotation which doesn't really add
anything other than adding complexitiy. randomess is generally
good enough that the few extra bits that the source type would
add are not worth it.

ok mikeb@ deraadt@


Revision tags: OPENBSD_6_0_BASE OPENBSD_6_1_BASE OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.38 14-Mar-2016 krw

Change a bunch of (<blah> *)0 to NULL.

ok beck@ deraadt@


Revision tags: OPENBSD_5_9_BASE
# 1.37 15-Feb-2016 stefan

Convert to uiomove. From Martin Natano.


Revision tags: OPENBSD_5_8_BASE
# 1.36 14-Mar-2015 jsg

Remove some includes include-what-you-use claims don't
have any direct symbols used. Tested for indirect use by compiling
amd64/i386/sparc64 kernels.

ok tedu@ deraadt@


Revision tags: OPENBSD_5_7_BASE
# 1.35 10-Feb-2015 miod

First step towards making uiomove() take a size_t size argument:
- rename uiomove() to uiomovei() and update all its users.
- introduce uiomove(), which is similar to uiomovei() but with a size_t.
- rewrite uiomovei() as an uiomove() wrapper.
ok kettenis@


# 1.34 16-Dec-2014 tedu

primary change: move uvm_vnode out of vnode, keeping only a pointer.
objective: vnode.h doesn't include uvm_extern.h anymore.
followup changes: include uvm_extern.h or lock.h where necessary.
ok and help from deraadt


Revision tags: OPENBSD_5_6_BASE
# 1.33 04-May-2014 sf

format string fixes for bus_addr_t and bus_size_t

bus_addr_t and bus_size_t are u_long everywhere

ok kettenis@


Revision tags: OPENBSD_5_5_BASE
# 1.32 26-Nov-2013 deraadt

1 << 31 cleanup. Eitan Adler pointed out that there has been a
resurrection of the bad idiom in the tree.
sufficient review by miod, kettenis, tedu


# 1.31 04-Oct-2013 brad

Fix tuner ioctl TVTUNER_SETFREQ after rev 1.30.

Pointed out by Pedro
ok krw@


Revision tags: OPENBSD_5_4_BASE
# 1.30 05-Jul-2013 brad

Use tmp_int to be able to pass back the -1 upon error and check for it properly
but the value passed forward throughout the ioctl handler otherwise is an
unsigned value.

Pointed out by LLVM.

bktr_core.c:1737:13: error: comparison of unsigned expression < 0 is always false
bktr_core.c:1779:13: error: comparison of unsigned expression < 0 is always false
bktr_core.c:2063:16: error: comparison of unsigned expression < 0 is always false

ok krw@


Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.29 06-Aug-2010 miod

don't return (potential errno) + (potential errno), instead only perform
the second errno-capable function if the first one didn't fail.
ok deraadt@


Revision tags: OPENBSD_4_7_BASE
# 1.28 09-Nov-2009 nicm

Every selwakeup() should have a matching KNOTE() (even if kqueue isn't
supported it doesn't do any harm), so put the KNOTE() in selwakeup() itself and
remove it from any occurences where both are used, except one for kqueue itself
and one in sys_pipe.c (where the selwakeup is under a PIPE_SEL flag).

Based on a diff from tedu.

ok deraadt


# 1.27 31-Oct-2009 deraadt

Add missing KNOTE() calls after selwakeup(), until we decide if the KNOTE()
calls can go directly into selwakeup() safely
long discussion with nicm, murmers of consent from tedu and miod, noone
else seems to care of kqueue is busted as long as it makes their sockets
move data fast... pretty sad.


Revision tags: OPENBSD_4_3_BASE OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE
# 1.26 26-Nov-2007 martynas

typos; ok jmc@
sys/netinet/in_pcb.c and sys/net/bridgestp.c ok henning@
sys/dev/pci/bktr/* ok jakemsr@


# 1.25 15-Sep-2007 martin

replace ctob and btoc with ptoa and atop respectively

help and ok miod@ thib@


Revision tags: OPENBSD_4_2_BASE
# 1.24 25-Jul-2007 art

Back out the tracking of procs in struct selinfo. There's one serious
bug in the code, but as soon as I try to fix it, it seems to trigger
some other bugs. Instead of trying to figure out what's going on
while everyone suffers, it's better to back out and figure out
the bugs outside the tree.


# 1.23 11-Jun-2007 robert

remove all FreeBSD/NetBSD specific code because we will
never use them and the code is much more readable now

ok jakemsr@


# 1.22 24-Mar-2007 art

Kill the horrible hack of storing the pid in struct selinfo.

Instead, keep the proc pointer in it and put the selinfo on a list
in struct proc in selrecord. Then clean up the list when leaving
sys_select and sys_poll.

miod@ ok, testing by many, including Bobs spamd boxes.


Revision tags: OPENBSD_4_1_BASE
# 1.21 11-Feb-2007 miod

Remove _KERNEL_OPT leftovers.


# 1.20 29-Dec-2006 pedro

Avoid void * arithmetic, okay deraadt@, suggestions from millert@


Revision tags: OPENBSD_3_9_BASE OPENBSD_4_0_BASE
# 1.19 20-Jan-2006 millert

Include sys/stdint.h instead of defining uintptr_t ourselves.
OK mickey@


# 1.18 15-Nov-2005 robert

Undefine STATUS_SUM, because it is not needed, and it makes
bktr(4) work on alpha.

ok mickey@


Revision tags: OPENBSD_3_8_BASE
# 1.17 23-Jun-2005 robert

Use proper type for 32 bit entity. s/long/int
This is needed for bktr(4) to work on sparc64.

testing and ok by mickey and Jacob Meuser <jakemsr@jakemsr.com>


# 1.16 22-Jun-2005 mickey

apparently i got the last one reversed; from jakemsr@


# 1.15 19-May-2005 mickey

no need for BKTR_NO_OPEN_RESET option now that all tuners sw has been fixed; from jakemsr@


# 1.14 14-Apr-2005 mickey

do not reset tuner and audio settings on open/close; from jakemsr@


Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE
# 1.13 29-Jun-2004 mickey

do not use u_long for 32bit data; found by Jacob Meuser


Revision tags: SMP_SYNC_A SMP_SYNC_B
# 1.12 24-May-2004 mickey

cummulative update from freebsd an netbsd:
PCI_VENROD_PINNACLE -> PCI_VENDOR_PINNACLE_ALT;
correct brightness ioctl; missing htole32s;
fix "set chroma comb" command in yuv422_prog();
use defines instead of magic numbers; fix statics and comments.
from jakemsr@jakemsr.com


Revision tags: OPENBSD_3_3_BASE OPENBSD_3_4_BASE OPENBSD_3_5_BASE UBC_SYNC_A
# 1.11 12-Mar-2003 mickey

a missing htole32 and a pasto; from netbsd


# 1.10 11-Feb-2003 mickey

be consistant on Hz vs hz


# 1.9 21-Jan-2003 mickey

fix cut and paste piece in dma programming, caused jumpieness in animation; good diagnose by Kamil Andrusz <wizz@mniam.net>


# 1.8 15-Jan-2003 art

Get rid of vm_offset_t in bktr.


# 1.7 05-Jan-2003 mickey

proper endianess handling in 16 and 32 bit video modes, 24 bit is not supported by the card


# 1.6 05-Jan-2003 mickey

endianess-free, works on macppc now, except for the fb endianess


Revision tags: OPENBSD_3_2_BASE UBC_SYNC_B
# 1.5 30-Apr-2002 mickey

constify a few structs


Revision tags: OPENBSD_3_1_BASE
# 1.4 14-Mar-2002 millert

Final __P removal plus some cosmetic fixups


Revision tags: UBC_BASE
# 1.3 06-Nov-2001 miod

branches: 1.3.2;
Replace inclusion of <vm/foo.h> with the correct <uvm/bar.h> when necessary.
(Look ma, I might have broken the tree)


Revision tags: OPENBSD_3_0_BASE
# 1.2 22-Sep-2001 mickey

supply some entropy from here


Revision tags: OPENBSD_2_9_BASE
# 1.1 28-Mar-2001 fgsch

branches: 1.1.4;
Latest bktr driver from FreeBSD; thanks to Andres Gunnarsson
<andreas@crt.se> for testing.


# 1.40 22-Nov-2018 fcambus

Remove useless assignment, value is overwritten right after being set.

Both assignements are in our tree since the driver got imported from
FreeBSD in 2001 and remained untouched since import.

The second assignment in its current form got introduced in FreeBSD in
1997 with r29233 [1], when syncinc the driver. The first assignment got
removed in 2017 with r314147 [2].

[1]: https://svnweb.freebsd.org/base?view=revision&revision=29233
[2]: https://svnweb.freebsd.org/base?view=revision&revision=314147

Coverity CID 1453008.

OK deraadt@


Revision tags: OPENBSD_6_4_BASE
# 1.39 28-Apr-2018 jasper

replace add_*_randomness with enqueue_randomness()

this gets rid of the source annotation which doesn't really add
anything other than adding complexitiy. randomess is generally
good enough that the few extra bits that the source type would
add are not worth it.

ok mikeb@ deraadt@


Revision tags: OPENBSD_6_0_BASE OPENBSD_6_1_BASE OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.38 14-Mar-2016 krw

Change a bunch of (<blah> *)0 to NULL.

ok beck@ deraadt@


Revision tags: OPENBSD_5_9_BASE
# 1.37 15-Feb-2016 stefan

Convert to uiomove. From Martin Natano.


Revision tags: OPENBSD_5_8_BASE
# 1.36 14-Mar-2015 jsg

Remove some includes include-what-you-use claims don't
have any direct symbols used. Tested for indirect use by compiling
amd64/i386/sparc64 kernels.

ok tedu@ deraadt@


Revision tags: OPENBSD_5_7_BASE
# 1.35 10-Feb-2015 miod

First step towards making uiomove() take a size_t size argument:
- rename uiomove() to uiomovei() and update all its users.
- introduce uiomove(), which is similar to uiomovei() but with a size_t.
- rewrite uiomovei() as an uiomove() wrapper.
ok kettenis@


# 1.34 16-Dec-2014 tedu

primary change: move uvm_vnode out of vnode, keeping only a pointer.
objective: vnode.h doesn't include uvm_extern.h anymore.
followup changes: include uvm_extern.h or lock.h where necessary.
ok and help from deraadt


Revision tags: OPENBSD_5_6_BASE
# 1.33 04-May-2014 sf

format string fixes for bus_addr_t and bus_size_t

bus_addr_t and bus_size_t are u_long everywhere

ok kettenis@


Revision tags: OPENBSD_5_5_BASE
# 1.32 26-Nov-2013 deraadt

1 << 31 cleanup. Eitan Adler pointed out that there has been a
resurrection of the bad idiom in the tree.
sufficient review by miod, kettenis, tedu


# 1.31 04-Oct-2013 brad

Fix tuner ioctl TVTUNER_SETFREQ after rev 1.30.

Pointed out by Pedro
ok krw@


Revision tags: OPENBSD_5_4_BASE
# 1.30 05-Jul-2013 brad

Use tmp_int to be able to pass back the -1 upon error and check for it properly
but the value passed forward throughout the ioctl handler otherwise is an
unsigned value.

Pointed out by LLVM.

bktr_core.c:1737:13: error: comparison of unsigned expression < 0 is always false
bktr_core.c:1779:13: error: comparison of unsigned expression < 0 is always false
bktr_core.c:2063:16: error: comparison of unsigned expression < 0 is always false

ok krw@


Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.29 06-Aug-2010 miod

don't return (potential errno) + (potential errno), instead only perform
the second errno-capable function if the first one didn't fail.
ok deraadt@


Revision tags: OPENBSD_4_7_BASE
# 1.28 09-Nov-2009 nicm

Every selwakeup() should have a matching KNOTE() (even if kqueue isn't
supported it doesn't do any harm), so put the KNOTE() in selwakeup() itself and
remove it from any occurences where both are used, except one for kqueue itself
and one in sys_pipe.c (where the selwakeup is under a PIPE_SEL flag).

Based on a diff from tedu.

ok deraadt


# 1.27 31-Oct-2009 deraadt

Add missing KNOTE() calls after selwakeup(), until we decide if the KNOTE()
calls can go directly into selwakeup() safely
long discussion with nicm, murmers of consent from tedu and miod, noone
else seems to care of kqueue is busted as long as it makes their sockets
move data fast... pretty sad.


Revision tags: OPENBSD_4_3_BASE OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE
# 1.26 26-Nov-2007 martynas

typos; ok jmc@
sys/netinet/in_pcb.c and sys/net/bridgestp.c ok henning@
sys/dev/pci/bktr/* ok jakemsr@


# 1.25 15-Sep-2007 martin

replace ctob and btoc with ptoa and atop respectively

help and ok miod@ thib@


Revision tags: OPENBSD_4_2_BASE
# 1.24 25-Jul-2007 art

Back out the tracking of procs in struct selinfo. There's one serious
bug in the code, but as soon as I try to fix it, it seems to trigger
some other bugs. Instead of trying to figure out what's going on
while everyone suffers, it's better to back out and figure out
the bugs outside the tree.


# 1.23 11-Jun-2007 robert

remove all FreeBSD/NetBSD specific code because we will
never use them and the code is much more readable now

ok jakemsr@


# 1.22 24-Mar-2007 art

Kill the horrible hack of storing the pid in struct selinfo.

Instead, keep the proc pointer in it and put the selinfo on a list
in struct proc in selrecord. Then clean up the list when leaving
sys_select and sys_poll.

miod@ ok, testing by many, including Bobs spamd boxes.


Revision tags: OPENBSD_4_1_BASE
# 1.21 11-Feb-2007 miod

Remove _KERNEL_OPT leftovers.


# 1.20 29-Dec-2006 pedro

Avoid void * arithmetic, okay deraadt@, suggestions from millert@


Revision tags: OPENBSD_3_9_BASE OPENBSD_4_0_BASE
# 1.19 20-Jan-2006 millert

Include sys/stdint.h instead of defining uintptr_t ourselves.
OK mickey@


# 1.18 15-Nov-2005 robert

Undefine STATUS_SUM, because it is not needed, and it makes
bktr(4) work on alpha.

ok mickey@


Revision tags: OPENBSD_3_8_BASE
# 1.17 23-Jun-2005 robert

Use proper type for 32 bit entity. s/long/int
This is needed for bktr(4) to work on sparc64.

testing and ok by mickey and Jacob Meuser <jakemsr@jakemsr.com>


# 1.16 22-Jun-2005 mickey

apparently i got the last one reversed; from jakemsr@


# 1.15 19-May-2005 mickey

no need for BKTR_NO_OPEN_RESET option now that all tuners sw has been fixed; from jakemsr@


# 1.14 14-Apr-2005 mickey

do not reset tuner and audio settings on open/close; from jakemsr@


Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE
# 1.13 29-Jun-2004 mickey

do not use u_long for 32bit data; found by Jacob Meuser


Revision tags: SMP_SYNC_A SMP_SYNC_B
# 1.12 24-May-2004 mickey

cummulative update from freebsd an netbsd:
PCI_VENROD_PINNACLE -> PCI_VENDOR_PINNACLE_ALT;
correct brightness ioctl; missing htole32s;
fix "set chroma comb" command in yuv422_prog();
use defines instead of magic numbers; fix statics and comments.
from jakemsr@jakemsr.com


Revision tags: OPENBSD_3_3_BASE OPENBSD_3_4_BASE OPENBSD_3_5_BASE UBC_SYNC_A
# 1.11 12-Mar-2003 mickey

a missing htole32 and a pasto; from netbsd


# 1.10 11-Feb-2003 mickey

be consistant on Hz vs hz


# 1.9 21-Jan-2003 mickey

fix cut and paste piece in dma programming, caused jumpieness in animation; good diagnose by Kamil Andrusz <wizz@mniam.net>


# 1.8 15-Jan-2003 art

Get rid of vm_offset_t in bktr.


# 1.7 05-Jan-2003 mickey

proper endianess handling in 16 and 32 bit video modes, 24 bit is not supported by the card


# 1.6 05-Jan-2003 mickey

endianess-free, works on macppc now, except for the fb endianess


Revision tags: OPENBSD_3_2_BASE UBC_SYNC_B
# 1.5 30-Apr-2002 mickey

constify a few structs


Revision tags: OPENBSD_3_1_BASE
# 1.4 14-Mar-2002 millert

Final __P removal plus some cosmetic fixups


Revision tags: UBC_BASE
# 1.3 06-Nov-2001 miod

branches: 1.3.2;
Replace inclusion of <vm/foo.h> with the correct <uvm/bar.h> when necessary.
(Look ma, I might have broken the tree)


Revision tags: OPENBSD_3_0_BASE
# 1.2 22-Sep-2001 mickey

supply some entropy from here


Revision tags: OPENBSD_2_9_BASE
# 1.1 28-Mar-2001 fgsch

branches: 1.1.4;
Latest bktr driver from FreeBSD; thanks to Andres Gunnarsson
<andreas@crt.se> for testing.


# 1.39 28-Apr-2018 jasper

replace add_*_randomness with enqueue_randomness()

this gets rid of the source annotation which doesn't really add
anything other than adding complexitiy. randomess is generally
good enough that the few extra bits that the source type would
add are not worth it.

ok mikeb@ deraadt@


Revision tags: OPENBSD_6_0_BASE OPENBSD_6_1_BASE OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.38 14-Mar-2016 krw

Change a bunch of (<blah> *)0 to NULL.

ok beck@ deraadt@


Revision tags: OPENBSD_5_9_BASE
# 1.37 15-Feb-2016 stefan

Convert to uiomove. From Martin Natano.


Revision tags: OPENBSD_5_8_BASE
# 1.36 14-Mar-2015 jsg

Remove some includes include-what-you-use claims don't
have any direct symbols used. Tested for indirect use by compiling
amd64/i386/sparc64 kernels.

ok tedu@ deraadt@


Revision tags: OPENBSD_5_7_BASE
# 1.35 10-Feb-2015 miod

First step towards making uiomove() take a size_t size argument:
- rename uiomove() to uiomovei() and update all its users.
- introduce uiomove(), which is similar to uiomovei() but with a size_t.
- rewrite uiomovei() as an uiomove() wrapper.
ok kettenis@


# 1.34 16-Dec-2014 tedu

primary change: move uvm_vnode out of vnode, keeping only a pointer.
objective: vnode.h doesn't include uvm_extern.h anymore.
followup changes: include uvm_extern.h or lock.h where necessary.
ok and help from deraadt


Revision tags: OPENBSD_5_6_BASE
# 1.33 04-May-2014 sf

format string fixes for bus_addr_t and bus_size_t

bus_addr_t and bus_size_t are u_long everywhere

ok kettenis@


Revision tags: OPENBSD_5_5_BASE
# 1.32 26-Nov-2013 deraadt

1 << 31 cleanup. Eitan Adler pointed out that there has been a
resurrection of the bad idiom in the tree.
sufficient review by miod, kettenis, tedu


# 1.31 04-Oct-2013 brad

Fix tuner ioctl TVTUNER_SETFREQ after rev 1.30.

Pointed out by Pedro
ok krw@


Revision tags: OPENBSD_5_4_BASE
# 1.30 05-Jul-2013 brad

Use tmp_int to be able to pass back the -1 upon error and check for it properly
but the value passed forward throughout the ioctl handler otherwise is an
unsigned value.

Pointed out by LLVM.

bktr_core.c:1737:13: error: comparison of unsigned expression < 0 is always false
bktr_core.c:1779:13: error: comparison of unsigned expression < 0 is always false
bktr_core.c:2063:16: error: comparison of unsigned expression < 0 is always false

ok krw@


Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.29 06-Aug-2010 miod

don't return (potential errno) + (potential errno), instead only perform
the second errno-capable function if the first one didn't fail.
ok deraadt@


Revision tags: OPENBSD_4_7_BASE
# 1.28 09-Nov-2009 nicm

Every selwakeup() should have a matching KNOTE() (even if kqueue isn't
supported it doesn't do any harm), so put the KNOTE() in selwakeup() itself and
remove it from any occurences where both are used, except one for kqueue itself
and one in sys_pipe.c (where the selwakeup is under a PIPE_SEL flag).

Based on a diff from tedu.

ok deraadt


# 1.27 31-Oct-2009 deraadt

Add missing KNOTE() calls after selwakeup(), until we decide if the KNOTE()
calls can go directly into selwakeup() safely
long discussion with nicm, murmers of consent from tedu and miod, noone
else seems to care of kqueue is busted as long as it makes their sockets
move data fast... pretty sad.


Revision tags: OPENBSD_4_3_BASE OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE
# 1.26 26-Nov-2007 martynas

typos; ok jmc@
sys/netinet/in_pcb.c and sys/net/bridgestp.c ok henning@
sys/dev/pci/bktr/* ok jakemsr@


# 1.25 15-Sep-2007 martin

replace ctob and btoc with ptoa and atop respectively

help and ok miod@ thib@


Revision tags: OPENBSD_4_2_BASE
# 1.24 25-Jul-2007 art

Back out the tracking of procs in struct selinfo. There's one serious
bug in the code, but as soon as I try to fix it, it seems to trigger
some other bugs. Instead of trying to figure out what's going on
while everyone suffers, it's better to back out and figure out
the bugs outside the tree.


# 1.23 11-Jun-2007 robert

remove all FreeBSD/NetBSD specific code because we will
never use them and the code is much more readable now

ok jakemsr@


# 1.22 24-Mar-2007 art

Kill the horrible hack of storing the pid in struct selinfo.

Instead, keep the proc pointer in it and put the selinfo on a list
in struct proc in selrecord. Then clean up the list when leaving
sys_select and sys_poll.

miod@ ok, testing by many, including Bobs spamd boxes.


Revision tags: OPENBSD_4_1_BASE
# 1.21 11-Feb-2007 miod

Remove _KERNEL_OPT leftovers.


# 1.20 29-Dec-2006 pedro

Avoid void * arithmetic, okay deraadt@, suggestions from millert@


Revision tags: OPENBSD_3_9_BASE OPENBSD_4_0_BASE
# 1.19 20-Jan-2006 millert

Include sys/stdint.h instead of defining uintptr_t ourselves.
OK mickey@


# 1.18 15-Nov-2005 robert

Undefine STATUS_SUM, because it is not needed, and it makes
bktr(4) work on alpha.

ok mickey@


Revision tags: OPENBSD_3_8_BASE
# 1.17 23-Jun-2005 robert

Use proper type for 32 bit entity. s/long/int
This is needed for bktr(4) to work on sparc64.

testing and ok by mickey and Jacob Meuser <jakemsr@jakemsr.com>


# 1.16 22-Jun-2005 mickey

apparently i got the last one reversed; from jakemsr@


# 1.15 19-May-2005 mickey

no need for BKTR_NO_OPEN_RESET option now that all tuners sw has been fixed; from jakemsr@


# 1.14 14-Apr-2005 mickey

do not reset tuner and audio settings on open/close; from jakemsr@


Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE
# 1.13 29-Jun-2004 mickey

do not use u_long for 32bit data; found by Jacob Meuser


Revision tags: SMP_SYNC_A SMP_SYNC_B
# 1.12 24-May-2004 mickey

cummulative update from freebsd an netbsd:
PCI_VENROD_PINNACLE -> PCI_VENDOR_PINNACLE_ALT;
correct brightness ioctl; missing htole32s;
fix "set chroma comb" command in yuv422_prog();
use defines instead of magic numbers; fix statics and comments.
from jakemsr@jakemsr.com


Revision tags: OPENBSD_3_3_BASE OPENBSD_3_4_BASE OPENBSD_3_5_BASE UBC_SYNC_A
# 1.11 12-Mar-2003 mickey

a missing htole32 and a pasto; from netbsd


# 1.10 11-Feb-2003 mickey

be consistant on Hz vs hz


# 1.9 21-Jan-2003 mickey

fix cut and paste piece in dma programming, caused jumpieness in animation; good diagnose by Kamil Andrusz <wizz@mniam.net>


# 1.8 15-Jan-2003 art

Get rid of vm_offset_t in bktr.


# 1.7 05-Jan-2003 mickey

proper endianess handling in 16 and 32 bit video modes, 24 bit is not supported by the card


# 1.6 05-Jan-2003 mickey

endianess-free, works on macppc now, except for the fb endianess


Revision tags: OPENBSD_3_2_BASE UBC_SYNC_B
# 1.5 30-Apr-2002 mickey

constify a few structs


Revision tags: OPENBSD_3_1_BASE
# 1.4 14-Mar-2002 millert

Final __P removal plus some cosmetic fixups


Revision tags: UBC_BASE
# 1.3 06-Nov-2001 miod

branches: 1.3.2;
Replace inclusion of <vm/foo.h> with the correct <uvm/bar.h> when necessary.
(Look ma, I might have broken the tree)


Revision tags: OPENBSD_3_0_BASE
# 1.2 22-Sep-2001 mickey

supply some entropy from here


Revision tags: OPENBSD_2_9_BASE
# 1.1 28-Mar-2001 fgsch

branches: 1.1.4;
Latest bktr driver from FreeBSD; thanks to Andres Gunnarsson
<andreas@crt.se> for testing.


Revision tags: OPENBSD_6_0_BASE OPENBSD_6_1_BASE OPENBSD_6_2_BASE
# 1.38 14-Mar-2016 krw

Change a bunch of (<blah> *)0 to NULL.

ok beck@ deraadt@


Revision tags: OPENBSD_5_9_BASE
# 1.37 15-Feb-2016 stefan

Convert to uiomove. From Martin Natano.


Revision tags: OPENBSD_5_8_BASE
# 1.36 14-Mar-2015 jsg

Remove some includes include-what-you-use claims don't
have any direct symbols used. Tested for indirect use by compiling
amd64/i386/sparc64 kernels.

ok tedu@ deraadt@


Revision tags: OPENBSD_5_7_BASE
# 1.35 10-Feb-2015 miod

First step towards making uiomove() take a size_t size argument:
- rename uiomove() to uiomovei() and update all its users.
- introduce uiomove(), which is similar to uiomovei() but with a size_t.
- rewrite uiomovei() as an uiomove() wrapper.
ok kettenis@


# 1.34 16-Dec-2014 tedu

primary change: move uvm_vnode out of vnode, keeping only a pointer.
objective: vnode.h doesn't include uvm_extern.h anymore.
followup changes: include uvm_extern.h or lock.h where necessary.
ok and help from deraadt


Revision tags: OPENBSD_5_6_BASE
# 1.33 04-May-2014 sf

format string fixes for bus_addr_t and bus_size_t

bus_addr_t and bus_size_t are u_long everywhere

ok kettenis@


Revision tags: OPENBSD_5_5_BASE
# 1.32 26-Nov-2013 deraadt

1 << 31 cleanup. Eitan Adler pointed out that there has been a
resurrection of the bad idiom in the tree.
sufficient review by miod, kettenis, tedu


# 1.31 04-Oct-2013 brad

Fix tuner ioctl TVTUNER_SETFREQ after rev 1.30.

Pointed out by Pedro
ok krw@


Revision tags: OPENBSD_5_4_BASE
# 1.30 05-Jul-2013 brad

Use tmp_int to be able to pass back the -1 upon error and check for it properly
but the value passed forward throughout the ioctl handler otherwise is an
unsigned value.

Pointed out by LLVM.

bktr_core.c:1737:13: error: comparison of unsigned expression < 0 is always false
bktr_core.c:1779:13: error: comparison of unsigned expression < 0 is always false
bktr_core.c:2063:16: error: comparison of unsigned expression < 0 is always false

ok krw@


Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.29 06-Aug-2010 miod

don't return (potential errno) + (potential errno), instead only perform
the second errno-capable function if the first one didn't fail.
ok deraadt@


Revision tags: OPENBSD_4_7_BASE
# 1.28 09-Nov-2009 nicm

Every selwakeup() should have a matching KNOTE() (even if kqueue isn't
supported it doesn't do any harm), so put the KNOTE() in selwakeup() itself and
remove it from any occurences where both are used, except one for kqueue itself
and one in sys_pipe.c (where the selwakeup is under a PIPE_SEL flag).

Based on a diff from tedu.

ok deraadt


# 1.27 31-Oct-2009 deraadt

Add missing KNOTE() calls after selwakeup(), until we decide if the KNOTE()
calls can go directly into selwakeup() safely
long discussion with nicm, murmers of consent from tedu and miod, noone
else seems to care of kqueue is busted as long as it makes their sockets
move data fast... pretty sad.


Revision tags: OPENBSD_4_3_BASE OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE
# 1.26 26-Nov-2007 martynas

typos; ok jmc@
sys/netinet/in_pcb.c and sys/net/bridgestp.c ok henning@
sys/dev/pci/bktr/* ok jakemsr@


# 1.25 15-Sep-2007 martin

replace ctob and btoc with ptoa and atop respectively

help and ok miod@ thib@


Revision tags: OPENBSD_4_2_BASE
# 1.24 25-Jul-2007 art

Back out the tracking of procs in struct selinfo. There's one serious
bug in the code, but as soon as I try to fix it, it seems to trigger
some other bugs. Instead of trying to figure out what's going on
while everyone suffers, it's better to back out and figure out
the bugs outside the tree.


# 1.23 11-Jun-2007 robert

remove all FreeBSD/NetBSD specific code because we will
never use them and the code is much more readable now

ok jakemsr@


# 1.22 24-Mar-2007 art

Kill the horrible hack of storing the pid in struct selinfo.

Instead, keep the proc pointer in it and put the selinfo on a list
in struct proc in selrecord. Then clean up the list when leaving
sys_select and sys_poll.

miod@ ok, testing by many, including Bobs spamd boxes.


Revision tags: OPENBSD_4_1_BASE
# 1.21 11-Feb-2007 miod

Remove _KERNEL_OPT leftovers.


# 1.20 29-Dec-2006 pedro

Avoid void * arithmetic, okay deraadt@, suggestions from millert@


Revision tags: OPENBSD_3_9_BASE OPENBSD_4_0_BASE
# 1.19 20-Jan-2006 millert

Include sys/stdint.h instead of defining uintptr_t ourselves.
OK mickey@


# 1.18 15-Nov-2005 robert

Undefine STATUS_SUM, because it is not needed, and it makes
bktr(4) work on alpha.

ok mickey@


Revision tags: OPENBSD_3_8_BASE
# 1.17 23-Jun-2005 robert

Use proper type for 32 bit entity. s/long/int
This is needed for bktr(4) to work on sparc64.

testing and ok by mickey and Jacob Meuser <jakemsr@jakemsr.com>


# 1.16 22-Jun-2005 mickey

apparently i got the last one reversed; from jakemsr@


# 1.15 19-May-2005 mickey

no need for BKTR_NO_OPEN_RESET option now that all tuners sw has been fixed; from jakemsr@


# 1.14 14-Apr-2005 mickey

do not reset tuner and audio settings on open/close; from jakemsr@


Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE
# 1.13 29-Jun-2004 mickey

do not use u_long for 32bit data; found by Jacob Meuser


Revision tags: SMP_SYNC_A SMP_SYNC_B
# 1.12 24-May-2004 mickey

cummulative update from freebsd an netbsd:
PCI_VENROD_PINNACLE -> PCI_VENDOR_PINNACLE_ALT;
correct brightness ioctl; missing htole32s;
fix "set chroma comb" command in yuv422_prog();
use defines instead of magic numbers; fix statics and comments.
from jakemsr@jakemsr.com


Revision tags: OPENBSD_3_3_BASE OPENBSD_3_4_BASE OPENBSD_3_5_BASE UBC_SYNC_A
# 1.11 12-Mar-2003 mickey

a missing htole32 and a pasto; from netbsd


# 1.10 11-Feb-2003 mickey

be consistant on Hz vs hz


# 1.9 21-Jan-2003 mickey

fix cut and paste piece in dma programming, caused jumpieness in animation; good diagnose by Kamil Andrusz <wizz@mniam.net>


# 1.8 15-Jan-2003 art

Get rid of vm_offset_t in bktr.


# 1.7 05-Jan-2003 mickey

proper endianess handling in 16 and 32 bit video modes, 24 bit is not supported by the card


# 1.6 05-Jan-2003 mickey

endianess-free, works on macppc now, except for the fb endianess


Revision tags: OPENBSD_3_2_BASE UBC_SYNC_B
# 1.5 30-Apr-2002 mickey

constify a few structs


Revision tags: OPENBSD_3_1_BASE
# 1.4 14-Mar-2002 millert

Final __P removal plus some cosmetic fixups


Revision tags: UBC_BASE
# 1.3 06-Nov-2001 miod

branches: 1.3.2;
Replace inclusion of <vm/foo.h> with the correct <uvm/bar.h> when necessary.
(Look ma, I might have broken the tree)


Revision tags: OPENBSD_3_0_BASE
# 1.2 22-Sep-2001 mickey

supply some entropy from here


Revision tags: OPENBSD_2_9_BASE
# 1.1 28-Mar-2001 fgsch

branches: 1.1.4;
Latest bktr driver from FreeBSD; thanks to Andres Gunnarsson
<andreas@crt.se> for testing.