coreboot/src/include/device/path.h
Lee Leahy b2789d37c9 UPSTREAM: src/include: Fix unsigned warnings
Fix warning detected by checkpatch.pl:

WARNING: Prefer 'unsigned int' to bare use of 'unsigned'

BRANCH=none
BUG=None
TEST=Build and run on Galileo Gen2

Change-Id: If4e006aff16981e2e9b7ac38ea2909838b2660d5
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: 0ca2a0654c
Original-Change-Id: I23d9b4b715aa74acc387db8fb8d3c73bd5cabfaa
Original-Signed-off-by: Lee Leahy <Leroy.P.Leahy@intel.com>
Original-Reviewed-on: https://review.coreboot.org/18607
Original-Reviewed-by: Philippe Mathieu-Daud <philippe.mathieu.daude@gmail.com>
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Original-Reviewed-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://chromium-review.googlesource.com/452473
2017-03-10 10:54:39 -08:00

128 lines
2 KiB
C

#ifndef DEVICE_PATH_H
#define DEVICE_PATH_H
enum device_path_type {
DEVICE_PATH_NONE = 0,
DEVICE_PATH_ROOT,
DEVICE_PATH_PCI,
DEVICE_PATH_PNP,
DEVICE_PATH_I2C,
DEVICE_PATH_APIC,
DEVICE_PATH_DOMAIN,
DEVICE_PATH_CPU_CLUSTER,
DEVICE_PATH_CPU,
DEVICE_PATH_CPU_BUS,
DEVICE_PATH_IOAPIC,
DEVICE_PATH_GENERIC,
DEVICE_PATH_SPI,
/*
* When adding path types to this table, please also update the
* DEVICE_PATH_NAMES macro below.
*/
};
#define DEVICE_PATH_NAMES { \
"DEVICE_PATH_NONE", \
"DEVICE_PATH_ROOT", \
"DEVICE_PATH_PCI", \
"DEVICE_PATH_PNP", \
"DEVICE_PATH_I2C", \
"DEVICE_PATH_APIC", \
"DEVICE_PATH_DOMAIN", \
"DEVICE_PATH_CPU_CLUSTER", \
"DEVICE_PATH_CPU", \
"DEVICE_PATH_CPU_BUS", \
"DEVICE_PATH_IOAPIC", \
"DEVICE_PATH_GENERIC", \
"DEVICE_PATH_SPI", \
}
struct domain_path
{
unsigned int domain;
};
struct pci_path
{
unsigned int devfn;
};
struct pnp_path
{
unsigned int port;
unsigned int device;
};
struct i2c_path
{
unsigned int device;
unsigned int mode_10bit;
};
struct spi_path
{
unsigned int cs;
};
struct apic_path
{
unsigned int apic_id;
unsigned int package_id;
unsigned int node_id;
unsigned int core_id;
unsigned int thread_id;
};
struct ioapic_path
{
unsigned int ioapic_id;
};
struct cpu_cluster_path
{
unsigned int cluster;
};
struct cpu_path
{
unsigned int id;
};
struct cpu_bus_path
{
unsigned int id;
};
struct generic_path
{
unsigned int id;
unsigned int subid;
};
struct device_path {
enum device_path_type type;
union {
struct pci_path pci;
struct pnp_path pnp;
struct i2c_path i2c;
struct apic_path apic;
struct ioapic_path ioapic;
struct domain_path domain;
struct cpu_cluster_path cpu_cluster;
struct cpu_path cpu;
struct cpu_bus_path cpu_bus;
struct generic_path generic;
struct spi_path spi;
};
};
#define DEVICE_PATH_MAX 30
#define BUS_PATH_MAX (DEVICE_PATH_MAX+10)
extern int path_eq(struct device_path *path1, struct device_path *path2);
extern const char *dev_path_name(enum device_path_type type);
#endif /* DEVICE_PATH_H */