History log of /netbsd-current/sys/modules/lua/lua.c
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.28 31-Mar-2022 pgoyette

For device modules that provide both auto-config and /dev/xxx
interfaces, make sure that initialization and destruction
follow the proper sequence. This is triggered by the recent
changes to the devsw stuff; per riastradh@ the required call
sequence is:

devsw_attach()
config_init_component() or config_cf*_attach()
...
config_fini_component() or config_cf*_detach()
devsw_detach()

While here, add a few missing calls to some of the detach
routines.

Testing of these changes has been limited to:
1. compile without build break
2. no related test failures from atf
3. modload/modunload work as well as
before.

No functional device testing done, since I don't have any
of these devices. Let me know of any damage I might cause
here!

XXX Some of the modules affected by this commit are already
XXX broken; see kern/56772. This commit does not break
any additional modules (as far as I know).


Revision tags: thorpej-i2c-spi-conf2-base
# 1.27 08-Aug-2021 rin

Fix LIST operations, found by strictly-aligned CPUs, i.e., ARMv5 and IBM403:
- Initialize LIST_HEAD.
- Use LIST_FOREACH_SAFE() where necessary.


# 1.26 07-Aug-2021 rin

Make sure that buffers allocated by lua_alloc() are aligned to 8-byte
boundaries as done by kmem_alloc(9).

Fix alignment faults on armv5te; GCC emits ldrd/strd instructions for
memory operands that are guaranteed to be aligned properly.

Drop unnecessary __packed attribute from alloc_header_t at the same time.


Revision tags: thorpej-futex2-base thorpej-cfargs2-base thorpej-i2c-spi-conf-base
# 1.25 29-Jun-2021 dholland

Add containment for the cloning devices hack in vn_open.

Cloning devices (and also things like /dev/stderr) work by allocating
a struct file, stuffing it in the file table (which is a layer
violation), stuffing the file descriptor number for it in a magic
field of struct lwp (which is gross), and then "failing" with one of
two magic errnos, EDUPFD or EMOVEFD.

Before this commit, all callers of vn_open in the kernel (there are
quite a few) were expected to check for these errors and handle the
situation. Needless to say, none of them except for open() itself did,
resulting in internal negative errnos being returned to userspace.

This hack is fairly deeply rooted and cannot be eliminated all at
once. This commit adds logic to handle the magic errnos inside
vn_open; now on success vn_open returns either a vnode or an integer
file descriptor, along with a flag that says whether the underlying
code requested EDUPFD or EMOVEFD. Callers not prepared to cope with
file descriptors can pass NULL for the extra return values, in which
case if a file descriptor would be produced vn_open fails with
EOPNOTSUPP.

Since I'm rearranging vn_open's signature anyway, stop exposing struct
nameidata. Instead, take three arguments: an optional vnode to use as
the starting point (like openat()), the path, and additional namei
flags to use, restricted to NOCHROOT and TRYEMULROOT. (Other namei
behavior, e.g. NOFOLLOW, can be requested via the open flags.)

This change requires a kernel bump. Ride the one an hour ago.
(That was supposed to be coordinated; did not intend to let an hour
slip by. My fault.)


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 netbsd-9-2-RELEASE cjep_staticlib_x-base thorpej-cfargs-base thorpej-futex-base netbsd-9-1-RELEASE bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3 netbsd-9-0-RELEASE netbsd-9-0-RC2 ad-namecache-base2 ad-namecache-base1 ad-namecache-base netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 isaki-audio2-base pgoyette-compat-merge-20190127 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.24 26-Dec-2017 martin

branches: 1.24.20;
Fix cargo cult ioctl implementation for LUAINFO: the name and desc fields
are arrays, not pointers, so don't use copyoutstr on them, but instead
copyin/copyout the whole array of structures.
Fixes PR 52864 for me (on sparc64).


Revision tags: tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base
# 1.23 20-May-2017 mbalmer

branches: 1.23.2;
always put the module on the stack


# 1.22 20-May-2017 mbalmer

Only load a module if it is not already loaded in a state (much like userland
Lua handles require).
Fixes PR kern/52226.


Revision tags: prg-localcount2-base3
# 1.21 11-May-2017 mbalmer

Avoid possible null pointer dereferencing.
Fixes PR kern/52225.


Revision tags: prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1
# 1.20 16-Apr-2017 riastradh

branches: 1.20.2;
Can't destroy pb until we're done using it.


Revision tags: jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204
# 1.19 20-Jan-2017 maya

Check pmf_device_register return value. NFC
Appeases static analyzers.


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.18 14-Jul-2016 msaitoh

branches: 1.18.2; 1.18.4;
- Use aprint*() instead of printf() in xxx_attach().
- Add missing aprint_naive("\n");
- KNF


Revision tags: nick-nhusb-base-20160907 nick-nhusb-base-20160529
# 1.17 21-May-2016 salazar

fix double require bug


Revision tags: nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606 nick-nhusb-base-20150406
# 1.16 07-Feb-2015 christos

plug leak on error. Reported by:
http://www.m00nbsd.net/ae123a9bae03f7dde5c6d654412daf5a.html#Report-4


# 1.15 30-Nov-2014 lneto

lua(4): fixed require


Revision tags: nick-nhusb-base
# 1.14 24-Sep-2014 mbalmer

branches: 1.14.2;
whitespace, knf, comments, but no functional change


Revision tags: tls-maxphys-base netbsd-7-base tls-earlyentropy-base
# 1.13 25-Jul-2014 dholland

branches: 1.13.2; 1.13.4;
Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.


# 1.12 19-Jul-2014 lneto

lua: updated from 5.1 to 5.3 work3

* lua(1):
- changed lua_Integer to intmax_t
- updated distrib/sets/lists and etc/mtree
- updated bsd.lua.mk
- fixed bozohttpd (lua-bozo.c)
- compatibilized bindings: gpio, sqlite
* lua(4):
- removed floating-point and libc dependencies using '#ifndef _KERNEL'
- fixed division by zero and exponentiation
- libkern: added isalnum(), iscntrl(), isgraph(), isprint() and ispunct()
- acpica: removed isprint() from acnetbsd.h
- libc: moved strcspn.c, strpbrk.c and strspn.c to common
- removed stub headers
- compatibilized bindings: luapmf, luasystm
* reorganized luaconf.h
* updated doc/CHANGES and doc/RESPONSIBLE


# 1.11 19-Jul-2014 lneto

