From 0bf17be9e33050324b510f047536ff12fc886514 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Wed, 16 Jul 2014 15:12:56 -0400 Subject: [PATCH] mmio: vxWorks m68k use default, add weak symbols for old versions --- src/libCom/osi/Makefile | 2 ++ src/libCom/osi/os/vxWorks/epicsMMIO.c | 40 +++++++++++++++++++++++++++ src/libCom/osi/os/vxWorks/epicsMMIO.h | 5 ++++ 3 files changed, 47 insertions(+) create mode 100644 src/libCom/osi/os/vxWorks/epicsMMIO.c diff --git a/src/libCom/osi/Makefile b/src/libCom/osi/Makefile index d48716e05..7794601e3 100644 --- a/src/libCom/osi/Makefile +++ b/src/libCom/osi/Makefile @@ -120,6 +120,8 @@ Com_SRCS += osdMessageQueue.c Com_SRCS += devLibVME.c Com_SRCS += devLibVMEOSD.c +Com_SRCS_vxWorks += epicsMMIO.c + Com_SRCS_vxWorks += atReboot.cpp # For old vxWorks applications diff --git a/src/libCom/osi/os/vxWorks/epicsMMIO.c b/src/libCom/osi/os/vxWorks/epicsMMIO.c new file mode 100644 index 000000000..947d7bc46 --- /dev/null +++ b/src/libCom/osi/os/vxWorks/epicsMMIO.c @@ -0,0 +1,40 @@ +/*************************************************************************\ +* Copyright (c) 2014 Brookhaven Science Associates, as Operator of +* Brookhaven National Laboratory. +* EPICS BASE is distributed subject to a Software License Agreement found +* in file LICENSE that is included with this distribution. +\*************************************************************************/ +/* + * Author: Michael Davidsaver + */ + +#ifndef __m68k__ + +#include "epicsMMIODef.h" + +epicsUInt16 sysIn16 (volatile void*) __attribute__((weak)); +epicsUInt32 sysIn32 (volatile void*) __attribute__((weak)); +void sysOut16 (volatile void*, epicsUInt16) __attribute__((weak)); +void sysOut32 (volatile void*, epicsUInt32) __attribute__((weak)); + +epicsUInt16 sysIn16 (volatile void* addr) +{ + return nat_read16(addr); +} + +epicsUInt32 sysIn32 (volatile void* addr) +{ + return nat_read32(addr); +} + +void sysOut16 (volatile void* addr, epicsUInt16 val) +{ + nat_write16(addr, val); +} + +void sysOut32 (volatile void* addr, epicsUInt32 val) +{ + nat_write32(addr, val); +} + +#endif /* m68k */ diff --git a/src/libCom/osi/os/vxWorks/epicsMMIO.h b/src/libCom/osi/os/vxWorks/epicsMMIO.h index 7141bf777..6b391da3a 100644 --- a/src/libCom/osi/os/vxWorks/epicsMMIO.h +++ b/src/libCom/osi/os/vxWorks/epicsMMIO.h @@ -15,6 +15,10 @@ * Author: Michael Davidsaver */ +#ifdef __m68k__ +#include "epicsMMIODef.h" +#else + #ifndef EPICSMMIO_H #define EPICSMMIO_H @@ -125,3 +129,4 @@ void sysOut32 (volatile void*, epicsUInt32); /* Synchronous 32 bit w #define rwbarr() VX_MEM_BARRIER_RW() #endif /* EPICSMMIO_H */ +#endif /* m68k */