Re: svn commit: r353365 - head/usr.bin/procstat

2019-10-19 Thread Rodney W. Grimes via svn-src-all
> On Thu, Oct 10, 2019 at 11:27 PM Rodney W. Grimes
>  wrote:
> >
> > > Author: jlh
> > > Date: Wed Oct  9 20:05:14 2019
> > > New Revision: 353365
> > > URL: https://svnweb.freebsd.org/changeset/base/353365
> > >
> > > Log:
> > >   Add a missing macro for the previous commit (IS_INADDR_ANY()).
> >
> > Can we write it the same was as it is 100+ other places?
> > 1022}# find . -type f | xargs grep "== INADDR_ANY" | wc
> >  131 7819607
> 
> Done in r353768. Thanks!

Thank you.

> > > Modified:
> > >   head/usr.bin/procstat/procstat_files.c
> > >
> > > Modified: head/usr.bin/procstat/procstat_files.c
> > > ==
> > > --- head/usr.bin/procstat/procstat_files.cWed Oct  9 20:01:23 2019
> > > (r353364)
> > > +++ head/usr.bin/procstat/procstat_files.cWed Oct  9 20:05:14 2019
> > > (r353365)
> > > @@ -94,6 +94,7 @@ addr_to_string(struct sockaddr_storage *ss, char *buff
> > >   struct sockaddr_in6 *sin6;
> > >   struct sockaddr_in *sin;
> > >   struct sockaddr_un *sun;
> > > +#define IS_INADDR_ANY(x) ((x).s_addr == INADDR_ANY)
> > >
> > >   switch (ss->ss_family) {
> > >   case AF_LOCAL:
> > >
> >
> > --
> > Rod Grimes 
> > rgri...@freebsd.org
> 
> 
> 
> -- 
> Jeremie Le Hen
> j...@freebsd.org
> 

-- 
Rod Grimes rgri...@freebsd.org
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r342619 - head/stand/i386/libi386

2018-12-30 Thread Rodney W. Grimes via svn-src-all
> Author: tsoome
> Date: Sun Dec 30 09:35:47 2018
> New Revision: 342619
> URL: https://svnweb.freebsd.org/changeset/base/342619
> 
> Log:
>   loader: create bio_alloc and bio_free for bios bounce buffer
>   
>   We do have 16KB buffer space defined in pxe.c, move it to bio.c and 
> implement
>   bio_alloc()/bio_free() interface to make it possible to use this space for
>   other BIOS calls (notably, from biosdisk.c).
>   
>   MFC after:  2 weeks
>   Differential Revision:  https://reviews.freebsd.org/D17131
> 
> Added:
>   head/stand/i386/libi386/bio.c   (contents, props changed)
> Modified:
>   head/stand/i386/libi386/Makefile
>   head/stand/i386/libi386/biosdisk.c
>   head/stand/i386/libi386/libi386.h
>   head/stand/i386/libi386/pxe.c
> 
> Modified: head/stand/i386/libi386/Makefile
> ==
> --- head/stand/i386/libi386/Makefile  Sun Dec 30 09:13:38 2018
> (r342618)
> +++ head/stand/i386/libi386/Makefile  Sun Dec 30 09:35:47 2018
> (r342619)
> @@ -4,7 +4,7 @@
>  
>  LIB= i386
>  
> -SRCS=biosacpi.c biosdisk.c biosmem.c biospnp.c \
> +SRCS=bio.c biosacpi.c biosdisk.c biosmem.c biospnp.c \
>   biospci.c biossmap.c bootinfo.c bootinfo32.c bootinfo64.c \
>   comconsole.c devicename.c elf32_freebsd.c \
>   elf64_freebsd.c multiboot.c multiboot_tramp.S relocater_tramp.S \
> 
> Added: head/stand/i386/libi386/bio.c
> ==
> --- /dev/null 00:00:00 1970   (empty, because file is newly added)
> +++ head/stand/i386/libi386/bio.c Sun Dec 30 09:35:47 2018
> (r342619)
> @@ -0,0 +1,65 @@
> +/*-
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions
> + * are met:
> + * 1. Redistributions of source code must retain the above copyright
> + *notice, this list of conditions and the following disclaimer.
> + * 2. Redistributions in binary form must reproduce the above copyright
> + *notice, this list of conditions and the following disclaimer in the
> + *documentation and/or other materials provided with the distribution.
> + *
> + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
> + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
> + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
> + * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
> + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
> + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
> + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
> + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
> + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
> + * SUCH DAMAGE.
> + */

This file has no copyright... please correct that.

> +
> +#include 
> +__FBSDID("$FreeBSD$");
> +
> +#include 
> +#include "libi386.h"
> +
> +/*
> + * The idea is borrowed from pxe.c and zfsimpl.c. The original buffer
> + * space in pxe.c was 2x 0x2000. Allocating it from BSS will give us needed
> + * memory below 1MB and usable for real mode calls.
> + *
> + * Note the allocations and frees are to be done in reverse order (LIFO).
> + */
> +
> +static char bio_buffer[BIO_BUFFER_SIZE];
> +static char *bio_buffer_end = bio_buffer + BIO_BUFFER_SIZE;
> +static char *bio_buffer_ptr = bio_buffer;
> +
> +void *
> +bio_alloc(size_t size)
> +{
> + char *ptr;
> +
> + ptr = bio_buffer_ptr;
> + if (ptr + size > bio_buffer_end)
> + return (NULL);
> + bio_buffer_ptr += size;
> +
> + return (ptr);
> +}
> +
> +void
> +bio_free(void *ptr, size_t size)
> +{
> +
> + if (ptr == NULL)
> + return;
> +
> + bio_buffer_ptr -= size;
> + if (bio_buffer_ptr != ptr)
> + panic("bio_alloc()/bio_free() mismatch\n");
> +}
> 

-- 
Rod Grimes rgri...@freebsd.org
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"