Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1763636AbXK2SBH (ORCPT ); Thu, 29 Nov 2007 13:01:07 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1763134AbXK2SAy (ORCPT ); Thu, 29 Nov 2007 13:00:54 -0500 Received: from sovereign.computergmbh.de ([85.214.69.204]:50053 "EHLO sovereign.computergmbh.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1762602AbXK2SAy (ORCPT ); Thu, 29 Nov 2007 13:00:54 -0500 Date: Thu, 29 Nov 2007 19:00:52 +0100 (CET) From: Jan Engelhardt To: Kyle McMartin cc: Daniel Drake , linux-kernel@vger.kernel.org, avuton@gmail.com, hancockr@shaw.ca, alan@lxorguk.ukuu.org.uk, andi@firstfloor.org, mrmacman_g4@mac.com, dean@arctic.org, argggh@dolphinics.no, shdl@zakalwe.fi, vlobanov@speakeasy.net, drzeus-list@drzeus.cx, strange@nsk.no-ip.org, dm.n9107@gmail.com, johannes@sipsolutions.net Subject: Re: [RFC v2] Documentation about unaligned memory access In-Reply-To: <20071129170436.GA2754@fattire.cabal.ca> Message-ID: References: <20071129161523.E0C349D4B52@zog.reactivated.net> <20071129170436.GA2754@fattire.cabal.ca> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 788 Lines: 20 On Nov 29 2007 12:04, Kyle McMartin wrote: > >For example, if you had 4GB of virtual memory, picture it as an >array of bytes, > u8 memory[4096 * (1024 * 1024)]; /* 4G bytes */ uint8_t memory[4096UL * 1024 * 1024]; >Aligned accesses would be accessing this array in this manner, > u16 memory[(4096 * (1024 * 1024)) / sizeof(u16)] /* 2G bytes */ > u32 memory[(4096 * (1024 * 1024)) / sizeof(u32)] /* 1G bytes */ > u64 memory[(4096 * (1024 * 1024)) / sizeof(u64)] /* 512M bytes */ u64 memory[4096UL * 1024 * 1024 / sizeof(u64)] /* 4G too */ - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/