summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg
Commit message (Collapse)AuthorAgeFilesLines
* MdeModulePkg: Define a general function to create DNS QNameJiaxin Wu2016-02-182-1/+90
| | | | | | | | | | | | | | | | | | | This patch is used to define a general function to create DNS QName. QName is a domain name represented as a sequence of labels, where each label consists of a length octet followed by that number of octets. The domain name terminates with the zero length octet for the null label of the root. Cc: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com> Cc: El-Haj-Mahmoud Samer <samer.el-haj-mahmoud@hpe.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com>
* Merge branch 'master' of https://github.com/tianocore/edk2 into ↵jiewen yao2016-02-173-9/+9
|\ | | | | | | MemoryAttributeTable
| * MdeModulePkg: SNP should check Cdb.StatCode with PXE_STATCODE_SUCCESS.Fu Siyuan2016-02-172-5/+5
| | | | | | | | | | | | | | | | | | | | This patch fixes a bug in SNP driver that the Cdb.StatCode should be check with PXE_STATCODE_SUCCESS instead of EFI_SUCCESS. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com>
| * MdeModulePkg: Make the DEBUG info consistent in SNP driver.Fu Siyuan2016-02-172-4/+4
| | | | | | | | | | | | | | | | | | | | | | SNP driver will print the UNDI returned StatFlags:StatCode with DEBUG macro, while in some please it uses the reverse order (StatCode:StatFlags). This patch is to make the print info consistent, that StatFlags always come first. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com>
* | MdePkg: Update DxeCore INF for MemoryAttributesTable.jiewen yao2016-02-171-1/+3
| | | | | | | | | | | | | | | | Update DxeCore INF for MemoryAttributesTable. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: "Yao, Jiewen" <jiewen.yao@intel.com> Reviewed-by: "Gao, Liming" <liming.gao@intel.com>
* | MdePkg: Call CoreInitializeMemoryAttributesTable() in DXE Entrypoint.jiewen yao2016-02-171-1/+2
| | | | | | | | | | | | | | | | Call CoreInitializeMemoryAttributesTable() in DXE Entrypoint. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: "Yao, Jiewen" <jiewen.yao@intel.com> Reviewed-by: "Gao, Liming" <liming.gao@intel.com>
* | MdeModulePkg: Add CoreInitializeMemoryAttributesTable() to header file.jiewen yao2016-02-171-1/+10
| | | | | | | | | | | | | | | | | | Add CoreInitializeMemoryAttributesTable() to DXE Core header file. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: "Yao, Jiewen" <jiewen.yao@intel.com> Reviewed-by: "Gao, Liming" <liming.gao@intel.com>
* | MdeModulePkg: Update PropertiesTable for MemoryAttributesTable.jiewen yao2016-02-171-10/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | MemoryAttributesTable generation need information in PropertiesTable. In memory attributes table generation path, PropertiesTable need record original memory map and do not merge the new memory map entry cross original memory map boundary. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: "Yao, Jiewen" <jiewen.yao@intel.com> Reviewed-by: "Gao, Liming" <liming.gao@intel.com>
* | MdeModulePkg: Add MemoryAttributesTable generation.jiewen yao2016-02-171-0/+214
|/ | | | | | | | | | | | | Add MemoryAttributesTable generation in DxeCore. We leverage the information collected by original PropertiesTable, and publish runtime code/data to another standalone table. So that this is a compatible solution to report more PE Code/Data information. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: "Yao, Jiewen" <jiewen.yao@intel.com> Reviewed-by: "Gao, Liming" <liming.gao@intel.com>
* MdeModulePkg: Refine function comments in Keyword Handler ProtocolDandan Bi2016-02-162-10/+14
| | | | | | | | | | | | Refine the function comments in ConfigKeywordHandler.c and HiiDatabase.h. Cc: Liming Gao <liming.gao@intel.com> Cc: Eric Dong <eric.dong@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdeModulePkg DxeCore: Minor comments update to AllocatePool()Star Zeng2016-02-152-5/+8
| | | | | | | | | | Follow UEFI 2.6 spec to minor update the comments of AllocatePool(). Cc: Liming Gao <liming.gao@intel.com> Cc: Feng Tian <feng.tian@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdeModulePkg DxeCore: Missing change for OEM reserved memory type at R17460Star Zeng2016-02-151-3/+3
| | | | | | | | | | | | At the end of CoreFreePoolI(), the check to see if it is a specific memory type should also cover OEM reserved memory type. It was missed when adding OEM reserved memory type support at R17460. Cc: Liming Gao <liming.gao@intel.com> Cc: Feng Tian <feng.tian@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdeModulePkg: Update DxeCore dispatcher to ignore PEI and SMM depex for FV.Liming Gao2016-02-051-27/+4
| | | | | | | | | | If FV image without DXE depex, it will be dispatched by DxeCore. If FV image with SMM depex, it is the invalid image. ASSERT will be trig. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Andrew Fish <afish@apple.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
* MdeModulePkg/UsbAbsPointer:Fix GetState() to return absolute valueRuiyu Ni2016-02-031-15/+39
| | | | | | | | | | | | Fix UsbMouseAbsolutePointer driver GetState() interface to return absolute value instead of relative value. The driver is ported from UsbMouse driver. The GetState of SimplePointer protocol returns relative value but the GetState of AbsolutePointer protocol should return absolute value. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
* MdeModulePkg: Correct one return status code in SNP Transmit function.Fu Siyuan2016-02-031-1/+2
| | | | | | | | | | | | | According to UEFI spec, a BUFFER_FULL return status in UNDI Transmit command indicates UNDI "Transmit buffer is full. Call Get Status command toempty buffer." So this patch updates the SNP Transmit to return EFI_NOT_READY for BUFFER_FULL to let the call know the buffer full status. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Sriram Subramanian <sriram-s@hpe.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ye Ting <ting.ye@intel.com>
* MdeModulePkg: Update the default size of MNP TX buffer pool.Fu Siyuan2016-02-031-1/+1
| | | | | | | | | | | | | | The MNP and SNP are independent drivers so the MNP_TX_BUFFER_INCREASEMENT could choose any value as needed. While this patch update the default value of this macro to 32, to be same as the maximum recycled buffer numbers in one UNDI GetStatus command. It is a workaround for some incorrect UNDI drivers which may not return the correct statuses for the SNP and MNP to correctly retry/call GetStatus to clear the buffers. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Sriram Subramanian <sriram-s@hpe.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ye Ting <ting.ye@intel.com>
* MdeModulePkg: Update DBsize in SNP GetStatus command.Fu Siyuan2016-02-031-5/+1
| | | | | | | | | | | | | Update the DBsize in GetStatus command to let UNDI return an array of recycled buffers. This is to make the loop at the end of PxeGetStatus() useful and to prevent buffer overflow with some non-conformant UNDI drivers which not check the value of the input DBsize in UNDI GetStatus command. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Sriram Subramanian <sriram-s@hpe.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ye Ting <ting.ye@intel.com>
* MdeModulePkg: Add BS+RT+AT variable attribute definitionChao Zhang2016-02-021-1/+2
| | | | | | | | | | | Add BS+RT+AT variable attribute definition. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Chao Zhang <chao.b.zhang@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19785 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg: Minor comments update to GetNextHighMonotonicCount()Star Zeng2016-01-291-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | Description of the GetNextHighMonotonicCount does not state that the counter is incremented on calling this function. However, the example usage of this API documented relies on this behavior. UEFI 2.6 spec is to update description to match usage documented. The high 32-bit value is nonvolatile and is increased by 1 whenever the system resets whenever the low 32-bit count (returned by GetNextMonoticCount()) overflows. -> The high 32-bit value is nonvolatile and is increased by 1 whenever the system resets, whenever GetNextHighMonotonicCount() is called, or whenever the low 32-bit count (returned by GetNextMonoticCount()) overflows. Cc: Liming Gao <liming.gao@intel.com> Cc: Feng Tian <feng.tian@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19773 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg Variable: Minor update to the Data parameter for GetVariable()Star Zeng2016-01-292-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | UEFI 2.6 spec has minor update to the Data parameter for GetVariable(), and no real functional behavior change. The modifier of Data parameter: OUT VOID *Data -> OUT VOID *Data OPTIONAL The comments of Data parameter: Data The buffer to return the contents of the variable. -> Data The buffer to return the contents of the variable. May be NULL with a zero DataSize in order to determine the size buffer needed. The patch is to follow the spec to update the implementation. Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19771 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg: NvmExpressDxe: clean up NvmeRead() / NvmeWrite() debug msgsLaszlo Ersek2016-01-281-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | These workhorse functions are part of the BlockIo protocol that NvmExpressDxe produces. For bulk data access, they are called very frequently. Their debug messages should be therefore downgraded to EFI_D_VERBOSE. In addition, the following DEBUG() warts are cleaned up: - The function name should be printed with %a / __FUNCTION__, so that renaming the function, or copying the DEBUG() elsewhere, be reflected in the debug output automatically. (In fact, after this patch, the DEBUG() calls become identical.) - "Lba" is of type UINT64, therefore it should be printed with %Lx, not %x. - "OrginalBlocks" and "Blocks" are both UINTN. The only portable way to print UINTN is to convert it to UINT64 manually, then format it with the %Lx (or %Lu) conversion specifier. Cc: Feng Tian <feng.tian@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Feng Tian <feng.tian@Intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19763 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg/PeiCore: Fix the debug info of PEI temp heap lengthCinnamon Shia2016-01-281-1/+2
| | | | | | | | | | | | | | (HandoffInformationTable->EfiFreeMemoryBottom - Private->HobList.Raw) is the PEI temp heap used instead of the length of PEI temp heap. The length of PEI temp heap should be: (HandoffInformationTable->EfiFreeMemoryTop - Private->HobList.Raw) Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Cinnamon Shia <cinnamon.shia@hpe.com> Reviewed-by: Star Zeng <star.zeng@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19762 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg DxeCore: Avoid the closed event to be signaled wronglyStar Zeng2016-01-271-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signal a closed event will still invoke the event notification function, it could only be exposed when no the DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit set in PcdDebugPropertyMask. For example: gBS->CreateEvent ( EVT_NOTIFY_SIGNAL, TPL_CALLBACK, CallbackFun, NULL, &Event ); gBS->CloseEvent (Event); gBS->SignalEvent (Event); <- CallbackFun still be invoked Although the case to signal a closed event is abnormal, the code could still be enhanced to avoid it. Cc: Liming Gao <liming.gao@intel.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Thomas Palmer <thomas.palmer@hpe.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19754 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg:Restore the HiiValue for string opcodeDandan Bi2016-01-271-1/+5
| | | | | | | | | | | | | | String opcode has HiiValue and BufferValue,BufferValue for string content, HiiValue for StringId.Function GetQuestionValue only update the BufferValue(string content),but the StringId and string content do not match,now fix this issue. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19750 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg:Make the logic in ConfigRouting.c clear and safeDandan Bi2016-01-261-16/+127
| | | | | | | | | | | | | | | | | The BlockData is expected to be NULL when to call function IsThisOpcodeRequired in each opcode,but now exists case that the Blockdata not be cleaned,then will be used in other opcode.it is not correct,now add the check before use. The comments and logic in function IsThisOpcodeRequired are not consistent,now refine the code to make the logic clear. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19749 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg/PciHostBridgeDxe: Fix GCC build failure.Ruiyu Ni2016-01-261-1/+1
| | | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19744 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg/.../IdeMode: correctly report length of returned dataPaolo Bonzini2016-01-251-14/+18
| | | | | | | | | | | | | | | | | | | | | | | | For some SCSI commands, notably INQUIRY, it's relatively common for the device to provide less data than we intended to read, and for this reason EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET makes InTransferLength and OutTransferLength read-write. Make ATAPI aware of this. This makes it possible to handle EFI_NOT_READY always, not just for read as done in r19685. I've chosen to use a break statement instead of calling CheckStatusRegister directly; the break statement reaches a pre-existing call the CheckStatusRegister function. This ensures that the assignment to *ByteCount is not missed, and adds a further sanity check to DRQClear. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Tested-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Feng Tian <feng.tian@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19737 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg: HiiDatabase: Refine the code to make it more safely.Eric Dong2016-01-251-4/+16
| | | | | | | | | | Refine the code to avoid potential buffer overflow or use NULL pointer. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19735 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg: TerminalDxe: select the UART's default receive FIFO depthLaszlo Ersek2016-01-212-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Serial IO protocol instances provided by SerialDxe and consumed by TerminalDxe come with a Mode.ReceiveFifoDepth=1 default setting, as required by UEFI 2.5. Although TerminalDxe calls EFI_SERIAL_IO_PROTOCOL.SetAttributes() in the TerminalDriverBindingStart() and TerminalConInTimerHandler() functions, it only does so to change the Mode.Timeout member. Other members of Mode, including Mode.ReceiveFifoDepth, are preserved. On some platforms this causes the UART that underlies TerminalDxe not to have enough room for bursts of scan codes, which translates to broken parsing of escape sequences, e.g. cursor movement keys. According to the UEFI spec, passing ReceiveFifoDepth=0 to EFI_SERIAL_IO_PROTOCOL.SetAttributes() "will use the device's default FIFO depth". While TerminalDxe could try to configure a receive FIFO depth that matches the longest escape sequence it wishes to parse, in practice the device-specific default FIFO depth -- which may well differ from the spec-mandated SerialIo->Mode.ReceiveFifoDepth=1 default -- seems to work. Hence let's just set that. This issue was exposed by SVN r18971 / git commit 921e987b2b ("ArmPlatformPkg: Use SerialDxe in MdeModulePkg instead of EmbeddedPkg"). In that conversion, MdeModulePkg's SerialDxe started to initialize Mode.ReceiveFifoDepth to 1 (in conformance with the spec), unlike the prior, non-conformant initialization to 0 in EmbeddedPkg's SerialDxe. Since TerminalDxe would never change ReceiveFifoDepth from the new default value 1, and the ArmPlatformPkg/Drivers/PL011Uart library instance, underlying SerialDxe through SerialPortLib, would obey it too, they would collectively effect a receive queue depth of 1, rather than the default 16 or 32. This broke cursor keys on the ARM FVP and Juno platforms. It is the client of EFI_SERIAL_IO_PROTOCOL that is responsible for modifying the attributes, if the defaults are not appropriate, hence this patch modifies TerminalDxe. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Ryan Harkin <ryan.harkin@linaro.org> Cc: Leif Lindholm <leif.lindholm@linaro.org> Cc: Star Zeng <star.zeng@intel.com> Reported-by: Ryan Harkin <ryan.harkin@linaro.org> Reference: http://thread.gmane.org/gmane.comp.bios.edk2.devel/4779/focus=6553 Reference: http://thread.gmane.org/gmane.comp.bios.edk2.devel/6594 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Tested-by: Ryan Harkin <ryan.harkin@linaro.org> Reviewed-by: Star Zeng <star.zeng@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19701 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg: SerialDxe: sync EFI_SERIAL_IO_MODE.Timeout with the specLaszlo Ersek2016-01-211-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In "11.8 Serial I/O Protocol", UEFI 2.5 requires: The default attributes for all UART-style serial device interfaces are: (a) 115,200 baud, (b) a 1 byte receive FIFO, (c) a 1,000,000 microsecond timeout per character, (d) no parity, (e) 8 data bits, (f) and 1 stop bit. It also says, about the EFI_SERIAL_IO_MODE.ControlMask member: (g) A mask of the Control bits that the device supports. The device must always support the Input Buffer Empty control bit. SerialDxe complies with requirement (b) via hard-coded constants. It complies with requirements (a), (d), (e) and (f) through PCD defaults (see MdePkg/MdePkg.dec): (a) 115,200 baud: gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate|115200|UINT64|0x00000020 (d) no parity: # 1 - No Parity.<BR> gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity|1|UINT8|0x00000022 (e) 8 data bits: gEfiMdePkgTokenSpaceGuid.PcdUartDefaultDataBits|8|UINT8|0x00000021 (f) 1 stop bit: # 1 - One Stop Bit.<BR> gEfiMdePkgTokenSpaceGuid.PcdUartDefaultStopBits|1|UINT8|0x00000023 SerialDxe does not comply with requirements (c) and (g). In this patch, we fix (c), and leave (g) for later. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Ryan Harkin <ryan.harkin@linaro.org> Cc: Leif Lindholm <leif.lindholm@linaro.org> Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Tested-by: Ryan Harkin <ryan.harkin@linaro.org> Reviewed-by: Star Zeng <star.zeng@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19700 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg: SerialDxe: lay out mSerialIoMode initializer more nicelyLaszlo Ersek2016-01-211-7/+10
| | | | | | | | | | | | | | | | | | This patch doesn't change behavior; it only modifies whitespace and comments. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Ryan Harkin <ryan.harkin@linaro.org> Cc: Leif Lindholm <leif.lindholm@linaro.org> Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Tested-by: Ryan Harkin <ryan.harkin@linaro.org> Reviewed-by: Star Zeng <star.zeng@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19699 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg: Add MorLock to variable driver.Yao, Jiewen2016-01-193-3/+69
| | | | | | | | | | | | | This patch adds MorLock function to Variable main function. It also updates corresponding INF file to pass build. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: "Yao, Jiewen" <jiewen.yao@intel.com> Reviewed-by: "Zhang, Chao B" <chao.b.zhang@intel.com> Reviewed-by: "Zeng, Star" <star.zeng@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19690 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg: Add MorLockDxe to variable driver.Yao, Jiewen2016-01-191-0/+89
| | | | | | | | | | | | | | Per secure MOR implementation document, it is not proper to add MOR lock in non-SMM version, because DXE version can not provide protection. This patch add standalone TcgMorLockDxe implementation. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: "Yao, Jiewen" <jiewen.yao@intel.com> Reviewed-by: "Zhang, Chao B" <chao.b.zhang@intel.com> Reviewed-by: "Zeng, Star" <star.zeng@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19689 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg: Add MorLockSmm to variable driver.Yao, Jiewen2016-01-191-0/+394
| | | | | | | | | | | | | | | | | | Microsoft published secure MOR implementation at https://msdn.microsoft.com/en-us/library/windows/hardware/mt270973(v=vs.85).aspx with revision 2 update. See URL for tech detail. Previous revision 1 is handled in SecurityPkg\Tcg\ MemoryOverwriteRequestControlLock. But the VarCheck API can not satisfy revision 2 requirement. So we decide include MOR lock control into variable driver directly. This patch add standalone TcgMorLockSmm implementation. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: "Yao, Jiewen" <jiewen.yao@intel.com> Reviewed-by: "Zhang, Chao B" <chao.b.zhang@intel.com> Reviewed-by: "Zeng, Star" <star.zeng@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19688 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg/.../IdeMode: report early finish of packet read as successLaszlo Ersek2016-01-191-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SVN r19611 (git commit 7cac240163), "MdeModulePkg/Ide: return correct status when DRQ is not ready for ATAPI", changed the behavior of AtaPacketReadWrite(), when DRQReady2() reported an error. The previous logic had been to: (a) terminate the transfer loop, (b) check the status register with CheckStatusRegister(), and determine AtaPacketReadWrite()'s return code directly from that. Action (a) had been correct, but action (b) had masked genuine errors. For example, when DRQReady2() reported EFI_TIMEOUT -- because the BSY bit had not been cleared within the allotted time --, CheckStatusRegister() would report EFI_SUCCESS, simply *because* BSY was still set, and the rest of the status bits could not be evaluated. SVN r19611 (git commit 7cac240163) intended to fix action (b) by directly propagating the error code of DRQReady2() from AtaPacketReadWrite(), eliminating the CheckStatusRegister() call. This was the right thing for most of the errors reported by DRQReady2() -- timeout, command abort, other device error --, but there was one exception: the "read" sub-case of EFI_NOT_READY, which stands for "'read' complete, with less data available than the requested amount". Regarding the "write" sub-case of EFI_NOT_READY: the AtaPacketCommandExecute() function programs the full transfer length into the IDE device before it calls AtaPacketReadWrite(), and AtaPacketReadWrite() only uses CylinderLsb and CylinderMsb for "chunking" (as requested by the device). Therefore the device cannot justifiedly clear DRQ earlier than seeing the entire data, when writing. However, when reading from the device, a "short read" is a successful operation. (The actual read length will be decoded by the higher level protocols.) And "short reads" had been handled correctly by the logic before git 7cac240163. Namely, when DRQReady2() returns EFI_NOT_READY, the BSY bit is already clear, and we can call CheckStatusRegister() to investigate all the other bits it cares about. Therefore restore the logic from before git 7cac240163, but only for the "read" sub-case of EFI_NOT_READY. This problem was encountered with OVMF running on QEMU's i440fx IDE emulation. Many thanks to John Snow for analyzing QEMU's behavior, and pointing out that it adhered to the relevant specs. Cc: Feng Tian <feng.tian@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: John Snow <jsnow@redhat.com> Reference: https://github.com/tianocore/edk2/issues/43 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Feng Tian <feng.tian@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19685 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg/.../IdeMode: actualize DRQReady*() comment blocksLaszlo Ersek2016-01-191-6/+25
| | | | | | | | | | | | | | | | | | | | | | | | | The DRQReady() and DRQReady2() functions only differ in that they poll different status registers for BSY, ERR, and DRQ: the former looks at the Status Register (clearing interrupt status), while the latter looks at the Alternate Status Register (not clearing interrupt status). They both correctly return a unique status code, EFI_NOT_READY, for the BSY==0 && ERR==0 && DRQ==0 case; that is, when the device reports "command complete". However, the functions' leading comments don't explain this case, so it's easy to miss in callers. Update the comments. Cc: Feng Tian <feng.tian@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: John Snow <jsnow@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Feng Tian <feng.tian@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19684 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg: Add NOOPT target in MdeModulePkg.dscHao Wu2016-01-191-1/+1
| | | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19673 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg:Modify the dsc file because of the rename actionDandan Bi2016-01-191-3/+3
| | | | | | | | | | Rename the Ui libraries,so need to update the MdeModulePkg.dsc file. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19668 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg:Modify related files because of rename actionDandan Bi2016-01-192-7/+7
| | | | | | | | | | Rename DeviceManagerLib,need to modify these files. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19667 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg:Rename DeviceManagerLib to DeviceManagerUiLibDandan Bi2016-01-196-0/+0
| | | | | | | | | | | Avoid any confusion,add the keyword "Ui", user can understand the use of the library clearly. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19666 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg:Modify relative files because of rename actionDandan Bi2016-01-192-7/+7
| | | | | | | | | | Rename BootManagerLib,need to modify these files. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19665 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg:Rename BootManagerLib to BootManagerUiLibDandan Bi2016-01-196-0/+0
| | | | | | | | | | | Avoid any confusion,add the keyword "Ui", user can understand the use of the library clearly. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19664 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg:Modify the inf file and c file because of the rename actionDandan Bi2016-01-192-7/+7
| | | | | | | | | | Rename BootMaintenanceManagerLib,need to modify these files. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19663 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg:Rename BootMaintenanceManagerLib to BootMaintenanceManagerUiLibDandan Bi2016-01-1913-0/+0
| | | | | | | | | | | Avoid any confusion,add the keyword "Ui", user can understand the use of the library clearly. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19662 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg: Add generic PciHostBridgeDxe driver.Ruiyu Ni2016-01-187-0/+3619
| | | | | | | | | | | This driver links to PciHostBridgeLib provided by platform/silicon to produce PciRootBridgeIo and PciHostBridgeResourceAllocation protocol. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19658 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg: Add PciHostBridgeLibNullRuiyu Ni2016-01-184-1/+162
| | | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19656 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg: Add new library class PciHostBridgeLibRuiyu Ni2016-01-182-1/+102
| | | | | | | | | | | | PciHostBridgeDxe driver needs PciHostBridgeLib implemented by platform to provide the root bridge related information and may call into PciHostBridgeLib when resource conflicts happen. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19655 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg:Fix the potential memory leak issue in Display EngineDandan Bi2016-01-151-8/+38
| | | | | | | | | | | | | | The MenuOption insert to gMenuOption allocate memory every time,but not free. Now add the code to free it.And for Date/Time,it will create 3 menus,but previously the Description point to the same address,so when free the Description,it will cause issue,now reset the Description pointer. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19647 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg: Add DNS QType and QClass values definitionJiaxin Wu2016-01-141-1/+28
| | | | | | | | | | | | | | | | This patch is used to add DNS QType and QClass values definition in NetLib.h Cc: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19642 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg/NvmExpressDxe: Fix MS toolchain /Od 32bit build failureFeng Tian2016-01-113-19/+10
| | | | | | | | | | | | Note NVME_ACQ & NVME_ASQ internal data structure are changed to make build pass. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19632 6f19259b-4bc3-4df7-8a09-765794883524