lua(4): uniformed the KPI name space using 'klua_' prefix


# 1.10 19-Jul-2014 lneto

lua(4): using lua_CFunction


# 1.9 19-Jul-2014 lneto

lua(4): added support for running Lua scripts in intr context

* using kmem_intr on lua_alloc
* using mutex directly on klua_lock
* added ipl arg on klua_newstate()
* added kluaL_newstate function
* fixed synchronization: locking the Lua state on luaioctl


Revision tags: rmind-smpnet-base rmind-smpnet-nbase yamt-pagecache-base9 riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3
# 1.8 16-Mar-2014 dholland

branches: 1.8.2; 1.8.4; 1.8.6;
Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.


# 1.7 25-Feb-2014 pooka

Ensure that the top level sysctl nodes (kern, vfs, net, ...) exist before
the sysctl link sets are processed, and remove redundancy.

Shaves >13kB off of an amd64 GENERIC, not to mention >1k duplicate
lines of code.


# 1.6 04-Dec-2013 lneto

fixed lua(4) alloc (nsize can be lesser than osize)


# 1.5 23-Nov-2013 mbalmer

switch from malloc(9) to kmem(9)


# 1.4 29-Oct-2013 mbalmer

initialize variables


# 1.3 23-Oct-2013 mbalmer

use MODULE_CLASS_MISC for Lua modules


# 1.2 18-Oct-2013 mbalmer

fix CVS marker and copyright year


# 1.1 16-Oct-2013 mbalmer

welcome lua(4), a devide driver that can create and control Lua states inside the kernel


Revision tags: thorpej-i2c-spi-conf2-base
# 1.27 08-Aug-2021 rin

Fix LIST operations, found by strictly-aligned CPUs, i.e., ARMv5 and IBM403:
- Initialize LIST_HEAD.
- Use LIST_FOREACH_SAFE() where necessary.


# 1.26 07-Aug-2021 rin

Make sure that buffers allocated by lua_alloc() are aligned to 8-byte
boundaries as done by kmem_alloc(9).

Fix alignment faults on armv5te; GCC emits ldrd/strd instructions for
memory operands that are guaranteed to be aligned properly.

Drop unnecessary __packed attribute from alloc_header_t at the same time.


Revision tags: thorpej-futex2-base thorpej-cfargs2-base thorpej-i2c-spi-conf-base
# 1.25 29-Jun-2021 dholland

Add containment for the cloning devices hack in vn_open.

Cloning devices (and also things like /dev/stderr) work by allocating
a struct file, stuffing it in the file table (which is a layer
violation), stuffing the file descriptor number for it in a magic
field of struct lwp (which is gross), and then "failing" with one of
two magic errnos, EDUPFD or EMOVEFD.

Before this commit, all callers of vn_open in the kernel (there are
quite a few) were expected to check for these errors and handle the
situation. Needless to say, none of them except for open() itself did,
resulting in internal negative errnos being returned to userspace.

This hack is fairly deeply rooted and cannot be eliminated all at
once. This commit adds logic to handle the magic errnos inside
vn_open; now on success vn_open returns either a vnode or an integer
file descriptor, along with a flag that says whether the underlying
code requested EDUPFD or EMOVEFD. Callers not prepared to cope with
file descriptors can pass NULL for the extra return values, in which
case if a file descriptor would be produced vn_open fails with
EOPNOTSUPP.

Since I'm rearranging vn_open's signature anyway, stop exposing struct
nameidata. Instead, take three arguments: an optional vnode to use as
the starting point (like openat()), the path, and additional namei
flags to use, restricted to NOCHROOT and TRYEMULROOT. (Other namei
behavior, e.g. NOFOLLOW, can be requested via the open flags.)

This change requires a kernel bump. Ride the one an hour ago.
(That was supposed to be coordinated; did not intend to let an hour
slip by. My fault.)


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 netbsd-9-2-RELEASE cjep_staticlib_x-base thorpej-cfargs-base thorpej-futex-base netbsd-9-1-RELEASE bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3 netbsd-9-0-RELEASE netbsd-9-0-RC2 ad-namecache-base2 ad-namecache-base1 ad-namecache-base netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 isaki-audio2-base pgoyette-compat-merge-20190127 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.24 26-Dec-2017 martin

branches: 1.24.20;
Fix cargo cult ioctl implementation for LUAINFO: the name and desc fields
are arrays, not pointers, so don't use copyoutstr on them, but instead
copyin/copyout the whole array of structures.
Fixes PR 52864 for me (on sparc64).


Revision tags: tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base
# 1.23 20-May-2017 mbalmer

branches: 1.23.2;
always put the module on the stack


# 1.22 20-May-2017 mbalmer

Only load a module if it is not already loaded in a state (much like userland
Lua handles require).
Fixes PR kern/52226.


Revision tags: prg-localcount2-base3
# 1.21 11-May-2017 mbalmer

Avoid possible null pointer dereferencing.
Fixes PR kern/52225.


Revision tags: prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1
# 1.20 16-Apr-2017 riastradh

branches: 1.20.2;
Can't destroy pb until we're done using it.


Revision tags: jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204
# 1.19 20-Jan-2017 maya

Check pmf_device_register return value. NFC
Appeases static analyzers.


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.18 14-Jul-2016 msaitoh

branches: 1.18.2; 1.18.4;
- Use aprint*() instead of printf() in xxx_attach().
- Add missing aprint_naive("\n");
- KNF


Revision tags: nick-nhusb-base-20160907 nick-nhusb-base-20160529
# 1.17 21-May-2016 salazar

fix double require bug


Revision tags: nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606 nick-nhusb-base-20150406
# 1.16 07-Feb-2015 christos

plug leak on error. Reported by:
http://www.m00nbsd.net/ae123a9bae03f7dde5c6d654412daf5a.html#Report-4


# 1.15 30-Nov-2014 lneto

lua(4): fixed require


Revision tags: nick-nhusb-base
# 1.14 24-Sep-2014 mbalmer

branches: 1.14.2;
whitespace, knf, comments, but no functional change


Revision tags: tls-maxphys-base netbsd-7-base tls-earlyentropy-base
# 1.13 25-Jul-2014 dholland

branches: 1.13.2; 1.13.4;
Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.


# 1.12 19-Jul-2014 lneto

lua: updated from 5.1 to 5.3 work3

