02.03.2014 Views

BSP Developer's Guide

BSP Developer's Guide

BSP Developer's Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

VxWorks 5.5<br />

<strong>BSP</strong> Developer’s <strong>Guide</strong><br />

When defining the global mappings in sysPhysMemDesc[ ], make sure that the<br />

amount of virtual memory being mapped does not exceed 66 MB. Also keep in<br />

mind that additional virtual memory space may be mapped at run-time for private<br />

virtual memory in each of the eight contexts.<br />

SPARC Reference MMU<br />

The SPARC Reference MMU page size is 4KB. Because this does not agree with the<br />

default definition of VM_PAGE_SIZE in config/all/configAll.h, add the following<br />

#undef/#define sequence to config/bspname/config.h:<br />

#undef VM_PAGE_SIZE<br />

#define VM_PAGE_SIZE 4096<br />

Due to a 32-bit physical address assumption in vmLib, it is impossible to fully<br />

represent the 36-bit physical addresses of the SPARC Reference MMU model.<br />

Thus, for the current version of vmLib, physical addresses must be physical page<br />

numbers (that is, physical address shifted to the right by PAGE_SHIFT, or 12 bits).<br />

This affects calls to vmGlobalMap( ), vmMap( ), and vmTranslate( ), as well as<br />

specifications in the sysPhysMemDesc[ ] array. For each of these calls (and<br />

specifications), do the PAGE_SHIFT of the physical address.<br />

For supporting multiple contexts, the SPARC Reference MMU implements a<br />

fourth layer in an otherwise three-layer page table indexed by the current context<br />

number. This table is variable in size and is defined by the constants exported from<br />

the <strong>BSP</strong> as follows:<br />

mmuInitNumContexts<br />

Initial number of contexts in table (which is rounded up to a power of 2 as well<br />

as what fits on a physical page).<br />

mmuMaxNumContexts<br />

Maximum number of contexts in table (not necessarily different than<br />

mmuInitNumContexts).<br />

mmuContextTableAlign<br />

Alignment required for context table.<br />

Each of these can be determined from documentation of the particular SPARC<br />

Reference MMU chips. <strong>BSP</strong> designers may want to limit mmuMaxNumContexts<br />

to prevent the table from getting overly large (on implementations that allow a<br />

large number of context table entries).<br />

86

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!