Browse Source

[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 years ago
parent
commit
f5cf4f706e
2 changed files with 4 additions and 0 deletions
  1. 2
    0
      src/core/settings.c
  2. 2
    0
      src/include/ipxe/settings.h

+ 2
- 0
src/core/settings.c View File

452
 		tmp_priority = fetch_intz_setting ( tmp, &priority_setting );
452
 		tmp_priority = fetch_intz_setting ( tmp, &priority_setting );
453
 		if ( priority > tmp_priority )
453
 		if ( priority > tmp_priority )
454
 			break;
454
 			break;
455
+		if ( settings->order > tmp->order )
456
+			break;
455
 	}
457
 	}
456
 	list_add_tail ( &settings->siblings, &tmp->siblings );
458
 	list_add_tail ( &settings->siblings, &tmp->siblings );
457
 
459
 

+ 2
- 0
src/include/ipxe/settings.h View File

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

Loading…
Cancel
Save