From f5cf4f706ec27e995b8431f885b61b5cdbcef968 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Tue, 19 Jul 2016 16:44:18 +0100 Subject: [PATCH] [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 --- src/core/settings.c | 2 ++ src/include/ipxe/settings.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/core/settings.c b/src/core/settings.c index 42bb5e53..c306054d 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 07ebaa62..8cc0b6bb 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; }; /**