From: David Woodhouse <dwmw2@infradead.org>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Cc: Dave Airlie <airlied@linux.ie>, benh@kernel.crashing.org
Subject: Re: drm: fix radeon setparam on 32/64 bit systems.
Date: Fri, 15 Jun 2007 09:44:20 +0100 [thread overview]
Message-ID: <1181897060.25228.323.camel@pmac.infradead.org> (raw)
In-Reply-To: <200706150159.l5F1xNgM000459@hera.kernel.org>
On Fri, 2007-06-15 at 01:59 +0000, Linux Kernel Mailing List wrote:
> Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9b01bd5b284bbf519b726b39f1352023cb5e9e69
> Commit: 9b01bd5b284bbf519b726b39f1352023cb5e9e69
> Parent: dc7a93190c21edbf3ed23e678ad04f852b9cff28
> Author: Dave Airlie <airlied@linux.ie>
> AuthorDate: Sun Jun 10 16:00:27 2007 +1000
> Committer: Dave Airlie <airlied@linux.ie>
> CommitDate: Sun Jun 10 16:00:27 2007 +1000
>
> drm: fix radeon setparam on 32/64 bit systems.
>
> The alignment on 64-bit is different for 64-bit values.
Only on i386. I think you just broke ppc32-on-ppc64.
> Signed-off-by: Dave Airlie <airlied@linux.ie>
> ---
> drivers/char/drm/radeon_ioc32.c | 26 ++++++++++++++++++++++++++
> 1 files changed, 26 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/char/drm/radeon_ioc32.c b/drivers/char/drm/radeon_ioc32.c
> index 1f1f9cc..04126c2 100644
> --- a/drivers/char/drm/radeon_ioc32.c
> +++ b/drivers/char/drm/radeon_ioc32.c
> @@ -349,6 +349,31 @@ static int compat_radeon_irq_emit(struct file *file, unsigned int cmd,
> DRM_IOCTL_RADEON_IRQ_EMIT, (unsigned long)request);
> }
>
> +typedef struct drm_radeon_setparam32 {
> + int param;
> + u64 value;
> +} __attribute__((packed)) drm_radeon_setparam32_t;
> +
> +static int compat_radeon_cp_setparam(struct file *file, unsigned int cmd,
> + unsigned long arg)
> +{
> + drm_radeon_setparam32_t req32;
> + drm_radeon_setparam_t __user *request;
> +
> + if (copy_from_user(&req32, (void __user *) arg, sizeof(req32)))
> + return -EFAULT;
> +
> + request = compat_alloc_user_space(sizeof(*request));
> + if (!access_ok(VERIFY_WRITE, request, sizeof(*request))
> + || __put_user(req32.param, &request->param)
> + || __put_user((void __user *)(unsigned long)req32.value,
> + &request->value))
> + return -EFAULT;
> +
> + return drm_ioctl(file->f_dentry->d_inode, file,
> + DRM_IOCTL_RADEON_SETPARAM, (unsigned long) request);
> +}
> +
> drm_ioctl_compat_t *radeon_compat_ioctls[] = {
> [DRM_RADEON_CP_INIT] = compat_radeon_cp_init,
> [DRM_RADEON_CLEAR] = compat_radeon_cp_clear,
> @@ -357,6 +382,7 @@ drm_ioctl_compat_t *radeon_compat_ioctls[] = {
> [DRM_RADEON_VERTEX2] = compat_radeon_cp_vertex2,
> [DRM_RADEON_CMDBUF] = compat_radeon_cp_cmdbuf,
> [DRM_RADEON_GETPARAM] = compat_radeon_cp_getparam,
> + [DRM_RADEON_SETPARAM] = compat_radeon_cp_setparam,
> [DRM_RADEON_ALLOC] = compat_radeon_mem_alloc,
> [DRM_RADEON_IRQ_EMIT] = compat_radeon_irq_emit,
> };
> -
> To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
dwmw2
next parent reply other threads:[~2007-06-15 8:44 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200706150159.l5F1xNgM000459@hera.kernel.org>
2007-06-15 8:44 ` David Woodhouse [this message]
2007-06-15 8:58 ` Benjamin Herrenschmidt
2007-06-15 9:28 ` Arnd Bergmann
2007-06-15 9:31 ` [PATCH] Introduce compat_u64 and compat_s64 types Arnd Bergmann
2007-06-15 9:55 ` David Miller
2007-06-15 11:55 ` Andi Kleen
2007-06-15 12:00 ` David Woodhouse
2007-06-15 12:38 ` Andi Kleen
2007-06-15 12:03 ` Arnd Bergmann
2007-06-15 12:40 ` Andi Kleen
2007-06-15 12:47 ` David Woodhouse
2007-06-15 13:19 ` Benjamin Herrenschmidt
2007-06-15 12:09 ` David Howells
2007-06-15 12:43 ` Andi Kleen
2007-06-15 12:54 ` Alan Cox
2007-06-15 12:54 ` Andi Kleen
2007-06-15 13:15 ` Alan Cox
2007-06-15 13:27 ` Andi Kleen
2007-06-15 13:32 ` David Woodhouse
2007-06-15 20:50 ` Robin Getz
2007-06-15 21:22 ` Andi Kleen
2007-06-16 8:31 ` David Woodhouse
2007-06-15 13:00 ` David Woodhouse
2007-06-15 12:11 ` Matthew Wilcox
2007-06-15 12:38 ` David Woodhouse
2007-06-15 12:42 ` Arnd Bergmann
2007-06-15 13:45 ` Matthew Wilcox
2007-06-15 13:52 ` Arnd Bergmann
2007-06-15 23:54 ` Benjamin Herrenschmidt
2007-06-15 13:16 ` Benjamin Herrenschmidt
2007-06-16 9:38 ` David Woodhouse
2007-06-16 10:26 ` Arnd Bergmann
2007-06-16 11:21 ` Arnd Bergmann
2007-06-16 11:34 ` David Woodhouse
2007-06-16 13:56 ` Matthew Wilcox
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=1181897060.25228.323.camel@pmac.infradead.org \
--to=dwmw2@infradead.org \
--cc=airlied@linux.ie \
--cc=benh@kernel.crashing.org \
--cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®