Subject: [edk2] DXE_ERROR() vs. PI_ENCODE_ERROR()

From: Andrew Fish <afish@apple.com>

To: edk2-devel@lists.sourceforge.net

Date: 2012-08-06 18:47:44

  • 2012-08-06 18:47:44  Andrew Fish   [edk2] DXE_ERROR() vs. PI_ENCODE_ERROR()
Why do we have DXE_ERROR() and PI_ENCODE_ERROR() defined? They seem to do the same thing. Also the DXE_ERROR() macro seems to be missing parentheses around StatusCode? Should DXE_ERROR be removed, or aliased to PI_ENCODE_ERROR()?

Andrew Fish


  Produces an error code in the range reserved for use by the Platform Initialization
  Architecture Specification.

  The supported 32-bit range is 0xA0000000-0xBFFFFFFF 
  The supported 64-bit range is 0xA000000000000000-0xBFFFFFFFFFFFFFFF 

  @param  StatusCode    The status code value to convert into a warning code.  
                        StatusCode must be in the range 0x00000000..0x1FFFFFFF.

  @return The value specified by StatusCode in the PI reserved range.

#define DXE_ERROR(StatusCode)  (MAX_BIT | (MAX_BIT >> 2) | StatusCode)

/// Error codes reserved for use by PI.
/// Supported 32-bit range is 0xa0000000-0xbfffffff.
/// Supported 64-bit range is 0xa000000000000000-0xbfffffffffffffff.
#define PI_ENCODE_ERROR(a)                  (MAX_BIT | (MAX_BIT >> 2) | (a))