Can't create a region?

Joel Sherrill joel.sherrill at
Mon Apr 16 14:10:36 UTC 2001

Phil Torre wrote:
> In my RTEMS 4.5.0 BSP for our MPC860 board, I want to create a non-
> cached memory region that I can allocate CPM buffers out of.
> (Right now they're malloc'd off of the heap, so it screws up when
> the D-cache is on.)  So at the bottom of bsp_start(), right after
> cache_mmu_init() has set up the page tables containing my cache-
> inhibited area, I make a call to rtems_region_create().  This call
> fails with RTEMS_TOO_MANY, because the _Region_Information struct
> hasn't been initialized yet.  (I did include MANAGERS=region in my
> application Makefile, and CONFIGURE_MAXIMUM_REGIONS 1 in my init.c.)
> Is _Region_Information not initialized yet because I'm doing this
> in the wrong place, or have I missed something else?  I've looked
> over the code and I can't find the place where the struct gets
> filled in with anything.

bsp_start() is called BEFORE the executive is initialized so you
can't allocate resources at that point.

I think you want to use the predriver hook to do this.  It is
invoked AFTER RTEMS is initialized but before any drivers are.

> Also, regarding non-cached buffers for the 860 CPM:  Am I solving
> a problem that's already been fixed by other means?

Possibly.  You might want to ask the caching part again with
860 in the subject.
> Many thanks for any advise...
> --
> =====================================================================
> Phil Torre                               phone: 425-820-6363 x234
> Design Engineer                          email: ptorre at
> Switching Systems Group                    fax: 425-820-7031
> Zetron, Inc.                               web:

Joel Sherrill, Ph.D.             Director of Research & Development
joel at                 On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
Support Available                (256) 722-9985

More information about the users mailing list