From b966da31ff8ab205add7db90f1ae0aa3f12df58f Mon Sep 17 00:00:00 2001 From: pjd Date: Sun, 4 Jun 2006 15:10:12 +0000 Subject: Move COPYDATA() and COPYBACK() macros to cryptodev.h, they will be used in padlock(4) as well. --- sys/opencrypto/cryptodev.h | 27 +++++++++++++++++++++++++++ sys/opencrypto/cryptosoft.c | 27 --------------------------- 2 files changed, 27 insertions(+), 27 deletions(-) (limited to 'sys/opencrypto') diff --git a/sys/opencrypto/cryptodev.h b/sys/opencrypto/cryptodev.h index fdd86e9..f106ef5 100644 --- a/sys/opencrypto/cryptodev.h +++ b/sys/opencrypto/cryptodev.h @@ -413,5 +413,32 @@ extern void cuio_copyback(struct uio* uio, int off, int len, caddr_t cp); extern struct iovec *cuio_getptr(struct uio *uio, int loc, int *off); extern int cuio_apply(struct uio *uio, int off, int len, int (*f)(void *, void *, u_int), void *arg); +struct mbuf; +#define COPYBACK(type, buf, off, size, in) do { \ + switch (type) { \ + case CRYPTO_BUF_CONTIG: \ + bcopy(in, (u_char *)(buf) + (off), size); \ + break; \ + case CRYPTO_BUF_MBUF: \ + m_copyback((struct mbuf *)(buf), off, size, in); \ + break; \ + case CRYPTO_BUF_IOV: \ + cuio_copyback((struct uio *)(buf), off, size, in); \ + break; \ + } \ +} while (0) +#define COPYDATA(type, buf, off, size, out) do { \ + switch (type) { \ + case CRYPTO_BUF_CONTIG: \ + bcopy((u_char *)(buf) + (off), out, size); \ + break; \ + case CRYPTO_BUF_MBUF: \ + m_copydata((struct mbuf *)(buf), off, size, out); \ + break; \ + case CRYPTO_BUF_IOV: \ + cuio_copydata((struct uio *)(buf), off, size, out); \ + break; \ + } \ +} while (0) #endif /* _KERNEL */ #endif /* _CRYPTO_CRYPTO_H_ */ diff --git a/sys/opencrypto/cryptosoft.c b/sys/opencrypto/cryptosoft.c index 2dfcf76..4a9640a 100644 --- a/sys/opencrypto/cryptosoft.c +++ b/sys/opencrypto/cryptosoft.c @@ -52,33 +52,6 @@ struct swcr_data **swcr_sessions = NULL; u_int32_t swcr_sesnum = 0; int32_t swcr_id = -1; -#define COPYBACK(type, buf, off, size, in) do { \ - switch (type) { \ - case CRYPTO_BUF_CONTIG: \ - bcopy(in, (u_char *)(buf) + (off), size); \ - break; \ - case CRYPTO_BUF_MBUF: \ - m_copyback((struct mbuf *)(buf), off, size, in); \ - break; \ - case CRYPTO_BUF_IOV: \ - cuio_copyback((struct uio *)(buf), off, size, in); \ - break; \ - } \ -} while (0) -#define COPYDATA(type, buf, off, size, out) do { \ - switch (type) { \ - case CRYPTO_BUF_CONTIG: \ - bcopy((u_char *)(buf) + (off), out, size); \ - break; \ - case CRYPTO_BUF_MBUF: \ - m_copydata((struct mbuf *)(buf), off, size, out); \ - break; \ - case CRYPTO_BUF_IOV: \ - cuio_copydata((struct uio *)(buf), off, size, out); \ - break; \ - } \ -} while (0) - static int swcr_encdec(struct cryptodesc *, struct swcr_data *, caddr_t, int); static int swcr_authcompute(struct cryptodesc *crd, struct swcr_data *sw, caddr_t buf, int outtype); -- cgit v1.1