summaryrefslogtreecommitdiff
path: root/sys/arch/sparc
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2014-07-12 18:44:44 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2014-07-12 18:44:44 +0000
commit48b6cac396e42c57b5037f5a67d6cd7afb1733d6 (patch)
tree29d721c60c102e5fb6ed78e8ad45bbda321c951f /sys/arch/sparc
parenta29a93ecbd0d69878182d5959b330ae5badcadc7 (diff)
add a size argument to free. will be used soon, but for now default to 0.
after discussions with beck deraadt kettenis.
Diffstat (limited to 'sys/arch/sparc')
-rw-r--r--sys/arch/sparc/dev/cs4231.c6
-rw-r--r--sys/arch/sparc/dev/fd.c6
-rw-r--r--sys/arch/sparc/dev/magma.c4
-rw-r--r--sys/arch/sparc/sparc/autoconf.c4
-rw-r--r--sys/arch/sparc/sparc/clock.c4
-rw-r--r--sys/arch/sparc/sparc/intr.c4
-rw-r--r--sys/arch/sparc/sparc/machdep.c8
-rw-r--r--sys/arch/sparc/sparc/openprom.c6
-rw-r--r--sys/arch/sparc/sparc/pmap.c26
-rw-r--r--sys/arch/sparc/sparc/vm_machdep.c8
-rw-r--r--sys/arch/sparc/stand/common/dvma.c6
-rw-r--r--sys/arch/sparc/stand/installboot/installboot.c10
-rw-r--r--sys/arch/sparc/stand/installboot/nlist.c4
13 files changed, 48 insertions, 48 deletions
diff --git a/sys/arch/sparc/dev/cs4231.c b/sys/arch/sparc/dev/cs4231.c
index 046e626684a..0f5ab7d281a 100644
--- a/sys/arch/sparc/dev/cs4231.c
+++ b/sys/arch/sparc/dev/cs4231.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cs4231.c,v 1.31 2013/05/15 21:19:45 ratchov Exp $ */
+/* $OpenBSD: cs4231.c,v 1.32 2014/07/12 18:44:42 tedu Exp $ */
/*
* Copyright (c) 1999 Jason L. Wright (jason@thought.net)
@@ -1461,7 +1461,7 @@ cs4231_alloc(addr, direction, size, pool, flags)
p->addr_dva = dvma_malloc(size, &p->addr, flags);
if (p->addr_dva == NULL) {
- free(p, pool);
+ free(p, pool, 0);
return (NULL);
}
@@ -1485,7 +1485,7 @@ cs4231_free(addr, ptr, pool)
continue;
dvma_free(p->addr_dva, p->size, &p->addr);
*pp = p->next;
- free(p, pool);
+ free(p, pool, 0);
return;
}
printf("%s: attempt to free rogue pointer\n", sc->sc_dev.dv_xname);
diff --git a/sys/arch/sparc/dev/fd.c b/sys/arch/sparc/dev/fd.c
index 2112db9059b..f47931cb127 100644
--- a/sys/arch/sparc/dev/fd.c
+++ b/sys/arch/sparc/dev/fd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fd.c,v 1.89 2013/11/26 15:42:43 martin Exp $ */
+/* $OpenBSD: fd.c,v 1.90 2014/07/12 18:44:43 tedu Exp $ */
/* $NetBSD: fd.c,v 1.51 1997/05/24 20:16:19 pk Exp $ */
/*-
@@ -1766,7 +1766,7 @@ fdioctl(dev, cmd, addr, flag, p)
lp = malloc(sizeof(*lp), M_TEMP, M_WAITOK);
fdgetdisklabel(dev, fd, lp, 0);
bcopy(lp, fd->sc_dk.dk_label, sizeof(*lp));
- free(lp, M_TEMP);
+ free(lp, M_TEMP, 0);
return 0;
case DIOCGPDINFO:
@@ -1938,7 +1938,7 @@ fdformat(dev, finfo, p)
/* ...and wait for it to complete */
rv = biowait(bp);
- free(bp, M_TEMP);
+ free(bp, M_TEMP, 0);
return (rv);
}
diff --git a/sys/arch/sparc/dev/magma.c b/sys/arch/sparc/dev/magma.c
index 50be93a3f9b..dd09f1b8a0e 100644
--- a/sys/arch/sparc/dev/magma.c
+++ b/sys/arch/sparc/dev/magma.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: magma.c,v 1.27 2010/07/02 17:27:01 nicm Exp $ */
+/* $OpenBSD: magma.c,v 1.28 2014/07/12 18:44:43 tedu Exp $ */
/*-
* Copyright (c) 1998 Iain Hibbert
@@ -1754,7 +1754,7 @@ again: /* goto bad */
uio->uio_resid += (len - cnt);
}
- free(buffer, M_DEVBUF);
+ free(buffer, M_DEVBUF, 0);
return (error);
}
diff --git a/sys/arch/sparc/sparc/autoconf.c b/sys/arch/sparc/sparc/autoconf.c
index 4ba613d5750..5a6b80a7c0d 100644
--- a/sys/arch/sparc/sparc/autoconf.c
+++ b/sys/arch/sparc/sparc/autoconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: autoconf.c,v 1.94 2014/05/09 20:15:06 miod Exp $ */
+/* $OpenBSD: autoconf.c,v 1.95 2014/07/12 18:44:43 tedu Exp $ */
/* $NetBSD: autoconf.c,v 1.73 1997/07/29 09:41:53 fair Exp $ */
/*
@@ -1039,7 +1039,7 @@ romprop(rp, cp, node)
rp->ra_intr[n].int_vec = 0;
};
len *= sizeof(struct rom_intr);
- free(interrupts, M_TEMP);
+ free(interrupts, M_TEMP, 0);
} else
len = 0;
}
diff --git a/sys/arch/sparc/sparc/clock.c b/sys/arch/sparc/sparc/clock.c
index bf596958c5a..befc549d698 100644
--- a/sys/arch/sparc/sparc/clock.c
+++ b/sys/arch/sparc/sparc/clock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: clock.c,v 1.28 2013/07/05 20:30:56 guenther Exp $ */
+/* $OpenBSD: clock.c,v 1.29 2014/07/12 18:44:43 tedu Exp $ */
/* $NetBSD: clock.c,v 1.52 1997/05/24 20:16:05 pk Exp $ */
/*
@@ -1126,7 +1126,7 @@ eeprom_uio(uio)
out:
if (buf)
- free(buf, M_DEVBUF);
+ free(buf, M_DEVBUF, 0);
eeprom_give();
return (error);
#else /* ! SUN4 */
diff --git a/sys/arch/sparc/sparc/intr.c b/sys/arch/sparc/sparc/intr.c
index 934b3db70dc..d06cdc9d71b 100644
--- a/sys/arch/sparc/sparc/intr.c
+++ b/sys/arch/sparc/sparc/intr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intr.c,v 1.38 2012/11/05 13:20:16 miod Exp $ */
+/* $OpenBSD: intr.c,v 1.39 2014/07/12 18:44:43 tedu Exp $ */
/* $NetBSD: intr.c,v 1.20 1997/07/29 09:42:03 fair Exp $ */
/*
@@ -416,7 +416,7 @@ softintr_disestablish(void *arg)
struct sintrhand *sih = (struct sintrhand *)arg;
ih_remove(&sintrhand[sih->sih_ipl], &sih->sih_ih);
- free(sih, M_DEVBUF);
+ free(sih, M_DEVBUF, 0);
}
void *
diff --git a/sys/arch/sparc/sparc/machdep.c b/sys/arch/sparc/sparc/machdep.c
index 25df437a34b..75103fc5206 100644
--- a/sys/arch/sparc/sparc/machdep.c
+++ b/sys/arch/sparc/sparc/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.160 2014/07/11 22:28:06 uebayasi Exp $ */
+/* $OpenBSD: machdep.c,v 1.161 2014/07/12 18:44:43 tedu Exp $ */
/* $NetBSD: machdep.c,v 1.85 1997/09/12 08:55:02 pk Exp $ */
/*
@@ -264,7 +264,7 @@ setregs(p, pack, stack, retval)
savefpstate(fs);
cpuinfo.fpproc = NULL;
}
- free((void *)fs, M_SUBPROC);
+ free((void *)fs, M_SUBPROC, 0);
p->p_md.md_fpstate = NULL;
}
bzero((caddr_t)tf, sizeof *tf);
@@ -969,7 +969,7 @@ _bus_dmamap_create(bus_dma_tag_t t, bus_size_t size, int nsegments,
void
_bus_dmamap_destroy(bus_dma_tag_t t, bus_dmamap_t map)
{
- free(map, M_DEVBUF);
+ free(map, M_DEVBUF, 0);
}
/*
@@ -1083,7 +1083,7 @@ _bus_dmamem_free(bus_dma_tag_t t, bus_dma_segment_t *segs, int nsegs)
* Return the list of pages back to the VM system.
*/
uvm_pglistfree(segs[0]._ds_mlist);
- free(segs[0]._ds_mlist, M_DEVBUF);
+ free(segs[0]._ds_mlist, M_DEVBUF, 0);
}
/*
diff --git a/sys/arch/sparc/sparc/openprom.c b/sys/arch/sparc/sparc/openprom.c
index 1aa16d4ce30..7f55c20303d 100644
--- a/sys/arch/sparc/sparc/openprom.c
+++ b/sys/arch/sparc/sparc/openprom.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: openprom.c,v 1.5 2003/06/02 23:27:55 millert Exp $ */
+/* $OpenBSD: openprom.c,v 1.6 2014/07/12 18:44:43 tedu Exp $ */
/* $NetBSD: openprom.c,v 1.8 1996/03/31 23:45:34 pk Exp $ */
/*
@@ -246,9 +246,9 @@ openpromioctl(dev, cmd, data, flags, p)
}
if (name)
- free(name, M_TEMP);
+ free(name, M_TEMP, 0);
if (value)
- free(value, M_TEMP);
+ free(value, M_TEMP, 0);
return (error);
}
diff --git a/sys/arch/sparc/sparc/pmap.c b/sys/arch/sparc/sparc/pmap.c
index 9e3a5eba96c..9d35e0a6fae 100644
--- a/sys/arch/sparc/sparc/pmap.c
+++ b/sys/arch/sparc/sparc/pmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.c,v 1.164 2014/04/08 13:23:51 mpi Exp $ */
+/* $OpenBSD: pmap.c,v 1.165 2014/07/12 18:44:43 tedu Exp $ */
/* $NetBSD: pmap.c,v 1.118 1998/05/19 19:00:18 thorpej Exp $ */
/*
@@ -3633,7 +3633,7 @@ pmap_destroy(pm)
simple_unlock(&pm->pm_lock);
if (count == 0) {
pmap_release(pm);
- free(pm, M_VMPMAP);
+ free(pm, M_VMPMAP, 0);
}
}
@@ -3695,7 +3695,7 @@ if (pmapdebug) {
}
#endif
if (pm->pm_regstore)
- free(pm->pm_regstore, M_VMPMAP);
+ free(pm->pm_regstore, M_VMPMAP, 0);
#if defined(SUN4M)
if (CPU_ISSUN4M) {
@@ -4091,10 +4091,10 @@ pmap_rmu4_4c(pm, va, endva, vr, vs)
pm->pm_stats.resident_count--;
}
if ((sp->sg_npte = nleft) == 0) {
- free(pte0, M_VMPMAP);
+ free(pte0, M_VMPMAP, 0);
sp->sg_pte = NULL;
if (--rp->rg_nsegmap == 0) {
- free(rp->rg_segmap, M_VMPMAP);
+ free(rp->rg_segmap, M_VMPMAP, 0);
rp->rg_segmap = NULL;
#if defined(SUN4_MMU3L)
if (HASSUN4_MMU3L && rp->rg_smeg != reginval) {
@@ -4175,12 +4175,12 @@ if (pm->pm_ctx == NULL) {
setregmap(0, rp->rg_smeg);
setsegmap(vs << SGSHIFT, seginval);
}
- free(pte0, M_VMPMAP);
+ free(pte0, M_VMPMAP, 0);
sp->sg_pte = NULL;
me_free(pm, pmeg);
if (--rp->rg_nsegmap == 0) {
- free(rp->rg_segmap, M_VMPMAP);
+ free(rp->rg_segmap, M_VMPMAP, 0);
rp->rg_segmap = NULL;
GAP_WIDEN(pm,vr);
@@ -4301,7 +4301,7 @@ pmap_rmu4m(pm, va, endva, vr, vs)
if (pm->pm_ctx)
tlb_flush_context(); /* Paranoia? */
setpgt4m(&pm->pm_reg_ptps[vr], SRMMU_TEINVALID);
- free(rp->rg_segmap, M_VMPMAP);
+ free(rp->rg_segmap, M_VMPMAP, 0);
rp->rg_segmap = NULL;
pool_put(&L23_pool, rp->rg_seg_ptps);
}
@@ -4382,10 +4382,10 @@ pmap_page_protect4_4c(struct vm_page *pg, vm_prot_t prot)
if (nleft) {
sp->sg_pte[VA_VPG(va)] = 0;
} else {
- free(sp->sg_pte, M_VMPMAP);
+ free(sp->sg_pte, M_VMPMAP, 0);
sp->sg_pte = NULL;
if (--rp->rg_nsegmap == 0) {
- free(rp->rg_segmap, M_VMPMAP);
+ free(rp->rg_segmap, M_VMPMAP, 0);
rp->rg_segmap = NULL;
GAP_WIDEN(pm,vr);
#if defined(SUN4_MMU3L)
@@ -4464,7 +4464,7 @@ pmap_page_protect4_4c(struct vm_page *pg, vm_prot_t prot)
setsegmap(vs << SGSHIFT, seginval);
}
#endif
- free(sp->sg_pte, M_VMPMAP);
+ free(sp->sg_pte, M_VMPMAP, 0);
sp->sg_pte = NULL;
me_free(pm, sp->sg_pmeg);
@@ -4477,7 +4477,7 @@ pmap_page_protect4_4c(struct vm_page *pg, vm_prot_t prot)
region_free(pm, rp->rg_smeg);
}
#endif
- free(rp->rg_segmap, M_VMPMAP);
+ free(rp->rg_segmap, M_VMPMAP, 0);
rp->rg_segmap = NULL;
GAP_WIDEN(pm,vr);
}
@@ -4805,7 +4805,7 @@ pmap_page_protect4m(struct vm_page *pg, vm_prot_t prot)
if (pm->pm_ctx)
tlb_flush_context();
setpgt4m(&pm->pm_reg_ptps[vr], SRMMU_TEINVALID);
- free(rp->rg_segmap, M_VMPMAP);
+ free(rp->rg_segmap, M_VMPMAP, 0);
rp->rg_segmap = NULL;
pool_put(&L23_pool, rp->rg_seg_ptps);
}
diff --git a/sys/arch/sparc/sparc/vm_machdep.c b/sys/arch/sparc/sparc/vm_machdep.c
index 410e829610c..9e933403d2c 100644
--- a/sys/arch/sparc/sparc/vm_machdep.c
+++ b/sys/arch/sparc/sparc/vm_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vm_machdep.c,v 1.56 2013/01/16 19:04:43 miod Exp $ */
+/* $OpenBSD: vm_machdep.c,v 1.57 2014/07/12 18:44:43 tedu Exp $ */
/* $NetBSD: vm_machdep.c,v 1.30 1997/03/10 23:55:40 pk Exp $ */
/*
@@ -107,7 +107,7 @@ dvma_malloc_space(len, kaddr, flags, space)
*(vaddr_t *)kaddr = kva;
dva = dvma_mapin_space(kernel_map, kva, len, (flags & M_NOWAIT) ? 0 : 1, space);
if (dva == 0) {
- free((void *)kva, M_DEVBUF);
+ free((void *)kva, M_DEVBUF, 0);
return (NULL);
}
return (caddr_t)dva;
@@ -133,7 +133,7 @@ dvma_free(dva, len, kaddr)
if (!has_iocache)
#endif
kvm_recache(kaddr, atop(len));
- free((void *)kva, M_DEVBUF);
+ free((void *)kva, M_DEVBUF, 0);
}
u_long dvma_cachealign = 0;
@@ -468,7 +468,7 @@ cpu_exit(p)
savefpstate(fs);
cpuinfo.fpproc = NULL;
}
- free((void *)fs, M_SUBPROC);
+ free((void *)fs, M_SUBPROC, 0);
}
pmap_deactivate(p);
diff --git a/sys/arch/sparc/stand/common/dvma.c b/sys/arch/sparc/stand/common/dvma.c
index bfb361057e9..0703791b693 100644
--- a/sys/arch/sparc/stand/common/dvma.c
+++ b/sys/arch/sparc/stand/common/dvma.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dvma.c,v 1.5 2011/04/14 18:27:49 miod Exp $ */
+/* $OpenBSD: dvma.c,v 1.6 2014/07/12 18:44:43 tedu Exp $ */
/* $NetBSD: dvma.c,v 1.2 1995/09/17 00:50:56 pk Exp $ */
/*
* Copyright (c) 1995 Gordon W. Ross
@@ -135,7 +135,7 @@ dvma_alloc(int len)
return (dvma_mapin(mem, len));
}
-extern void free(void *ptr, int len);
+extern void free(void *ptr, int len, 0);
void
dvma_free(char *dvma, int len)
{
@@ -143,5 +143,5 @@ dvma_free(char *dvma, int len)
mem = dvma_mapout(dvma, len);
if (mem)
- free(mem, len);
+ free(mem, len, 0);
}
diff --git a/sys/arch/sparc/stand/installboot/installboot.c b/sys/arch/sparc/stand/installboot/installboot.c
index 3e09bcbe779..0409685f3cd 100644
--- a/sys/arch/sparc/stand/installboot/installboot.c
+++ b/sys/arch/sparc/stand/installboot/installboot.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: installboot.c,v 1.8 2013/09/29 21:30:50 jmc Exp $ */
+/* $OpenBSD: installboot.c,v 1.9 2014/07/12 18:44:43 tedu Exp $ */
/* $NetBSD: installboot.c,v 1.1 1997/06/01 03:39:45 mrg Exp $ */
/*
@@ -251,7 +251,7 @@ loadprotoblocks(fname, size)
}
if (read(fd, bp, statbuf.st_size) != statbuf.st_size) {
warn("read: %s", fname);
- free(bp);
+ free(bp, 0);
close(fd);
return NULL;
}
@@ -269,21 +269,21 @@ loadprotoblocks(fname, size)
if ((int)block_table & 3) {
warn("%s: invalid address: block_table = %x",
fname, block_table);
- free(bp);
+ free(bp, 0);
close(fd);
return NULL;
}
if ((int)block_count_p & 3) {
warn("%s: invalid address: block_count_p = %x",
fname, block_count_p);
- free(bp);
+ free(bp, 0);
close(fd);
return NULL;
}
if ((int)block_size_p & 3) {
warn("%s: invalid address: block_size_p = %x",
fname, block_size_p);
- free(bp);
+ free(bp, 0);
close(fd);
return NULL;
}
diff --git a/sys/arch/sparc/stand/installboot/nlist.c b/sys/arch/sparc/stand/installboot/nlist.c
index 26b71dc5607..0b4b2d7ca47 100644
--- a/sys/arch/sparc/stand/installboot/nlist.c
+++ b/sys/arch/sparc/stand/installboot/nlist.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nlist.c,v 1.1 2013/10/30 18:04:47 deraadt Exp $ */
+/* $OpenBSD: nlist.c,v 1.2 2014/07/12 18:44:43 tedu Exp $ */
/*
* Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
@@ -137,7 +137,7 @@ __aout_fdnlist(int fd, struct nlist *list)
}
aout_done:
if (usemalloc)
- free(strtab);
+ free(strtab, 0);
else
munmap(strtab, strsize);
return (nent);