]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
init_main: Switch from SLIST to STAILQ, fix order
authorColin Percival <cperciva@FreeBSD.org>
Tue, 5 Sep 2023 23:46:38 +0000 (16:46 -0700)
committerColin Percival <cperciva@FreeBSD.org>
Wed, 6 Sep 2023 18:36:36 +0000 (11:36 -0700)
commit71679cf468ba28c0e3c88371f3fde13fccec99bd
treed8dcdc33240998f786a4c0fe983ac80fc2de5f14
parent8f26d01f53316c055cc1116eb56ff438da50d831
init_main: Switch from SLIST to STAILQ, fix order

Constructing an SLIST of SYSINITs by inserting them one by one at the
head of the list resulted in them being sorted in anti-stable order:
When two SYSINITs tied for (subsystem, order), they were executed in
the reverse order to the order in which they appeared in the linker
set.

Note that while this changes struct sysinit, it doesn't affect ABI
since SLIST_ENTRY and STAILQ_ENTRY are compatible (in both cases a
single pointer to the next element).

Fixes: 9a7add6d01f3 "init_main: Switch from sysinit array to SLIST"
Reported by: gallatin
Reviewed by: jhb, gallatin, emaste
Tested by: gallatin
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D41748
sys/kern/init_main.c
sys/sys/kernel.h