source: rtems/cpukit/libpci/pci_access_io.c @ a31845f7

4.11
Last change on this file since a31845f7 was a31845f7, checked in by Daniel Hellstrom <daniel@…>, on Nov 28, 2011 at 9:11:10 AM

LIBPCI: added PCI layer to cpukit/libpci

  • Property mode set to 100644
File size: 1.0 KB
Line 
1/*  PCI Access Library
2 *
3 *  COPYRIGHT (c) 2010.
4 *  Cobham Gaisler AB.
5 *
6 *  The license and distribution terms for this file may be
7 *  found in the file LICENSE in this distribution or at
8 *  http://www.rtems.com/license/LICENSE.
9 */
10
11#include <pci.h>
12#include <pci/access.h>
13
14/* Read a 8-bit register over PCI I/O Space */
15uint8_t pci_io_r8(uint32_t adr)
16{
17        return pci_access_ops.io.read8((uint8_t *)adr);
18}
19
20/* Read a 16-bit I/O Register */
21uint16_t pci_io_r16(uint32_t adr)
22{
23        return pci_access_ops.io.read16((uint16_t *)adr);
24}
25
26/* Read a 32-bit I/O Register */
27uint32_t pci_io_r32(uint32_t adr)
28{
29        return pci_access_ops.io.read32((uint32_t *)adr);
30}
31
32/* Write a 8-bit I/O Register */
33void pci_io_w8(uint32_t adr, uint8_t data)
34{
35        pci_access_ops.io.write8((uint8_t *)adr, data);
36}
37
38/* Write a 16-bit I/O Register */
39void pci_io_w16(uint32_t adr, uint16_t data)
40{
41        pci_access_ops.io.write16((uint16_t *)adr, data);
42}
43
44/* Write a 32-bit I/O Register */
45void pci_io_w32(uint32_t adr, uint32_t data)
46{
47        pci_access_ops.io.write32((uint32_t *)adr, data);
48}
Note: See TracBrowser for help on using the repository browser.