How to allocate a region of address space (NOT RAM!)

From: david . hagood
Date: Wed Sep 01 2010 - 15:51:25 EST


I'm working with a single chip system (specifically, a PPC core) that has
onboard devices. I need to allocate a region of address space that is
unused, so that I can configure one of the on-chip devices to occupy that
space. The region of address space allocated must NOT have anything there
already - no RAM, no devices.

As far as I can see, there is no "bus" object I can talk to in order to
allocate address space, as one would do when allocating space on PCI. How
do I grab a region of address space, and be sure that nobody else is going
to frob it?

I could just look at the memory map, plunk my flag down and say "I claim
this address in the name of Endpoint!" but that doesn't keep me from
accidentally laying claim to New York, nor does it stop somebody else from
sailing in behind me and plunking their flag down.

Is there some master resource somewhere in the kernel that tracks the
allocation of physical address space, in the same way that kalloc tracks
the allocation of RAM space? Is there some API I've missed that will
allocate space and make sure it gets mapped into virtual space for me, or
will I have to roll my own solution?


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/