* lua(1):
- changed lua_Integer to intmax_t
- updated distrib/sets/lists and etc/mtree
- updated bsd.lua.mk
- fixed bozohttpd (lua-bozo.c)
- compatibilized bindings: gpio, sqlite
* lua(4):
- removed floating-point and libc dependencies using '#ifndef _KERNEL'
- fixed division by zero and exponentiation
- libkern: added isalnum(), iscntrl(), isgraph(), isprint() and ispunct()
- acpica: removed isprint() from acnetbsd.h
- libc: moved strcspn.c, strpbrk.c and strspn.c to common
- removed stub headers
- compatibilized bindings: luapmf, luasystm
* reorganized luaconf.h
* updated doc/CHANGES and doc/RESPONSIBLE


# 1.11 19-Jul-2014 lneto

lua(4): uniformed the KPI name space using 'klua_' prefix


# 1.10 19-Jul-2014 lneto

lua(4): using lua_CFunction


# 1.9 19-Jul-2014 lneto

lua(4): added support for running Lua scripts in intr context

* using kmem_intr on lua_alloc
* using mutex directly on klua_lock
* added ipl arg on klua_newstate()
* added kluaL_newstate function
* fixed synchronization: locking the Lua state on luaioctl


Revision tags: rmind-smpnet-base rmind-smpnet-nbase yamt-pagecache-base9 riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3
# 1.8 16-Mar-2014 dholland

branches: 1.8.2; 1.8.4; 1.8.6;
Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.


# 1.7 25-Feb-2014 pooka

Ensure that the top level sysctl nodes (kern, vfs, net, ...) exist before
the sysctl link sets are processed, and remove redundancy.

Shaves >13kB off of an amd64 GENERIC, not to mention >1k duplicate
lines of code.


# 1.6 04-Dec-2013 lneto

fixed lua(4) alloc (nsize can be lesser than osize)


# 1.5 23-Nov-2013 mbalmer

switch from malloc(9) to kmem(9)


# 1.4 29-Oct-2013 mbalmer

initialize variables


# 1.3 23-Oct-2013 mbalmer

use MODULE_CLASS_MISC for Lua modules


# 1.2 18-Oct-2013 mbalmer

fix CVS marker and copyright year


# 1.1 16-Oct-2013 mbalmer

welcome lua(4), a devide driver that can create and control Lua states inside the kernel


# 1.26 07-Aug-2021 rin

Make sure that buffers allocated by lua_alloc() are aligned to 8-byte
boundaries as done by kmem_alloc(9).

Fix alignment faults on armv5te; GCC emits ldrd/strd instructions for
memory operands that are guaranteed to be aligned properly.

Drop unnecessary __packed attribute from alloc_header_t at the same time.


Revision tags: thorpej-futex2-base thorpej-cfargs2-base thorpej-i2c-spi-conf-base
# 1.25 29-Jun-2021 dholland

Add containment for the cloning devices hack in vn_open.

Cloning devices (and also things like /dev/stderr) work by allocating
a struct file, stuffing it in the file table (which is a layer
violation), stuffing the file descriptor number for it in a magic
field of struct lwp (which is gross), and then "failing" with one of
two magic errnos, EDUPFD or EMOVEFD.

Before this commit, all callers of vn_open in the kernel (there are
quite a few) were expected to check for these errors and handle the
situation. Needless to say, none of them except for open() itself did,
resulting in internal negative errnos being returned to userspace.

This hack is fairly deeply rooted and cannot be eliminated all at
once. This commit adds logic to handle the magic errnos inside
vn_open; now on success vn_open returns either a vnode or an integer
file descriptor, along with a flag that says whether the underlying
code requested EDUPFD or EMOVEFD. Callers not prepared to cope with
file descriptors can pass NULL for the extra return values, in which
case if a file descriptor would be produced vn_open fails with
EOPNOTSUPP.

Since I'm rearranging vn_open's signature anyway, stop exposing struct
nameidata. Instead, take three arguments: an optional vnode to use as
the starting point (like openat()), the path, and additional namei
flags to use, restricted to NOCHROOT and TRYEMULROOT. (Other namei
behavior, e.g. NOFOLLOW, can be requested via the open flags.)

This change requires a kernel bump. Ride the one an hour ago.
(That was supposed to be coordinated; did not intend to let an hour
slip by. My fault.)


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 netbsd-9-2-RELEASE cjep_staticlib_x-base thorpej-cfargs-base thorpej-futex-base netbsd-9-1-RELEASE bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3 netbsd-9-0-RELEASE netbsd-9-0-RC2 ad-namecache-base2 ad-namecache-base1 ad-namecache-base netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 isaki-audio2-base pgoyette-compat-merge-20190127 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.24 26-Dec-2017 martin

branches: 1.24.20;
Fix cargo cult ioctl implementation for LUAINFO: the name and desc fields
are arrays, not pointers, so don't use copyoutstr on them, but instead
copyin/copyout the whole array of structures.
Fixes PR 52864 for me (on sparc64).


Revision tags: tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base
# 1.23 20-May-2017 mbalmer

branches: 1.23.2;
always put the module on the stack


# 1.22 20-May-2017 mbalmer

Only load a module if it is not already loaded in a state (much like userland
Lua handles require).
Fixes PR kern/52226.


Revision tags: prg-localcount2-base3
# 1.21 11-May-2017 mbalmer

Avoid possible null pointer dereferencing.
Fixes PR kern/52225.


Revision tags: prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1
# 1.20 16-Apr-2017 riastradh

branches: 1.20.2;
Can't destroy pb until we're done using it.


Revision tags: jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204
# 1.19 20-Jan-2017 maya

Check pmf_device_register return value. NFC
Appeases static analyzers.


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.18 14-Jul-2016 msaitoh

branches: 1.18.2; 1.18.4;
- Use aprint*() instead of printf() in xxx_attach().
- Add missing aprint_naive("\n");
- KNF


Revision tags: nick-nhusb-base-20160907 nick-nhusb-base-20160529
# 1.17 21-May-2016 salazar

fix double require bug


Revision tags: nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606 nick-nhusb-base-20150406
# 1.16 07-Feb-2015 christos

plug leak on error. Reported by:
http://www.m00nbsd.net/ae123a9bae03f7dde5c6d654412daf5a.html#Report-4


# 1.15 30-Nov-2014 lneto

lua(4): fixed require


Revision tags: nick-nhusb-base
# 1.14 24-Sep-2014 mbalmer

