diff --git a/.appveyor.yml b/.appveyor.yml new file mode 100644 index 0000000..e3116d2 --- /dev/null +++ b/.appveyor.yml @@ -0,0 +1,51 @@ +cache: + - C:\Users\appveyor\.tools + +init: + - git config --global core.autocrlf true + +clone_depth: 50 + +skip_commits: + files: + - 'documentation/*' + - '**/*.html' + - '**/*.md' + - '.travis.yml' + +# Build Configurations: dll/static, regular/debug +configuration: + - dynamic + - static + - dynamic-debug + - static-debug + +environment: + # common / default variables for all jobs + SETUP_PATH: .ci-local + + matrix: + - CMP: vs2019 + BASE: 7.0 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 + +# Platform: processor architecture +platform: + - x64 + +install: + - cmd: git submodule update --init --recursive + +build_script: + - cmd: python .ci/cue.py prepare + - cmd: python .ci/cue.py build + +test_script: + - cmd: python .ci/cue.py test + +on_finish: + - ps: Get-ChildItem *.tap -Recurse -Force | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name } + - cmd: python .ci/cue.py test-results + +notifications: + - provider: GitHubPullRequest diff --git a/.ci-local/defaults.set b/.ci-local/defaults.set new file mode 100644 index 0000000..1e35c18 --- /dev/null +++ b/.ci-local/defaults.set @@ -0,0 +1,6 @@ +# EPICS Base +BASE_DIRNAME=base +BASE_REPONAME=epics-base +BASE_REPOOWNER=epics-base +BASE_VARNAME=EPICS_BASE +BASE_RECURSIVE=no diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..23b792c --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +README.md export-subst diff --git a/.github/workflows/ci-scripts-build.yml b/.github/workflows/ci-scripts-build.yml new file mode 100644 index 0000000..b68745a --- /dev/null +++ b/.github/workflows/ci-scripts-build.yml @@ -0,0 +1,129 @@ +# .github/workflows/ci-scripts-build.yml for use with EPICS Base ci-scripts +# (see: https://github.com/epics-base/ci-scripts) + +# This is YAML - indentation levels are crucial + +# Set the 'name:' properties to values that work for you (pvxs) + +name: devlib2 + +# Trigger on pushes and PRs to any branch +on: + push: + paths-ignore: + - "documentation/**" + - "**/*.md" + pull_request: + paths-ignore: + - "documentation/**" + - "**/*.md" + workflow_dispatch: + +env: + SETUP_PATH: .ci-local:.ci + EPICS_TEST_IMPRECISE_TIMING: YES + +jobs: + build-base: + name: ${{ matrix.base }}/${{ matrix.os }}/${{ matrix.cmp }}/${{ matrix.configuration }}${{ matrix.rtems }}/${{ matrix.extra }} + runs-on: ${{ matrix.os }} + # Set environment variables from matrix parameters + env: + BASE: ${{ matrix.base }} + CMP: ${{ matrix.cmp }} + BCFG: ${{ matrix.configuration }} + RTEMS: ${{ matrix.rtems }} + EXTRA: ${{ matrix.extra }} + TEST: ${{ matrix.test }} + strategy: + fail-fast: false + matrix: + include: + - os: ubuntu-20.04 + cmp: gcc + configuration: default + base: "7.0" + wine: "64" + + - os: ubuntu-20.04 + cmp: gcc + configuration: static + base: "7.0" + + - os: ubuntu-20.04 + cmp: gcc + configuration: default + base: "3.15" + + - os: ubuntu-20.04 + cmp: gcc + configuration: default + base: "3.14" + + - os: ubuntu-20.04 + cmp: gcc + configuration: static + base: "7.0" + extra: "CMD_CXXFLAGS=-std=c++11" + + - os: ubuntu-20.04 + cmp: clang + configuration: default + base: "7.0" + extra: "CMD_CXXFLAGS=-std=c++11" + + - os: ubuntu-20.04 + cmp: gcc + configuration: default + base: "7.0" + rtems: "4.10" + + - os: ubuntu-20.04 + cmp: gcc + configuration: default + base: "7.0" + rtems: "4.9" + + - os: ubuntu-20.04 + cmp: gcc-8 + utoolchain: "8" + configuration: default + base: "7.0" + + - os: ubuntu-20.04 + cmp: clang + configuration: default + base: "7.0" + + steps: + - uses: actions/checkout@v2 + with: + submodules: true + - name: Cache Dependencies + uses: actions/cache@v2 + with: + path: ~/.cache + key: ${{ matrix.base }}/${{ matrix.os }}/${{ matrix.cmp }}/${{ matrix.configuration }}/${{ matrix.wine }}${{ matrix.rtems }}/${{ matrix.extra }} + - name: Automatic core dump analysis + uses: mdavidsaver/ci-core-dumper@master + - name: "apt-get install" + run: | + sudo apt-get update + sudo apt-get -y install qemu-system-x86 g++-mingw-w64-x86-64 gdb + if: runner.os == 'Linux' + - name: "apt-get install ${{ matrix.cmp }}" + run: | + sudo apt-get update + sudo apt-get -y install software-properties-common + sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test + sudo apt-get update + sudo apt-get -y install g++-${{ matrix.utoolchain }} + if: matrix.utoolchain + - name: Prepare and compile dependencies + run: python .ci/cue.py prepare + - name: Build main module + run: python .ci/cue.py build + - name: Run main module tests + run: python .ci/cue.py test + - name: Collect and show test results + run: python .ci/cue.py test-results diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..948af4a --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +/bin/ +/db/ +/dbd/ +/include/ +/lib/ +/cfg/ +O.*/ +*.local diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..16d8e49 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule ".ci"] + path = .ci + url = https://github.com/epics-base/ci-scripts.git diff --git a/.hgignore b/.hgignore new file mode 100644 index 0000000..605543d --- /dev/null +++ b/.hgignore @@ -0,0 +1,9 @@ +O.* +^bin$ +^db$ +^dbd$ +^include$ +^lib$ +^envPaths$ +^html$ +^documentation/doc$ diff --git a/.hgtags b/.hgtags new file mode 100644 index 0000000..25005c0 --- /dev/null +++ b/.hgtags @@ -0,0 +1,7 @@ +e23cb6805b9fb3a5489ae6f041e065ef841a84eb 2.0 +f8131c88926e6d5b0cf7195edf55f2a8e6311745 2.1 +da086a6d94ae8b2f2447dd3eba39dd6ff929a35e 2.2 +921aed1b0b86ada325b9e5fe70acfd383636e008 2.3 +4ceac34e67b963a6be0a2c6f032004f337568912 2.4 +9dd68ea8e138c64e1f6c1a8e874ba8629dc8b07e 2.5 +8f9f3f208d469f694812a0c8333d8316443919d0 2.6 diff --git a/annotated.html b/annotated.html new file mode 100644 index 0000000..9479da7 --- /dev/null +++ b/annotated.html @@ -0,0 +1,67 @@ + + +
+ + + + +
+ devLib2
+ 2.11
+
+ |
+
Cbdf | |
Cbdfmatch | |
CdevLibPCI | |
CepicsPCIDevice | Device token |
CepicsPCIID | PCI device identifier |
CosdPCIDevice | |
CPCIBar | |
CrangeItem | |
Csearchinfo | |
CVMECSRID | ID info for a VME64(x) device This structure is used to hold identifying information for a VME64 compatible device. When used for searching each field can hold a specific value of the 'VMECSRANY' wildcard |
+ devLib2
+ 2.11
+
+ |
+
|
|
|
| |||||
bdf | epicsPCIDevice | PCIBar | searchinfo | |||||
bdfmatch | epicsPCIID |
|
| |||||
|
| |||||||
rangeItem | VMECSRID | |||||||
devLibPCI | osdPCIDevice | |||||||
+ devLib2
+ 2.11
+
+ |
+
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <ellLib.h>
#include <errlog.h>
#include <epicsThread.h>
#include <epicsMutex.h>
#include <iocsh.h>
#include <epicsStdio.h>
#include "devLibPCIImpl.h"
#include "devLibPCI.h"
#include <epicsExport.h>
Go to the source code of this file.
++Data Structures | |
struct | bdfmatch |
struct | searchinfo |
+Macros | |
#define | epicsExportSharedSymbols |
#define | CONTAINER(ptr, structure, member) ((structure*)((char*)(ptr) - offsetof(structure, member))) |
#define | PCIINIT |
+Functions | |
int | devLibPCIRegisterDriver2 (devLibPCI *drv, size_t drvsize) |
int | devLibPCIUse (const char *use) |
Select driver implementation. Pick driver implementation by name, or NULL to use default. If no selection is made then the default will be used if available. More... | |
const char * | devLibPCIDriverName () |
int | devLibPCIMatch (const epicsPCIID *match, const epicsPCIID *dev) |
int | devPCIFindCB (const epicsPCIID *idlist, devPCISearchFn searchfn, void *arg, unsigned int opt) |
PCI bus search w/ callback. More... | |
int | devPCIFindSpec (const epicsPCIID *idlist, const char *spec, const epicsPCIDevice **found, unsigned int opt) |
PCI bus search by specification string. More... | |
int | devPCIFindDBDF (const epicsPCIID *idlist, unsigned int domain, unsigned int b, unsigned int d, unsigned int f, const epicsPCIDevice **found, unsigned int opt) |
PCI bus probe. More... | |
int | devPCIFindBDF (const epicsPCIID *idlist, unsigned int b, unsigned int d, unsigned int f, const epicsPCIDevice **found, unsigned int opt) |
int | devPCIToLocalAddr (const epicsPCIDevice *curdev, unsigned int bar, volatile void **ppLocalAddr, unsigned int opt) |
Get pointer to PCI BAR. More... | |
int | devPCIBarLen (const epicsPCIDevice *curdev, unsigned int bar, epicsUInt32 *len) |
Find the size of a BAR. More... | |
int | devPCIConnectInterrupt (const epicsPCIDevice *curdev, void(*pFunction)(void *), void *parameter, unsigned int opt) |
Request interrupts for device. More... | |
int | devPCIDisconnectInterrupt (const epicsPCIDevice *curdev, void(*pFunction)(void *), void *parameter) |
Stop receiving interrupts. More... | |
void | devPCIShow (int lvl, int vendor, int device, int exact) |
void | devPCIShowMatch (int lvl, const char *spec, int vendor, int device) |
void | devPCIShowDevice (int lvl, const epicsPCIDevice *dev) |
int | devPCIConfigRead8 (const epicsPCIDevice *dev, unsigned offset, epicsUInt8 *pResult) |
Read byte from configuration space. More... | |
int | devPCIConfigRead16 (const epicsPCIDevice *dev, unsigned offset, epicsUInt16 *pResult) |
Read (16-bit) word from configuration space. More... | |
int | devPCIConfigRead32 (const epicsPCIDevice *dev, unsigned offset, epicsUInt32 *pResult) |
Read (32-bit) dword from configuration space. More... | |
int | devPCIConfigWrite8 (const epicsPCIDevice *dev, unsigned offset, epicsUInt8 value) |
Write byte to configuration space. More... | |
int | devPCIConfigWrite16 (const epicsPCIDevice *dev, unsigned offset, epicsUInt16 value) |
Write (16-bit) word from configuration space. More... | |
int | devPCIConfigWrite32 (const epicsPCIDevice *dev, unsigned offset, epicsUInt32 value) |
Write (32-bit) dword from configuration space. More... | |
int | devPCIEnableInterrupt (const epicsPCIDevice *dev) |
Enable interrupts at the device. More... | |
int | devPCIDisableInterrupt (const epicsPCIDevice *dev) |
Enable interrupts at the device. More... | |
epicsExportRegistrar (devLibPCIIOCSH) | |
epicsExportAddress (int, devPCIDebug) | |
+Variables | |
int | devPCIDebug = 0 |
#define CONTAINER | +( | ++ | ptr, | +
+ | + | + | structure, | +
+ | + | + | member | +
+ | ) | +((structure*)((char*)(ptr) - offsetof(structure, member))) | +
Definition at line 33 of file devLibPCI.c.
+ +#define epicsExportSharedSymbols | +
Definition at line 22 of file devLibPCI.c.
+ +#define PCIINIT | +
Definition at line 205 of file devLibPCI.c.
+ +int devLibPCIMatch | +( | +const epicsPCIID * | +match, | +
+ | + | const epicsPCIID * | +dev | +
+ | ) | ++ |
Helper for implementing devLibPCI::pDevPCIFind()
+Returns true if the given match (which may include DEVPCI_ANY_* wildcards) matches the given device (which may not).
+ +Definition at line 153 of file devLibPCI.c.
+ +int devLibPCIRegisterDriver2 | +( | +devLibPCI * | +drv, | +
+ | + | size_t | +drvsize | +
+ | ) | ++ |
Definition at line 70 of file devLibPCI.c.
+ +epicsExportAddress | +( | +int | +, | +
+ | + | devPCIDebug | ++ |
+ | ) | ++ |
epicsExportRegistrar | +( | +devLibPCIIOCSH | +) | ++ |
int devPCIDebug = 0 | +
Definition at line 48 of file devLibPCI.c.
+ +
+ devLib2
+ 2.11
+
+ |
+
+ devLib2
+ 2.11
+
+ |
+
#include <dbDefs.h>
#include <epicsTypes.h>
#include <devLib.h>
#include <shareLib.h>
Go to the source code of this file.
++Data Structures | |
struct | epicsPCIID |
PCI device identifier. More... | |
struct | PCIBar |
struct | epicsPCIDevice |
Device token. More... | |
+Macros | |
#define | DEVLIBPCI_MAJOR 1 |
API major version. More... | |
#define | DEVLIBPCI_MINOR 3 |
API minor version. More... | |
#define | DEVPCI_ANY_DEVICE 0x10000 |
#define | DEVPCI_ANY_VENDOR 0x10000 |
#define | DEVPCI_ANY_SUBDEVICE 0x10000 |
#define | DEVPCI_ANY_SUBVENDOR 0x10000 |
#define | DEVPCI_ANY_CLASS 0x1000000 |
#define | DEVPCI_ANY_REVISION 0x100 |
#define | DEVPCI_LAST_DEVICE 0xffff0000 |
#define | DEVPCI_END {DEVPCI_LAST_DEVICE,0,0,0,0,0} |
The last item in a list of PCI IDS. More... | |
#define | DEVPCI_DEVICE_ANY() |
#define | DEVPCI_DEVICE_VENDOR(dev, vend) |
#define | DEVPCI_DEVICE_VENDOR_CLASS(dev, vend, pclass) |
#define | DEVPCI_SUBDEVICE_SUBVENDOR(dev, vend, sdev, svend) |
#define | DEVPCI_SUBDEVICE_SUBVENDOR_CLASS(dev, vend, sdev, svend, revision, pclass) |
#define | DEVPCI_NO_SLOT NULL |
#define | PCIBARCOUNT NELEMENTS( ((epicsPCIDevice*)0)->bar ) |
The maximum number of base address registers (BARs). More... | |
#define | DEVLIB_MAP_UIO1TO1 0 |
#define | DEVLIB_MAP_UIOCOMPACT 0 |
+Typedefs | |
typedef int(* | devPCISearchFn) (void *ptr, const epicsPCIDevice *dev) |
PCI search callback prototype. More... | |
+Functions | |
epicsShareFunc int | devPCIFindCB (const epicsPCIID *idlist, devPCISearchFn searchfn, void *arg, unsigned int opt) |
PCI bus search w/ callback. More... | |
epicsShareFunc int | devPCIFindSpec (const epicsPCIID *idlist, const char *spec, const epicsPCIDevice **found, unsigned int opt) |
PCI bus search by specification string. More... | |
epicsShareFunc int | devPCIFindDBDF (const epicsPCIID *idlist, unsigned int domain, unsigned int b, unsigned int d, unsigned int f, const epicsPCIDevice **found, unsigned int opt) |
PCI bus probe. More... | |
epicsShareFunc int | devPCIFindBDF (const epicsPCIID *idlist, unsigned int b, unsigned int d, unsigned int f, const epicsPCIDevice **found, unsigned int opt) |
epicsShareFunc int | devPCIToLocalAddr (const epicsPCIDevice *id, unsigned int bar, volatile void **ppLocalAddr, unsigned int opt) |
Get pointer to PCI BAR. More... | |
epicsShareFunc int | devPCIBarLen (const epicsPCIDevice *id, unsigned int bar, epicsUInt32 *len) |
Find the size of a BAR. More... | |
epicsShareFunc int | devPCIConnectInterrupt (const epicsPCIDevice *id, void(*pFunction)(void *), void *parameter, unsigned int opt) |
Request interrupts for device. More... | |
epicsShareFunc int | devPCIDisconnectInterrupt (const epicsPCIDevice *id, void(*pFunction)(void *), void *parameter) |
Stop receiving interrupts. More... | |
epicsShareFunc void | devPCIShow (int lvl, int vendor, int device, int exact) |
epicsShareFunc void | devPCIShowMatch (int lvl, const char *spec, int vendor, int device) |
epicsShareFunc void | devPCIShowDevice (int lvl, const epicsPCIDevice *dev) |
epicsShareFunc int | devLibPCIUse (const char *name) |
Select driver implementation. Pick driver implementation by name, or NULL to use default. If no selection is made then the default will be used if available. More... | |
epicsShareFunc const char * | devLibPCIDriverName () |
epicsShareFunc int | devPCIConfigRead8 (const epicsPCIDevice *dev, unsigned offset, epicsUInt8 *pResult) |
Read byte from configuration space. More... | |
epicsShareFunc int | devPCIConfigRead16 (const epicsPCIDevice *dev, unsigned offset, epicsUInt16 *pResult) |
Read (16-bit) word from configuration space. More... | |
epicsShareFunc int | devPCIConfigRead32 (const epicsPCIDevice *dev, unsigned offset, epicsUInt32 *pResult) |
Read (32-bit) dword from configuration space. More... | |
epicsShareFunc int | devPCIConfigWrite8 (const epicsPCIDevice *dev, unsigned offset, epicsUInt8 value) |
Write byte to configuration space. More... | |
epicsShareFunc int | devPCIConfigWrite16 (const epicsPCIDevice *dev, unsigned offset, epicsUInt16 value) |
Write (16-bit) word from configuration space. More... | |
epicsShareFunc int | devPCIConfigWrite32 (const epicsPCIDevice *dev, unsigned offset, epicsUInt32 value) |
Write (32-bit) dword from configuration space. More... | |
epicsShareFunc int | devPCIEnableInterrupt (const epicsPCIDevice *dev) |
Enable interrupts at the device. More... | |
epicsShareFunc int | devPCIDisableInterrupt (const epicsPCIDevice *dev) |
Enable interrupts at the device. More... | |
epicsShareFunc const char * | devPCIDeviceClassToString (int classId) |
Translate class id to string. More... | |
+Variables | |
epicsShareExtern int | devPCIDebug |
+ devLib2
+ 2.11
+
+ |
+
+ devLib2
+ 2.11
+
+ |
+
#include <stddef.h>
#include <dbDefs.h>
#include <ellLib.h>
#include <shareLib.h>
#include <epicsTypes.h>
#include "devLibPCI.h"
Go to the source code of this file.
++Data Structures | |
struct | devLibPCI |
+Macros | |
#define | CFG_ACC_WIDTH(mode) ((mode) & 0x0f) |
#define | CFG_ACC_WRITE(mode) ((mode) & 0x10) |
#define | devLibPCIRegisterDriver(TPTR) devLibPCIRegisterDriver2(TPTR, sizeof(*(TPTR))) |
+Enumerations | |
enum | devPCIAccessMode { + RD_08 = 0x01, +RD_16 = 0x02, +RD_32 = 0x04, +WR_08 = 0x11, + + WR_16 = 0x12, +WR_32 = 0x14 + + } |
+Functions | |
epicsShareFunc int | devLibPCIRegisterDriver2 (devLibPCI *, size_t) |
epicsShareFunc void | devLibPCIRegisterBaseDefault (void) |
epicsShareFunc int | devLibPCIMatch (const epicsPCIID *match, const epicsPCIID *dev) |
#define CFG_ACC_WIDTH | +( | ++ | mode | ) | +((mode) & 0x0f) | +
Definition at line 36 of file devLibPCIImpl.h.
+ +#define CFG_ACC_WRITE | +( | ++ | mode | ) | +((mode) & 0x10) | +
Definition at line 37 of file devLibPCIImpl.h.
+ +#define devLibPCIRegisterDriver | +( | ++ | TPTR | ) | +devLibPCIRegisterDriver2(TPTR, sizeof(*(TPTR))) | +
Definition at line 72 of file devLibPCIImpl.h.
+ +enum devPCIAccessMode | +
Enumerator | |
---|---|
RD_08 | |
RD_16 | |
RD_32 | |
WR_08 | |
WR_16 | |
WR_32 |
Definition at line 27 of file devLibPCIImpl.h.
+ +epicsShareFunc int devLibPCIMatch | +( | +const epicsPCIID * | +match, | +
+ | + | const epicsPCIID * | +dev | +
+ | ) | ++ |
Helper for implementing devLibPCI::pDevPCIFind()
+Returns true if the given match (which may include DEVPCI_ANY_* wildcards) matches the given device (which may not).
+ +Definition at line 153 of file devLibPCI.c.
+ +epicsShareFunc void devLibPCIRegisterBaseDefault | +( | +void | +) | ++ |
Register default implementation
+Not needed by IOCs
+ +epicsShareFunc int devLibPCIRegisterDriver2 | +( | +devLibPCI * | +, | +
+ | + | size_t | ++ |
+ | ) | ++ |
Definition at line 70 of file devLibPCI.c.
+ +
+ devLib2
+ 2.11
+
+ |
+
+ devLib2
+ 2.11
+
+ |
+
Go to the source code of this file.
++Macros | |
#define | epicsExportSharedSymbols |
+Functions | |
const char * | devPCIDeviceClassToString (int classId) |
Translate class id to string. More... | |
#define epicsExportSharedSymbols | +
Definition at line 4 of file devLibPCIStrings.c.
+ +
+ devLib2
+ 2.11
+
+ |
+
+ devLib2
+ 2.11
+
+ |
+
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include "dbDefs.h"
#include "epicsMutex.h"
#include "errlog.h"
#include "ellLib.h"
#include "devLibVME.h"
#include <epicsExport.h>
Go to the source code of this file.
++Data Structures | |
struct | rangeItem |
+Macros | |
#define | epicsExportSharedSymbols |
#define | NO_DEVLIB_COMPAT |
#define | SUCCESS 0 |
+Functions | |
long | devBusToLocalAddr2 (epicsAddressType addrType, size_t busAddr, volatile void **ppLocalAddress) |
long | devRegisterAddress2 (const char *pOwnerName, epicsAddressType addrType, size_t base, size_t size, volatile void **ppPhysicalAddress) |
long | devUnregisterAddress2 (epicsAddressType addrType, size_t baseAddress, const char *pOwnerName) |
long | devAllocAddress2 (const char *pOwnerName, epicsAddressType addrType, size_t size, unsigned alignment, volatile void **pLocalAddress) |
long | devAddressMap2 (void) |
void | devReplaceVirtualOS (void) |
epicsExportRegistrar (devReplaceVirtualOS) | |
+Variables | |
const char * | epicsAddressTypeName2 [] |
#define epicsExportSharedSymbols | +
Definition at line 31 of file devLibVME.c.
+ +#define NO_DEVLIB_COMPAT | +
Definition at line 37 of file devLibVME.c.
+ +#define SUCCESS 0 | +
Definition at line 142 of file devLibVME.c.
+ +long devAddressMap2 | +( | +void | +) | ++ |
Definition at line 702 of file devLibVME.c.
+ +long devAllocAddress2 | +( | +const char * | +pOwnerName, | +
+ | + | epicsAddressType | +addrType, | +
+ | + | size_t | +size, | +
+ | + | unsigned | +alignment, | +
+ | + | volatile void ** | +pLocalAddress | +
+ | ) | ++ |
Definition at line 569 of file devLibVME.c.
+ +long devBusToLocalAddr2 | +( | +epicsAddressType | +addrType, | +
+ | + | size_t | +busAddr, | +
+ | + | volatile void ** | +ppLocalAddress | +
+ | ) | ++ |
Definition at line 147 of file devLibVME.c.
+ +long devRegisterAddress2 | +( | +const char * | +pOwnerName, | +
+ | + | epicsAddressType | +addrType, | +
+ | + | size_t | +base, | +
+ | + | size_t | +size, | +
+ | + | volatile void ** | +ppPhysicalAddress | +
+ | ) | ++ |
Definition at line 198 of file devLibVME.c.
+ +void devReplaceVirtualOS | +( | +void | +) | ++ |
Definition at line 811 of file devLibVME.c.
+ +long devUnregisterAddress2 | +( | +epicsAddressType | +addrType, | +
+ | + | size_t | +baseAddress, | +
+ | + | const char * | +pOwnerName | +
+ | ) | ++ |
Definition at line 432 of file devLibVME.c.
+ +epicsExportRegistrar | +( | +devReplaceVirtualOS | +) | ++ |
const char* epicsAddressTypeName2[] | +
Definition at line 71 of file devLibVME.c.
+ +
+ devLib2
+ 2.11
+
+ |
+
+ devLib2
+ 2.11
+
+ |
+
#include "dbDefs.h"
#include "osdVME.h"
#include "errMdef.h"
#include "shareLib.h"
#include "devLib.h"
Go to the source code of this file.
++Macros | |
#define | atVMECSR ((epicsAddressType)4) |
#define | atLast ((epicsAddressType)5) |
#define | epicsAddressTypeName epicsAddressTypeName2 |
#define | devAddressMap devAddressMap2 |
#define | devBusToLocalAddr devBusToLocalAddr2 |
#define | devRegisterAddress devRegisterAddress2 |
#define | devUnregisterAddress devUnregisterAddress2 |
#define | devAllocAddress devAllocAddress2 |
+Functions | |
epicsShareFunc long | devAddressMap2 (void) |
epicsShareFunc long | devBusToLocalAddr2 (epicsAddressType addrType, size_t busAddr, volatile void **ppLocalAddr) |
epicsShareFunc long | devRegisterAddress2 (const char *pOwnerName, epicsAddressType addrType, size_t logicalBaseAddress, size_t size, volatile void **pPhysicalAddress) |
epicsShareFunc long | devUnregisterAddress2 (epicsAddressType addrType, size_t logicalBaseAddress, const char *pOwnerName) |
epicsShareFunc long | devAllocAddress2 (const char *pOwnerName, epicsAddressType addrType, size_t size, unsigned alignment, volatile void **pLocalAddress) |
epicsShareFunc void | devReplaceVirtualOS (void) |
+Variables | |
epicsShareExtern const char * | epicsAddressTypeName2 [] |
devLibVirtualOS * | pdevLibVME2 |
#define atLast ((epicsAddressType)5) | +
Definition at line 40 of file devLibVME.h.
+ +#define atVMECSR ((epicsAddressType)4) | +
Definition at line 39 of file devLibVME.h.
+ +#define devAddressMap devAddressMap2 | +
Definition at line 56 of file devLibVME.h.
+ +#define devAllocAddress devAllocAddress2 | +
Definition at line 92 of file devLibVME.h.
+ +#define devBusToLocalAddr devBusToLocalAddr2 | +
Definition at line 67 of file devLibVME.h.
+ +#define devRegisterAddress devRegisterAddress2 | +
Definition at line 75 of file devLibVME.h.
+ +#define devUnregisterAddress devUnregisterAddress2 | +
Definition at line 81 of file devLibVME.h.
+ +#define epicsAddressTypeName epicsAddressTypeName2 | +
Definition at line 47 of file devLibVME.h.
+ +epicsShareFunc long devAddressMap2 | +( | +void | +) | ++ |
Definition at line 702 of file devLibVME.c.
+ +epicsShareFunc long devAllocAddress2 | +( | +const char * | +pOwnerName, | +
+ | + | epicsAddressType | +addrType, | +
+ | + | size_t | +size, | +
+ | + | unsigned | +alignment, | +
+ | + | volatile void ** | +pLocalAddress | +
+ | ) | ++ |
Definition at line 569 of file devLibVME.c.
+ +epicsShareFunc long devBusToLocalAddr2 | +( | +epicsAddressType | +addrType, | +
+ | + | size_t | +busAddr, | +
+ | + | volatile void ** | +ppLocalAddr | +
+ | ) | ++ |
Definition at line 147 of file devLibVME.c.
+ +epicsShareFunc long devRegisterAddress2 | +( | +const char * | +pOwnerName, | +
+ | + | epicsAddressType | +addrType, | +
+ | + | size_t | +logicalBaseAddress, | +
+ | + | size_t | +size, | +
+ | + | volatile void ** | +pPhysicalAddress | +
+ | ) | ++ |
Definition at line 198 of file devLibVME.c.
+ +epicsShareFunc void devReplaceVirtualOS | +( | +void | +) | ++ |
Definition at line 87 of file devlib_compat.c.
+ +epicsShareFunc long devUnregisterAddress2 | +( | +epicsAddressType | +addrType, | +
+ | + | size_t | +logicalBaseAddress, | +
+ | + | const char * | +pOwnerName | +
+ | ) | ++ |
Definition at line 432 of file devLibVME.c.
+ +epicsShareExtern const char* epicsAddressTypeName2[] | +
Definition at line 46 of file devLibVME.h.
+ +devLibVirtualOS* pdevLibVME2 | +
+ devLib2
+ 2.11
+
+ |
+
+ devLib2
+ 2.11
+
+ |
+
Go to the source code of this file.
++Macros | |
#define | epicsExportSharedSymbols |
+Functions | |
volatile unsigned char * | devCSRProbeSlot (int slot) |
Get the CSR base address for a slot. More... | |
volatile unsigned char * | devCSRTestSlot (const struct VMECSRID *devs, int slot, struct VMECSRID *info) |
Probe a VME slot then check its ID. More... | |
void | vmecsrprint (int N, int v) |
Decode contents of CSR/CR and print to screen. More... | |
void | vmecsrdump (int v) |
Decode contents of CSR/CR for all cards and print to screen. More... | |
+ devLib2
+ 2.11
+
+ |
+
+ devLib2
+ 2.11
+
+ |
+
#include <epicsVersion.h>
#include "devLib.h"
#include <epicsTypes.h>
#include "epicsMMIO.h"
#include "vmedefs.h"
#include <shareLib.h>
Go to the source code of this file.
++Data Structures | |
struct | VMECSRID |
ID info for a VME64(x) device This structure is used to hold identifying information for a VME64 compatible device. When used for searching each field can hold a specific value of the 'VMECSRANY' wildcard. More... | |
+Macros | |
#define | DEVLIBVME_MAJOR 1 |
API major version. More... | |
#define | DEVLIBVME_MINOR 0 |
API minor version. More... | |
#define | VMECSR_END {0,0,0} |
Must be the last entry in a device list. More... | |
#define | VMECSRANY 0xFfffFfff |
Match any value. May be used in any field of VMECSRID. More... | |
#define | VMECSRSLOTMAX ((1<<5)-1) |
The highest slot number. More... | |
#define | CSRSlotBase(slot) ( (slot)<<19 ) |
Derives the CSR space base address for a slot. More... | |
#define | CSRADER(addr, mod) ( ((addr)&0xFfffFf00) | ( ((mod)&0x3f)<<2 ) ) |
Computes values for the VME64x address decode registers (ADER). More... | |
#define | CSRRead8(addr) ioread8(addr) |
#define | CSRRead16(addr) ( CSRRead8(addr)<<8 | CSRRead8(addr+4) ) |
#define | CSRRead24(addr) ( CSRRead16(addr)<<8 | CSRRead8(addr+8) ) |
#define | CSRRead32(addr) ( CSRRead24(addr)<<8 | CSRRead8(addr+12) ) |
#define | CSRWrite8(addr, val) iowrite8(addr, val) |
#define | CSRWrite16(addr, val) do{ CSRWrite8(addr,(val&0xff00)>>8); CSRWrite8(addr+4,val&0xff); }while(0) |
#define | CSRWrite24(addr, val) do{ CSRWrite16(addr,(val&0xffff00)>>8); CSRWrite8(addr+8,val&0xff); }while(0) |
#define | CSRWrite32(addr, val) do{ CSRWrite24(addr,(val&0xffffff00)>>8); CSRWrite8(addr+12,val&0xff); }while(0) |
#define | CR_ROM_CHECKSUM 0x0003 |
8-bit checksum of Configuration ROM space More... | |
#define | CR_ROM_LENGTH 0x0007 |
Number of bytes in Configuration ROM to checksum. More... | |
#define | CR_DATA_ACCESS_WIDTH 0x0013 |
Configuration ROM area (CR) data access method. More... | |
#define | CSR_DATA_ACCESS_WIDTH 0x0017 |
Control/Status Reg area (CSR) data access method. More... | |
#define | CR_SPACE_ID 0x001B |
CR/CSR space ID (VME64, VME64X, etc). More... | |
#define | CR_ASCII_C 0x001F |
ASCII "C" (identifies this as CR space) More... | |
#define | CR_ASCII_R 0x0023 |
ASCII "R" (identifies this as CR space) More... | |
#define | CR_IEEE_OUI 0x0027 |
IEEE Organizationally Unique Identifier (OUI) More... | |
#define | CR_IEEE_OUI_BYTES 3 |
Number of bytes in manufacturer's OUI. More... | |
#define | CR_BOARD_ID 0x0033 |
Manufacturer's board ID. More... | |
#define | CR_BOARD_ID_BYTES 4 |
Number of bytes in manufacturer's OUI. More... | |
#define | CR_REVISION_ID 0x0043 |
Manufacturer's board revision ID. More... | |
#define | CR_REVISION_ID_BYTES 4 |
Number of bytes in board revision ID. More... | |
#define | CR_ASCII_STRING 0x0053 |
Offset to ASCII string (manufacturer-specific) More... | |
#define | CR_PROGRAM_ID 0x007F |
Program ID code for CR space. More... | |
#define | CR_BEG_UCR 0x0083 |
Offset to start of manufacturer-defined CR space. More... | |
#define | CR_END_UCR 0x008F |
Offset to end of manufacturer-defined CR space. More... | |
#define | CR_BEG_UCSR_BYTES 3 |
Number of bytes in User CSR starting offset. More... | |
#define | CR_BEG_CRAM 0x009B |
Offset to start of Configuration RAM (CRAM) space. More... | |
#define | CR_END_CRAM 0x00A7 |
Offset to end of Configuration RAM (CRAM) space. More... | |
#define | CR_BEG_UCSR 0x00B3 |
Offset to start of manufacturer-defined CSR space. More... | |
#define | CR_END_UCSR 0x00BF |
Offset to end of manufacturer-defined CSR space. More... | |
#define | CR_BEG_SN 0x00CB |
Offset to beginning of board serial number. More... | |
#define | CR_END_SN 0x00DF |
Offset to end of board serial number. More... | |
#define | CR_SLAVE_CHAR 0x00E3 |
Board's slave-mode characteristics. More... | |
#define | CR_UD_SLAVE_CHAR 0x00E7 |
Manufacturer-defined slave-mode characteristics. More... | |
#define | CR_MASTER_CHAR 0x00EB |
Board's master-mode characteristics. More... | |
#define | CR_UD_MASTER_CHAR 0x00EF |
Manufacturer-defined master-mode characteristics. More... | |
#define | CR_IRQ_HANDLER_CAP 0x00F3 |
Interrupt levels board can respond to (handle) More... | |
#define | CR_IRQ_CAP 0x00F7 |
Interrupt levels board can assert. More... | |
#define | CR_CRAM_WIDTH 0x00FF |
Configuration RAM (CRAM) data access method) More... | |
#define | CR_FN_DAWPR(N) ( 0x0103 + (N)*0x04 ) /* N = 0 -> 7 */ |
Start of Data Access Width Parameter (DAWPR) regs. More... | |
#define | CR_DAWPR_BYTES 1 /* Number of bytes in a DAWPR register */ |
#define | CR_FN_AMCAP(N) ( 0x0123 + (N)*0x20 ) /* N = 0 -> 7 */ |
Start of Address Mode Capability (AMCAP) registers. More... | |
#define | CR_AMCAP_BYTES 8 /* Number of bytes in an AMCAP register */ |
#define | CR_FN_XAMCAP(N) ( 0x0223 + (N)*0x80 ) /* N = 0 -> 7 */ |
Start of Extended Address Mode Cap (XAMCAP) registers. More... | |
#define | CR_XAMCAP_BYTES 32 /* Number of bytes in an XAMCAP register */ |
#define | CR_FN_ADEM(N) ( 0x0623 + (N)*0x10 ) /* N = 0 -> 7 */ |
Start of Address Decoder Mask (ADEM) registers. More... | |
#define | CR_ADEM_BYTES 4 /* Number of bytes in an ADEM register */ |
#define | CR_MASTER_DAWPR 0x06AF |
Master Data Access Width Parameter. More... | |
#define | CR_MASTER_AMCAP 0x06B3 |
Master Address Mode Capabilities (8 entries) More... | |
#define | CR_MASTER_XAMCAP 0x06D3 |
Master Extended Address Mode Capabilities (8 entries) More... | |
#define | CR_SIZE 0x0750 |
Size of CR space (in total bytes) More... | |
#define | CR_BYTES (CR_SIZE>>2) |
Number of bytes in CR space. More... | |
#define | CSR_BAR 0x7ffff |
Base Address Register (MSB of our CR/CSR address) More... | |
#define | CSR_BIT_SET 0x7fffb |
Bit Set Register (writing a 1 sets the control bit) More... | |
#define | CSR_BIT_CLEAR 0x7fff7 |
Bit Clear Register (writing a 1 clears the control bit) More... | |
#define | CSR_CRAM_OWNER 0x7fff3 |
Configuration RAM Owner Register (0 = not owned) More... | |
#define | CSR_UD_BIT_SET 0x7ffef |
User-Defined Bit Set Register (for user-defined fns) More... | |
#define | CSR_UD_BIT_CLEAR 0x7ffeb |
User-Defined Bit Clear Register (for user-defined fns) More... | |
#define | CSR_FN_ADER(N) (0x7ff63 + (N)*0x10) /* N = 0 -> 7 */ |
Function N Address Decoder Compare Register (1st byte) More... | |
#define | CSR_ADER_BYTES 4 /* Number of bytes in an ADER register */ |
#define | CSR_BITSET_RESET_MODE 0x80 |
Module is in reset mode. More... | |
#define | CSR_BITSET_SYSFAIL_ENA 0x40 |
SYSFAIL driver is enabled. More... | |
#define | CSR_BITSET_MODULE_FAIL 0x20 |
Module has failed. More... | |
#define | CSR_BITSET_MODULE_ENA 0x10 |
Module is enabled. More... | |
#define | CSR_BITSET_BERR 0x08 |
Module has asserted a Bus Error. More... | |
#define | CSR_BITSET_CRAM_OWNED 0x04 |
CRAM is owned. More... | |
+Functions | |
epicsShareFunc volatile unsigned char * | devCSRProbeSlot (int slot) |
Get the CSR base address for a slot. More... | |
epicsShareFunc volatile unsigned char * | devCSRTestSlot (const struct VMECSRID *devs, int slot, struct VMECSRID *info) |
Probe a VME slot then check its ID. More... | |
epicsShareExtern void | vmecsrprint (int N, int verb) |
Decode contents of CSR/CR and print to screen. More... | |
epicsShareExtern void | vmecsrdump (int verb) |
Decode contents of CSR/CR for all cards and print to screen. More... | |
INLINE void | CSRSetBase (volatile void *base, epicsUInt8 N, epicsUInt32 addr, epicsUInt8 amod) |
Set base address for VME64x function N. More... | |
+ devLib2
+ 2.11
+
+ |
+
+ devLib2
+ 2.11
+
+ |
+
#include <stdlib.h>
#include <epicsVersion.h>
#include <devLib.h>
#include "devlibversion.h"
#include <shareLib.h>
#include <epicsExport.h>
Go to the source code of this file.
++Macros | |
#define | epicsExportSharedSymbols |
#define | NEED_IFACE |
+Functions | |
void | devReplaceVirtualOS (void) |
epicsExportRegistrar (devReplaceVirtualOS) | |
#define epicsExportSharedSymbols | +
Definition at line 18 of file devlib_compat.c.
+ +#define NEED_IFACE | +
Definition at line 29 of file devlib_compat.c.
+ +void devReplaceVirtualOS | +( | +void | +) | ++ |
Definition at line 87 of file devlib_compat.c.
+ +epicsExportRegistrar | +( | +devReplaceVirtualOS | +) | ++ |
+ devLib2
+ 2.11
+
+ |
+
+ devLib2
+ 2.11
+
+ |
+
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <devLib.h>
Go to the source code of this file.
++Functions | |
long | devAddressMap (void) |
long | devReadProbe (unsigned wordSize, volatile const void *ptr, void *pValueRead) |
long | devNoResponseProbe (epicsAddressType addrType, size_t base, size_t size) |
long | devWriteProbe (unsigned wordSize, volatile void *ptr, const void *pValueWritten) |
long | devRegisterAddress (const char *pOwnerName, epicsAddressType addrType, size_t logicalBaseAddress, size_t size, volatile void **pPhysicalAddress) |
long | devUnregisterAddress (epicsAddressType addrType, size_t logicalBaseAddress, const char *pOwnerName) |
long | devAllocAddress (const char *pOwnerName, epicsAddressType addrType, size_t size, unsigned alignment, volatile void **pLocalAddress) |
long | devDisableInterruptLevelVME (unsigned level) |
void * | devLibA24Malloc (size_t l) |
void * | devLibA24Calloc (size_t l) |
void | devLibA24Free (void *pBlock) |
long | devConnectInterrupt (epicsInterruptType intType, unsigned vectorNumber, void(*pFunction)(void *), void *parameter) |
long | devDisconnectInterrupt (epicsInterruptType intType, unsigned vectorNumber, void(*pFunction)(void *)) |
long | devEnableInterruptLevel (epicsInterruptType intType, unsigned level) |
long | devDisableInterruptLevel (epicsInterruptType intType, unsigned level) |
long | locationProbe (epicsAddressType addrType, char *pLocation) |
void | bcopyLongs (char *source, char *destination, int nlongs) |
+Variables | |
const char * | epicsAddressTypeName [] = {"","","","","",""} |
devLibVirtualOS * | pdevLibVirtualOS =NULL |
void bcopyLongs | +( | +char * | +source, | +
+ | + | char * | +destination, | +
+ | + | int | +nlongs | +
+ | ) | ++ |
Definition at line 83 of file devlib_dummy.c.
+ +long devAddressMap | +( | +void | +) | ++ |
Definition at line 26 of file devlib_dummy.c.
+ +long devAllocAddress | +( | +const char * | +pOwnerName, | +
+ | + | epicsAddressType | +addrType, | +
+ | + | size_t | +size, | +
+ | + | unsigned | +alignment, | +
+ | + | volatile void ** | +pLocalAddress | +
+ | ) | ++ |
Definition at line 51 of file devlib_dummy.c.
+ +long devConnectInterrupt | +( | +epicsInterruptType | +intType, | +
+ | + | unsigned | +vectorNumber, | +
+ | + | void(*)(void *) | +pFunction, | +
+ | + | void * | +parameter | +
+ | ) | ++ |
Definition at line 65 of file devlib_dummy.c.
+ +long devDisableInterruptLevel | +( | +epicsInterruptType | +intType, | +
+ | + | unsigned | +level | +
+ | ) | ++ |
Definition at line 78 of file devlib_dummy.c.
+ +long devDisableInterruptLevelVME | +( | +unsigned | +level | ) | ++ |
Definition at line 59 of file devlib_dummy.c.
+ +long devDisconnectInterrupt | +( | +epicsInterruptType | +intType, | +
+ | + | unsigned | +vectorNumber, | +
+ | + | void(*)(void *) | +pFunction | +
+ | ) | ++ |
Definition at line 71 of file devlib_dummy.c.
+ +long devEnableInterruptLevel | +( | +epicsInterruptType | +intType, | +
+ | + | unsigned | +level | +
+ | ) | ++ |
Definition at line 76 of file devlib_dummy.c.
+ +void* devLibA24Calloc | +( | +size_t | +l | ) | ++ |
Definition at line 62 of file devlib_dummy.c.
+ +void devLibA24Free | +( | +void * | +pBlock | ) | ++ |
Definition at line 63 of file devlib_dummy.c.
+ +void* devLibA24Malloc | +( | +size_t | +l | ) | ++ |
Definition at line 61 of file devlib_dummy.c.
+ +long devNoResponseProbe | +( | +epicsAddressType | +addrType, | +
+ | + | size_t | +base, | +
+ | + | size_t | +size | +
+ | ) | ++ |
Definition at line 30 of file devlib_dummy.c.
+ +long devReadProbe | +( | +unsigned | +wordSize, | +
+ | + | volatile const void * | +ptr, | +
+ | + | void * | +pValueRead | +
+ | ) | ++ |
Definition at line 28 of file devlib_dummy.c.
+ +long devRegisterAddress | +( | +const char * | +pOwnerName, | +
+ | + | epicsAddressType | +addrType, | +
+ | + | size_t | +logicalBaseAddress, | +
+ | + | size_t | +size, | +
+ | + | volatile void ** | +pPhysicalAddress | +
+ | ) | ++ |
Definition at line 39 of file devlib_dummy.c.
+ +long devUnregisterAddress | +( | +epicsAddressType | +addrType, | +
+ | + | size_t | +logicalBaseAddress, | +
+ | + | const char * | +pOwnerName | +
+ | ) | ++ |
Definition at line 46 of file devlib_dummy.c.
+ +long devWriteProbe | +( | +unsigned | +wordSize, | +
+ | + | volatile void * | +ptr, | +
+ | + | const void * | +pValueWritten | +
+ | ) | ++ |
Definition at line 36 of file devlib_dummy.c.
+ +long locationProbe | +( | +epicsAddressType | +addrType, | +
+ | + | char * | +pLocation | +
+ | ) | ++ |
Definition at line 80 of file devlib_dummy.c.
+ +const char* epicsAddressTypeName[] = {"","","","","",""} | +
Definition at line 24 of file devlib_dummy.c.
+ +devLibVirtualOS* pdevLibVirtualOS =NULL | +
Definition at line 86 of file devlib_dummy.c.
+ +
+ devLib2
+ 2.11
+
+ |
+
+ devLib2
+ 2.11
+
+ |
+
#include <epicsVersion.h>
Go to the source code of this file.
++Macros | |
#define | VERSION_INT(V, R, M, P) ( ((V)<<24) | ((R)<<16) | ((M)<<8) | (P)) |
#define | EPICS_VERSION_INT VERSION_INT(EPICS_VERSION, EPICS_REVISION, EPICS_MODIFICATION, EPICS_PATCH_LEVEL) |
#define EPICS_VERSION_INT VERSION_INT(EPICS_VERSION, EPICS_REVISION, EPICS_MODIFICATION, EPICS_PATCH_LEVEL) | +
Definition at line 8 of file devlibversion.h.
+ +#define VERSION_INT | +( | ++ | V, | +
+ | + | + | R, | +
+ | + | + | M, | +
+ | + | + | P | +
+ | ) | +( ((V)<<24) | ((R)<<16) | ((M)<<8) | (P)) | +
Definition at line 7 of file devlibversion.h.
+ +
+ devLib2
+ 2.11
+
+ |
+
+ devLib2
+ 2.11
+
+ |
+
+Directories | |
directory | os |
+Files | |
file | devlibversion.h [code] |
file | epicsEndian.h [code] |
+ devLib2
+ 2.11
+
+ |
+
+Files | |
file | explore.h [code] |
file | linux.h [code] |
file | mainpage.h [code] |
file | usage.h [code] |
+ devLib2
+ 2.11
+
+ |
+
+Directories | |
directory | devlib2 |
+ devLib2
+ 2.11
+
+ |
+
+Files | |
file | devcsr.c [code] |
file | devcsr.h [code] |
file | devlib_compat.c [code] |
file | devlib_dummy.c [code] |
file | devLibVME.c [code] |
file | devLibVME.h [code] |
file | iocreg.c [code] |
file | vmedefs.h [code] |
file | vmesh.c [code] |
+ devLib2
+ 2.11
+
+ |
+
+Directories | |
directory | default |
+ devLib2
+ 2.11
+
+ |
+
+Files | |
file | devLibPCI.c [code] |
file | devLibPCI.h [code] |
file | devLibPCIImpl.h [code] |
file | devLibPCIStrings.c [code] |
file | osdPciShared.c [code] |
file | osdPciShared.h [code] |
file | pcish.c [code] |
+ devLib2
+ 2.11
+
+ |
+
+Directories | |
directory | common |
directory | documentation |
directory | pciApp |
directory | vmeApp |
+ devLib2
+ 2.11
+
+ |
+
+Files | |
file | epicsMMIO.h [code] |
file | epicsMMIODef.h [code] |
file | osdWireConfig.h [code] |
+ devLib2
+ 2.11
+
+ |
+
#include "osdWireConfig.h"
Go to the source code of this file.
++Macros | |
#define | EPICS_ENDIAN_LITTLE 1234 |
#define | EPICS_ENDIAN_BIG 4321 |
#define EPICS_ENDIAN_BIG 4321 | +
Definition at line 16 of file epicsEndian.h.
+ +#define EPICS_ENDIAN_LITTLE 1234 | +
Definition at line 15 of file epicsEndian.h.
+ +
+ devLib2
+ 2.11
+
+ |
+
+ devLib2
+ 2.11
+
+ |
+
#include "epicsMMIODef.h"
+ devLib2
+ 2.11
+
+ |
+
+ devLib2
+ 2.11
+
+ |
+
Go to the source code of this file.
++Macros | |
#define | rbarr() do{}while(0) |
Explicit read memory barrier Prevents reordering of reads around it. More... | |
#define | wbarr() do{}while(0) |
Explicit write memory barrier Prevents reordering of writes around it. More... | |
#define | rwbarr() do{}while(0) |
Explicit read/write memory barrier Prevents reordering of reads or writes around it. More... | |
#define | be_ioread16(A) nat_ioread16(A) |
Read two byte in big endian order. More... | |
#define | be_ioread32(A) nat_ioread32(A) |
Read four byte in big endian order. More... | |
#define | be_iowrite16(A, D) nat_iowrite16(A,D) |
Write two byte in big endian order. More... | |
#define | be_iowrite32(A, D) nat_iowrite32(A,D) |
Write four byte in big endian order. More... | |
#define | le_ioread16(A) bswap16(nat_ioread16(A)) |
Read two byte in little endian order. More... | |
#define | le_ioread32(A) bswap32(nat_ioread32(A)) |
Read four byte in little endian order. More... | |
#define | le_iowrite16(A, D) nat_iowrite16(A,bswap16(D)) |
Write two byte in little endian order. More... | |
#define | le_iowrite32(A, D) nat_iowrite32(A,bswap32(D)) |
Write four byte in little endian order. More... | |
INLINE epicsUInt8 | ioread8 (volatile void *addr) |
Read a single byte. More... | |
INLINE void | iowrite8 (volatile void *addr, epicsUInt8 val) |
Write a single byte. More... | |
INLINE epicsUInt16 | nat_ioread16 (volatile void *addr) |
Read two bytes in host order. Not byte swapping. More... | |
INLINE void | nat_iowrite16 (volatile void *addr, epicsUInt16 val) |
Write two byte in host order. Not byte swapping. More... | |
INLINE epicsUInt32 | nat_ioread32 (volatile void *addr) |
Read four bytes in host order. Not byte swapping. More... | |
INLINE void | nat_iowrite32 (volatile void *addr, epicsUInt32 val) |
Write four byte in host order. Not byte swapping. More... | |
INLINE epicsUInt16 | bswap16 (epicsUInt16 value) |
INLINE epicsUInt32 | bswap32 (epicsUInt32 value) |
#define be_ioread16 | +( | ++ | A | ) | +nat_ioread16(A) | +
Read two byte in big endian order.
+ +#define be_ioread32 | +( | ++ | A | ) | +nat_ioread32(A) | +
Read four byte in big endian order.
+ +#define be_iowrite16 | +( | ++ | A, | +
+ | + | + | D | +
+ | ) | +nat_iowrite16(A,D) | +
Write two byte in big endian order.
+ +#define be_iowrite32 | +( | ++ | A, | +
+ | + | + | D | +
+ | ) | +nat_iowrite32(A,D) | +
Write four byte in big endian order.
+ +#define le_ioread16 | +( | ++ | A | ) | +bswap16(nat_ioread16(A)) | +
Read two byte in little endian order.
+ +#define le_ioread32 | +( | ++ | A | ) | +bswap32(nat_ioread32(A)) | +
Read four byte in little endian order.
+ +#define le_iowrite16 | +( | ++ | A, | +
+ | + | + | D | +
+ | ) | +nat_iowrite16(A,bswap16(D)) | +
Write two byte in little endian order.
+ +#define le_iowrite32 | +( | ++ | A, | +
+ | + | + | D | +
+ | ) | +nat_iowrite32(A,bswap32(D)) | +
Write four byte in little endian order.
+ +INLINE epicsUInt32 bswap32 | +( | +epicsUInt32 | +value | ) | ++ |
Definition at line 102 of file epicsMMIODef.h.
+ +INLINE void iowrite8 | +( | +volatile void * | +addr, | +
+ | + | epicsUInt8 | +val | +
+ | ) | ++ |
Write a single byte.
+ +Definition at line 41 of file epicsMMIODef.h.
+ +INLINE epicsUInt16 nat_ioread16 | +( | +volatile void * | +addr | ) | ++ |
Read two bytes in host order. Not byte swapping.
+ +Definition at line 51 of file epicsMMIODef.h.
+ +INLINE epicsUInt32 nat_ioread32 | +( | +volatile void * | +addr | ) | ++ |
Read four bytes in host order. Not byte swapping.
+ +Definition at line 71 of file epicsMMIODef.h.
+ +INLINE void nat_iowrite16 | +( | +volatile void * | +addr, | +
+ | + | epicsUInt16 | +val | +
+ | ) | ++ |
Write two byte in host order. Not byte swapping.
+ +Definition at line 61 of file epicsMMIODef.h.
+ +INLINE void nat_iowrite32 | +( | +volatile void * | +addr, | +
+ | + | epicsUInt32 | +val | +
+ | ) | ++ |
Write four byte in host order. Not byte swapping.
+ +Definition at line 81 of file epicsMMIODef.h.
+ +
+ devLib2
+ 2.11
+
+ |
+
+ devLib2
+ 2.11
+
+ |
+
+ devLib2
+ 2.11
+
+ |
+
+ devLib2
+ 2.11
+
+ |
+
The exploreApp support is intended as a tool to explore new PCI devices. This may be useful when preparing to write a dedicated driver and/or during development of PCI/PCIe device firmware. exploreApp allows a PCI register to be read and/or written an EPICS record. For example:
+The record pcitestout will be connected to the PCI device 8:0.0 (bus 8, device 0, function 0) with the first BAR. A single write of 4 bytes is made when the record is processed.
+The following can be added to some xyzApp/src/Makefile to include exploreApp.
+INP/OUT link strings may contain the following components
+For record types: longout, bo, mbbo, mbboDirect, ao allowed DTYP are:
+For record types: longin, longout, bi, bo, mbbi, mbbo, mbbiDirect, mbboDirect, ai, ao
+The ao record type also accepts
+The ai record type also accepts
+The waveform record type accepts both integer Read and Write DTYP. The step= link option may be applied to change how the address counter is incremented. The default step size is the read size (eg. 4 for Read32). A step size of 0 will read the base address NELM times.
+Limited support of PCI interrupts is available on Linux only. A longin record with DTYP="Explore IRQ Count" and SCAN="I/O Intr" will be processed each time an interrupt occurs.
+This requires that a UIO kernel module be installed.
+The DTYP="Explore FRIB Flash" support implements a FRIB specific protocol for accessing a SPI flash chip over PCI. The frib-flash.db file demonstrates use.
+
+ devLib2
+ 2.11
+
+ |
+
devcsr.c | |
devcsr.h | |
devlib_compat.c | |
devlib_dummy.c | |
devLibPCI.c | |
devLibPCI.h | |
devLibPCIImpl.h | |
devLibPCIStrings.c | |
devlibversion.h | |
devLibVME.c | |
devLibVME.h | |
epicsEndian.h | |
epicsMMIO.h | |
epicsMMIODef.h | |
explore.h | |
iocreg.c | |
linux.h | |
mainpage.h | |
osdPciShared.c | |
osdPciShared.h | |
osdWireConfig.h | |
pcish.c | |
usage.h | |
vmedefs.h | |
vmesh.c |
+ devLib2
+ 2.11
+
+ |
+
+ devLib2
+ 2.11
+
+ |
+
+ devLib2
+ 2.11
+
+ |
+
+ devLib2
+ 2.11
+
+ |
+
+ devLib2
+ 2.11
+
+ |
+
+ devLib2
+ 2.11
+
+ |
+
+ devLib2
+ 2.11
+
+ |
+
+ devLib2
+ 2.11
+
+ |
+
+ devLib2
+ 2.11
+
+ |
+
+ devLib2
+ 2.11
+
+ |
+
+ devLib2
+ 2.11
+
+ |
+
+ devLib2
+ 2.11
+
+ |
+
+ devLib2
+ 2.11
+
+ |
+
+ devLib2
+ 2.11
+
+ |
+
+ devLib2
+ 2.11
+
+ |
+
+ devLib2
+ 2.11
+
+ |
+
+ devLib2
+ 2.11
+
+ |
+
+ devLib2
+ 2.11
+
+ |
+
+ devLib2
+ 2.11
+
+ |
+
+ devLib2
+ 2.11
+
+ |
+
+ devLib2
+ 2.11
+
+ |
+
+ devLib2
+ 2.11
+
+ |
+
+ devLib2
+ 2.11
+
+ |
+
INLINE epicsUInt8 | ioread8 (volatile void *addr) |
Read a single byte. More... | |
INLINE epicsUInt16 | bswap16 (epicsUInt16 value) |
#define | rbarr() do{}while(0) |
Explicit read memory barrier Prevents reordering of reads around it. More... | |
#define | wbarr() do{}while(0) |
Explicit write memory barrier Prevents reordering of writes around it. More... | |
#define | rwbarr() do{}while(0) |
Explicit read/write memory barrier Prevents reordering of reads or writes around it. More... | |
Safe operations on I/O memory.
+This files defines a set of macros for access to Memory Mapped I/O
+They are named T_ioread# and T_iowrite# where # can be 8, 16, or 32. 'T' can either be 'le', 'be', or 'nat' (except ioread8 and iowrite8).
+The macros defined use OS specific extensions (when available) to ensure the following.
+PCI access should use either 'le_' or 'be_' as determined by the device byte order.
+VME access should always use 'nat_'. If the device byte order is little endian then an explicit swap is required.
+PCI
+VME
+PCI
VME
This difference arises because VME bridges implement hardware byte swapping on little endian systems, while PCI bridges do not. Software accessing PCI devices must know if byte swapping is required. This conditional swap is implemented by the 'be_' and 'le_' macros.
+This is a fundamental difference between PCI and VME.
+Software accessing PCI must do conditional swapping.
+Software accessing VME must not do conditional swapping.
+#define rbarr | +( | +) | +do{}while(0) | +
Explicit read memory barrier Prevents reordering of reads around it.
+ +Definition at line 194 of file epicsMMIODef.h.
+ +#define rwbarr | +( | +) | +do{}while(0) | +
Explicit read/write memory barrier Prevents reordering of reads or writes around it.
+ +Definition at line 202 of file epicsMMIODef.h.
+ +#define wbarr | +( | +) | +do{}while(0) | +
Explicit write memory barrier Prevents reordering of writes around it.
+ +Definition at line 198 of file epicsMMIODef.h.
+ +INLINE epicsUInt16 bswap16 | +( | +epicsUInt16 | +value | ) | ++ |
Definition at line 94 of file epicsMMIODef.h.
+ +INLINE epicsUInt8 ioread8 | +( | +volatile void * | +addr | ) | ++ |
Read a single byte.
+ +Definition at line 32 of file epicsMMIODef.h.
+ +
+ devLib2
+ 2.11
+
+ |
+
+Data Structures | |
struct | epicsPCIID |
PCI device identifier. More... | |
struct | PCIBar |
struct | epicsPCIDevice |
Device token. More... | |
+Macros | |
#define | DEVLIBPCI_MAJOR 1 |
API major version. More... | |
#define | DEVLIBPCI_MINOR 3 |
API minor version. More... | |
#define | DEVPCI_ANY_DEVICE 0x10000 |
#define | DEVPCI_ANY_VENDOR 0x10000 |
#define | DEVPCI_ANY_SUBDEVICE 0x10000 |
#define | DEVPCI_ANY_SUBVENDOR 0x10000 |
#define | DEVPCI_ANY_CLASS 0x1000000 |
#define | DEVPCI_ANY_REVISION 0x100 |
#define | DEVPCI_LAST_DEVICE 0xffff0000 |
#define | DEVPCI_END {DEVPCI_LAST_DEVICE,0,0,0,0,0} |
The last item in a list of PCI IDS. More... | |
#define | DEVPCI_DEVICE_ANY() |
#define | DEVPCI_DEVICE_VENDOR(dev, vend) |
#define | DEVPCI_DEVICE_VENDOR_CLASS(dev, vend, pclass) |
#define | DEVPCI_SUBDEVICE_SUBVENDOR(dev, vend, sdev, svend) |
#define | DEVPCI_SUBDEVICE_SUBVENDOR_CLASS(dev, vend, sdev, svend, revision, pclass) |
#define | DEVPCI_NO_SLOT NULL |
#define | PCIBARCOUNT NELEMENTS( ((epicsPCIDevice*)0)->bar ) |
The maximum number of base address registers (BARs). More... | |
#define | DEVLIB_MAP_UIO1TO1 0 |
#define | DEVLIB_MAP_UIOCOMPACT 0 |
+Typedefs | |
typedef int(* | devPCISearchFn) (void *ptr, const epicsPCIDevice *dev) |
PCI search callback prototype. More... | |
+Functions | |
epicsShareFunc int | devPCIFindCB (const epicsPCIID *idlist, devPCISearchFn searchfn, void *arg, unsigned int opt) |
PCI bus search w/ callback. More... | |
epicsShareFunc int | devPCIFindSpec (const epicsPCIID *idlist, const char *spec, const epicsPCIDevice **found, unsigned int opt) |
PCI bus search by specification string. More... | |
epicsShareFunc int | devPCIFindDBDF (const epicsPCIID *idlist, unsigned int domain, unsigned int b, unsigned int d, unsigned int f, const epicsPCIDevice **found, unsigned int opt) |
PCI bus probe. More... | |
epicsShareFunc int | devPCIFindBDF (const epicsPCIID *idlist, unsigned int b, unsigned int d, unsigned int f, const epicsPCIDevice **found, unsigned int opt) |
epicsShareFunc int | devPCIToLocalAddr (const epicsPCIDevice *id, unsigned int bar, volatile void **ppLocalAddr, unsigned int opt) |
Get pointer to PCI BAR. More... | |
epicsShareFunc int | devPCIBarLen (const epicsPCIDevice *id, unsigned int bar, epicsUInt32 *len) |
Find the size of a BAR. More... | |
epicsShareFunc int | devPCIConnectInterrupt (const epicsPCIDevice *id, void(*pFunction)(void *), void *parameter, unsigned int opt) |
Request interrupts for device. More... | |
epicsShareFunc int | devPCIDisconnectInterrupt (const epicsPCIDevice *id, void(*pFunction)(void *), void *parameter) |
Stop receiving interrupts. More... | |
epicsShareFunc void | devPCIShow (int lvl, int vendor, int device, int exact) |
epicsShareFunc void | devPCIShowMatch (int lvl, const char *spec, int vendor, int device) |
epicsShareFunc void | devPCIShowDevice (int lvl, const epicsPCIDevice *dev) |
epicsShareFunc int | devLibPCIUse (const char *name) |
Select driver implementation. Pick driver implementation by name, or NULL to use default. If no selection is made then the default will be used if available. More... | |
epicsShareFunc const char * | devLibPCIDriverName () |
epicsShareFunc int | devPCIConfigRead8 (const epicsPCIDevice *dev, unsigned offset, epicsUInt8 *pResult) |
Read byte from configuration space. More... | |
epicsShareFunc int | devPCIConfigRead16 (const epicsPCIDevice *dev, unsigned offset, epicsUInt16 *pResult) |
Read (16-bit) word from configuration space. More... | |
epicsShareFunc int | devPCIConfigRead32 (const epicsPCIDevice *dev, unsigned offset, epicsUInt32 *pResult) |
Read (32-bit) dword from configuration space. More... | |
epicsShareFunc int | devPCIConfigWrite8 (const epicsPCIDevice *dev, unsigned offset, epicsUInt8 value) |
Write byte to configuration space. More... | |
epicsShareFunc int | devPCIConfigWrite16 (const epicsPCIDevice *dev, unsigned offset, epicsUInt16 value) |
Write (16-bit) word from configuration space. More... | |
epicsShareFunc int | devPCIConfigWrite32 (const epicsPCIDevice *dev, unsigned offset, epicsUInt32 value) |
Write (32-bit) dword from configuration space. More... | |
epicsShareFunc int | devPCIEnableInterrupt (const epicsPCIDevice *dev) |
Enable interrupts at the device. More... | |
epicsShareFunc int | devPCIDisableInterrupt (const epicsPCIDevice *dev) |
Enable interrupts at the device. More... | |
epicsShareFunc const char * | devPCIDeviceClassToString (int classId) |
Translate class id to string. More... | |
+Variables | |
epicsShareExtern int | devPCIDebug |
Library to support PCI bus access
+#define DEVLIB_MAP_UIO1TO1 0 | +
Definition at line 232 of file devLibPCI.h.
+ +#define DEVLIB_MAP_UIOCOMPACT 0 | +
Definition at line 233 of file devLibPCI.h.
+ +#define DEVLIBPCI_MAJOR 1 | +
API major version.
+ +Definition at line 30 of file devLibPCI.h.
+ +#define DEVLIBPCI_MINOR 3 | +
API minor version.
+ +Definition at line 31 of file devLibPCI.h.
+ +#define DEVPCI_ANY_CLASS 0x1000000 | +
Definition at line 66 of file devLibPCI.h.
+ +#define DEVPCI_ANY_DEVICE 0x10000 | +
Definition at line 62 of file devLibPCI.h.
+ +#define DEVPCI_ANY_REVISION 0x100 | +
Definition at line 67 of file devLibPCI.h.
+ +#define DEVPCI_ANY_SUBDEVICE 0x10000 | +
Definition at line 64 of file devLibPCI.h.
+ +#define DEVPCI_ANY_SUBVENDOR 0x10000 | +
Definition at line 65 of file devLibPCI.h.
+ +#define DEVPCI_ANY_VENDOR 0x10000 | +
Definition at line 63 of file devLibPCI.h.
+ +#define DEVPCI_DEVICE_ANY | +( | +) | ++ |
Definition at line 74 of file devLibPCI.h.
+ +#define DEVPCI_DEVICE_VENDOR | +( | ++ | dev, | +
+ | + | + | vend | +
+ | ) | ++ |
Definition at line 79 of file devLibPCI.h.
+ +#define DEVPCI_DEVICE_VENDOR_CLASS | +( | ++ | dev, | +
+ | + | + | vend, | +
+ | + | + | pclass | +
+ | ) | ++ |
Definition at line 83 of file devLibPCI.h.
+ +#define DEVPCI_END {DEVPCI_LAST_DEVICE,0,0,0,0,0} | +
The last item in a list of PCI IDS.
+ +Definition at line 72 of file devLibPCI.h.
+ +#define DEVPCI_LAST_DEVICE 0xffff0000 | +
Definition at line 69 of file devLibPCI.h.
+ +#define DEVPCI_NO_SLOT NULL | +
Definition at line 95 of file devLibPCI.h.
+ +#define DEVPCI_SUBDEVICE_SUBVENDOR | +( | ++ | dev, | +
+ | + | + | vend, | +
+ | + | + | sdev, | +
+ | + | + | svend | +
+ | ) | ++ |
Definition at line 87 of file devLibPCI.h.
+ +#define DEVPCI_SUBDEVICE_SUBVENDOR_CLASS | +( | ++ | dev, | +
+ | + | + | vend, | +
+ | + | + | sdev, | +
+ | + | + | svend, | +
+ | + | + | revision, | +
+ | + | + | pclass | +
+ | ) | ++ |
Definition at line 91 of file devLibPCI.h.
+ +#define PCIBARCOUNT NELEMENTS( ((epicsPCIDevice*)0)->bar ) | +
The maximum number of base address registers (BARs).
+ +Definition at line 126 of file devLibPCI.h.
+ +typedef int(* devPCISearchFn) (void *ptr, const epicsPCIDevice *dev) | +
PCI search callback prototype.
+ptr | User pointer |
dev | PCI device pointer |
Definition at line 136 of file devLibPCI.h.
+ +epicsShareFunc const char* devLibPCIDriverName | +( | +) | ++ |
Definition at line 138 of file devLibPCI.c.
+ +epicsShareFunc int devLibPCIUse | +( | +const char * | +name | ) | ++ |
Select driver implementation. Pick driver implementation by name, or NULL to use default. If no selection is made then the default will be used if available.
+name | An implementation name |
Definition at line 107 of file devLibPCI.c.
+ +epicsShareFunc int devPCIBarLen | +( | +const epicsPCIDevice * | +id, | +
+ | + | unsigned int | +bar, | +
+ | + | epicsUInt32 * | +len | +
+ | ) | ++ |
Find the size of a BAR.
+Returns the size (in bytes) of the region visible through the given BAR.
+id | PCI device pointer | |
bar | BAR number | |
[out] | len | BAR size in bytes |
Definition at line 449 of file devLibPCI.c.
+ +epicsShareFunc int devPCIConfigRead16 | +( | +const epicsPCIDevice * | +dev, | +
+ | + | unsigned | +offset, | +
+ | + | epicsUInt16 * | +pResult | +
+ | ) | ++ |
Read (16-bit) word from configuration space.
+dev | A PCI device handle |
offset | Offset into configuration space (must be 16-bit aligned) |
pResult | Pointer to where result is to be written |
Definition at line 609 of file devLibPCI.c.
+ +epicsShareFunc int devPCIConfigRead32 | +( | +const epicsPCIDevice * | +dev, | +
+ | + | unsigned | +offset, | +
+ | + | epicsUInt32 * | +pResult | +
+ | ) | ++ |
Read (32-bit) dword from configuration space.
+dev | A PCI device handle |
offset | Offset into configuration space (must be 32-bit aligned) |
pResult | Pointer to where result is to be written |
Definition at line 615 of file devLibPCI.c.
+ +epicsShareFunc int devPCIConfigRead8 | +( | +const epicsPCIDevice * | +dev, | +
+ | + | unsigned | +offset, | +
+ | + | epicsUInt8 * | +pResult | +
+ | ) | ++ |
Read byte from configuration space.
+dev | A PCI device handle |
offset | Offset into configuration space |
pResult | Pointer to where result is to be written |
Definition at line 603 of file devLibPCI.c.
+ +epicsShareFunc int devPCIConfigWrite16 | +( | +const epicsPCIDevice * | +dev, | +
+ | + | unsigned | +offset, | +
+ | + | epicsUInt16 | +value | +
+ | ) | ++ |
Write (16-bit) word from configuration space.
+dev | A PCI device handle |
offset | Offset into configuration space (must be 16-bit aligned) |
value | Value to be written |
Definition at line 627 of file devLibPCI.c.
+ +epicsShareFunc int devPCIConfigWrite32 | +( | +const epicsPCIDevice * | +dev, | +
+ | + | unsigned | +offset, | +
+ | + | epicsUInt32 | +value | +
+ | ) | ++ |
Write (32-bit) dword from configuration space.
+dev | A PCI device handle |
offset | Offset into configuration space (must be 32-bit aligned) |
value | Value to be written |
Definition at line 633 of file devLibPCI.c.
+ +epicsShareFunc int devPCIConfigWrite8 | +( | +const epicsPCIDevice * | +dev, | +
+ | + | unsigned | +offset, | +
+ | + | epicsUInt8 | +value | +
+ | ) | ++ |
Write byte to configuration space.
+dev | A PCI device handle |
offset | Offset into configuration space |
value | Value to be written |
Definition at line 621 of file devLibPCI.c.
+ +epicsShareFunc int devPCIConnectInterrupt | +( | +const epicsPCIDevice * | +id, | +
+ | + | void(*)(void *) | +pFunction, | +
+ | + | void * | +parameter, | +
+ | + | unsigned int | +opt | +
+ | ) | ++ |
Request interrupts for device.
+Request that the provided callback be invoked whenever the device asserts an interrupt.
+id | PCI device pointer |
pFunction | User ISR |
parameter | User pointer |
opt | Modifiers. Currently unused |
Definition at line 463 of file devLibPCI.c.
+ +epicsShareFunc const char* devPCIDeviceClassToString | +( | +int | +classId | ) | ++ |
Translate class id to string.
+classId | PCI class Id |
Definition at line 7 of file devLibPCIStrings.c.
+ +epicsShareFunc int devPCIDisableInterrupt | +( | +const epicsPCIDevice * | +dev | ) | ++ |
Enable interrupts at the device.
+dev | A PCI device handle |
Definition at line 649 of file devLibPCI.c.
+ +epicsShareFunc int devPCIDisconnectInterrupt | +( | +const epicsPCIDevice * | +id, | +
+ | + | void(*)(void *) | +pFunction, | +
+ | + | void * | +parameter | +
+ | ) | ++ |
Stop receiving interrupts.
+Use the same arguments passed to devPCIConnectInterrupt()
id | PCI device pointer |
pFunction | User ISR |
parameter | User pointer |
Definition at line 476 of file devLibPCI.c.
+ +epicsShareFunc int devPCIEnableInterrupt | +( | +const epicsPCIDevice * | +dev | ) | ++ |
Enable interrupts at the device.
+dev | A PCI device handle |
Definition at line 640 of file devLibPCI.c.
+ +epicsShareFunc int devPCIFindBDF | +( | +const epicsPCIID * | +idlist, | +
+ | + | unsigned int | +b, | +
+ | + | unsigned int | +d, | +
+ | + | unsigned int | +f, | +
+ | + | const epicsPCIDevice ** | +found, | +
+ | + | unsigned int | +opt | +
+ | ) | ++ |
Definition at line 418 of file devLibPCI.c.
+ +epicsShareFunc int devPCIFindCB | +( | +const epicsPCIID * | +idlist, | +
+ | + | devPCISearchFn | +searchfn, | +
+ | + | void * | +arg, | +
+ | + | unsigned int | +opt | +
+ | ) | ++ |
PCI bus search w/ callback.
+Iterate through all devices in the system and invoke the provided callback for those matching an entry in the provided ID list.
+Iteration will stop when the callback returns a non-zero value. If the callback returns 1 this call will return 0. Any other value will be returned without modification.
+idlist | List of PCI identifiers |
searchfn | User callback |
arg | User pointer |
opt | Modifiers. Currently unused |
Definition at line 214 of file devLibPCI.c.
+ +epicsShareFunc int devPCIFindDBDF | +( | +const epicsPCIID * | +idlist, | +
+ | + | unsigned int | +domain, | +
+ | + | unsigned int | +b, | +
+ | + | unsigned int | +d, | +
+ | + | unsigned int | +f, | +
+ | + | const epicsPCIDevice ** | +found, | +
+ | + | unsigned int | +opt | +
+ | ) | ++ |
PCI bus probe.
+Probe and test a single address. If it matches, the corresponding epicsPCIDevice instance is stored in 'found'.
+If no compatible device is present the call returns S_dev_noDevice.
+idlist | List of PCI identifiers | |
domain | domain | |
b | bus | |
d | device | |
f | function | |
[out] | found | On success the result is stored here |
opt | Modifiers. Currently unused |
Definition at line 376 of file devLibPCI.c.
+ +epicsShareFunc int devPCIFindSpec | +( | +const epicsPCIID * | +idlist, | +
+ | + | const char * | +spec, | +
+ | + | const epicsPCIDevice ** | +found, | +
+ | + | unsigned int | +opt | +
+ | ) | ++ |
PCI bus search by specification string.
+Search for a device on the bus matching the given specification string, which is a space seperated list of the following:
+Some targets do not support some match types (eg. only Linux matches slot numbers).
+idlist | List of PCI identifiers | |
spec | specification string | |
[out] | found | On success the result is stored here |
opt | Modifiers. Currently unused |
Definition at line 267 of file devLibPCI.c.
+ +epicsShareFunc void devPCIShow | +( | +int | +lvl, | +
+ | + | int | +vendor, | +
+ | + | int | +device, | +
+ | + | int | +exact | +
+ | ) | ++ |
Definition at line 504 of file devLibPCI.c.
+ +epicsShareFunc void devPCIShowDevice | +( | +int | +lvl, | +
+ | + | const epicsPCIDevice * | +dev | +
+ | ) | ++ |
Definition at line 541 of file devLibPCI.c.
+ +epicsShareFunc void devPCIShowMatch | +( | +int | +lvl, | +
+ | + | const char * | +spec, | +
+ | + | int | +vendor, | +
+ | + | int | +device | +
+ | ) | ++ |
Definition at line 522 of file devLibPCI.c.
+ +epicsShareFunc int devPCIToLocalAddr | +( | +const epicsPCIDevice * | +id, | +
+ | + | unsigned int | +bar, | +
+ | + | volatile void ** | +ppLocalAddr, | +
+ | + | unsigned int | +opt | +
+ | ) | ++ |
Get pointer to PCI BAR.
+Map a PCI BAR into the local process address space.
+The opt argument is used to modify the mapping process. Currently only two (mutually exclusive) flags are supported which are only used by the Linux UIO bus implementation to control how requested BAR #s are mapped to UIO region numbers.
+id | PCI device pointer | |
bar | BAR number | |
[out] | ppLocalAddr | Pointer to start of BAR |
opt | Modifiers. 0 or bitwise OR of one or more DEVLIB_MAP_* macros |
Definition at line 431 of file devLibPCI.c.
+ +epicsShareExtern int devPCIDebug | +
Definition at line 354 of file devLibPCI.h.
+ +
+ devLib2
+ 2.11
+
+ |
+
+Data Structures | |
struct | VMECSRID |
ID info for a VME64(x) device This structure is used to hold identifying information for a VME64 compatible device. When used for searching each field can hold a specific value of the 'VMECSRANY' wildcard. More... | |
+Macros | |
#define | DEVLIBVME_MAJOR 1 |
API major version. More... | |
#define | DEVLIBVME_MINOR 0 |
API minor version. More... | |
#define | VMECSR_END {0,0,0} |
Must be the last entry in a device list. More... | |
#define | VMECSRANY 0xFfffFfff |
Match any value. May be used in any field of VMECSRID. More... | |
#define | VMECSRSLOTMAX ((1<<5)-1) |
The highest slot number. More... | |
#define | CSRSlotBase(slot) ( (slot)<<19 ) |
Derives the CSR space base address for a slot. More... | |
#define | CSRADER(addr, mod) ( ((addr)&0xFfffFf00) | ( ((mod)&0x3f)<<2 ) ) |
Computes values for the VME64x address decode registers (ADER). More... | |
#define | CSRRead8(addr) ioread8(addr) |
#define | CSRRead16(addr) ( CSRRead8(addr)<<8 | CSRRead8(addr+4) ) |
#define | CSRRead24(addr) ( CSRRead16(addr)<<8 | CSRRead8(addr+8) ) |
#define | CSRRead32(addr) ( CSRRead24(addr)<<8 | CSRRead8(addr+12) ) |
#define | CSRWrite8(addr, val) iowrite8(addr, val) |
#define | CSRWrite16(addr, val) do{ CSRWrite8(addr,(val&0xff00)>>8); CSRWrite8(addr+4,val&0xff); }while(0) |
#define | CSRWrite24(addr, val) do{ CSRWrite16(addr,(val&0xffff00)>>8); CSRWrite8(addr+8,val&0xff); }while(0) |
#define | CSRWrite32(addr, val) do{ CSRWrite24(addr,(val&0xffffff00)>>8); CSRWrite8(addr+12,val&0xff); }while(0) |
+Functions | |
epicsShareFunc volatile unsigned char * | devCSRProbeSlot (int slot) |
Get the CSR base address for a slot. More... | |
epicsShareFunc volatile unsigned char * | devCSRTestSlot (const struct VMECSRID *devs, int slot, struct VMECSRID *info) |
Probe a VME slot then check its ID. More... | |
epicsShareExtern void | vmecsrprint (int N, int verb) |
Decode contents of CSR/CR and print to screen. More... | |
epicsShareExtern void | vmecsrdump (int verb) |
Decode contents of CSR/CR for all cards and print to screen. More... | |
INLINE void | CSRSetBase (volatile void *base, epicsUInt8 N, epicsUInt32 addr, epicsUInt8 amod) |
Set base address for VME64x function N. More... | |
Extensions to EPICS devLib to deal with the CSR address space defined by the VME64 standard and extended by the VME64x standard.
+#define CSRADER | +( | ++ | addr, | +
+ | + | + | mod | +
+ | ) | +( ((addr)&0xFfffFf00) | ( ((mod)&0x3f)<<2 ) ) | +
#define CSRRead8 | +( | ++ | addr | ) | +ioread8(addr) | +
#define CSRSlotBase | +( | ++ | slot | ) | +( (slot)<<19 ) | +
Derives the CSR space base address for a slot.
+The top 5 bits of the 24 bit CSR address are the slot number.
+This macro gives the VME CSR base address for a slot. Give this address to devBusToLocalAddr() with type atVMECSR
+ + + +#define CSRWrite16 | +( | ++ | addr, | +
+ | + | + | val | +
+ | ) | +do{ CSRWrite8(addr,(val&0xff00)>>8); CSRWrite8(addr+4,val&0xff); }while(0) | +
#define CSRWrite24 | +( | ++ | addr, | +
+ | + | + | val | +
+ | ) | +do{ CSRWrite16(addr,(val&0xffff00)>>8); CSRWrite8(addr+8,val&0xff); }while(0) | +
#define CSRWrite32 | +( | ++ | addr, | +
+ | + | + | val | +
+ | ) | +do{ CSRWrite24(addr,(val&0xffffff00)>>8); CSRWrite8(addr+12,val&0xff); }while(0) | +
#define CSRWrite8 | +( | ++ | addr, | +
+ | + | + | val | +
+ | ) | +iowrite8(addr, val) | +
#define DEVLIBVME_MAJOR 1 | +
#define DEVLIBVME_MINOR 0 | +
#define VMECSR_END {0,0,0} | +
#define VMECSRANY 0xFfffFfff | +
#define VMECSRSLOTMAX ((1<<5)-1) | +
INLINE void CSRSetBase | +( | +volatile void * | +base, | +
+ | + | epicsUInt8 | +N, | +
+ | + | epicsUInt32 | +addr, | +
+ | + | epicsUInt8 | +amod | +
+ | ) | ++ |
epicsShareFunc volatile unsigned char* devCSRProbeSlot | +( | +int | +slot | ) | ++ |
Get the CSR base address for a slot.
+Test a single slot for the presense of VME64 complient module. Succeeds if a card is present and provides the standard registers.
+slot | The VME slot number (0-31) |
NULL | On all failures |
!NULL | A pointer to slot's CSR base address |
epicsShareFunc volatile unsigned char* devCSRTestSlot | +( | +const struct VMECSRID * | +devs, | +
+ | + | int | +slot, | +
+ | + | struct VMECSRID * | +info | +
+ | ) | ++ |
Probe a VME slot then check its ID.
+Calls devCSRProbeSlot(). If a card is found the PCI ID fields are compared against the given VMECSRID list. The base address is returned if the card matches and NULL otherwise.
+If info is non-NULL then the structure it points to will be filled with the ID information of the matching card.
+An identifier list should be defined like:
devs | A list of PCI device IDs (wildcards optional). |
slot | VME slot number (0-31) |
info | If not NULL the exact ID of the matching device is copied here. |
NULL | It no card is present, or the card does not match. |
!NULL | If a card matching an entry in the device list is found. |
epicsShareExtern void vmecsrdump | +( | +int | +verb | ) | ++ |
Decode contents of CSR/CR for all cards and print to screen.
+Calls vmecsrprint() on all slots (0-21)
+verb | Level of detail (0-2) |
epicsShareExtern void vmecsrprint | +( | +int | +N, | +
+ | + | int | +verb | +
+ | ) | ++ |
+ devLib2
+ 2.11
+
+ |
+
+Macros | |
#define | CR_ROM_CHECKSUM 0x0003 |
8-bit checksum of Configuration ROM space More... | |
#define | CR_ROM_LENGTH 0x0007 |
Number of bytes in Configuration ROM to checksum. More... | |
#define | CR_DATA_ACCESS_WIDTH 0x0013 |
Configuration ROM area (CR) data access method. More... | |
#define | CSR_DATA_ACCESS_WIDTH 0x0017 |
Control/Status Reg area (CSR) data access method. More... | |
#define | CR_SPACE_ID 0x001B |
CR/CSR space ID (VME64, VME64X, etc). More... | |
#define | CR_ASCII_C 0x001F |
ASCII "C" (identifies this as CR space) More... | |
#define | CR_ASCII_R 0x0023 |
ASCII "R" (identifies this as CR space) More... | |
#define | CR_IEEE_OUI 0x0027 |
IEEE Organizationally Unique Identifier (OUI) More... | |
#define | CR_IEEE_OUI_BYTES 3 |
Number of bytes in manufacturer's OUI. More... | |
#define | CR_BOARD_ID 0x0033 |
Manufacturer's board ID. More... | |
#define | CR_BOARD_ID_BYTES 4 |
Number of bytes in manufacturer's OUI. More... | |
#define | CR_REVISION_ID 0x0043 |
Manufacturer's board revision ID. More... | |
#define | CR_REVISION_ID_BYTES 4 |
Number of bytes in board revision ID. More... | |
#define | CR_ASCII_STRING 0x0053 |
Offset to ASCII string (manufacturer-specific) More... | |
#define | CR_PROGRAM_ID 0x007F |
Program ID code for CR space. More... | |
#define | CR_BEG_UCR 0x0083 |
Offset to start of manufacturer-defined CR space. More... | |
#define | CR_END_UCR 0x008F |
Offset to end of manufacturer-defined CR space. More... | |
#define | CR_BEG_UCSR_BYTES 3 |
Number of bytes in User CSR starting offset. More... | |
#define | CR_BEG_CRAM 0x009B |
Offset to start of Configuration RAM (CRAM) space. More... | |
#define | CR_END_CRAM 0x00A7 |
Offset to end of Configuration RAM (CRAM) space. More... | |
#define | CR_BEG_UCSR 0x00B3 |
Offset to start of manufacturer-defined CSR space. More... | |
#define | CR_END_UCSR 0x00BF |
Offset to end of manufacturer-defined CSR space. More... | |
#define | CR_BEG_SN 0x00CB |
Offset to beginning of board serial number. More... | |
#define | CR_END_SN 0x00DF |
Offset to end of board serial number. More... | |
#define | CR_SLAVE_CHAR 0x00E3 |
Board's slave-mode characteristics. More... | |
#define | CR_UD_SLAVE_CHAR 0x00E7 |
Manufacturer-defined slave-mode characteristics. More... | |
#define | CR_MASTER_CHAR 0x00EB |
Board's master-mode characteristics. More... | |
#define | CR_UD_MASTER_CHAR 0x00EF |
Manufacturer-defined master-mode characteristics. More... | |
#define | CR_IRQ_HANDLER_CAP 0x00F3 |
Interrupt levels board can respond to (handle) More... | |
#define | CR_IRQ_CAP 0x00F7 |
Interrupt levels board can assert. More... | |
#define | CR_CRAM_WIDTH 0x00FF |
Configuration RAM (CRAM) data access method) More... | |
#define | CR_FN_DAWPR(N) ( 0x0103 + (N)*0x04 ) /* N = 0 -> 7 */ |
Start of Data Access Width Parameter (DAWPR) regs. More... | |
#define | CR_DAWPR_BYTES 1 /* Number of bytes in a DAWPR register */ |
#define | CR_FN_AMCAP(N) ( 0x0123 + (N)*0x20 ) /* N = 0 -> 7 */ |
Start of Address Mode Capability (AMCAP) registers. More... | |
#define | CR_AMCAP_BYTES 8 /* Number of bytes in an AMCAP register */ |
#define | CR_FN_XAMCAP(N) ( 0x0223 + (N)*0x80 ) /* N = 0 -> 7 */ |
Start of Extended Address Mode Cap (XAMCAP) registers. More... | |
#define | CR_XAMCAP_BYTES 32 /* Number of bytes in an XAMCAP register */ |
#define | CR_FN_ADEM(N) ( 0x0623 + (N)*0x10 ) /* N = 0 -> 7 */ |
Start of Address Decoder Mask (ADEM) registers. More... | |
#define | CR_ADEM_BYTES 4 /* Number of bytes in an ADEM register */ |
#define | CR_MASTER_DAWPR 0x06AF |
Master Data Access Width Parameter. More... | |
#define | CR_MASTER_AMCAP 0x06B3 |
Master Address Mode Capabilities (8 entries) More... | |
#define | CR_MASTER_XAMCAP 0x06D3 |
Master Extended Address Mode Capabilities (8 entries) More... | |
#define | CR_SIZE 0x0750 |
Size of CR space (in total bytes) More... | |
#define | CR_BYTES (CR_SIZE>>2) |
Number of bytes in CR space. More... | |
#define | CSR_BAR 0x7ffff |
Base Address Register (MSB of our CR/CSR address) More... | |
#define | CSR_BIT_SET 0x7fffb |
Bit Set Register (writing a 1 sets the control bit) More... | |
#define | CSR_BIT_CLEAR 0x7fff7 |
Bit Clear Register (writing a 1 clears the control bit) More... | |
#define | CSR_CRAM_OWNER 0x7fff3 |
Configuration RAM Owner Register (0 = not owned) More... | |
#define | CSR_UD_BIT_SET 0x7ffef |
User-Defined Bit Set Register (for user-defined fns) More... | |
#define | CSR_UD_BIT_CLEAR 0x7ffeb |
User-Defined Bit Clear Register (for user-defined fns) More... | |
#define | CSR_FN_ADER(N) (0x7ff63 + (N)*0x10) /* N = 0 -> 7 */ |
Function N Address Decoder Compare Register (1st byte) More... | |
#define | CSR_ADER_BYTES 4 /* Number of bytes in an ADER register */ |
#define | CSR_BITSET_RESET_MODE 0x80 |
Module is in reset mode. More... | |
#define | CSR_BITSET_SYSFAIL_ENA 0x40 |
SYSFAIL driver is enabled. More... | |
#define | CSR_BITSET_MODULE_FAIL 0x20 |
Module has failed. More... | |
#define | CSR_BITSET_MODULE_ENA 0x10 |
Module is enabled. More... | |
#define | CSR_BITSET_BERR 0x08 |
Module has asserted a Bus Error. More... | |
#define | CSR_BITSET_CRAM_OWNED 0x04 |
CRAM is owned. More... | |
Common defininitions for registers found in the Configuration Rom (CR) on VME64 and VME64x cards.
+These registers are addressed with the CSR address space.
+The CR is a little strange in that all values are single bytes (D8), but still have 4 byte spacing. For example the Organizationaly Unique Identifier (OUI) is 3 bytes long. The first byte is offset 0x27, the second is 0x2B, and the third is 0x2F.
+The following definitions were originally taken from the mrfEventSystem IOC written by: Jukka Pietarinen (Micro-Research Finland, Oy) Till Straumann (SLAC) Eric Bjorklund (LANSCE)
+Corrected against 'The VMEBus Handbook' (Ch 5.6) ISBN 1-885731-08-6
+#define CR_ADEM_BYTES 4 /* Number of bytes in an ADEM register */ | +
#define CR_AMCAP_BYTES 8 /* Number of bytes in an AMCAP register */ | +
#define CR_ASCII_C 0x001F | +
#define CR_ASCII_R 0x0023 | +
#define CR_ASCII_STRING 0x0053 | +
#define CR_BEG_CRAM 0x009B | +
#define CR_BEG_SN 0x00CB | +
#define CR_BEG_UCR 0x0083 | +
#define CR_BEG_UCSR 0x00B3 | +
#define CR_BEG_UCSR_BYTES 3 | +
#define CR_BOARD_ID 0x0033 | +
#define CR_BOARD_ID_BYTES 4 | +
#define CR_BYTES (CR_SIZE>>2) | +
#define CR_CRAM_WIDTH 0x00FF | +
#define CR_DATA_ACCESS_WIDTH 0x0013 | +
#define CR_DAWPR_BYTES 1 /* Number of bytes in a DAWPR register */ | +
#define CR_END_CRAM 0x00A7 | +
#define CR_END_SN 0x00DF | +
#define CR_END_UCR 0x008F | +
#define CR_END_UCSR 0x00BF | +
#define CR_FN_ADEM | +( | ++ | N | ) | +( 0x0623 + (N)*0x10 ) /* N = 0 -> 7 */ | +
#define CR_FN_AMCAP | +( | ++ | N | ) | +( 0x0123 + (N)*0x20 ) /* N = 0 -> 7 */ | +
#define CR_FN_DAWPR | +( | ++ | N | ) | +( 0x0103 + (N)*0x04 ) /* N = 0 -> 7 */ | +
#define CR_FN_XAMCAP | +( | ++ | N | ) | +( 0x0223 + (N)*0x80 ) /* N = 0 -> 7 */ | +
#define CR_IEEE_OUI 0x0027 | +
#define CR_IEEE_OUI_BYTES 3 | +
#define CR_IRQ_CAP 0x00F7 | +
#define CR_IRQ_HANDLER_CAP 0x00F3 | +
#define CR_MASTER_AMCAP 0x06B3 | +
#define CR_MASTER_CHAR 0x00EB | +
#define CR_MASTER_DAWPR 0x06AF | +
#define CR_MASTER_XAMCAP 0x06D3 | +
#define CR_PROGRAM_ID 0x007F | +
#define CR_REVISION_ID 0x0043 | +
#define CR_REVISION_ID_BYTES 4 | +
#define CR_ROM_CHECKSUM 0x0003 | +
#define CR_ROM_LENGTH 0x0007 | +
#define CR_SIZE 0x0750 | +
#define CR_SLAVE_CHAR 0x00E3 | +
#define CR_SPACE_ID 0x001B | +
#define CR_UD_MASTER_CHAR 0x00EF | +
#define CR_UD_SLAVE_CHAR 0x00E7 | +
#define CR_XAMCAP_BYTES 32 /* Number of bytes in an XAMCAP register */ | +
#define CSR_ADER_BYTES 4 /* Number of bytes in an ADER register */ | +
#define CSR_BAR 0x7ffff | +
#define CSR_BIT_CLEAR 0x7fff7 | +
#define CSR_BIT_SET 0x7fffb | +
#define CSR_BITSET_BERR 0x08 | +
#define CSR_BITSET_CRAM_OWNED 0x04 | +
#define CSR_BITSET_MODULE_ENA 0x10 | +
#define CSR_BITSET_MODULE_FAIL 0x20 | +
#define CSR_BITSET_RESET_MODE 0x80 | +
#define CSR_BITSET_SYSFAIL_ENA 0x40 | +
#define CSR_CRAM_OWNER 0x7fff3 | +
#define CSR_DATA_ACCESS_WIDTH 0x0017 | +
#define CSR_FN_ADER | +( | ++ | N | ) | +(0x7ff63 + (N)*0x10) /* N = 0 -> 7 */ | +
#define CSR_UD_BIT_CLEAR 0x7ffeb | +
+ devLib2
+ 2.11
+
+ |
+
devLib2 is an extension to the EPICS OS independent VME bus access library found in the EPICS Base. The MMIO API is included in EPICS Base >=3.15.0.2
+Releases can be found at http://sourceforge.net/projects/epics/files/devlib2/
+VCS source browser https://github.com/epics-modules/devlib2
+Or checked out with
+git clone https://github.com/epics-modules/devlib2.git
+The canonical version of this page is http://epics.sourceforge.net/devlib2/
+EPICS Base >= 3.14.8.2
+ +devLib2 adds features in several areas: PCI bus access, VME64x CSR/CSR, and memory mapped I/O (MMIO) operations.
+The PCI bus access interface is entirely new. It is currently implemented for RTEMS, vxWorks, and Linux (with some limitations). The PCI interface provides functions for: searching the bus, mapping devices into process memory, and (dis)connecting interrupts.
+Runtime selection of implementations is also supported. This allows code using this interface to compile and link for all target, even those which lack an implementation.
+ +The exploreApp PCI driver/hardware development tool is a generic EPICS driver intended to support development of custom PCI/PCIe devices. It provides a set of records which read/write to individual registers. Basic support for interrupts is also available (Linux only).
+The VME64x library provides several functions for accessing the CSR/CR address space defined by VME64 and extended by VME64x. This includes: probing by slot number and matching by identifier registers, definitions of standard registers, and functions to access them.
+ + + + +The MMIO library provides an OS and CPU architecture independent way to safely access memory mapped I/O devices. Makes guarantees of the width and order of accesses.
+ +Work by Andrew Johnson
+Work by Till Straumann
+Work by Dirk Zimoch
+Work by Michael Davidsaver
+
+ devLib2
+ 2.11
+
+ |
+
Go to the source code of this file.
++Functions | |
epicsExportRegistrar (vmecsr) | |
epicsExportRegistrar | +( | +vmecsr | +) | ++ |
+ devLib2
+ 2.11
+
+ |
+
+ devLib2
+ 2.11
+
+ |
+
Several IOC shell functions are provided to access PCI and VME devices
+To use, begin by calling pcidiagset() to select the device and BAR that subsequent read/write calls will operate on.
+t |