02.03.2014 Views

BSP Developer's Guide

BSP Developer's Guide

BSP Developer's Guide

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

4<br />

Hardware <strong>Guide</strong>lines<br />

0x10000, /* 64 Kbytes */<br />

VM_STATE_MASK_VALID | VM_STATE_MASK_WRITABLE |<br />

VM_STATE_MASK_CACHEABLE,<br />

VM_STATE_VALID | VM_STATE_WRITABLE | VM_STATE_CACHEABLE_NOT<br />

}<br />

};<br />

int sysPhysMemDescNumEnt = NELEMENTS (sysPhysMemDesc);<br />

4<br />

4.5.2 Changes to config.h<br />

Define INCLUDE_MMU_BASIC to enable basic virtual memory support.<br />

4.5.3 Additional Requirements for SPARC Targets<br />

In SPARC <strong>BSP</strong>s, two global variables in sysLib.c, sysCacheLibInit and<br />

sysMmuLibInit, are used to select appropriate cache and MMU libraries. The<br />

following code segment illustrates this mechanism (Sun-4 MMU example):<br />

/* Sun-4 cache library */<br />

IMPORT mmuSun4LibInit();<br />

FUNCPTR sysCacheLibInit = (FUNCPTR) cacheSun4LibInit;<br />

FUNCPTR sysMmuLibInit = (FUNCPTR) mmuSun4LibInit;<br />

Sun-4 MMU<br />

The Sun-4 MMU page size is typically 8 KB, matching the definition of<br />

VM_PAGE_SIZE in target/config/all/configAll.h. Some hardware implementations<br />

use a different page size. For such a target, override the VM_PAGE_SIZE default<br />

value by adding the following #undef/#define sequence to<br />

config/bspname/config.h (this example assumes a 4 KB page size):<br />

#undef VM_PAGE_SIZE<br />

#define VM_PAGE_SIZE 4096<br />

The Sun-4 MMU supports only eight virtual memory contexts. Additionally, only<br />

66 MB of virtual address space may be mapped at any one time (shared among the<br />

various contexts) because of the finite size of the static RAM containing the<br />

translation tables.<br />

85

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

Saved successfully!

Ooh no, something went wrong!