GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > MEM / V5-8-0
Constituent: mem_base     Tag: linux-gcc
#include <string.h>
#include "MEM/MEM_cmddefs.h"
#include "MEM/MEM_map.h"
#include "MEM/MEM_msgs.h"
#include "MSG/MSG_pubdefs.h"
#include "mempriv.h"
Include dependency graph for memmap.c:
Defines | |
#define | DIM(a) (sizeof (a) / sizeof ((a)[0])) |
Dimension of an array. | |
#define | mem_NUM_MEM_MAP_TABLE_ENTRIES (64) |
Maximum number of mem_mapMemoryTable entries. | |
Functions | |
void * | MEM_mapRWGeneric (void *dest_p, const void *source_p, const size_t nbytes, void *context_p, size_t *bytes_moved_p) |
Generic memory access callback. | |
void * | MEM_mapRead32Swap (void *dest_p, const void *source_p, const size_t nbytes, void *context_p, size_t *bytes_read_p) |
Byte-swapped 32-bit memory read callback. | |
void * | MEM_mapWrite32Swap (void *dest_p, const void *source_p, const size_t nbytes, void *context_p, size_t *bytes_written_p) |
Byte-swapped 32-bit memory write callback. | |
void * | MEM_mapReadBuffer (void *dest_p, const void *offset, const size_t nbytes, void *buf_p, size_t *bytes_read_p) |
Buffer read access. | |
void * | MEM_mapWriteBuffer (void *offset, const void *src_p, const size_t nbytes, void *buf_p, size_t *bytes_written_p) |
Buffer write access. | |
unsigned int | Mem_ValidateMemoryRange (const MEM_Descriptor *md, const MEM_mapAccessType accessType, const mem_mapEntry **mapEntry) |
Validate memory descriptor against memory map table. | |
unsigned int | MEM_mapInit (void) |
Start the Memory Map system. | |
unsigned int | MEM_mapAddEntry (const caddr_t start_addr, const size_t num_bytes, const MEM_mapAccessType access_flags, MEM_mapAccessCb *read_cb, MEM_mapAccessCb *write_cb, void *context_p) |
Add an entry to the memory map table. | |
unsigned int | MEM_mapAddPpciEntries (void) |
Add memory map table entries for the PPCI bridge chip. | |
Variables | |
static mem_mapEntry | mem_mapMemoryTable [mem_NUM_MEM_MAP_TABLE_ENTRIES] |
Memory map table for 'memory' accesses. | |
static unsigned char | mem_mapFakeRegs [MEM_REGISTER_SET_BYTES] |
Buffer for simulating CPU register accesses. | |
static unsigned char | mem_mapFakePci [65536] |
Buffer for simulating PCI device header accesses. | |
static mem_mapEntry | mem_mapRegisterTable [] |
Memory map table for 'register' accesses. | |
static mem_mapEntry | mem_mapPciConfigTable [] |
Memory map table for 'PCI Configuration' accesses. |
These functions manipulate memory maps.
CVS $Id: memmap.c,v 1.20 2005/11/08 20:43:17 dmay Exp $
|
Add an entry to the memory map table. Add an entry to the memory map table, which defines all the valid locations within the memory address space. Each table entry defines a contiguous region of the memory address space, including the types of accesses allowed to the region and pointers to callback functions that can be used to read and write the region.
|
|
Add memory map table entries for the PPCI bridge chip. Add memory map table entries for the registers within the powerPCI bridge chip on the RAD750 board.
|
|
Start the Memory Map system. Start the Memory Map system. This function should be called once to initialize the internal state associated with the Memory Map functions.
|
|
Byte-swapped 32-bit memory read callback. This is a callback function for reading 32-bit words that require byte swapping. Accesses must be a multiple of 32-bits and aligned on a 32-bit boundary.
|
|
Buffer read access. This is a callback function for reading values from a buffer. This would be used, for example, to read a snapshot of the CPU register values or the PCI configuration space values which have been captured in a buffer. A pointer to the beginning of this snapshot buffer must be provided as the buf_p parameter.
|
|
Generic memory access callback. This is a callback function for reading and writing generic memory. It is suitable for RAM or other memory that has no alignment or access restrictions.
|
|
Byte-swapped 32-bit memory write callback. This is a callback function for writing 32-bit words that require byte swapping. Accesses must be a multiple of 32-bits and aligned on a 32-bit boundary.
|
|
Buffer write access. This is a callback function for writing values to a buffer. A pointer to the beginning of the buffer must be provided as the buf_p parameter.
|
|
Validate memory descriptor against memory map table. This function verifies that a memory descriptor is valid for a given set of access types. Potential access types are specified in accessType as a bitfield. If at least one of the access types specified is legal for the memory descriptor, a handle to the appropriate memory map entry is passed back for future use. If, instead, the caller wants to know if *all* specified access types are valid, then this function must be called once for each type.
|
|
Initial value: { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, }
|
|
Memory map table for 'memory' accesses. Describes the memory map for MEM_MEMMAP_MEMORY loads and dumps. |
|
Initial value: { { 1, (void *)0x0, 0x10000, MEM_MAP_ACCESS_ANY, MEM_mapReadBuffer, MEM_mapWriteBuffer, mem_mapFakePci }, } Describes the memory map for MEM_MEMMAP_PCI_CFG loads and dumps. The PCI configuration space is a 256-byte address space for each device on the PCI bus. |
|
Initial value: { { 1, (void *)0x0, MEM_REGISTER_SET_BYTES, MEM_MAP_ACCESS_ANY, MEM_mapReadBuffer, MEM_mapWriteBuffer, mem_mapFakeRegs }, } Describes the memory map for MEM_MEMMAP_REGISTER loads and dumps. |