diff options
author | klu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524> | 2007-11-05 06:29:00 +0000 |
---|---|---|
committer | klu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524> | 2007-11-05 06:29:00 +0000 |
commit | a4c9ede55fdd3de2c9138f45c4e1ca42947ed549 (patch) | |
tree | 7d62bdc0cf8aa04e79ca5a6cebaf82ddef9894be /Nt32Pkg/FvbServicesRuntimeDxe | |
parent | a3589760c461266cca9a88a27fa9b54454dc9b82 (diff) | |
download | edk2-platforms-a4c9ede55fdd3de2c9138f45c4e1ca42947ed549.tar.xz |
the implementation of FVB->SetAttribute() interface should check the unchanged bit in parameter at first.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4267 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'Nt32Pkg/FvbServicesRuntimeDxe')
-rw-r--r-- | Nt32Pkg/FvbServicesRuntimeDxe/FWBlockService.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Nt32Pkg/FvbServicesRuntimeDxe/FWBlockService.c b/Nt32Pkg/FvbServicesRuntimeDxe/FWBlockService.c index 7b00fd9b3a..a95d3b400d 100644 --- a/Nt32Pkg/FvbServicesRuntimeDxe/FWBlockService.c +++ b/Nt32Pkg/FvbServicesRuntimeDxe/FWBlockService.c @@ -740,6 +740,7 @@ Returns: UINT32 OldStatus;
UINT32 NewStatus;
EFI_STATUS Status;
+ EFI_FVB_ATTRIBUTES UnchangedAttributes;
//
// Find the right instance of the FVB private data
@@ -758,6 +759,24 @@ Returns: OldStatus = OldAttributes & EFI_FVB2_STATUS;
NewStatus = *Attributes & EFI_FVB2_STATUS;
+ UnchangedAttributes = EFI_FVB2_READ_DISABLED_CAP | \
+ EFI_FVB2_READ_ENABLED_CAP | \
+ EFI_FVB2_WRITE_DISABLED_CAP | \
+ EFI_FVB2_WRITE_ENABLED_CAP | \
+ EFI_FVB2_LOCK_CAP | \
+ EFI_FVB2_STICKY_WRITE | \
+ EFI_FVB2_MEMORY_MAPPED | \
+ EFI_FVB2_ERASE_POLARITY | \
+ EFI_FVB2_READ_LOCK_CAP | \
+ EFI_FVB2_WRITE_LOCK_CAP | \
+ EFI_FVB2_ALIGNMENT;
+
+ //
+ // Some attributes of FV is read only can *not* be set
+ //
+ if ((OldAttributes & UnchangedAttributes) ^ (*Attributes & UnchangedAttributes)) {
+ return EFI_INVALID_PARAMETER;
+ }
//
// If firmware volume is locked, no status bit can be updated
//
|