Skip to content

Commit

Permalink
UefiPayloadPkg: Add min/max/step values and hex flag for CFR number opts
Browse files Browse the repository at this point in the history
Signed-off-by: Filip Brozovic <[email protected]>
  • Loading branch information
fbrozovic committed Jan 17, 2025
1 parent 3521c44 commit 49e57ec
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
10 changes: 6 additions & 4 deletions UefiPayloadPkg/CfrSetupMenuDxe/SetupMenuCfr.c
Original file line number Diff line number Diff line change
Expand Up @@ -602,10 +602,12 @@ CfrProcessNumericOption (
HiiDisplayStringId,
HiiHelpTextId,
QuestionFlags,
EFI_IFR_NUMERIC_SIZE_4 | EFI_IFR_DISPLAY_UINT_DEC,
0x00000000,
0xFFFFFFFF,
0,
EFI_IFR_NUMERIC_SIZE_4 |
((Option->flags & CFR_OPTFLAG_NUMBER_HEX) ?
EFI_IFR_DISPLAY_UINT_HEX : EFI_IFR_DISPLAY_UINT_DEC),
Option->min,
(Option->min == 0 && Option->max == 0) ? 0xFFFFFFFF : Option->max,
Option->step,
DefaultOpCodeHandle
);
ASSERT (TempHiiBuffer != NULL);
Expand Down
14 changes: 9 additions & 5 deletions UefiPayloadPkg/Include/Guid/CfrSetupMenuGuid.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,12 @@ extern EFI_GUID gEfiCfrSetupMenuFormGuid;
* TODO: "This should be documentation instead."
*/
enum cfr_option_flags {
CFR_OPTFLAG_READONLY = 1 << 0,
CFR_OPTFLAG_INACTIVE = 1 << 1,
CFR_OPTFLAG_SUPPRESS = 1 << 2,
CFR_OPTFLAG_VOLATILE = 1 << 3,
CFR_OPTFLAG_RUNTIME = 1 << 4,
CFR_OPTFLAG_READONLY = 1 << 0,
CFR_OPTFLAG_INACTIVE = 1 << 1,
CFR_OPTFLAG_SUPPRESS = 1 << 2,
CFR_OPTFLAG_VOLATILE = 1 << 3,
CFR_OPTFLAG_RUNTIME = 1 << 4,
CFR_OPTFLAG_NUMBER_HEX = 1 << 5,
};

#define CB_TAG_CFR_VARCHAR_OPT_NAME 0x0007
Expand Down Expand Up @@ -80,6 +81,9 @@ typedef struct {
UINT64 dependency_id; /* Dependent object ID, or 0 */
UINT32 flags; /* enum cfr_option_flags */
UINT32 default_value;
UINT32 min;
UINT32 max;
UINT32 step;
/*
* CFR_VARCHAR_OPT_NAME opt_name
* CFR_VARCHAR_UI_NAME ui_name
Expand Down

0 comments on commit 49e57ec

Please sign in to comment.