소스 검색

[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 9 년 전
부모
커밋
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
 		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 파일 보기

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…
취소
저장