From dbe1e0a65e3dc00ae66db87d80f14d899dd7b416 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Mon, 1 Apr 2013 15:42:50 +0200 Subject: [PATCH] Use symbol versioning for our new member of struct pci_dev --- Makefile | 1 + lib/access.c | 13 ++++++++----- lib/caps.c | 2 +- lib/filter.c | 2 +- lib/internal.h | 1 + lib/libpci.ver | 5 +++++ lib/pci.h | 2 +- 7 files changed, 18 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 8a3d396..fb240ca 100644 --- a/Makefile +++ b/Makefile @@ -22,6 +22,7 @@ DNS= SHARED=no # ABI version suffix in the name of the shared library +# (as we use proper symbol versioning, this seldom needs changing) ABI_VERSION=.3 # Installation directories diff --git a/lib/access.c b/lib/access.c index faad7c4..5112504 100644 --- a/lib/access.c +++ b/lib/access.c @@ -1,7 +1,7 @@ /* * The PCI Library -- User Access * - * Copyright (c) 1997--2008 Martin Mares + * Copyright (c) 1997--2013 Martin Mares * * Can be freely distributed and used under the terms of the GNU GPL. */ @@ -153,7 +153,7 @@ pci_write_block(struct pci_dev *d, int pos, byte *buf, int len) } int -pci_fill_info_v31(struct pci_dev *d, int flags) +pci_fill_info_v32(struct pci_dev *d, int flags) { if (flags & PCI_FILL_RESCAN) { @@ -167,10 +167,13 @@ pci_fill_info_v31(struct pci_dev *d, int flags) } /* In version 3.1, pci_fill_info got new flags => versioned alias */ -STATIC_ALIAS(int pci_fill_info(struct pci_dev *d, int flags), pci_fill_info_v31(d,flags)); -DEFINE_ALIAS(int pci_fill_info_v30(struct pci_dev *d, int flags), pci_fill_info_v31); +/* In version 3.2, the same has happened */ +STATIC_ALIAS(int pci_fill_info(struct pci_dev *d, int flags), pci_fill_info_v32(d, flags)); +DEFINE_ALIAS(int pci_fill_info_v30(struct pci_dev *d, int flags), pci_fill_info_v32); +DEFINE_ALIAS(int pci_fill_info_v31(struct pci_dev *d, int flags), pci_fill_info_v32); SYMBOL_VERSION(pci_fill_info_v30, pci_fill_info@LIBPCI_3.0); -SYMBOL_VERSION(pci_fill_info_v31, pci_fill_info@@LIBPCI_3.1); +SYMBOL_VERSION(pci_fill_info_v31, pci_fill_info@LIBPCI_3.1); +SYMBOL_VERSION(pci_fill_info_v32, pci_fill_info@@LIBPCI_3.2); void pci_setup_cache(struct pci_dev *d, byte *cache, int len) diff --git a/lib/caps.c b/lib/caps.c index ff4d9c4..2378591 100644 --- a/lib/caps.c +++ b/lib/caps.c @@ -106,7 +106,7 @@ pci_find_cap(struct pci_dev *d, unsigned int id, unsigned int type) { struct pci_cap *c; - pci_fill_info_v31(d, ((type == PCI_CAP_NORMAL) ? PCI_FILL_CAPS : PCI_FILL_EXT_CAPS)); + pci_fill_info_v32(d, ((type == PCI_CAP_NORMAL) ? PCI_FILL_CAPS : PCI_FILL_EXT_CAPS)); for (c=d->first_cap; c; c=c->next) if (c->type == type && c->id == id) return c; diff --git a/lib/filter.c b/lib/filter.c index 0b7ce6e..f321b0f 100644 --- a/lib/filter.c +++ b/lib/filter.c @@ -114,7 +114,7 @@ pci_filter_match(struct pci_filter *f, struct pci_dev *d) return 0; if (f->device >= 0 || f->vendor >= 0) { - pci_fill_info_v31(d, PCI_FILL_IDENT); + pci_fill_info_v32(d, PCI_FILL_IDENT); if ((f->device >= 0 && f->device != d->device_id) || (f->vendor >= 0 && f->vendor != d->vendor_id)) return 0; diff --git a/lib/internal.h b/lib/internal.h index 0d95109..9718be6 100644 --- a/lib/internal.h +++ b/lib/internal.h @@ -56,6 +56,7 @@ int pci_link_dev(struct pci_access *, struct pci_dev *); int pci_fill_info_v30(struct pci_dev *, int flags) PCI_ABI; int pci_fill_info_v31(struct pci_dev *, int flags) PCI_ABI; +int pci_fill_info_v32(struct pci_dev *, int flags) PCI_ABI; /* params.c */ void pci_define_param(struct pci_access *acc, char *param, char *val, char *help); diff --git a/lib/libpci.ver b/lib/libpci.ver index 2f7dff7..3f73fca 100644 --- a/lib/libpci.ver +++ b/lib/libpci.ver @@ -47,3 +47,8 @@ LIBPCI_3.1 { pci_find_cap; pci_read_vpd; }; + +LIBPCI_3.2 { + global: + pci_fill_info; +}; diff --git a/lib/pci.h b/lib/pci.h index 148b055..38e2e99 100644 --- a/lib/pci.h +++ b/lib/pci.h @@ -16,7 +16,7 @@ #include "header.h" #include "types.h" -#define PCI_LIB_VERSION 0x030100 +#define PCI_LIB_VERSION 0x030200 #ifndef PCI_ABI #define PCI_ABI -- 2.39.5