2002-06-04 18:24:45

by Nick Popoff

[permalink] [raw]
Subject: Question regarding do_munmap


Greetings all. My apologies in advance if this question is off topic
for this list. I'm responsible for Linux drivers for the hardware my
company makes. Our drivers use kernel modules which use the
do_munmap() function. I noticed that the kernel provided in RH 7.3 is
patched to change this function to add a new parameter which is
missing in the generic kernel.

(Generic 2.4.18 include/linux/mm.h)
extern int do_munmap(struct mm_struct *, unsigned long, size_t);

(RH 7.3/AC patched 2.4.18-3 include/linux/mm.h)
extern int do_munmap(struct mm_struct *, unsigned long, size_t, int
acct);

My question is what is the recommended way for module developers to
handle changes to this API so that end users don't have to edit
makefiles to build for their particular kernel? Is there a way to
detect that a specific patch or patch author is in use so that my
install script can use the correct function? Any recomendations on
how to handle this besides grep'ing source in my installer? :-)

Any advice on this would be much appreciated. Right now our driver is
easier to install on Linux than another other OS we support and I want
to keep it that way! Also, I'm not subscribed to this fearsome
mailing list so please CC me on any replies.




2002-06-04 18:44:47

by John Levon

[permalink] [raw]
Subject: Re: Question regarding do_munmap

On Tue, Jun 04, 2002 at 11:24:33AM -0700, Nick Popoff wrote:

> (Generic 2.4.18 include/linux/mm.h)
> extern int do_munmap(struct mm_struct *, unsigned long, size_t);
>
> (RH 7.3/AC patched 2.4.18-3 include/linux/mm.h)
> extern int do_munmap(struct mm_struct *, unsigned long, size_t, int
> acct);
>
> My question is what is the recommended way for module developers to
> handle changes to this API so that end users don't have to edit
> makefiles to build for their particular kernel? Is there a way to

Add some tests in a ./configure script that finds out which one
is being used in the kernel headers.

> how to handle this besides grep'ing source in my installer? :-)

It's roughly similar to this though. API creep is one of the facts of
external module development on Linux, I'm afraid.

regards
john

--
"Do you mean to tell me that "The Prince" is not the set textbook for CS1072
Professional Issues ? What on earth do you learn in that course ?"
- David Lester

2002-06-04 19:21:51

by Alan

[permalink] [raw]
Subject: Re: Question regarding do_munmap

On Tue, 2002-06-04 at 19:24, Nick Popoff wrote:
> (Generic 2.4.18 include/linux/mm.h)
> extern int do_munmap(struct mm_struct *, unsigned long, size_t);
>
> (RH 7.3/AC patched 2.4.18-3 include/linux/mm.h)
> extern int do_munmap(struct mm_struct *, unsigned long, size_t, int
> acct);
>
> My question is what is the recommended way for module developers to
> handle changes to this API so that end users don't have to edit
> makefiles to build for their particular kernel? Is there a way to

All the -ac trees I ship have -ac in the EXTRAVERSION string. Red Hat
don't propogate that however. I hope to submit the changes to Marcelo
that include the munmap changes for the base tree fairly soon, which
will be ok as its a straight version test.

I hadn't anticipated people using do_munmap in drivers beyond a couple
of fun bits in the intel 3D acceleration

Alan