branches: 1.14.2;
whitespace, knf, comments, but no functional change


Revision tags: tls-maxphys-base netbsd-7-base tls-earlyentropy-base
# 1.13 25-Jul-2014 dholland

branches: 1.13.2; 1.13.4;
Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.


# 1.12 19-Jul-2014 lneto

lua: updated from 5.1 to 5.3 work3

* lua(1):
- changed lua_Integer to intmax_t
- updated distrib/sets/lists and etc/mtree
- updated bsd.lua.mk
- fixed bozohttpd (lua-bozo.c)
- compatibilized bindings: gpio, sqlite
* lua(4):
- removed floating-point and libc dependencies using '#ifndef _KERNEL'
- fixed division by zero and exponentiation
- libkern: added isalnum(), iscntrl(), isgraph(), isprint() and ispunct()
- acpica: removed isprint() from acnetbsd.h
- libc: moved strcspn.c, strpbrk.c and strspn.c to common
- removed stub headers
- compatibilized bindings: luapmf, luasystm
* reorganized luaconf.h
* updated doc/CHANGES and doc/RESPONSIBLE


# 1.11 19-Jul-2014 lneto

lua(4): uniformed the KPI name space using 'klua_' prefix


# 1.10 19-Jul-2014 lneto

lua(4): using lua_CFunction


# 1.9 19-Jul-2014 lneto

lua(4): added support for running Lua scripts in intr context

* using kmem_intr on lua_alloc
* using mutex directly on klua_lock
* added ipl arg on klua_newstate()
* added kluaL_newstate function
* fixed synchronization: locking the Lua state on luaioctl


Revision tags: rmind-smpnet-base rmind-smpnet-nbase yamt-pagecache-base9 riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3
# 1.8 16-Mar-2014 dholland

branches: 1.8.2; 1.8.4; 1.8.6;
Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.


# 1.7 25-Feb-2014 pooka

Ensure that the top level sysctl nodes (kern, vfs, net, ...) exist before
the sysctl link sets are processed, and remove redundancy.

Shaves >13kB off of an amd64 GENERIC, not to mention >1k duplicate
lines of code.


# 1.6 04-Dec-2013 lneto

fixed lua(4) alloc (nsize can be lesser than osize)


# 1.5 23-Nov-2013 mbalmer

switch from malloc(9) to kmem(9)


# 1.4 29-Oct-2013 mbalmer

initialize variables


# 1.3 23-Oct-2013 mbalmer

use MODULE_CLASS_MISC for Lua modules


# 1.2 18-Oct-2013 mbalmer

fix CVS marker and copyright year


# 1.1 16-Oct-2013 mbalmer

welcome lua(4), a devide driver that can create and control Lua states inside the kernel


# 1.25 29-Jun-2021 dholland

Add containment for the cloning devices hack in vn_open.

Cloning devices (and also things like /dev/stderr) work by allocating
a struct file, stuffing it in the file table (which is a layer
violation), stuffing the file descriptor number for it in a magic
field of struct lwp (which is gross), and then "failing" with one of
two magic errnos, EDUPFD or EMOVEFD.

Before this commit, all callers of vn_open in the kernel (there are
quite a few) were expected to check for these errors and handle the
situation. Needless to say, none of them except for open() itself did,
resulting in internal negative errnos being returned to userspace.

This hack is fairly deeply rooted and cannot be eliminated all at
once. This commit adds logic to handle the magic errnos inside
vn_open; now on success vn_open returns either a vnode or an integer
file descriptor, along with a flag that says whether the underlying
code requested EDUPFD or EMOVEFD. Callers not prepared to cope with
file descriptors can pass NULL for the extra return values, in which
case if a file descriptor would be produced vn_open fails with
EOPNOTSUPP.

Since I'm rearranging vn_open's signature anyway, stop exposing struct
nameidata. Instead, take three arguments: an optional vnode to use as
the starting point (like openat()), the path, and additional namei
flags to use, restricted to NOCHROOT and TRYEMULROOT. (Other namei
behavior, e.g. NOFOLLOW, can be requested via the open flags.)

This change requires a kernel bump. Ride the one an hour ago.
(That was supposed to be coordinated; did not intend to let an hour
slip by. My fault.)


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 netbsd-9-2-RELEASE cjep_staticlib_x-base thorpej-i2c-spi-conf-base thorpej-cfargs-base thorpej-futex-base netbsd-9-1-RELEASE bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3 netbsd-9-0-RELEASE netbsd-9-0-RC2 ad-namecache-base2 ad-namecache-base1 ad-namecache-base netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 isaki-audio2-base pgoyette-compat-merge-20190127 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.24 26-Dec-2017 martin

Fix cargo cult ioctl implementation for LUAINFO: the name and desc fields
are arrays, not pointers, so don't use copyoutstr on them, but instead
copyin/copyout the whole array of structures.
Fixes PR 52864 for me (on sparc64).


Revision tags: tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base
# 1.23 20-May-2017 mbalmer

branches: 1.23.2;
always put the module on the stack


# 1.22 20-May-2017 mbalmer

Only load a module if it is not already loaded in a state (much like userland
Lua handles require).
Fixes PR kern/52226.


Revision tags: prg-localcount2-base3
# 1.21 11-May-2017 mbalmer

Avoid possible null pointer dereferencing.
Fixes PR kern/52225.


Revision tags: prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1
# 1.20 16-Apr-2017 riastradh

branches: 1.20.2;
Can't destroy pb until we're done using it.


Revision tags: jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204
# 1.19 20-Jan-2017 maya

Check pmf_device_register return value. NFC
Appeases static analyzers.


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.18 14-Jul-2016 msaitoh

branches: 1.18.2; 1.18.4;
- Use aprint*() instead of printf() in xxx_attach().
- Add missing aprint_naive("\n");
- KNF


Revision tags: nick-nhusb-base-20160907 nick-nhusb-base-20160529
# 1.17 21-May-2016 salazar

fix double require bug


Revision tags: nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606 nick-nhusb-base-20150406
# 1.16 07-Feb-2015 christos

plug leak on error. Reported by:
http://www.m00nbsd.net/ae123a9bae03f7dde5c6d654412daf5a.html#Report-4


# 1.15 30-Nov-2014 lneto

lua(4): fixed require


Revision tags: nick-nhusb-base
# 1.14 24-Sep-2014 mbalmer

branches: 1.14.2;
whitespace, knf, comments, but no functional change


