Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753134Ab2KMLFN (ORCPT ); Tue, 13 Nov 2012 06:05:13 -0500 Received: from caramon.arm.linux.org.uk ([78.32.30.218]:41467 "EHLO caramon.arm.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751625Ab2KMLFL (ORCPT ); Tue, 13 Nov 2012 06:05:11 -0500 Date: Tue, 13 Nov 2012 11:04:54 +0000 From: Russell King - ARM Linux To: Rob Clark Cc: linux-arm-kernel@lists.infradead.org, patches@linaro.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, dri-devel@lists.freedesktop.org, Arnd Bergmann Subject: Re: [PATCH] ARM: add get_user() support for 8 byte types Message-ID: <20121113110454.GE28341@n2100.arm.linux.org.uk> References: <1352495853-9790-1-git-send-email-rob.clark@linaro.org> <20121112192727.GB28341@n2100.arm.linux.org.uk> <20121112230819.GC28341@n2100.arm.linux.org.uk> <20121112235348.GD28341@n2100.arm.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.19 (2009-01-05) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1183 Lines: 29 On Mon, Nov 12, 2012 at 06:31:50PM -0600, Rob Clark wrote: > right, that is what I was worried about.. but what about something > along the lines of: > > case 8: { \ > if (sizeof(x) < 8) \ > __get_user_x(__r2, __p, __e, __l, 4); \ > else \ > __get_user_x(__r2, __p, __e, __l, 8); \ > break; \ > } \ > > maybe we need a special variant of __get_user_8() instead to get the > right 32bits on big vs little endian systems, but I think something > roughly along these lines could work. The problem with that is... big endian systems - where the 32-bit word we want is the second one, so you can't just reduce that down to a 32-bit access like that. You also need to add an offset to the pointer in the BE case (which can be done.) I'd suggest calling the 4-byte version in there __get_user_xb() and doing the 4-byte offset for BE inside that (or aliasing it to __get_user_x for LE systems). -- 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/