From patchwork Tue Jun 2 17:56:05 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 5388 Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by open-mesh.net (8.14.3/8.13.4/Debian-3sarge3) with SMTP id n52IDv5W029628 for ; Tue, 2 Jun 2009 18:13:58 GMT Received: (qmail invoked by alias); 02 Jun 2009 17:56:06 -0000 Received: from i59F6A6D3.versanet.de (EHLO localhost) [89.246.166.211] by mail.gmx.net (mp007) with SMTP; 02 Jun 2009 19:56:06 +0200 X-Authenticated: #15668376 X-Provags-ID: V01U2FsdGVkX19+D6tEjSN+Ly0HkOsirbZulktqMZrw/xZ9qwr0Yg QELc9YTxDGzyK2 From: Sven Eckelmann To: b.a.t.m.a.n@open-mesh.net Date: Tue, 2 Jun 2009 19:56:05 +0200 Message-Id: <1243965365-6526-1-git-send-email-sven.eckelmann@gmx.de> X-Mailer: git-send-email 1.6.3.1 In-Reply-To: <200906021950.07235.sven.eckelmann@gmx.de> References: <200906021950.07235.sven.eckelmann@gmx.de> X-Y-GMX-Trusted: 0 X-FuHaFi: 0.57 Subject: [B.A.T.M.A.N.] [PATCH] [batman] Align pointers in hna list elements X-BeenThere: b.a.t.m.a.n@open-mesh.net X-Mailman-Version: 2.1.11 Precedence: list Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jun 2009 18:13:58 -0000 Architectures like SuperARM or Xscale needs aligned data for multi-byte operations. GCC can create instructions sequences for packed data, but must know that something will not be aligned. Since list_add will operate on untyped data over void-pointers it cannot know that hna_global_entry is packed and will create only a fast and unsafe version for load and store operations. It is only important for the first 5 bytes of hna_global_entry to be packed we can force these elements to be aligned without changing the relative addresses of the first bytes. Signed-off-by: Sven Eckelmann --- batman/hna.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/batman/hna.h b/batman/hna.h index 6063324..3e7049e 100644 --- a/batman/hna.h +++ b/batman/hna.h @@ -58,8 +58,8 @@ struct hna_global_entry { uint32_t addr; uint8_t netmask; - struct orig_node *curr_orig_node; - struct list_head_first orig_list; + struct orig_node *curr_orig_node ALIGN_WORD; + struct list_head_first orig_list ALIGN_WORD; } __attribute__((packed)); struct hna_orig_ptr