Revision tags: tls-maxphys-base netbsd-7-base tls-earlyentropy-base
# 1.13 25-Jul-2014 dholland

branches: 1.13.2; 1.13.4;
Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.


# 1.12 19-Jul-2014 lneto

lua: updated from 5.1 to 5.3 work3

* lua(1):
- changed lua_Integer to intmax_t
- updated distrib/sets/lists and etc/mtree
- updated bsd.lua.mk
- fixed bozohttpd (lua-bozo.c)
- compatibilized bindings: gpio, sqlite
* lua(4):
- removed floating-point and libc dependencies using '#ifndef _KERNEL'
- fixed division by zero and exponentiation
- libkern: added isalnum(), iscntrl(), isgraph(), isprint() and ispunct()
- acpica: removed isprint() from acnetbsd.h
- libc: moved strcspn.c, strpbrk.c and strspn.c to common
- removed stub headers
- compatibilized bindings: luapmf, luasystm
* reorganized luaconf.h
* updated doc/CHANGES and doc/RESPONSIBLE


# 1.11 19-Jul-2014 lneto

lua(4): uniformed the KPI name space using 'klua_' prefix


# 1.10 19-Jul-2014 lneto

lua(4): using lua_CFunction


# 1.9 19-Jul-2014 lneto

lua(4): added support for running Lua scripts in intr context

* using kmem_intr on lua_alloc
* using mutex directly on klua_lock
* added ipl arg on klua_newstate()
* added kluaL_newstate function
* fixed synchronization: locking the Lua state on luaioctl


Revision tags: rmind-smpnet-base rmind-smpnet-nbase yamt-pagecache-base9 riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3
# 1.8 16-Mar-2014 dholland

branches: 1.8.2; 1.8.4; 1.8.6;
Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.


# 1.7 25-Feb-2014 pooka

Ensure that the top level sysctl nodes (kern, vfs, net, ...) exist before
the sysctl link sets are processed, and remove redundancy.

Shaves >13kB off of an amd64 GENERIC, not to mention >1k duplicate
lines of code.


# 1.6 04-Dec-2013 lneto

fixed lua(4) alloc (nsize can be lesser than osize)


# 1.5 23-Nov-2013 mbalmer

switch from malloc(9) to kmem(9)


# 1.4 29-Oct-2013 mbalmer

initialize variables


# 1.3 23-Oct-2013 mbalmer

use MODULE_CLASS_MISC for Lua modules


# 1.2 18-Oct-2013 mbalmer

fix CVS marker and copyright year


# 1.1 16-Oct-2013 mbalmer

welcome lua(4), a devide driver that can create and control Lua states inside the kernel


# 1.24 26-Dec-2017 martin

Fix cargo cult ioctl implementation for LUAINFO: the name and desc fields
are arrays, not pointers, so don't use copyoutstr on them, but instead
copyin/copyout the whole array of structures.
Fixes PR 52864 for me (on sparc64).


Revision tags: tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base
# 1.23 20-May-2017 mbalmer

branches: 1.23.2;
always put the module on the stack


# 1.22 20-May-2017 mbalmer

Only load a module if it is not already loaded in a state (much like userland
Lua handles require).
Fixes PR kern/52226.


Revision tags: prg-localcount2-base3
# 1.21 11-May-2017 mbalmer

Avoid possible null pointer dereferencing.
Fixes PR kern/52225.


Revision tags: prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1
# 1.20 16-Apr-2017 riastradh

branches: 1.20.2;
Can't destroy pb until we're done using it.


Revision tags: jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204
# 1.19 20-Jan-2017 maya

Check pmf_device_register return value. NFC
Appeases static analyzers.


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.18 14-Jul-2016 msaitoh

branches: 1.18.2; 1.18.4;
- Use aprint*() instead of printf() in xxx_attach().
- Add missing aprint_naive("\n");
- KNF


Revision tags: nick-nhusb-base-20160907 nick-nhusb-base-20160529
# 1.17 21-May-2016 salazar

fix double require bug


Revision tags: nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606 nick-nhusb-base-20150406
# 1.16 07-Feb-2015 christos

plug leak on error. Reported by:
http://www.m00nbsd.net/ae123a9bae03f7dde5c6d654412daf5a.html#Report-4


# 1.15 30-Nov-2014 lneto

lua(4): fixed require


Revision tags: nick-nhusb-base
# 1.14 24-Sep-2014 mbalmer

branches: 1.14.2;
whitespace, knf, comments, but no functional change


Revision tags: tls-maxphys-base netbsd-7-base tls-earlyentropy-base
# 1.13 25-Jul-2014 dholland

branches: 1.13.2; 1.13.4;
Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.


# 1.12 19-Jul-2014 lneto

lua: updated from 5.1 to 5.3 work3

* lua(1):
- changed lua_Integer to intmax_t
- updated distrib/sets/lists and etc/mtree
- updated bsd.lua.mk
- fixed bozohttpd (lua-bozo.c)
- compatibilized bindings: gpio, sqlite
* lua(4):
- removed floating-point and libc dependencies using '#ifndef _KERNEL'
- fixed division by zero and exponentiation
- libkern: added isalnum(), iscntrl(), isgraph(), isprint() and ispunct()
- acpica: removed isprint() from acnetbsd.h
- libc: moved strcspn.c, strpbrk.c and strspn.c to common
- removed stub headers
- compatibilized bindings: luapmf, luasystm
* reorganized luaconf.h
* updated doc/CHANGES and doc/RESPONSIBLE


# 1.11 19-Jul-2014 lneto

lua(4): uniformed the KPI name space using 'klua_' prefix


# 1.10 19-Jul-2014 lneto

lua(4): using lua_CFunction


# 1.9 19-Jul-2014 lneto

lua(4): added support for running Lua scripts in intr context

* using kmem_intr on lua_alloc
* using mutex directly on klua_lock
* added ipl arg on klua_newstate()
* added kluaL_newstate function
* fixed synchronization: locking the Lua state on luaioctl


Revision tags: rmind-smpnet-base rmind-smpnet-nbase yamt-pagecache-base9 riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3
# 1.8 16-Mar-2014 dholland

branches: 1.8.2; 1.8.4; 1.8.6;
Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.


# 1.7 25-Feb-2014 pooka

Ensure that the top level sysctl nodes (kern, vfs, net, ...) exist before
the sysctl link sets are processed, and remove redundancy.

