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:
parent
8a15ac8378
commit
049264c5cc
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=362343
@ -5454,7 +5454,7 @@ print_devclass_list(void)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
static int
|
static int
|
||||||
sysctl_bus(SYSCTL_HANDLER_ARGS)
|
sysctl_bus_info(SYSCTL_HANDLER_ARGS)
|
||||||
{
|
{
|
||||||
struct u_businfo ubus;
|
struct u_businfo ubus;
|
||||||
|
|
||||||
@ -5463,7 +5463,8 @@ sysctl_bus(SYSCTL_HANDLER_ARGS)
|
|||||||
|
|
||||||
return (SYSCTL_OUT(req, &ubus, sizeof(ubus)));
|
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");
|
"bus-related data");
|
||||||
|
|
||||||
static int
|
static int
|
||||||
@ -5555,7 +5556,8 @@ bus_data_generation_check(int generation)
|
|||||||
void
|
void
|
||||||
bus_data_generation_update(void)
|
bus_data_generation_update(void)
|
||||||
{
|
{
|
||||||
bus_data_generation++;
|
|
||||||
|
atomic_add_int(&bus_data_generation, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -1122,7 +1122,6 @@ SYSCTL_DECL(_dev);
|
|||||||
SYSCTL_DECL(_hw);
|
SYSCTL_DECL(_hw);
|
||||||
SYSCTL_DECL(_hw_bus);
|
SYSCTL_DECL(_hw_bus);
|
||||||
SYSCTL_DECL(_hw_bus_devices);
|
SYSCTL_DECL(_hw_bus_devices);
|
||||||
SYSCTL_DECL(_hw_bus_info);
|
|
||||||
SYSCTL_DECL(_machdep);
|
SYSCTL_DECL(_machdep);
|
||||||
SYSCTL_DECL(_machdep_mitigations);
|
SYSCTL_DECL(_machdep_mitigations);
|
||||||
SYSCTL_DECL(_user);
|
SYSCTL_DECL(_user);
|
||||||
|
Loading…
Reference in New Issue
Block a user