diff options
author | Hao Wu <hao.a.wu@intel.com> | 2017-09-01 09:32:10 +0800 |
---|---|---|
committer | Hao Wu <hao.a.wu@intel.com> | 2017-09-04 09:01:16 +0800 |
commit | c00ad62378b1594c9af0f9ebbcc2e30d05a2121e (patch) | |
tree | 978131adc5374c251b2d225de1f6ab02e203b6b6 /SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon | |
parent | db52890926b6ecff9a416b3beda9c97c83f9fc60 (diff) | |
download | edk2-c00ad62378b1594c9af0f9ebbcc2e30d05a2121e.tar.gz edk2-c00ad62378b1594c9af0f9ebbcc2e30d05a2121e.tar.bz2 edk2-c00ad62378b1594c9af0f9ebbcc2e30d05a2121e.zip |
SourceLevelDebugPkg: Use Pcd for the revision of transfer protocol
V3 changes:
Add detailed description for the usage of the Pcd in package DEC file.
Update the comment for the introduced Pcd in module INF files.
V2 changes:
Instead of using a global variable, use a Pcd for transfer protocol
revision.
Previously, the revision of the debug agent transfer protocol is
reflected by a macro.
This commit introduces a Pcd to reflect the revision in order to avoid the
comparison of two macros, which will generate a constant result detected
by code checkers.
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Diffstat (limited to 'SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon')
-rw-r--r-- | SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugAgent.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugAgent.c b/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugAgent.c index f156fe24db..36b1ef924c 100644 --- a/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugAgent.c +++ b/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugAgent.c @@ -1564,7 +1564,7 @@ ReadMemoryAndSendResponsePacket ( // Compression/decompression support was added since revision 0.4.
// Revision 0.3 shouldn't compress the packet.
//
- if (DEBUG_AGENT_REVISION >= DEBUG_AGENT_REVISION_04) {
+ if (PcdGet32(PcdTransferProtocolRevision) >= DEBUG_AGENT_REVISION_04) {
//
// Get the compressed data size without modifying the packet.
//
@@ -1711,7 +1711,7 @@ AttachHost ( }
if (IncompatibilityFlag) {
//
- // If the incompatible Debug Packet received, the HOST should be running transfer protocol before DEBUG_AGENT_REVISION.
+ // If the incompatible Debug Packet received, the HOST should be running transfer protocol before PcdTransferProtocolRevision.
// It could be UDK Debugger for Windows v1.1/v1.2 or for Linux v0.8/v1.2.
//
DebugPortWriteBuffer (Handle, (UINT8 *) mErrorMsgVersionAlert, AsciiStrLen (mErrorMsgVersionAlert));
@@ -2192,7 +2192,7 @@ CommandCommunication ( break;
case DEBUG_COMMAND_GET_REVISION:
- DebugAgentRevision.Revision = DEBUG_AGENT_REVISION;
+ DebugAgentRevision.Revision = PcdGet32(PcdTransferProtocolRevision);
DebugAgentRevision.Capabilities = DEBUG_AGENT_CAPABILITIES;
Status = SendDataResponsePacket ((UINT8 *) &DebugAgentRevision, (UINT16) sizeof (DEBUG_DATA_RESPONSE_GET_REVISION), DebugHeader);
break;
|