History log of /netbsd-src/sys/modules/lua/lua.c (Results 1 – 25 of 28)
Revision Date Author Comments
# 97f8debd 31-Mar-2022 pgoyette <pgoyette@NetBSD.org>

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 dev

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).

show more ...


# 9c8bf6ee 08-Aug-2021 rin <rin@NetBSD.org>

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


# 46895156 07-Aug-2021 rin <rin@NetBSD.org>

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

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.

show more ...


# 723d09ce 29-Jun-2021 dholland <dholland@NetBSD.org>

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
violatio

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.)

show more ...


# 63f6d58f 26-Dec-2017 martin <martin@NetBSD.org>

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

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).

show more ...


# 934d80f7 20-May-2017 mbalmer <mbalmer@NetBSD.org>

always put the module on the stack


# d191c429 20-May-2017 mbalmer <mbalmer@NetBSD.org>

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


# 3c246ec0 11-May-2017 mbalmer <mbalmer@NetBSD.org>

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


# e67dab8d 16-Apr-2017 riastradh <riastradh@NetBSD.org>

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


# b8f12c7f 20-Jan-2017 maya <maya@NetBSD.org>

Check pmf_device_register return value. NFC
Appeases static analyzers.


# d21ffc75 14-Jul-2016 msaitoh <msaitoh@NetBSD.org>

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


# 7093afb2 21-May-2016 salazar <salazar@NetBSD.org>

fix double require bug


# 4bb71db0 07-Feb-2015 christos <christos@NetBSD.org>

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


# 26258645 30-Nov-2014 lneto <lneto@NetBSD.org>

lua(4): fixed require


# 433f0999 24-Sep-2014 mbalmer <mbalmer@NetBSD.org>

whitespace, knf, comments, but no functional change


# f9228f42 25-Jul-2014 dholland <dholland@NetBSD.org>

Add d_discard to all struct cdevsw instances I could find.

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


# 4ab4902e 19-Jul-2014 lneto <lneto@NetBSD.org>

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)
- compatibiliz

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

show more ...


# 4e28dab9 19-Jul-2014 lneto <lneto@NetBSD.org>

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


# 094cf69f 19-Jul-2014 lneto <lneto@NetBSD.org>

lua(4): using lua_CFunction


# ba791a5e 19-Jul-2014 lneto <lneto@NetBSD.org>

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
*

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

show more ...


# a68f9396 16-Mar-2014 dholland <dholland@NetBSD.org>

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

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.

show more ...


# 4f6fb3bf 25-Feb-2014 pooka <pooka@NetBSD.org>

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 duplicat

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.

show more ...


# a8dd600b 04-Dec-2013 lneto <lneto@NetBSD.org>

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


# b345b17f 23-Nov-2013 mbalmer <mbalmer@NetBSD.org>

switch from malloc(9) to kmem(9)


# 3b5eeb2b 29-Oct-2013 mbalmer <mbalmer@NetBSD.org>

initialize variables


12