Shaves >13kB off of an amd64 GENERIC, not to mention >1k duplicate
lines of code.


# 1.6 04-Dec-2013 lneto

fixed lua(4) alloc (nsize can be lesser than osize)


# 1.5 23-Nov-2013 mbalmer

switch from malloc(9) to kmem(9)


# 1.4 29-Oct-2013 mbalmer

initialize variables


# 1.3 23-Oct-2013 mbalmer

use MODULE_CLASS_MISC for Lua modules


# 1.2 18-Oct-2013 mbalmer

fix CVS marker and copyright year


# 1.1 16-Oct-2013 mbalmer

welcome lua(4), a devide driver that can create and control Lua states inside the kernel


# 1.23 20-May-2017 mbalmer

always put the module on the stack


# 1.22 20-May-2017 mbalmer

Only load a module if it is not already loaded in a state (much like userland
Lua handles require).
Fixes PR kern/52226.


Revision tags: prg-localcount2-base3
# 1.21 11-May-2017 mbalmer

Avoid possible null pointer dereferencing.
Fixes PR kern/52225.


Revision tags: prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1
# 1.20 16-Apr-2017 riastradh

branches: 1.20.2;
Can't destroy pb until we're done using it.


Revision tags: jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204
# 1.19 20-Jan-2017 maya

Check pmf_device_register return value. NFC
Appeases static analyzers.


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.18 14-Jul-2016 msaitoh

branches: 1.18.2; 1.18.4;
- Use aprint*() instead of printf() in xxx_attach().
- Add missing aprint_naive("\n");
- KNF


Revision tags: nick-nhusb-base-20160907 nick-nhusb-base-20160529
# 1.17 21-May-2016 salazar

fix double require bug


Revision tags: nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606 nick-nhusb-base-20150406
# 1.16 07-Feb-2015 christos

plug leak on error. Reported by:
http://www.m00nbsd.net/ae123a9bae03f7dde5c6d654412daf5a.html#Report-4


# 1.15 30-Nov-2014 lneto

lua(4): fixed require


Revision tags: nick-nhusb-base
# 1.14 24-Sep-2014 mbalmer

branches: 1.14.2;
whitespace, knf, comments, but no functional change


Revision tags: tls-maxphys-base netbsd-7-base tls-earlyentropy-base
# 1.13 25-Jul-2014 dholland

branches: 1.13.2; 1.13.4;
Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.


# 1.12 19-Jul-2014 lneto

lua: updated from 5.1 to 5.3 work3

* lua(1):
- changed lua_Integer to intmax_t
- updated distrib/sets/lists and etc/mtree
- updated bsd.lua.mk
- fixed bozohttpd (lua-bozo.c)
- compatibilized bindings: gpio, sqlite
* lua(4):
- removed floating-point and libc dependencies using '#ifndef _KERNEL'
- fixed division by zero and exponentiation
- libkern: added isalnum(), iscntrl(), isgraph(), isprint() and ispunct()
- acpica: removed isprint() from acnetbsd.h
- libc: moved strcspn.c, strpbrk.c and strspn.c to common
- removed stub headers
- compatibilized bindings: luapmf, luasystm
* reorganized luaconf.h
* updated doc/CHANGES and doc/RESPONSIBLE


# 1.11 19-Jul-2014 lneto

lua(4): uniformed the KPI name space using 'klua_' prefix


# 1.10 19-Jul-2014 lneto

lua(4): using lua_CFunction


# 1.9 19-Jul-2014 lneto

lua(4): added support for running Lua scripts in intr context

* using kmem_intr on lua_alloc
* using mutex directly on klua_lock
* added ipl arg on klua_newstate()
* added kluaL_newstate function
* fixed synchronization: locking the Lua state on luaioctl


Revision tags: rmind-smpnet-base rmind-smpnet-nbase yamt-pagecache-base9 riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3
# 1.8 16-Mar-2014 dholland

branches: 1.8.2; 1.8.4; 1.8.6;
Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.


# 1.7 25-Feb-2014 pooka

Ensure that the top level sysctl nodes (kern, vfs, net, ...) exist before
the sysctl link sets are processed, and remove redundancy.

Shaves >13kB off of an amd64 GENERIC, not to mention >1k duplicate
lines of code.


# 1.6 04-Dec-2013 lneto

fixed lua(4) alloc (nsize can be lesser than osize)


# 1.5 23-Nov-2013 mbalmer

switch from malloc(9) to kmem(9)


# 1.4 29-Oct-2013 mbalmer

initialize variables


# 1.3 23-Oct-2013 mbalmer

use MODULE_CLASS_MISC for Lua modules


# 1.2 18-Oct-2013 mbalmer

fix CVS marker and copyright year


# 1.1 16-Oct-2013 mbalmer

welcome lua(4), a devide driver that can create and control Lua states inside the kernel


# 1.21 11-May-2017 mbalmer

Avoid possible null pointer dereferencing.
Fixes PR kern/52225.


Revision tags: prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1
# 1.20 16-Apr-2017 riastradh

branches: 1.20.2;
Can't destroy pb until we're done using it.


Revision tags: jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204
# 1.19 20-Jan-2017 maya

Check pmf_device_register return value. NFC
Appeases static analyzers.


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.18 14-Jul-2016 msaitoh

branches: 1.18.2; 1.18.4;
- Use aprint*() instead of printf() in xxx_attach().
- Add missing aprint_naive("\n");
- KNF


Revision tags: nick-nhusb-base-20160907 nick-nhusb-base-20160529
# 1.17 21-May-2016 salazar

fix double require bug


Revision tags: nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606 nick-nhusb-base-20150406
# 1.16 07-Feb-2015 christos

plug leak on error. Reported by:
http://www.m00nbsd.net/ae123a9bae03f7dde5c6d654412daf5a.html#Report-4


# 1.15 30-Nov-2014 lneto

lua(4): fixed require


Revision tags: nick-nhusb-base
# 1.14 24-Sep-2014 mbalmer

branches: 1.14.2;
whitespace, knf, comments, but no functional change


Revision tags: tls-maxphys-base netbsd-7-base tls-earlyentropy-base
# 1.13 25-Jul-2014 dholland

branches: 1.13.2; 1.13.4;
Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.


# 1.12 19-Jul-2014 lneto

lua: updated from 5.1 to 5.3 work3

