public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Allocating 16MB aligned phsyical memory
@ 2002-12-11  9:23 Felix Domke
  0 siblings, 0 replies; 2+ messages in thread
From: Felix Domke @ 2002-12-11  9:23 UTC (permalink / raw)
  To: linux-kernel

Hi,

i'm almost a newbie to kernel hacking, and i'm currently writing a driver
for some powerpc-based chipset by IBM (STBxxxx), using the
2.4.xx-linuxppc_devel kernel.

Some On-Chip-Devices require a very strict alignment of memory. For example,
one function (mpeg2 transport demuxer) require that all (32) queues (each of
them about 32kb) reside in one 16MB region, each of them not crossing 1MB
boundary.

At the moment, i'm reserving a 16MB space of ram for which i made an own
allocater. needless to say that this sucks. So now i'm searching for a way
to allocate physical-mapped, contiguous, aligned (at 2^24 bytes) memory. I
already tried to understand __get_free_pages, map_page and the
powerpc-specific "consistent_alloc", but i couldn't think of enforcing the
alignments. I don't want to allocate 16MB more memory just for the
alignment.

I know that allocating 16MB-aligned memory isn't nice. But the other choice
is to completely reserve 16MB of RAM, which isn't nice either, since i only
need ~2MB of them.

Can anybody give me a hint how to do this?

felix domke


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

* Re: Allocating 16MB aligned phsyical memory
       [not found] <mailman.1039599127.17111.linux-kernel2news@redhat.com>
@ 2002-12-11 22:43 ` Pete Zaitcev
  0 siblings, 0 replies; 2+ messages in thread
From: Pete Zaitcev @ 2002-12-11 22:43 UTC (permalink / raw)
  To: Felix Domke; +Cc: linux-kernel

>[...]
> At the moment, i'm reserving a 16MB space of ram for which i made an own
> allocater. needless to say that this sucks.

No, that's normal. Of course, you should have used Pauline's
bigphysarea patch, but otherwise it's a sane idea, IMHO.
 http://www.polyware.nl/~middelink/En/hob-v4l.html
 http://www.polyware.nl/~middelink/patch/bigphysarea-2.4.4.tar.gz

I often wonder why MPEG hardware designers are such dorks.
It is pretty common place between them to ask for contiguous
memory. I would say, 95% of requests for contiguous memory
comes from poor hacks who have to deal with DVRs, PVRs,
and such. Practically no other hardware is this idiotic.
Not that it's impossible to do right, or anything. I think,
stradis is sane.

-- Pete

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

end of thread, other threads:[~2002-12-11 22:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-12-11  9:23 Allocating 16MB aligned phsyical memory Felix Domke
     [not found] <mailman.1039599127.17111.linux-kernel2news@redhat.com>
2002-12-11 22:43 ` Pete Zaitcev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox