Commit Graph

12 Commits

Author SHA1 Message Date
Jean-Sébastien Pédron
a04aa80e77
lindebugfs: Add debugfs_create_file_size()
This is the same as `debugfs_create_file()` but takes the initial size
of the file. In FreeBSD, the given size is ignored and
`debugfs_create_file()` is called.

Reviewed by:	emaste, manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D37914
2023-01-25 23:23:16 +01:00
Jean-Sébastien Pédron
976aa07a88
lindebugfs: Add missing debugfs_create_u*() and debugfs_create_x*()
The `debugfs_create_x*()` variants are the same as their
`debugfs_create_u*()` equivalent, but they work with lowercase
hexadecimal.

While here, fix a few style(9) issues.

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D38087
2023-01-25 22:26:52 +01:00
Jean-Sébastien Pédron
f2044a3030
lindebugfs: Add debugfs_create_atomic_t()
Reviewed by:	jfree
Approved by:	jfree
Differential Revision:	https://reviews.freebsd.org/D37915
2023-01-25 22:26:32 +01:00
Bjoern A. Zeeb
0fce2dc157 LinuxKPI,lindebugfs: add u8 base type and blob support
Add debugfs_create_u8() based on other already present implementations.
Add a read-only implementation for debugfs_create_blob().

Both are needed for iwlwifi debugfs support.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
OKed by:	jfree (earlier version)
Differential Revision: https://reviews.freebsd.org/D37090
2022-11-28 17:21:50 +00:00
Jake Freeland
f697b9432d linuxkpi: drm-kmod debugfs support
This diff extends LinuxKPI to support simple attribute files in debugfs.
These simple attributes are an essential component for compiling drm-kmod
with CONFIG_DEBUG_FS enabled.
This will allow for easier graphics driver debugging using
Intel's igt-gpu-tools.

Reviewed by:	hselasky
Differential Revision:	https://reviews.freebsd.org/D35883
Sponsored by:	Google, Inc. (GSoC 2022)
2022-09-20 19:41:10 +02:00
Hans Petter Selasky
68ec2949ad lindebugfs: The Linux file operations use negative return values in the kernel.
Fix sign.

MFC after:	1 week
Sponsored by:	NVIDIA Networking
2022-03-11 17:41:33 +01:00
Hans Petter Selasky
88a29d89eb lindebugfs: Zero the linux_file structure before use.
This avoids clients using garbage values on the stack and makes
debugging easier.

MFC after:	1 week
Sponsored by:	NVIDIA Networking
2022-03-11 17:41:33 +01:00
Emmanuel Vadot
867b4decb4 lindebugfs: Fix write
For write operation pseudofs creates an sbuf with the data.
Use this data instead of the uio as it's not usable anymore after
uiomove.

Reviewed by:	hselasky
MFC after:	1 week
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D34114
2022-02-04 14:31:08 +01:00
Mark Johnston
46888dedc9 Add emulation support for the Linux kcov(4) ioctl API.
This makes it possible to run an unmodified Linux syzkaller executor
against the Linuxulator, and have it gather code coverage information.

Sponsored by:	The FreeBSD Foundation
2020-09-04 00:12:28 +00:00
Mateusz Guzik
1a18003240 compat: clean up empty lines in .c and .h files 2020-09-01 21:24:33 +00:00
Johannes Lundberg
03f1cf9f32 LinuxKPI: Finalize move of lindebugfs from ports to base.
The source file was moved to base earlier and also improved upon,
but never compiled in. This patch will:
- Make a module in sys/modules
- Make lindebugfs depend on linuxkpi (for seq_file)
- Check if read/write functions are set before calling, DRM drivers
  don't always set both of them.

Reviewed by:	hps
Approved by:	imp (mentor), hps
MFC after:	1 week
2019-05-19 15:44:21 +00:00
Matt Macy
3f6cab079c import linux debugfs support
Reviewed by:	hps@
MFC after:	1 week
Sponsored by:	iX Systems
Differential Revision:	https://reviews.freebsd.org/D19258
2019-02-23 20:56:41 +00:00