* lua(1):
- changed lua_Integer to intmax_t
- updated distrib/sets/lists and etc/mtree
- updated bsd.lua.mk
- fixed bozohttpd (lua-bozo.c)
- compatibilized bindings: gpio, sqlite
* lua(4):
- removed floating-point and libc dependencies using '#ifndef _KERNEL'
- fixed division by zero and exponentiation
- libkern: added isalnum(), iscntrl(), isgraph(), isprint() and ispunct()
- acpica: removed isprint() from acnetbsd.h
- libc: moved strcspn.c, strpbrk.c and strspn.c to common
- removed stub headers
- compatibilized bindings: luapmf, luasystm
* reorganized luaconf.h
* updated doc/CHANGES and doc/RESPONSIBLE


# 1.11 19-Jul-2014 lneto

lua(4): uniformed the KPI name space using 'klua_' prefix


# 1.10 19-Jul-2014 lneto

lua(4): using lua_CFunction


# 1.9 19-Jul-2014 lneto

lua(4): added support for running Lua scripts in intr context

* using kmem_intr on lua_alloc
* using mutex directly on klua_lock
* added ipl arg on klua_newstate()
* added kluaL_newstate function
* fixed synchronization: locking the Lua state on luaioctl


Revision tags: rmind-smpnet-base rmind-smpnet-nbase yamt-pagecache-base9 riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3
# 1.8 16-Mar-2014 dholland

branches: 1.8.2; 1.8.4; 1.8.6;
Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.


# 1.7 25-Feb-2014 pooka

Ensure that the top level sysctl nodes (kern, vfs, net, ...) exist before
the sysctl link sets are processed, and remove redundancy.

Shaves >13kB off of an amd64 GENERIC, not to mention >1k duplicate
lines of code.


# 1.6 04-Dec-2013 lneto

fixed lua(4) alloc (nsize can be lesser than osize)


# 1.5 23-Nov-2013 mbalmer

switch from malloc(9) to kmem(9)


# 1.4 29-Oct-2013 mbalmer

initialize variables


# 1.3 23-Oct-2013 mbalmer

use MODULE_CLASS_MISC for Lua modules


# 1.2 18-Oct-2013 mbalmer

fix CVS marker and copyright year


# 1.1 16-Oct-2013 mbalmer

welcome lua(4), a devide driver that can create and control Lua states inside the kernel


Revision tags: prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1
# 1.20 16-Apr-2017 riastradh

Can't destroy pb until we're done using it.


Revision tags: jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204
# 1.19 20-Jan-2017 maya

Check pmf_device_register return value. NFC
Appeases static analyzers.


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.18 14-Jul-2016 msaitoh

branches: 1.18.2; 1.18.4;
- Use aprint*() instead of printf() in xxx_attach().
- Add missing aprint_naive("\n");
- KNF


Revision tags: nick-nhusb-base-20160907 nick-nhusb-base-20160529
# 1.17 21-May-2016 salazar

fix double require bug


Revision tags: nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606 nick-nhusb-base-20150406
# 1.16 07-Feb-2015 christos

plug leak on error. Reported by:
http://www.m00nbsd.net/ae123a9bae03f7dde5c6d654412daf5a.html#Report-4


# 1.15 30-Nov-2014 lneto

lua(4): fixed require


Revision tags: nick-nhusb-base
# 1.14 24-Sep-2014 mbalmer

branches: 1.14.2;
whitespace, knf, comments, but no functional change


Revision tags: tls-maxphys-base netbsd-7-base tls-earlyentropy-base
# 1.13 25-Jul-2014 dholland

branches: 1.13.2; 1.13.4;
Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.


# 1.12 19-Jul-2014 lneto

lua: updated from 5.1 to 5.3 work3

* lua(1):
- changed lua_Integer to intmax_t
- updated distrib/sets/lists and etc/mtree
- updated bsd.lua.mk
- fixed bozohttpd (lua-bozo.c)
- compatibilized bindings: gpio, sqlite
* lua(4):
- removed floating-point and libc dependencies using '#ifndef _KERNEL'
- fixed division by zero and exponentiation
- libkern: added isalnum(), iscntrl(), isgraph(), isprint() and ispunct()
- acpica: removed isprint() from acnetbsd.h
- libc: moved strcspn.c, strpbrk.c and strspn.c to common
- removed stub headers
- compatibilized bindings: luapmf, luasystm
* reorganized luaconf.h
* updated doc/CHANGES and doc/RESPONSIBLE


# 1.11 19-Jul-2014 lneto

lua(4): uniformed the KPI name space using 'klua_' prefix


# 1.10 19-Jul-2014 lneto

lua(4): using lua_CFunction


# 1.9 19-Jul-2014 lneto

lua(4): added support for running Lua scripts in intr context

* using kmem_intr on lua_alloc
* using mutex directly on klua_lock
* added ipl arg on klua_newstate()
* added kluaL_newstate function
* fixed synchronization: locking the Lua state on luaioctl


Revision tags: rmind-smpnet-base rmind-smpnet-nbase yamt-pagecache-base9 riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3
# 1.8 16-Mar-2014 dholland

branches: 1.8.2; 1.8.4; 1.8.6;
Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.


# 1.7 25-Feb-2014 pooka

Ensure that the top level sysctl nodes (kern, vfs, net, ...) exist before
the sysctl link sets are processed, and remove redundancy.

Shaves >13kB off of an amd64 GENERIC, not to mention >1k duplicate
lines of code.


# 1.6 04-Dec-2013 lneto

fixed lua(4) alloc (nsize can be lesser than osize)


# 1.5 23-Nov-2013 mbalmer

switch from malloc(9) to kmem(9)


# 1.4 29-Oct-2013 mbalmer

initialize variables


# 1.3 23-Oct-2013 mbalmer

use MODULE_CLASS_MISC for Lua modules


# 1.2 18-Oct-2013 mbalmer

fix CVS marker and copyright year


# 1.1 16-Oct-2013 mbalmer

welcome lua(4), a devide driver that can create and control Lua states inside the kernel


# 1.19 20-Jan-2017 maya

Check pmf_device_register return value. NFC
Appeases static analyzers.


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.18 14-Jul-2016 msaitoh

- Use aprint*() instead of printf() in xxx_attach().
- Add missing aprint_naive("\n");
- KNF


Revision tags: nick-nhusb-base-20160907 nick-nhusb-base-20160529
# 1.17 21-May-2016 salazar

fix double require bug


Revision tags: nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606 nick-nhusb-base-20150406
# 1.16 07-Feb-2015 christos

