summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorMartin Peschke <mpeschke@de.ibm.com>2016-05-22 08:40:16 +0200
committerPrachi Gupta <pragupta@us.ibm.com>2016-06-08 11:45:52 -0500
commit066e9594171870480aca727846287049355e2389 (patch)
tree45f2c49281ff29043ae97fc328cde33b796fa4c2 /tools
parenteb1b71efed5605274dbfb17a11e353a385e190b0 (diff)
downloadtalos-sbe-066e9594171870480aca727846287049355e2389.tar.gz
talos-sbe-066e9594171870480aca727846287049355e2389.zip
sbe_default_tool: cleaning up endianess conversion
Use system header endian.h routines to do endianess conversion instead of own routines. Change-Id: I45746998d3a59d3a5e051075f5eb75d6d5f4e3e0 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/24896 Tested-by: Jenkins Server Reviewed-by: Claus M. Olsen <cmolsen@us.ibm.com> Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com> Reviewed-by: Martin Peschke <mpeschke@de.ibm.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/image/sbe_default_tool.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/tools/image/sbe_default_tool.c b/tools/image/sbe_default_tool.c
index 8ea0e58d..aca20f14 100644
--- a/tools/image/sbe_default_tool.c
+++ b/tools/image/sbe_default_tool.c
@@ -118,27 +118,27 @@ void setAttribute(void* image, const char* attribute, unsigned int index, uint64
} else if(item.iv_toc->iv_type == P9_XIP_UINT16) {
- *((uint16_t*)thePointer + (index * sizeof(uint16_t))) = xipRevLe16((uint16_t)val);
+ *((uint16_t*)thePointer + (index * sizeof(uint16_t))) = htobe16((uint16_t)val);
} else if(item.iv_toc->iv_type == P9_XIP_INT16) {
- *((int16_t*)thePointer + (index * sizeof(int16_t))) = xipRevLe16((int16_t)val);
+ *((int16_t*)thePointer + (index * sizeof(int16_t))) = htobe16((int16_t)val);
} else if(item.iv_toc->iv_type == P9_XIP_UINT32) {
- *((uint32_t*)thePointer + (index * sizeof(uint32_t))) = xipRevLe32((uint32_t)val);
+ *((uint32_t*)thePointer + (index * sizeof(uint32_t))) = htobe32((uint32_t)val);
} else if(item.iv_toc->iv_type == P9_XIP_INT32) {
- *((int32_t*)thePointer + (index * sizeof(int32_t))) = xipRevLe32((int32_t)val);
+ *((int32_t*)thePointer + (index * sizeof(int32_t))) = htobe32((int32_t)val);
} else if(item.iv_toc->iv_type == P9_XIP_UINT64) {
- *((uint64_t*)thePointer + (index * sizeof(uint64_t))) = xipRevLe64((uint64_t)val);
+ *((uint64_t*)thePointer + (index * sizeof(uint64_t))) = htobe64((uint64_t)val);
} else if(item.iv_toc->iv_type == P9_XIP_INT64) {
- *((int64_t*)thePointer + (index * sizeof(int64_t))) = xipRevLe64((int64_t)val);
+ *((int64_t*)thePointer + (index * sizeof(int64_t))) = htobe64((int64_t)val);
} else {
fprintf(stderr, "sbe_default_tool: type not available");
@@ -190,29 +190,29 @@ uint64_t getAttribute(void* image, const char* attribute, unsigned int index) {
} else if(item.iv_toc->iv_type == P9_XIP_UINT16) {
- val = xipRevLe16(*((uint16_t*)thePointer + (index * sizeof(uint16_t))));
+ val = htobe16(*((uint16_t*)thePointer + (index * sizeof(uint16_t))));
} else if(item.iv_toc->iv_type == P9_XIP_INT16) {
- val = xipRevLe16(*((int16_t*)thePointer + (index * sizeof(int16_t))));
+ val = htobe16(*((int16_t*)thePointer + (index * sizeof(int16_t))));
val &= 0xFFFF;
} else if(item.iv_toc->iv_type == P9_XIP_UINT32) {
- val = xipRevLe32(*((uint32_t*)thePointer + (index * sizeof(uint32_t))));
+ val = htobe32(*((uint32_t*)thePointer + (index * sizeof(uint32_t))));
} else if(item.iv_toc->iv_type == P9_XIP_INT32) {
- val = xipRevLe32(*((int32_t*)thePointer + (index * sizeof(int32_t))));
+ val = htobe32(*((int32_t*)thePointer + (index * sizeof(int32_t))));
val &= 0xFFFFFFFF;
} else if(item.iv_toc->iv_type == P9_XIP_UINT64) {
- val = xipRevLe64(*((uint64_t*)thePointer + (index * sizeof(uint64_t))));
+ val = htobe64(*((uint64_t*)thePointer + (index * sizeof(uint64_t))));
} else if(item.iv_toc->iv_type == P9_XIP_INT64) {
- val = xipRevLe64(*((int64_t*)thePointer + (index * sizeof(int64_t))));
+ val = htobe64(*((int64_t*)thePointer + (index * sizeof(int64_t))));
} else {
fprintf(stderr, "sbe_default_tool: type not available");
OpenPOWER on IntegriCloud