All of lore.kernel.org
 help / color / mirror / Atom feed
From: <ting.liu@nxp.com>
To: <meta-freescale@yoctoproject.org>
Subject: [meta-fsl-arm][PATCH 19/41] change-file-endianess: keep 8 byte alignment
Date: Fri, 24 Jun 2016 18:41:14 +0800	[thread overview]
Message-ID: <1466764896-30762-20-git-send-email-ting.liu@nxp.com> (raw)
In-Reply-To: <1466764896-30762-1-git-send-email-ting.liu@nxp.com>

From: Yuan Yao <yao.yuan@nxp.com>

Signed-off-by: Yuan Yao <yao.yuan@nxp.com>
---
 .../change-file-endianess/change-file-endianess/byte_swap.tcl    | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/recipes-bsp/change-file-endianess/change-file-endianess/byte_swap.tcl b/recipes-bsp/change-file-endianess/change-file-endianess/byte_swap.tcl
index aca956b..a4e8008 100755
--- a/recipes-bsp/change-file-endianess/change-file-endianess/byte_swap.tcl
+++ b/recipes-bsp/change-file-endianess/change-file-endianess/byte_swap.tcl
@@ -11,6 +11,13 @@ fconfigure $fileid_o -translation {binary binary}
 
 set old_bin [read $fileid_i]
 set new_bin {}
