diff options
Diffstat (limited to 'cpukit/include/pci/access.h')
-rw-r--r-- | cpukit/include/pci/access.h | 45 |
1 files changed, 32 insertions, 13 deletions
diff --git a/cpukit/include/pci/access.h b/cpukit/include/pci/access.h index 9a53c7e3a3..96409150cd 100644 --- a/cpukit/include/pci/access.h +++ b/cpukit/include/pci/access.h @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /** * @file * @@ -10,9 +12,26 @@ /* * COPYRIGHT (c) 2010 Cobham Gaisler AB. * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.org/license/LICENSE. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. */ @@ -134,32 +153,32 @@ extern int pci_access_drv_register(struct pci_access_drv *drv); extern void pci_modify_cmdsts(pci_dev_t dev, uint32_t mask, uint32_t val); /* Enable Memory in command register */ -RTEMS_INLINE_ROUTINE void pci_mem_enable(pci_dev_t dev) +static inline void pci_mem_enable(pci_dev_t dev) { pci_modify_cmdsts(dev, PCIM_CMD_MEMEN, PCIM_CMD_MEMEN); } -RTEMS_INLINE_ROUTINE void pci_mem_disable(pci_dev_t dev) +static inline void pci_mem_disable(pci_dev_t dev) { pci_modify_cmdsts(dev, PCIM_CMD_MEMEN, 0); } -RTEMS_INLINE_ROUTINE void pci_io_enable(pci_dev_t dev) +static inline void pci_io_enable(pci_dev_t dev) { pci_modify_cmdsts(dev, PCIM_CMD_PORTEN, PCIM_CMD_PORTEN); } -RTEMS_INLINE_ROUTINE void pci_io_disable(pci_dev_t dev) +static inline void pci_io_disable(pci_dev_t dev) { pci_modify_cmdsts(dev, PCIM_CMD_PORTEN, 0); } -RTEMS_INLINE_ROUTINE void pci_master_enable(pci_dev_t dev) +static inline void pci_master_enable(pci_dev_t dev) { pci_modify_cmdsts(dev, PCIM_CMD_BUSMASTEREN, PCIM_CMD_BUSMASTEREN); } -RTEMS_INLINE_ROUTINE void pci_master_disable(pci_dev_t dev) +static inline void pci_master_disable(pci_dev_t dev) { pci_modify_cmdsts(dev, PCIM_CMD_BUSMASTEREN, 0); } @@ -185,25 +204,25 @@ extern void pci_io_w16(uint32_t adr, uint16_t data); extern void pci_io_w32(uint32_t adr, uint32_t data); /* Translate PCI address into CPU accessible address */ -RTEMS_INLINE_ROUTINE int pci_pci2cpu(uint32_t *address, int type) +static inline int pci_pci2cpu(uint32_t *address, int type) { return pci_access_ops.translate(address, type, 0); } /* Translate CPU accessible address into PCI address (for DMA) */ -RTEMS_INLINE_ROUTINE int pci_cpu2pci(uint32_t *address, int type) +static inline int pci_cpu2pci(uint32_t *address, int type) { return pci_access_ops.translate(address, type, 1); } /*** Read/Write a register over PCI Memory Space ***/ -RTEMS_INLINE_ROUTINE uint8_t pci_ld8(volatile uint8_t *addr) +static inline uint8_t pci_ld8(volatile uint8_t *addr) { return *addr; } -RTEMS_INLINE_ROUTINE void pci_st8(volatile uint8_t *addr, uint8_t val) +static inline void pci_st8(volatile uint8_t *addr, uint8_t val) { *addr = val; } |