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 />

– Address and length parameters must be multiples of VM_PAGE_SIZE,<br />

defined as 8192 in configAll.h.<br />

– Because each mapped page requires a page table entry to be stored in<br />

physical memory, there is a physical memory size-dependent upper limit<br />

to the amount of address space that can be mapped. Do not map vast<br />

regions of VMEbus space. To be safe, do not map more than 32 MB per<br />

record.<br />

– When virtual memory support is enabled (see below), CPU accesses<br />

falling outside the physical memory description result in bus errors.<br />

Memory mapped devices (Ethernet, SCSI, serial, and others) are not<br />

accessible unless included in the sysPhysMemDesc[ ] array.<br />

■<br />

Add the following at the beginning of sysToMonitor( ):<br />

VM_ENABLE (FALSE); /* disable MMU */<br />

Example 4-1<br />

Additions to sysLib.c for Virtual Memory Support<br />

/* includes */<br />

#include "private/vmLibP.h"<br />

/* globals */<br />

PHYS_MEM_DESC sysPhysMemDesc [] =<br />

{<br />

/* adrs and length parameters must be page-aligned */<br />

/* RAM */<br />

{<br />

(void *) LOCAL_MEM_LOCAL_ADRS,<br />

(void *) LOCAL_MEM_LOCAL_ADRS,<br />

LOCAL_MEM_SIZE,<br />

VM_STATE_MASK_VALID | VM_STATE_MASK_WRITABLE |<br />

VM_STATE_MASK_CACHEABLE,<br />

VM_STATE_VALID | VM_STATE_WRITABLE | VM_STATE_CACHEABLE<br />

},<br />

/* ROM */<br />

{<br />

(void *) ROM_BASE_ADRS,<br />

(void *) ROM_BASE_ADRS,<br />

ROM_SIZE,<br />

VM_STATE_MASK_VALID | VM_STATE_MASK_WRITABLE |<br />

VM_STATE_MASK_CACHEABLE,<br />

VM_STATE_VALID | VM_STATE_WRITABLE_NOT | VM_STATE_CACHEABLE_NOT<br />

}, /* a16 VME */<br />

{<br />

(void *) SHORT_IO_ADRS,<br />

(void *) SHORT_IO_ADRS,<br />

84

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

Saved successfully!

Ooh no, something went wrong!