hw.bus.info: rework handler

hw.bus.info was added in r68522 as a node, but there was never anything
connected "behind" it.  Its only purpose is to return a struct u_businfo.
The only in-base consumer are devinfo(3)/devinfo(8).
Rewrite the handler as SYSCTL_PROC and mark it as MPSAFE and read-only
as there never was a writable path.

Reviewed by:	kib
Approved by:	kib (mentor)
Sponsored by:	Mysterious Code Ltd.
Differential Revision:	https://reviews.freebsd.org/D25321
This commit is contained in:
Pawel Biernacki 2020-06-18 21:42:54 +00:00
parent 8a15ac8378
commit 049264c5cc
2 changed files with 5 additions and 4 deletions

View File

@ -5454,7 +5454,7 @@ print_devclass_list(void)
*/
static int
sysctl_bus(SYSCTL_HANDLER_ARGS)
sysctl_bus_info(SYSCTL_HANDLER_ARGS)
{
struct u_businfo ubus;
@ -5463,7 +5463,8 @@ sysctl_bus(SYSCTL_HANDLER_ARGS)
return (SYSCTL_OUT(req, &ubus, sizeof(ubus)));
}
SYSCTL_NODE(_hw_bus, OID_AUTO, info, CTLFLAG_RW | CTLFLAG_NEEDGIANT, sysctl_bus,
SYSCTL_PROC(_hw_bus, OID_AUTO, info, CTLTYPE_STRUCT | CTLFLAG_RD |
CTLFLAG_MPSAFE, NULL, 0, sysctl_bus_info, "S,u_businfo",
"bus-related data");
static int
@ -5555,7 +5556,8 @@ bus_data_generation_check(int generation)
void
bus_data_generation_update(void)
{
bus_data_generation++;
atomic_add_int(&bus_data_generation, 1);
}
int

View File

@ -1122,7 +1122,6 @@ SYSCTL_DECL(_dev);
SYSCTL_DECL(_hw);
SYSCTL_DECL(_hw_bus);
SYSCTL_DECL(_hw_bus_devices);
SYSCTL_DECL(_hw_bus_info);
SYSCTL_DECL(_machdep);
SYSCTL_DECL(_machdep_mitigations);
SYSCTL_DECL(_user);