source: rtems-libbsd/rtemsbsd/rtems/rtems-kernel-pci_bus.c @ 5b1f20b

55-freebsd-126-freebsd-12freebsd-9.3
Last change on this file since 5b1f20b was 5b1f20b, checked in by Sebastian Huber <sebastian.huber@…>, on 05/06/16 at 19:22:38

Rename files for kernel namespace script

This makes it easier to create the kernel namespace header.

  • Property mode set to 100644
File size: 2.4 KB
Line 
1#include <machine/rtems-bsd-kernel-space.h>
2
3/**
4 * @file
5 *
6 * @ingroup rtems_bsd_rtems
7 *
8 * @brief This file contains methods that are rtems specific implementation
9 * of methods in pci_bus.c.
10 */
11
12/*
13 * COPYRIGHT (c) 2012. On-Line Applications Research Corporation (OAR).
14 * All rights reserved.
15 *
16 * Redistribution and use in source and binary forms, with or without
17 * modification, are permitted provided that the following conditions
18 * are met:
19 * 1. Redistributions of source code must retain the above copyright
20 *    notice, this list of conditions and the following disclaimer.
21 * 2. Redistributions in binary form must reproduce the above copyright
22 *    notice, this list of conditions and the following disclaimer in the
23 *    documentation and/or other materials provided with the distribution.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 */
37
38#include <sys/cdefs.h>
39__FBSDID("$FreeBSD$");
40
41#include <rtems/bsd/local/opt_cpu.h>
42
43#include <rtems/bsd/sys/param.h>
44#include <sys/systm.h>
45#include <sys/bus.h>
46#include <sys/kernel.h>
47
48#include <dev/pci/pcivar.h>
49#include <dev/pci/pcireg.h>
50#include <dev/pci/pcib_private.h>
51#include <machine/resource.h>
52
53#include <rtems/bsd/local/pcib_if.h>
54#define pci_find_device rtems_pci_find_device
55#if HAVE_RTEMS_PCI_H
56#include <rtems/pci.h>
57#endif
58#include <machine/bus.h>
59
60int
61pcibios_pcib_route_interrupt(device_t pcib, device_t dev, int pin)
62{
63#if HAVE_RTEMS_PCI_H
64  int     bus;
65  int     slot;
66  int     func;
67  uint8_t irq;
68
69  bus  = pci_get_bus(dev);
70  slot = pci_get_slot(dev);
71  func = pci_get_function(dev);
72
73  pci_read_config_byte(bus, slot, func, PCI_INTERRUPT_LINE, &irq);
74  return irq;
75#else
76  return 0;
77#endif
78}
Note: See TracBrowser for help on using the repository browser.