Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 10 Jan 1999 21:46:54 +1100
From:      Bruce Evans <bde@zeta.org.au>
To:        cvs-all@FreeBSD.ORG, cvs-committers@FreeBSD.ORG, mjacob@FreeBSD.ORG
Subject:   Re: cvs commit: src/sys/dev/isp isp.c
Message-ID:  <199901101046.VAA08330@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>  Modified files:
>    sys/dev/isp          isp.c 
>  Log:
>  Add some prototype deadchip detection. Set FIFO bursting (1XX0 only-
>  it's already on for the 2XX0) and detect the broken 1040A FIFO. Change
>  bzero to MEMZERO (portability with **nux). Use memcpy for same reason.

FreeBSD doesn't really have memcpy in the kernel.  At least on i386's,
It has a highly "optimised" bcopy that handles overflapping copies.
memcpy should only be used when its size arg is known at compile time
and small, and the copy doesn't overlap.  In this case, gcc -O inlines
the memcpy and the inlined version is actually faster than bcopy on all
systems.  The extern version of memcpy is not optimised and is supposed
to only get called when gcc is invoked without -O.

History:

RCS file: /home/ncvs/src/sys/netinet/if_ether.c,v
Working file: if_ether.c
head: 1.49
...
----------------------------
revision 1.30
date: 1996/06/08 08:18:56;  author: bde;  state: Exp;  lines: +2 -2
Changed some memcpy()'s back to bcopy()'s.

gcc only inlines memcpy()'s whose count is constant and didn't inline
these.  I want memcpy() in the kernel go away so that it's obvious that
it doesn't need to be optimized.  Now it is only used for one struct
copy in si.c.
----------------------------
...
----------------------------
revision 1.15
date: 1995/05/09 13:35:44;  author: davidg;  state: Exp;  lines: +20 -29
Replaced some bcopy()'s with memcpy()'s so that gcc while inline/optimize.
----------------------------

Bruce

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199901101046.VAA08330>