瀏覽代碼

[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 年之前
父節點
當前提交
f5cf4f706e
共有 2 個文件被更改,包括 4 次插入0 次删除
  1. 2
    0
      src/core/settings.c
  2. 2
    0
      src/include/ipxe/settings.h

+ 2
- 0
src/core/settings.c 查看文件

@@ -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 查看文件

@@ -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
 /**

Loading…
取消
儲存