From: Michael Brown Date: Tue, 19 Jul 2016 15:44:18 +0000 (+0100) Subject: [settings] Allow settings blocks to specify a sibling ordering X-Git-Tag: v1.20.1~382 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f5cf4f706ec27e995b8431f885b61b5cdbcef968;p=thirdparty%2Fipxe.git [settings] Allow settings blocks to specify a sibling ordering Allow settings blocks to provide an explicit default ordering between siblings, with lower precedence than the existing ${priority} setting. Signed-off-by: Michael Brown --- diff --git a/src/core/settings.c b/src/core/settings.c index 42bb5e53f..c306054d6 100644 --- a/src/core/settings.c +++ b/src/core/settings.c @@ -452,6 +452,8 @@ static void reprioritise_settings ( struct settings *settings ) { tmp_priority = fetch_intz_setting ( tmp, &priority_setting ); if ( priority > tmp_priority ) break; + if ( settings->order > tmp->order ) + break; } list_add_tail ( &settings->siblings, &tmp->siblings ); diff --git a/src/include/ipxe/settings.h b/src/include/ipxe/settings.h index 07ebaa620..8cc0b6bb7 100644 --- a/src/include/ipxe/settings.h +++ b/src/include/ipxe/settings.h @@ -144,6 +144,8 @@ struct settings { struct settings_operations *op; /** Default scope for numerical settings constructed for this block */ const struct settings_scope *default_scope; + /** Sibling ordering */ + int order; }; /**