Bladeren bron

[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 <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 8 jaren geleden
bovenliggende
commit
f5cf4f706e
2 gewijzigde bestanden met toevoegingen van 4 en 0 verwijderingen
  1. 2
    0
      src/core/settings.c
  2. 2
    0
      src/include/ipxe/settings.h

+ 2
- 0
src/core/settings.c Bestand weergeven

@@ -452,6 +452,8 @@ static void reprioritise_settings ( struct settings *settings ) {
452 452
 		tmp_priority = fetch_intz_setting ( tmp, &priority_setting );
453 453
 		if ( priority > tmp_priority )
454 454
 			break;
455
+		if ( settings->order > tmp->order )
456
+			break;
455 457
 	}
456 458
 	list_add_tail ( &settings->siblings, &tmp->siblings );
457 459
 

+ 2
- 0
src/include/ipxe/settings.h Bestand weergeven

@@ -144,6 +144,8 @@ struct settings {
144 144
 	struct settings_operations *op;
145 145
 	/** Default scope for numerical settings constructed for this block */
146 146
 	const struct settings_scope *default_scope;
147
+	/** Sibling ordering */
148
+	int order;
147 149
 };
148 150
 
149 151
 /**

Laden…
Annuleren
Opslaan