HomeFreeBSD

init_main: Switch from SLIST to STAILQ, fix order

Description

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

Details

Provenance
cpercivaAuthored on Sep 5 2023, 11:46 PM
Reviewer
jhb
Differential Revision
D41748: init_main: Switch from SLIST to STAILQ, fix order
Parents
rG8f26d01f5331: arm64: Fix the TCR_EPD0 definition
Branches
Unknown
Tags
Unknown