plug leak on error. Reported by:
http://www.m00nbsd.net/ae123a9bae03f7dde5c6d654412daf5a.html#Report-4


# 1.15 30-Nov-2014 lneto

lua(4): fixed require


Revision tags: nick-nhusb-base
# 1.14 24-Sep-2014 mbalmer

branches: 1.14.2;
whitespace, knf, comments, but no functional change


Revision tags: tls-maxphys-base netbsd-7-base tls-earlyentropy-base
# 1.13 25-Jul-2014 dholland

branches: 1.13.2; 1.13.4;
Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.


# 1.12 19-Jul-2014 lneto

lua: updated from 5.1 to 5.3 work3

* lua(1):
- changed lua_Integer to intmax_t
- updated distrib/sets/lists and etc/mtree
- updated bsd.lua.mk
- fixed bozohttpd (lua-bozo.c)
- compatibilized bindings: gpio, sqlite
* lua(4):
- removed floating-point and libc dependencies using '#ifndef _KERNEL'
- fixed division by zero and exponentiation
- libkern: added isalnum(), iscntrl(), isgraph(), isprint() and ispunct()
- acpica: removed isprint() from acnetbsd.h
- libc: moved strcspn.c, strpbrk.c and strspn.c to common
- removed stub headers
- compatibilized bindings: luapmf, luasystm
* reorganized luaconf.h
* updated doc/CHANGES and doc/RESPONSIBLE


# 1.11 19-Jul-2014 lneto

lua(4): uniformed the KPI name space using 'klua_' prefix


# 1.10 19-Jul-2014 lneto

lua(4): using lua_CFunction


# 1.9 19-Jul-2014 lneto

lua(4): added support for running Lua scripts in intr context

* using kmem_intr on lua_alloc
* using mutex directly on klua_lock
* added ipl arg on klua_newstate()
* added kluaL_newstate function
* fixed synchronization: locking the Lua state on luaioctl


Revision tags: rmind-smpnet-base rmind-smpnet-nbase yamt-pagecache-base9 riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3
# 1.8 16-Mar-2014 dholland

branches: 1.8.2; 1.8.4; 1.8.6;
Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.


# 1.7 25-Feb-2014 pooka

Ensure that the top level sysctl nodes (kern, vfs, net, ...) exist before
the sysctl link sets are processed, and remove redundancy.

Shaves >13kB off of an amd64 GENERIC, not to mention >1k duplicate
lines of code.


# 1.6 04-Dec-2013 lneto

fixed lua(4) alloc (nsize can be lesser than osize)


# 1.5 23-Nov-2013 mbalmer

switch from malloc(9) to kmem(9)


# 1.4 29-Oct-2013 mbalmer

initialize variables


# 1.3 23-Oct-2013 mbalmer

use MODULE_CLASS_MISC for Lua modules


# 1.2 18-Oct-2013 mbalmer

fix CVS marker and copyright year


# 1.1 16-Oct-2013 mbalmer

welcome lua(4), a devide driver that can create and control Lua states inside the kernel


Revision tags: nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.18 14-Jul-2016 msaitoh

- Use aprint*() instead of printf() in xxx_attach().
- Add missing aprint_naive("\n");
- KNF


Revision tags: nick-nhusb-base-20160907 nick-nhusb-base-20160529
# 1.17 21-May-2016 salazar

fix double require bug


Revision tags: nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606 nick-nhusb-base-20150406
# 1.16 07-Feb-2015 christos

plug leak on error. Reported by:
http://www.m00nbsd.net/ae123a9bae03f7dde5c6d654412daf5a.html#Report-4


# 1.15 30-Nov-2014 lneto

lua(4): fixed require


Revision tags: nick-nhusb-base
# 1.14 24-Sep-2014 mbalmer

branches: 1.14.2;
whitespace, knf, comments, but no functional change


Revision tags: tls-maxphys-base netbsd-7-base tls-earlyentropy-base
# 1.13 25-Jul-2014 dholland

branches: 1.13.2; 1.13.4;
Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.


# 1.12 19-Jul-2014 lneto

lua: updated from 5.1 to 5.3 work3

* lua(1):
- changed lua_Integer to intmax_t
- updated distrib/sets/lists and etc/mtree
- updated bsd.lua.mk
- fixed bozohttpd (lua-bozo.c)
- compatibilized bindings: gpio, sqlite
* lua(4):
- removed floating-point and libc dependencies using '#ifndef _KERNEL'
- fixed division by zero and exponentiation
- libkern: added isalnum(), iscntrl(), isgraph(), isprint() and ispunct()
- acpica: removed isprint() from acnetbsd.h
- libc: moved strcspn.c, strpbrk.c and strspn.c to common
- removed stub headers
- compatibilized bindings: luapmf, luasystm
* reorganized luaconf.h
* updated doc/CHANGES and doc/RESPONSIBLE


# 1.11 19-Jul-2014 lneto

lua(4): uniformed the KPI name space using 'klua_' prefix


# 1.10 19-Jul-2014 lneto

lua(4): using lua_CFunction


# 1.9 19-Jul-2014 lneto

lua(4): added support for running Lua scripts in intr context

* using kmem_intr on lua_alloc
* using mutex directly on klua_lock
* added ipl arg on klua_newstate()
* added kluaL_newstate function
* fixed synchronization: locking the Lua state on luaioctl


Revision tags: rmind-smpnet-base rmind-smpnet-nbase yamt-pagecache-base9 riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3
# 1.8 16-Mar-2014 dholland

branches: 1.8.2; 1.8.4; 1.8.6;
Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.


# 1.7 25-Feb-2014 pooka

Ensure that the top level sysctl nodes (kern, vfs, net, ...) exist before
the sysctl link sets are processed, and remove redundancy.

Shaves >13kB off of an amd64 GENERIC, not to mention >1k duplicate
lines of code.


# 1.6 04-Dec-2013 lneto

fixed lua(4) alloc (nsize can be lesser than osize)


# 1.5 23-Nov-2013 mbalmer

switch from malloc(9) to kmem(9)


# 1.4 29-Oct-2013 mbalmer

initialize variables


# 1.3 23-Oct-2013 mbalmer

use MODULE_CLASS_MISC for Lua modules


# 1.2 18-Oct-2013 mbalmer

fix CVS marker and copyright year


# 1.1 16-Oct-2013 mbalmer

welcome lua(4), a devide driver that can create and control Lua states inside the kernel