Skip to contentSkip to conversation

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

DISCUSSION [email protected] 1 participant 1 message Sep 1, 2010

lore
Share & tools
lore
#0 lore raw

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?