git: cedc82c0466a - main - struct sysinit: Add SLIST_ENTRY(sysinit) next
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 20 Aug 2023 05:05:42 UTC
The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=cedc82c0466a5116d5a89ecd1f10a69be1a31ca0 commit cedc82c0466a5116d5a89ecd1f10a69be1a31ca0 Author: Colin Percival <cperciva@FreeBSD.org> AuthorDate: 2023-07-18 02:20:05 +0000 Commit: Colin Percival <cperciva@FreeBSD.org> CommitDate: 2023-08-20 05:04:55 +0000 struct sysinit: Add SLIST_ENTRY(sysinit) next This will be used to put SYSINITs onto a linked list. Reviewed by: jhb, emaste Sponsored by: https://www.patreon.com/cperciva Differential Revision: https://reviews.freebsd.org/D41074 --- share/man/man9/SYSINIT.9 | 1 + sys/sys/kernel.h | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/share/man/man9/SYSINIT.9 b/share/man/man9/SYSINIT.9 index cf5dbe2e797f..ae360a95c44f 100644 --- a/share/man/man9/SYSINIT.9 +++ b/share/man/man9/SYSINIT.9 @@ -60,6 +60,7 @@ are defined in struct sysinit { enum sysinit_sub_id subsystem; /* subsystem identifier*/ enum sysinit_elem_order order; /* init order within subsystem*/ + SLIST_ENTRY(sysinit) next; /* singly-linked list */ sysinit_cfunc_t func; /* function */ const void *udata; /* multiplexer/argument */ }; diff --git a/sys/sys/kernel.h b/sys/sys/kernel.h index b6059858394b..12e346514d1a 100644 --- a/sys/sys/kernel.h +++ b/sys/sys/kernel.h @@ -50,7 +50,7 @@ #ifdef _KERNEL -/* for intrhook below */ +/* for intrhook and sysinit linked list below */ #include <sys/queue.h> /* for timestamping SYSINITs; other files may assume this is included here */ @@ -220,6 +220,7 @@ typedef void (*sysinit_cfunc_t)(const void *); struct sysinit { enum sysinit_sub_id subsystem; /* subsystem identifier*/ enum sysinit_elem_order order; /* init order within subsystem*/ + SLIST_ENTRY(sysinit) next; /* singly-linked list */ sysinit_cfunc_t func; /* function */ const void *udata; /* multiplexer/argument */ }; @@ -260,6 +261,7 @@ sysinit_tslog_shim(const void * data) static struct sysinit uniquifier ## _sys_init = { \ subsystem, \ order, \ + { NULL }, \ sysinit_tslog_shim, \ &uniquifier ## _sys_init_tslog \ }; \ @@ -269,6 +271,7 @@ sysinit_tslog_shim(const void * data) static struct sysinit uniquifier ## _sys_init = { \ subsystem, \ order, \ + { NULL }, \ func, \ (ident) \ }; \ @@ -286,6 +289,7 @@ sysinit_tslog_shim(const void * data) static struct sysinit uniquifier ## _sys_uninit = { \ subsystem, \ order, \ + { NULL }, \ func, \ (ident) \ }; \