From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: [PATCH v8 3/4] pci: add wrapper for parse_pci Date: Wed, 8 Jul 2015 13:32:13 -0400 Message-ID: <20150708173213.GC17261@l.oracle.com> References: <1435707242-24937-1-git-send-email-elena.ufimtseva@oracle.com> <1435707242-24937-4-git-send-email-elena.ufimtseva@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1435707242-24937-4-git-send-email-elena.ufimtseva@oracle.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: elena.ufimtseva@oracle.com Cc: kevin.tian@intel.com, tim@xen.org, xen-devel@lists.xen.org, jbeulich@suse.com, yang.z.zhang@intel.com, boris.ostrovsky@oracle.com List-Id: xen-devel@lists.xenproject.org On Tue, Jun 30, 2015 at 07:34:01PM -0400, elena.ufimtseva@oracle.com wrote: > From: Elena Ufimtseva > > For sbdf'si parsing in rmrr command line add __parse_pci with addtional sbdf'si ? s/rmrr/RMRR/ s/addtional/additional/ > parameter def_seg. __parse_pci will help to identify if segment was > found > in string being parsed or default segment was used. > Make a wrapper parse_pci so the rest of the callers are not affected. > > Signed-off-by: Elena Ufimtseva > Acked-by: Jan Beulich > --- > xen/drivers/pci/pci.c | 11 +++++++++++ > xen/include/xen/pci.h | 3 +++ > 2 files changed, 14 insertions(+) > > diff --git a/xen/drivers/pci/pci.c b/xen/drivers/pci/pci.c > index ca07ed0..788a356 100644 > --- a/xen/drivers/pci/pci.c > +++ b/xen/drivers/pci/pci.c > @@ -119,11 +119,21 @@ const char *__init parse_pci(const char *s, unsigned int *seg_p, > unsigned int *bus_p, unsigned int *dev_p, > unsigned int *func_p) > { > + bool_t def_seg; > + > + return __parse_pci(s, seg_p, bus_p, dev_p, func_p, &def_seg); > +} > + > +const char *__init __parse_pci(const char *s, unsigned int *seg_p, > + unsigned int *bus_p, unsigned int *dev_p, > + unsigned int *func_p, bool_t *def_seg) > +{ > unsigned long seg = simple_strtoul(s, &s, 16), bus, dev, func; > > if ( *s != ':' ) > return NULL; > bus = simple_strtoul(s + 1, &s, 16); > + *def_seg = 0; > if ( *s == ':' ) > dev = simple_strtoul(s + 1, &s, 16); > else > @@ -131,6 +141,7 @@ const char *__init parse_pci(const char *s, unsigned int *seg_p, > dev = bus; > bus = seg; > seg = 0; > + *def_seg = 1; > } > if ( func_p ) > { > diff --git a/xen/include/xen/pci.h b/xen/include/xen/pci.h > index 414106a..d66ecab 100644 > --- a/xen/include/xen/pci.h > +++ b/xen/include/xen/pci.h > @@ -150,6 +150,9 @@ int pci_find_ext_capability(int seg, int bus, int devfn, int cap); > int pci_find_next_ext_capability(int seg, int bus, int devfn, int pos, int cap); > const char *parse_pci(const char *, unsigned int *seg, unsigned int *bus, > unsigned int *dev, unsigned int *func); > +const char *__parse_pci(const char *, unsigned int *seg, unsigned int *bus, > + unsigned int *dev, unsigned int *func, bool_t *def_seg); > + > > bool_t pcie_aer_get_firmware_first(const struct pci_dev *); > > -- > 2.1.3 >