diff options
author | Jason Wright <jason@cvs.openbsd.org> | 2002-01-29 15:48:30 +0000 |
---|---|---|
committer | Jason Wright <jason@cvs.openbsd.org> | 2002-01-29 15:48:30 +0000 |
commit | 7b5ea35a544a1fb201e256a8cfdc2147dc14607b (patch) | |
tree | 9318d908f1b8882ca535ad94f28d91fd62ebd247 /sys | |
parent | 52b1aac8497d030be6a8e0f25a3072889df73fe9 (diff) |
Remove the iov2pages/mbuf2pages API... All of the relevant arch's support
bus_dma(9) which actually does this job correctly.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/conf/files | 3 | ||||
-rw-r--r-- | sys/crypto/criov.c | 62 | ||||
-rw-r--r-- | sys/crypto/cryptodev.h | 5 | ||||
-rw-r--r-- | sys/crypto/cryptombuf.c | 98 |
4 files changed, 3 insertions, 165 deletions
diff --git a/sys/conf/files b/sys/conf/files index ba36121aed3..d2c3ef68a9d 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -1,4 +1,4 @@ -# $OpenBSD: files,v 1.236 2002/01/24 22:38:02 mickey Exp $ +# $OpenBSD: files,v 1.237 2002/01/29 15:48:29 jason Exp $ # $NetBSD: files,v 1.87 1996/05/19 17:17:50 jonathan Exp $ # @(#)files.newconf 7.5 (Berkeley) 5/10/93 @@ -674,7 +674,6 @@ file crypto/crypto.c (inet & ipsec) | crypto file crypto/cryptodev.c ((inet & ipsec) | crypto) needs-flag file crypto/criov.c (inet & ipsec) | crypto file crypto/cryptosoft.c (inet & ipsec) | crypto -file crypto/cryptombuf.c (inet & ipsec) | crypto file crypto/xform.c (inet & ipsec) | crypto file crypto/deflate.c (inet & ipsec) | crypto file netatalk/aarp.c netatalk diff --git a/sys/crypto/criov.c b/sys/crypto/criov.c index 9088aee375b..f9fb59f7386 100644 --- a/sys/crypto/criov.c +++ b/sys/crypto/criov.c @@ -1,4 +1,4 @@ -/* $OpenBSD: criov.c,v 1.8 2001/11/06 19:53:18 miod Exp $ */ +/* $OpenBSD: criov.c,v 1.9 2002/01/29 15:48:29 jason Exp $ */ /* * Copyright (c) 1999 Theo de Raadt @@ -39,66 +39,6 @@ #include <crypto/cryptodev.h> -int -iov2pages(uio, np, pp, lp, maxp, nicep) - struct uio *uio; - int *np; - long *pp; - int *lp; - int maxp; - int *nicep; -{ - int npa = 0, tlen = 0; - int i; - - for (i = 0; i < uio->uio_iovcnt; i++) { - vaddr_t va, off; - paddr_t pa; - int len; - - if ((len = uio->uio_iov[i].iov_len) == 0) - continue; - tlen += len; - va = (vaddr_t)uio->uio_iov[i].iov_base; - off = va & PAGE_MASK; - va -= off; - -next_page: - - if (pmap_extract(pmap_kernel(), va, &pa) == FALSE) - panic("iov2pages: unmapped pages"); - - pa += off; - - lp[npa] = len; - pp[npa] = pa; - - if (++npa > maxp) - return (0); - - if (len + off > PAGE_SIZE) { - lp[npa - 1] = PAGE_SIZE - off; - va += PAGE_SIZE; - len -= PAGE_SIZE; - goto next_page; - } - } - - if (nicep) { - int nice = 1; - int i; - - /* see if each [pa,len] entry is long-word aligned */ - for (i = 0; i < npa; i++) - if ((lp[i] & 3) || (pp[i] & 3)) - nice = 0; - *nicep = nice; - } - - *np = npa; - return (tlen); -} - void cuio_copydata(uio, off, len, cp) struct uio *uio; diff --git a/sys/crypto/cryptodev.h b/sys/crypto/cryptodev.h index 62c0534783e..b3782013e0a 100644 --- a/sys/crypto/cryptodev.h +++ b/sys/crypto/cryptodev.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cryptodev.h,v 1.15 2001/11/09 03:11:38 deraadt Exp $ */ +/* $OpenBSD: cryptodev.h,v 1.16 2002/01/29 15:48:29 jason Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu) @@ -370,9 +370,6 @@ int crypto_invoke(struct cryptop *); void crypto_done(struct cryptop *); int crypto_check_alg(struct cryptoini *); -struct mbuf; -int mbuf2pages __P((struct mbuf *, int *, long *, int *, int, int *)); -int iov2pages __P((struct uio *, int *, long *, int *, int, int *)); void cuio_copydata __P((struct uio *, int, int, caddr_t)); void cuio_copyback __P((struct uio *, int, int, caddr_t)); diff --git a/sys/crypto/cryptombuf.c b/sys/crypto/cryptombuf.c deleted file mode 100644 index 4e39757cd02..00000000000 --- a/sys/crypto/cryptombuf.c +++ /dev/null @@ -1,98 +0,0 @@ -/* $OpenBSD: cryptombuf.c,v 1.5 2001/11/06 19:53:18 miod Exp $ */ - -/* - * Copyright (c) 1999 Theo de Raadt - * - * 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. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 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 <sys/param.h> -#include <sys/systm.h> -#include <sys/proc.h> -#include <sys/errno.h> -#include <sys/malloc.h> -#include <sys/kernel.h> -#include <sys/mbuf.h> - -#include <uvm/uvm_extern.h> - -#include <crypto/cryptodev.h> - -int -mbuf2pages(m, np, pp, lp, maxp, nicep) - struct mbuf *m; - int *np; - long *pp; - int *lp; - int maxp; - int *nicep; -{ - int npa = 0, tlen = 0; - - for (; m != NULL; m = m->m_next) { - vaddr_t va, off; - paddr_t pa; - int len; - - if ((len = m->m_len) == 0) - continue; - tlen += len; - va = (vaddr_t)m->m_data; - off = va & PAGE_MASK; - va -= off; - -next_page: - if (pmap_extract(pmap_kernel(), va, &pa) == FALSE) - panic("mbuf2pages: page not mapped"); - - pa += off; - - lp[npa] = len; - pp[npa] = pa; - - if (++npa > maxp) - return (0); - - if (len + off > PAGE_SIZE) { - lp[npa - 1] = PAGE_SIZE - off; - va += PAGE_SIZE; - len -= PAGE_SIZE; - goto next_page; - } - } - - if (nicep) { - int nice = 1; - int i; - - /* see if each [pa,len] entry is long-word aligned */ - for (i = 0; i < npa; i++) - if ((lp[i] & 3) || (pp[i] & 3)) - nice = 0; - *nicep = nice; - } - - *np = npa; - return (tlen); -} |