Deleted Added
full compact
linux_ioctl.c (346812) linux_ioctl.c (346816)
1/*-
2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3 *
4 * Copyright (c) 1994-1995 S��ren Schmidt
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

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

24 * LIABILITY, 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
26 * SUCH DAMAGE.
27 */
28
29#include "opt_compat.h"
30
31#include <sys/cdefs.h>
1/*-
2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3 *
4 * Copyright (c) 1994-1995 S��ren Schmidt
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

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

24 * LIABILITY, 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
26 * SUCH DAMAGE.
27 */
28
29#include "opt_compat.h"
30
31#include <sys/cdefs.h>
32__FBSDID("$FreeBSD: stable/11/sys/compat/linux/linux_ioctl.c 346812 2019-04-28 09:53:08Z dchagin $");
32__FBSDID("$FreeBSD: stable/11/sys/compat/linux/linux_ioctl.c 346816 2019-04-28 13:19:28Z dchagin $");
33
34#include <sys/param.h>
35#include <sys/systm.h>
36#include <sys/sysproto.h>
37#include <sys/capsicum.h>
38#include <sys/cdio.h>
39#include <sys/dvdio.h>
40#include <sys/conf.h>

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

160DATA_SET(linux_ioctl_handler_set, video2_handler);
161DATA_SET(linux_ioctl_handler_set, fbsd_usb);
162DATA_SET(linux_ioctl_handler_set, evdev_handler);
163
164#ifdef __i386__
165static TAILQ_HEAD(, linux_ioctl_handler_element) linux_ioctl_handlers =
166 TAILQ_HEAD_INITIALIZER(linux_ioctl_handlers);
167static struct sx linux_ioctl_sx;
33
34#include <sys/param.h>
35#include <sys/systm.h>
36#include <sys/sysproto.h>
37#include <sys/capsicum.h>
38#include <sys/cdio.h>
39#include <sys/dvdio.h>
40#include <sys/conf.h>

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

160DATA_SET(linux_ioctl_handler_set, video2_handler);
161DATA_SET(linux_ioctl_handler_set, fbsd_usb);
162DATA_SET(linux_ioctl_handler_set, evdev_handler);
163
164#ifdef __i386__
165static TAILQ_HEAD(, linux_ioctl_handler_element) linux_ioctl_handlers =
166 TAILQ_HEAD_INITIALIZER(linux_ioctl_handlers);
167static struct sx linux_ioctl_sx;
168SX_SYSINIT(linux_ioctl, &linux_ioctl_sx, "linux ioctl handlers");
168SX_SYSINIT(linux_ioctl, &linux_ioctl_sx, "Linux ioctl handlers");
169#else
170extern TAILQ_HEAD(, linux_ioctl_handler_element) linux_ioctl_handlers;
171extern struct sx linux_ioctl_sx;
172#endif
173#ifdef COMPAT_LINUX32
174static TAILQ_HEAD(, linux_ioctl_handler_element) linux32_ioctl_handlers =
175 TAILQ_HEAD_INITIALIZER(linux32_ioctl_handlers);
176#endif

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

1339 case DVD_STRUCT_BCA:
1340 lp->bca.len = bp->length;
1341 memcpy(lp->bca.value, bp->data, sizeof(lp->bca.value));
1342 break;
1343 case DVD_STRUCT_MANUFACT:
1344 lp->manufact.len = bp->length;
1345 memcpy(lp->manufact.value, bp->data,
1346 sizeof(lp->manufact.value));
169#else
170extern TAILQ_HEAD(, linux_ioctl_handler_element) linux_ioctl_handlers;
171extern struct sx linux_ioctl_sx;
172#endif
173#ifdef COMPAT_LINUX32
174static TAILQ_HEAD(, linux_ioctl_handler_element) linux32_ioctl_handlers =
175 TAILQ_HEAD_INITIALIZER(linux32_ioctl_handlers);
176#endif

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

1339 case DVD_STRUCT_BCA:
1340 lp->bca.len = bp->length;
1341 memcpy(lp->bca.value, bp->data, sizeof(lp->bca.value));
1342 break;
1343 case DVD_STRUCT_MANUFACT:
1344 lp->manufact.len = bp->length;
1345 memcpy(lp->manufact.value, bp->data,
1346 sizeof(lp->manufact.value));
1347 /* lp->manufact.layer_num is unused in linux (redhat 7.0) */
1347 /* lp->manufact.layer_num is unused in Linux (redhat 7.0). */
1348 break;
1349 default:
1350 return (EINVAL);
1351 }
1352 return (0);
1353}
1354
1355static int

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

2904 struct video_clip vclip;
2905 struct l_video_clip l_vclip;
2906
2907 error = copyin(lvc, &l_vclip, sizeof(l_vclip));
2908 if (error) return (error);
2909 linux_to_bsd_v4l_clip(&l_vclip, &vclip);
2910 /* XXX: If there can be no concurrency: s/M_NOWAIT/M_WAITOK/ */
2911 if ((*ppvc = malloc(sizeof(**ppvc), M_LINUX, M_NOWAIT)) == NULL)
1348 break;
1349 default:
1350 return (EINVAL);
1351 }
1352 return (0);
1353}
1354
1355static int

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

2904 struct video_clip vclip;
2905 struct l_video_clip l_vclip;
2906
2907 error = copyin(lvc, &l_vclip, sizeof(l_vclip));
2908 if (error) return (error);
2909 linux_to_bsd_v4l_clip(&l_vclip, &vclip);
2910 /* XXX: If there can be no concurrency: s/M_NOWAIT/M_WAITOK/ */
2911 if ((*ppvc = malloc(sizeof(**ppvc), M_LINUX, M_NOWAIT)) == NULL)
2912 return (ENOMEM); /* XXX: linux has no ENOMEM here */
2912 return (ENOMEM); /* XXX: Linux has no ENOMEM here. */
2913 memcpy(*ppvc, &vclip, sizeof(vclip));
2914 (*ppvc)->next = NULL;
2915 return (0);
2916}
2917
2918static int
2919linux_v4l_cliplist_free(struct video_window *vw)
2920{

--- 976 unchanged lines hidden ---
2913 memcpy(*ppvc, &vclip, sizeof(vclip));
2914 (*ppvc)->next = NULL;
2915 return (0);
2916}
2917
2918static int
2919linux_v4l_cliplist_free(struct video_window *vw)
2920{

--- 976 unchanged lines hidden ---