| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: netbsd32_ioctl.c,v 1.52 2011/01/18 19:52:24 matt Exp $ */ | | 1 | /* $NetBSD: netbsd32_ioctl.c,v 1.53 2011/01/22 20:51:21 matt Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 1998, 2001 Matthew R. Green | | 4 | * Copyright (c) 1998, 2001 Matthew R. Green |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * Redistribution and use in source and binary forms, with or without | | 7 | * Redistribution and use in source and binary forms, with or without |
8 | * modification, are permitted provided that the following conditions | | 8 | * modification, are permitted provided that the following conditions |
9 | * are met: | | 9 | * are met: |
10 | * 1. Redistributions of source code must retain the above copyright | | 10 | * 1. Redistributions of source code must retain the above copyright |
11 | * notice, this list of conditions and the following disclaimer. | | 11 | * notice, this list of conditions and the following disclaimer. |
12 | * 2. Redistributions in binary form must reproduce the above copyright | | 12 | * 2. Redistributions in binary form must reproduce the above copyright |
13 | * notice, this list of conditions and the following disclaimer in the | | 13 | * notice, this list of conditions and the following disclaimer in the |
14 | * documentation and/or other materials provided with the distribution. | | 14 | * documentation and/or other materials provided with the distribution. |
| @@ -21,27 +21,27 @@ | | | @@ -21,27 +21,27 @@ |
21 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | | 21 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED | | 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED |
23 | * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | | 23 | * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | | 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
25 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | | 25 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
26 | * SUCH DAMAGE. | | 26 | * SUCH DAMAGE. |
27 | */ | | 27 | */ |
28 | | | 28 | |
29 | /* | | 29 | /* |
30 | * handle ioctl conversions from netbsd32 -> 64-bit kernel | | 30 | * handle ioctl conversions from netbsd32 -> 64-bit kernel |
31 | */ | | 31 | */ |
32 | | | 32 | |
33 | #include <sys/cdefs.h> | | 33 | #include <sys/cdefs.h> |
34 | __KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.52 2011/01/18 19:52:24 matt Exp $"); | | 34 | __KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.53 2011/01/22 20:51:21 matt Exp $"); |
35 | | | 35 | |
36 | #include <sys/param.h> | | 36 | #include <sys/param.h> |
37 | #include <sys/systm.h> | | 37 | #include <sys/systm.h> |
38 | #include <sys/filedesc.h> | | 38 | #include <sys/filedesc.h> |
39 | #include <sys/ioctl.h> | | 39 | #include <sys/ioctl.h> |
40 | #include <sys/file.h> | | 40 | #include <sys/file.h> |
41 | #include <sys/proc.h> | | 41 | #include <sys/proc.h> |
42 | #include <sys/socketvar.h> | | 42 | #include <sys/socketvar.h> |
43 | #include <sys/audioio.h> | | 43 | #include <sys/audioio.h> |
44 | #include <sys/disklabel.h> | | 44 | #include <sys/disklabel.h> |
45 | #include <sys/dkio.h> | | 45 | #include <sys/dkio.h> |
46 | #include <sys/sockio.h> | | 46 | #include <sys/sockio.h> |
47 | #include <sys/socket.h> | | 47 | #include <sys/socket.h> |
| @@ -730,17 +730,17 @@ netbsd32_ioctl(struct lwp *l, const stru | | | @@ -730,17 +730,17 @@ netbsd32_ioctl(struct lwp *l, const stru |
730 | * already set and checked above. | | 730 | * already set and checked above. |
731 | */ | | 731 | */ |
732 | if (error == 0 && (com&IOC_OUT) && size32) { | | 732 | if (error == 0 && (com&IOC_OUT) && size32) { |
733 | error = copyout(data32, SCARG_P32(uap, data), size32); | | 733 | error = copyout(data32, SCARG_P32(uap, data), size32); |
734 | ktrgenio(fd, UIO_READ, SCARG_P32(uap, data), | | 734 | ktrgenio(fd, UIO_READ, SCARG_P32(uap, data), |
735 | size32, error); | | 735 | size32, error); |
736 | } | | 736 | } |
737 | | | 737 | |
738 | out: | | 738 | out: |
739 | /* If we allocated data, free it here. */ | | 739 | /* If we allocated data, free it here. */ |
740 | if (memp32) | | 740 | if (memp32) |
741 | kmem_free(memp32, alloc_size32); | | 741 | kmem_free(memp32, alloc_size32); |
742 | if (memp) | | 742 | if (memp) |
743 | kmem_free(memp32, size); | | 743 | kmem_free(memp, size); |
744 | fd_putfile(fd); | | 744 | fd_putfile(fd); |
745 | return (error); | | 745 | return (error); |
746 | } | | 746 | } |