From: Thomas Dodd <ted@cypress.com>
To: linux-kernel@vger.kernel.org
Subject: Re: patch to NVIDIA_kernel & kernel 2.5.5
Date: Thu, 28 Feb 2002 10:53:32 -0600 [thread overview]
Message-ID: <3C7E608C.3020506@cypress.com> (raw)
In-Reply-To: <XFMail.020228094914.pirx@minet.uni-jena.de>
Would it make more sens to us a compatibility marco
in one of NVIDIA's header files instead of
having the #if LINUX_VERSION_CODE scattered
everywhere? Or create a new header (kern_2.5_compat.h)?
Then if/when the kernel changes again just one file needs changed?
Martin Huenniger wrote:
>
> diff -ur NVIDIA_kernel-1.0-2314.old/nv.c NVIDIA_kernel-1.0-2314/nv.c
> --- NVIDIA_kernel-1.0-2314.old/nv.c Sat Dec 1 05:11:06 2001
> +++ NVIDIA_kernel-1.0-2314/nv.c Sun Feb 24 12:37:35 2002
> +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)
> if (NV_DEVICE_IS_CONTROL_DEVICE(inode->i_rdev))
> + return nv_kern_ctl_open(inode, file);
> +#else
> + if (NV_DEVICE_IS_CONTROL_DEVICE(kdev_val(inode->i_rdev)))
> return nv_kern_ctl_open(inode, file);
Here change NV_DEVICE_IS_CONTROL_DEVICE to add the kdev_val()
around arg 1.
> +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)
> +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)
And 2 more times.
> +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)
> if (remap_page_range(vma->vm_start,
> +#else
> + if (remap_page_range(vma, vma->vm_start
> +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)
make a macro for remap_page_range to always take
the new arg, but ignore it on older kernels.
> +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)
> pg_table = pte_offset(pg_mid_dir, address);
> +#else
> + pg_table = pte_offset_map(pg_mid_dir, address);
Macro that becomes pte_offset() or pte_offset_map()
> diff -ur NVIDIA_kernel-1.0-2314.old/os-interface.c
> NVIDIA_kernel-1.0-2314/os-interface.c
> --- NVIDIA_kernel-1.0-2314.old/os-interface.c Sat Dec 1 05:11:06 2001
> +++ NVIDIA_kernel-1.0-2314/os-interface.c Wed Feb 20 18:19:01 2002
> +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)
> + err = remap_page_range( (size_t) uaddr, (size_t) paddr, size_bytes,
> +#else
> + err = remap_page_range( kaddr, (size_t) uaddr, (size_t) paddr, size_bytes,
> +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)
> +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)
use the new macro for remap_page_range 3 more times.
-Thomas
next prev parent reply other threads:[~2002-02-28 16:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-02-20 18:17 patch to NVIDIA_kernel & kernel 2.5.5 Martin Huenniger
2002-02-28 8:49 ` Martin Huenniger
2002-02-28 16:53 ` Thomas Dodd [this message]
-- strict thread matches above, loose matches on Subject: below --
2002-02-20 20:01 Nicholas Petreley
2002-02-20 20:40 ` Martin Huenniger
2002-02-20 22:50 ` J.A. Magallon
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=3C7E608C.3020506@cypress.com \
--to=ted@cypress.com \
--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