/* $NetBSD: memccpy.c,v 1.13 2012/06/25 22:32:46 abs Exp $ */ /*- * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. * * 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. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. */ #include #if defined(LIBC_SCCS) && !defined(lint) #if 0 static char sccsid[] = "@(#)memccpy.c 8.1 (Berkeley) 6/4/93"; #else __RCSID("$NetBSD: memccpy.c,v 1.13 2012/06/25 22:32:46 abs Exp $"); #endif #endif /* LIBC_SCCS and not lint */ #include #include void * memccpy(void *t, const void *f, int c, size_t n) { _DIAGASSERT(t != 0); _DIAGASSERT(f != 0); if (n) { unsigned char *tp = t; const unsigned char *fp = f; unsigned char uc = c; do { if ((*tp++ = *fp++) == uc) return (tp); } while (--n != 0); } return (0); } 4fcdee6a2f23fc0366a65643f5d34fe4cc10'>sys/dev/ebus
AgeCommit message (Expand)Author
2009-05-12struct device * -> device_t, no functional changes intended.cegger
2009-05-12struct cfdata * -> cfdata_t, no functional changes intended.cegger
2009-01-31Make it attach on JavaStation KRUPS againmartin
2009-01-06use the prom addresses except on MSIIEP.mrg
2008-12-17make this compilecegger
2008-12-16replace bitmask_snprintf(9) with snprintb(3)christos
2008-12-11also attach if the "compatible" property matches, as seen on sb2000.mrg
2008-05-29remove clause #3 from my license where there are no othermrg
2008-04-29Replicate sbus fixes for PR kern/37540.ad
2008-04-08use aprint_*_dev and device_xnamecegger
2007-12-03Interrupt handling changes, in discussion since February:ad
2007-10-19machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.had
2006-10-15Add missing initializermartin
2006-05-14integrate kauth.elad
2006-03-29Use device_private().thorpej
2005-12-11merge ktrace-lwp.christos
2005-02-27nuke trailing whitespaceperry
2005-01-11ansify and KNFkent
2005-01-11fix compilation errorskent
2005-01-10merge kent-audio1 branch, which introduces audio filter pipeline to the MIkent
2004-10-29constify audio_hw_if, midi_hw_if, and radio_hw_if.yamt
2003-09-10Use EBDMA_BURST_SIZE_16. Introduce EBus specific round_blocksize touwe
2003-07-14add missing __KERNEL_RCSID()lukem
2003-05-03DMA, not dma nor Dma.wiz
2002-12-10Remove the `flags' argument from bus_intr_establish().pk
2002-10-02Add trailing ; to CFATTACH_DECL.thorpej
2002-09-30Use CFATTACH_DECL().thorpej
2002-09-27Declare all cfattach structures const.thorpej
2002-04-04Prettify error message.uwe
2002-03-22Fix some handle/tag confusion. This makes it compile on sparc64 again.martin
2002-03-21Do not even bother trying to use the mappings provided by the PROM.eeh
2002-03-21Remove struct ebus_dmac_reg to discourage indiscriminate usage ofuwe
2002-03-21Drop BUS_SPACE_MAP_LINEAR and properly bus_space_*-ify this so that ituwe
2002-03-12Fix whitespace nits (oops).uwe
2002-03-12Rework the driver to add EBus DMA support and improve APC DMA support.uwe
2002-03-12Drop ebus_bus_map(), use plain bus_space_map() instead.uwe
2002-03-01Remove EBUS_PADDR_FROM_REG, as it does not realy creates a paddr on sparc.martin
2002-02-18Shared ebusvar.h for sparc and sparc64.uwe
2002-02-18Add DMA definitions.uwe
2001-09-07make this "MI"; nothing different between this and the SPARC version.mrg