+set old_length [string length $old_bin]
+set old_rem [expr $old_length % $num_b]
+if {$old_rem != 0} {
+	for {set i 0} {$i< [expr $num_b - $old_rem]} {incr i 1} {
+	        append old_bin y
+	}
+}
 for {set i 0} {$i<[string length $old_bin]} {incr i $num_b} {
         for {set j $num_b} {$j>0} {incr j -1} {
                 append new_bin [string index $old_bin [expr $i+($j-1)]]
@@ -20,7 +27,7 @@ for {set i 0} {$i<[string length $old_bin]} {incr i $num_b} {
 for {set i 0} {$i<[string length $old_bin]} {incr i $num_b} {
         set binValue [string range $old_bin [expr $i+0] [expr $i+($num_b-1)]]
         binary scan $binValue H[expr $num_b*2] hexValue
-        
+
         set binValue [string range $new_bin [expr $i+0] [expr $i+($num_b-1)]]
         binary scan $binValue H[expr $num_b*2] hexValue
 }
-- 
1.9.2



  parent reply	other threads:[~2016-06-24 10:43 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-24 10:40 [meta-fsl-arm][PATCH 00/41] QorIQ SDK 2.0 patches ting.liu
2016-06-24 10:40 ` [meta-fsl-arm][PATCH 01/41] qemu-fsl: rename to qemu-qoriq ting.liu
2016-06-24 10:40 ` [meta-fsl-arm][PATCH 02/41] u-boot-ls1: rename to u-boot-qoriq ting.liu
2016-06-24 10:40 ` [meta-fsl-arm][PATCH 03/41] linux-ls1: rename to linux-qoriq ting.liu
2016-06-24 10:40 ` [meta-fsl-arm][PATCH 04/41] qoriq-arm.inc: split common bits into qoriq.inc ting.liu
2016-06-24 10:41 ` [meta-fsl-arm][PATCH 05/41] qoriq-arm64.inc: add ting.liu
2016-06-24 10:41 ` [meta-fsl-arm][PATCH 06/41] ls2080ardb: Add machine file ting.liu
2016-06-24 10:41 ` [meta-fsl-arm][PATCH 07/41] ls1043ardb: add " ting.liu
2016-06-24 10:41 ` [meta-fsl-arm][PATCH 08/41] ls1021atwr: update " ting.liu
2016-06-24 10:41 ` [meta-fsl-arm][PATCH 09/41] u-boot-qoriq: upgrade to 2016.01 ting.liu
2016-06-24 10:41 ` [meta-fsl-arm][PATCH 10/41] u-boot-qoriq: copy right binary for nor/secure_boot ting.liu
2016-06-24 10:41 ` [meta-fsl-arm][PATCH 11/41] qemu-qoriq: upgrade to v2.4 plus fsl patches ting.liu
2016-06-24 10:41 ` [meta-fsl-arm][PATCH 12/41] linux-qoriq: upgrade to 4.1 " ting.liu
2016-06-24 10:41 ` [meta-fsl-arm][PATCH 13/41] udev-rules-qoriq: add recipe ting.liu
2016-06-24 10:41 ` [meta-fsl-arm][PATCH 14/41] management-complex: Add recipe ting.liu
2016-06-24 10:41 ` [meta-fsl-arm][PATCH 15/41] ls2-phy: " ting.liu
2016-06-24 10:41 ` [meta-fsl-arm][PATCH 16/41] ls2-rcw: " ting.liu
2016-06-24 10:41 ` [meta-fsl-arm][PATCH 17/41] dpl-examples: " ting.liu
2016-06-24 10:41 ` [meta-fsl-arm][PATCH 18/41] restool: " ting.liu
2016-06-24 10:41 ` ting.liu [this message]
2016-06-24 10:41 ` [meta-fsl-arm][PATCH 20/41] ppa: add recipe ting.liu
2016-06-24 10:41 ` [meta-fsl-arm][PATCH 21/41] fm-ucode: " ting.liu
2016-06-24 10:41 ` [meta-fsl-arm][PATCH 22/41] qe-ucode: update to a95f42ae ting.liu
2016-06-24 10:41 ` [meta-fsl-arm][PATCH 23/41] rcw: swap qspi binary in do_install_append ting.liu
2016-06-24 10:41 ` [meta-fsl-arm][PATCH 24/41] rcw: update to commit 521008f ting.liu
2016-06-24 10:41 ` [meta-fsl-arm][PATCH 25/41] rcw: update to 1af724b ting.liu
2016-06-24 10:41 ` [meta-fsl-arm][PATCH 26/41] apptrk: update to commit 4216af3 ting.liu
2016-06-24 10:41 ` [meta-fsl-arm][PATCH 27/41] apptrk: update to 873f44c ting.liu
2016-06-24 10:41 ` [meta-fsl-arm][PATCH 28/41] asf: set COMPATIBLE_MACHINE as ls102xa ting.liu
2016-06-24 10:41 ` [meta-fsl-arm][PATCH 29/41] asf: not package .ko files in PN ting.liu
2016-06-24 10:41 ` [meta-fsl-arm][PATCH 30/41] asf: remove empty install directories ting.liu
2016-06-24 10:41 ` [meta-fsl-arm][PATCH 31/41] asf: update to commit 9580a62 ting.liu
2016-06-24 10:41 ` [meta-fsl-arm][PATCH 32/41] asf: update to a8bbba6 ting.liu
2016-06-24 10:41 ` [meta-fsl-arm][PATCH 33/41] cst: update to commit 65f79eb ting.liu
2016-06-24 10:41 ` [meta-fsl-arm][PATCH 34/41] cst: update to d1c6c28 ting.liu
2016-06-24 10:41 ` [meta-fsl-arm][PATCH 35/41] fmc: add recipe ting.liu
2016-06-24 10:41 ` [meta-fsl-arm][PATCH 36/41] eth-config: " ting.liu
2016-06-24 10:41 ` [meta-fsl-arm][PATCH 37/41] flib: " ting.liu
2016-06-24 10:41 ` [meta-fsl-arm][PATCH 38/41] fmlib: " ting.liu
2016-06-24 10:41 ` [meta-fsl-arm][PATCH 39/41] usdpaa: " ting.liu
2016-06-24 10:41 ` [meta-fsl-arm][PATCH 40/41] dpa-offload: " ting.liu
2016-06-24 10:41 ` [meta-fsl-arm][PATCH 41/41] usdpaa-apps: " ting.liu
2016-06-27 10:51 ` [meta-fsl-arm][PATCH 00/41] QorIQ SDK 2.0 patches Otavio Salvador
2016-06-28  2:54   ` Zhenhua Luo
2016-06-30  7:59     ` Ting Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1466764896-30762-20-git-send-email-ting.liu@nxp.com \
    --to=ting.liu@nxp.com \
    --cc=meta-freescale@yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.