aboutsummaryrefslogtreecommitdiff
path: root/src/include/device/pci_type.h
blob: 0b08e8d0aa934f907618182c94cf9ce090f82ceb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*
 * This file is part of the coreboot project.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; version 2 of the License.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

#ifndef DEVICE_PCI_TYPE_H
#define DEVICE_PCI_TYPE_H

#include <stdint.h>

typedef u32 pci_devfn_t;
typedef u32 pnp_devfn_t;

#define PCI_DEV(SEGBUS, DEV, FN) ( \
	(((SEGBUS) & 0xFFF) << 20) | \
	(((DEV) & 0x1F) << 15) | \
	(((FN)  & 0x07) << 12))

#define PCI_DEV_INVALID (0xffffffffU)

#endif /* DEVICE_PCI_TYPE_H */