linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Memory Pre-allocation (mem=xxx)
@ 2002-02-23  0:42 David C. Chiu
  2002-02-23  0:57 ` Wolfgang Denk
  2002-02-23  1:54 ` Jim Lewis
  0 siblings, 2 replies; 9+ messages in thread
From: David C. Chiu @ 2002-02-23  0:42 UTC (permalink / raw)
  To: linuxppc-embedded


We're working on a project that requires a two megabytes block of
contiguous memory in kernel space. Although it is well documented that
memory can be reserved by using mem=xx arguments during boot time, it is
unclear (to me) as to how a driver can automatically detect the size of
the said reserved block.

At this moment I am 'cheating' by inserting a global variable to save a
copy of total_memory before it gets replaced by __max_memory in
arch/ppc/mm/init.c so that the saved total_memory (containing the real
physical memory size passed in from boot block) is available to my
driver. But I can't help but to feel there has to be a better way to
determine the reserved buffer size. Is there something else that will do
this without having to modify the kernel?

Any comment is appreciated.

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 9+ messages in thread
* RE: Memory Pre-allocation (mem=xxx)
@ 2002-02-23  1:21 David C. Chiu
  2002-02-25 12:35 ` Kenneth Johansson
  0 siblings, 1 reply; 9+ messages in thread
From: David C. Chiu @ 2002-02-23  1:21 UTC (permalink / raw)
  To: linuxppc-embedded


Thanks for your comment Wolfgang.

The driver in question is compiled as module, and the last time I
checked (a year ago) there isn't a way to pass an argument to a module
driver during boot time. Has this changed? The kernel is 2.4 series.

-----Original Message-----
From: owner-linuxppc-embedded@lists.linuxppc.org
[mailto:owner-linuxppc-embedded@lists.linuxppc.org]On Behalf Of Wolfgang
Denk
Sent: Friday, February 22, 2002 4:57 PM
To: David C. Chiu
Cc: linuxppc-embedded@lists.linuxppc.org
Subject: Re: Memory Pre-allocation (mem=xxx)

In message <8A098FDFC6EED94B872CA2033711F86F0ABD0C@orion.ariodata.com>
you wrote:

> We're working on a project that requires a two megabytes block of
> contiguous memory in kernel space. Although it is well documented that
> memory can be reserved by using mem=xx arguments during boot time, it
is
> unclear (to me) as to how a driver can automatically detect the size
of
> the said reserved block.

Pass an extra boot argument?

Wolfgang Denk

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 9+ messages in thread
* RE: Memory Pre-allocation (mem=xxx)
@ 2002-02-23  3:11 David C. Chiu
  2002-02-23 17:14 ` Tom Rini
  0 siblings, 1 reply; 9+ messages in thread
From: David C. Chiu @ 2002-02-23  3:11 UTC (permalink / raw)
  To: Tom Rini; +Cc: linuxppc-embedded


Thanks for the response. Would you be so kind to be more specific? I did
a coarse search of the kernel documentation subdirectory contents, but
fail to find what you are referring to (although I have been referred to
as the seeing blind in the past.)

The basic goal was to have a singular location in which buffer size is
specified so that future changes doesn't turn into a nightmare, and
computing the delta between mem=xxx and actual memory size seem logical,
but the present method employed by yours truely felt ugly and... so
wrong. ^^;

-----Original Message-----
From: Tom Rini [mailto:trini@kernel.crashing.org]
Sent: Friday, February 22, 2002 6:38 PM
To: Wolfgang Denk
Cc: David C. Chiu; linuxppc-embedded@lists.linuxppc.org
Subject: Re: Memory Pre-allocation (mem=xxx)


On Sat, Feb 23, 2002 at 01:57:24AM +0100, Wolfgang Denk wrote:
> In message <8A098FDFC6EED94B872CA2033711F86F0ABD0C@orion.ariodata.com>
you wrote:
> >
> > We're working on a project that requires a two megabytes block of
> > contiguous memory in kernel space. Although it is well documented
that
> > memory can be reserved by using mem=xx arguments during boot time,
it is
> > unclear (to me) as to how a driver can automatically detect the size
of
> > the said reserved block.
>
> Pass an extra boot argument?

Basically.  IIRC there's a clean way to do it now (tho it can fail, so
you'd have to catch that in the driver, but early on it shouldn't be a
problem).  Look around in Documentation/

--
Tom Rini (TR1265)
http://gate.crashing.org/~trini/

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 9+ messages in thread
* RE: Memory Pre-allocation (mem=xxx)
@ 2002-02-27 21:23 David C. Chiu
  0 siblings, 0 replies; 9+ messages in thread
From: David C. Chiu @ 2002-02-27 21:23 UTC (permalink / raw)
  To: linuxppc-embedded


Thanks for all that replied. It would seem that the best possible choice
is probably to just the /proc/cmdline to pass the buffer allocation
size.

-----Original Message-----
From: innkeon@etx.ericsson.se [mailto:innkeon@etx.ericsson.se]On Behalf
Of Kenneth Johansson
Sent: Monday, February 25, 2002 4:36 AM
To: David C. Chiu
Cc: linuxppc-embedded@lists.linuxppc.org
Subject: Re: Memory Pre-allocation (mem=xxx)


I'am not shure what you mean with a module driver during boot but If you
want
to pass a option that was entered in the bootline you can read the
bootline
from /proc/cmdline and with some small shell script extract the part you
want
and pass that to the module when you insert it.

"David C. Chiu" wrote:
>
> Thanks for your comment Wolfgang.
>
> The driver in question is compiled as module, and the last time I
> checked (a year ago) there isn't a way to pass an argument to a module
> driver during boot time. Has this changed? The kernel is 2.4 series.
>
> -----Original Message-----
> From: owner-linuxppc-embedded@lists.linuxppc.org
> [mailto:owner-linuxppc-embedded@lists.linuxppc.org]On Behalf Of
Wolfgang
> Denk
> Sent: Friday, February 22, 2002 4:57 PM
> To: David C. Chiu
> Cc: linuxppc-embedded@lists.linuxppc.org
> Subject: Re: Memory Pre-allocation (mem=xxx)
>
> In message <8A098FDFC6EED94B872CA2033711F86F0ABD0C@orion.ariodata.com>
> you wrote:
>
> > We're working on a project that requires a two megabytes block of
> > contiguous memory in kernel space. Although it is well documented
that
> > memory can be reserved by using mem=xx arguments during boot time,
it
> is
> > unclear (to me) as to how a driver can automatically detect the size
> of
> > the said reserved block.
>
> Pass an extra boot argument?

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2002-02-27 21:23 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-02-23  0:42 Memory Pre-allocation (mem=xxx) David C. Chiu
2002-02-23  0:57 ` Wolfgang Denk
2002-02-23  1:54 ` Jim Lewis
  -- strict thread matches above, loose matches on Subject: below --
2002-02-23  1:21 David C. Chiu
2002-02-25 12:35 ` Kenneth Johansson
2002-02-23  3:11 David C. Chiu
2002-02-23 17:14 ` Tom Rini
2002-02-24  0:15   ` Tom Rini
2002-02-27 21:23 David C. Chiu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).