Deleted Added
full compact
cam_periph.c (109572) cam_periph.c (109623)
1/*
2 * Common functions for CAM "type" (peripheral) drivers.
3 *
4 * Copyright (c) 1997, 1998 Justin T. Gibbs.
5 * Copyright (c) 1997, 1998, 1999, 2000 Kenneth D. Merry.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 12 unchanged lines hidden (view full) ---

21 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
1/*
2 * Common functions for CAM "type" (peripheral) drivers.
3 *
4 * Copyright (c) 1997, 1998 Justin T. Gibbs.
5 * Copyright (c) 1997, 1998, 1999, 2000 Kenneth D. Merry.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 12 unchanged lines hidden (view full) ---

21 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * $FreeBSD: head/sys/cam/cam_periph.c 109572 2003-01-20 17:46:48Z dillon $
29 * $FreeBSD: head/sys/cam/cam_periph.c 109623 2003-01-21 08:56:16Z alfred $
30 */
31
32#include <sys/param.h>
33#include <sys/systm.h>
34#include <sys/types.h>
35#include <sys/malloc.h>
36#include <sys/linker_set.h>
37#include <sys/bio.h>

--- 46 unchanged lines hidden (view full) ---

84
85void
86periphdriver_register(void *data)
87{
88 struct periph_driver **newdrivers, **old;
89 int ndrivers;
90
91 ndrivers = nperiph_drivers + 2;
30 */
31
32#include <sys/param.h>
33#include <sys/systm.h>
34#include <sys/types.h>
35#include <sys/malloc.h>
36#include <sys/linker_set.h>
37#include <sys/bio.h>

--- 46 unchanged lines hidden (view full) ---

84
85void
86periphdriver_register(void *data)
87{
88 struct periph_driver **newdrivers, **old;
89 int ndrivers;
90
91 ndrivers = nperiph_drivers + 2;
92 newdrivers = malloc(sizeof(*newdrivers) * ndrivers, M_TEMP, M_WAITOK);
92 newdrivers = malloc(sizeof(*newdrivers) * ndrivers, M_TEMP, 0);
93 if (periph_drivers)
94 bcopy(periph_drivers, newdrivers,
95 sizeof(*newdrivers) * nperiph_drivers);
96 newdrivers[nperiph_drivers] = (struct periph_driver *)data;
97 newdrivers[nperiph_drivers + 1] = NULL;
98 old = periph_drivers;
99 periph_drivers = newdrivers;
100 if (old)

--- 1645 unchanged lines hidden ---
93 if (periph_drivers)
94 bcopy(periph_drivers, newdrivers,
95 sizeof(*newdrivers) * nperiph_drivers);
96 newdrivers[nperiph_drivers] = (struct periph_driver *)data;
97 newdrivers[nperiph_drivers + 1] = NULL;
98 old = periph_drivers;
99 periph_drivers = newdrivers;
100 if (old)

--- 1645 unchanged lines hidden ---