diff options
| author | Priti Bavaria <pbavari@us.ibm.com> | 2013-12-11 13:15:16 -0600 |
|---|---|---|
| committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2013-12-12 15:25:29 -0600 |
| commit | b8bd7e40b69ba88c6a32dd7d2fed9b765d7e3be7 (patch) | |
| tree | 67e17e6a8131dd79bd146782eb8e9483fdebba53 /src/include/usr/targeting/common | |
| parent | 2d18b3d85929710092cb401727a2dca102a99990 (diff) | |
| download | talos-hostboot-b8bd7e40b69ba88c6a32dd7d2fed9b765d7e3be7.tar.gz talos-hostboot-b8bd7e40b69ba88c6a32dd7d2fed9b765d7e3be7.zip | |
Segmentation fault in x86 targeting library
- 56 bits to 8 bit swap
Change-Id: I6f09f5b37e475440aebb1438f98bfd20a3fc73ec
CQ: SW236046
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/7680
Reviewed-by: Andrew J. Geissler <andrewg@us.ibm.com>
Tested-by: Jenkins Server
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/include/usr/targeting/common')
| -rw-r--r-- | src/include/usr/targeting/common/pointer.H | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/include/usr/targeting/common/pointer.H b/src/include/usr/targeting/common/pointer.H index 11c11ea28..bce3afb04 100644 --- a/src/include/usr/targeting/common/pointer.H +++ b/src/include/usr/targeting/common/pointer.H @@ -31,6 +31,7 @@ */ #include <builtins.h> +#include <endian.h> namespace TARGETING { @@ -50,6 +51,15 @@ union AbstractPointer * address translation to traverse associations, and presumes that * byte 0 of any virtual address is never set. */ +#if __BYTE_ORDER == __LITTLE_ENDIAN + struct { + uint64_t ptr : 56; ///< Node ID indexed to 1. Value of 0 + ///< indicates node ID should not be used + ///< for address translation + uint64_t nodeId : 8; ///< Address to translate + + } TranslationEncoded; +#else struct { uint64_t nodeId : 8; ///< Node ID indexed to 1. Value of 0 ///< indicates node ID should not be used @@ -57,7 +67,7 @@ union AbstractPointer uint64_t ptr : 56; ///< Address to translate } TranslationEncoded; - +#endif /** * @brief Returns the AbstractPointer as a platform specific pointer * @@ -106,6 +116,7 @@ union AbstractPointer #define TARG_TO_PLAT_PTR(__PTR__) \ ((__PTR__)) + /** * @biref Macro which accepts an AbstractPointer<T>, customizes the pointer to * the platform, then increments the pointer the specified number of times |

