From owner-freebsd-questions@FreeBSD.ORG Sun Jan 28 11:24:54 2007 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5D12116A404 for ; Sun, 28 Jan 2007 11:24:54 +0000 (UTC) (envelope-from usleepless@gmail.com) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.175]) by mx1.freebsd.org (Postfix) with ESMTP id EF92413C4A3 for ; Sun, 28 Jan 2007 11:24:53 +0000 (UTC) (envelope-from usleepless@gmail.com) Received: by ug-out-1314.google.com with SMTP id o2so935616uge for ; Sun, 28 Jan 2007 03:24:52 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=pl8apJmboP8XUe3UyDnFokskr78ljLQ9Sv8vHwSiAFzQ8CgCjpCPCl/Vxn9mn3OGNWp+Ltg5ugS2j/+9X9LPk6nt+aYwf3P84RppSpDm3l9/Ic9OETdrl4AXuxvw3q4F+zuIGhgcLFTN8GCo/MWybJhSKk7JSdH9dNTTBy9N33U= Received: by 10.78.201.2 with SMTP id y2mr3468928huf.1169983492466; Sun, 28 Jan 2007 03:24:52 -0800 (PST) Received: by 10.78.121.6 with HTTP; Sun, 28 Jan 2007 03:24:52 -0800 (PST) Message-ID: Date: Sun, 28 Jan 2007 12:24:52 +0100 From: usleepless@gmail.com To: "FreeBSD Questions" MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Subject: structure alignment problems X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Jan 2007 11:24:54 -0000 Hi, i am working on getting mythtv-0.20 talking to the pvrxxx driver. the problem appears when i want to do: v4l2_capabilities vcap; ioctl(videofd, VIDIOC_QUERYCAP, &vcap); the driver and mythtv have the struct differently aligned, and i get an "inappropiate ioctl for device". this is what the struct + IOR look like: struct v4l2_capability { __u8 driver[16]; /* i.e. "bttv" */ __u8 card[32]; /* i.e. "Hauppauge WinTV" */ __u8 bus_info[32]; /* "PCI:" + pci_name(pci_dev) */ __u32 version; /* should use KERNEL_VERSION() */ __u32 capabilities; /* Device capabilities */ __u32 reserved[4]; }; #define VIDIOC_QUERYCAP _IOR ('V', 0, struct v4l2_capability) the driver is compiled like this: cc -O -pipe -Werror -D_KERNEL -DKLD_MODULE -nostdinc -I- -I../../.. -I. -I@ -I@/contrib/altq -I@/../include -finline-limit=8000 -fno-common -fno-omit-frame-pointer -mcmodel=kernel -mno-red-zone -mfpmath=387 -mno-sse -mno-sse2 -mno-mmx -mno-3dnow -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -fformat-extensions -std=c99 -c /usr/ports/multimedia/pvrxxx/work/modules/cxm/cxm/../../../dev/cxm/cxm.c it yields a struct-size of 104 bytes. mythtv is compiled like this: g++ -c -pipe -I/usr/local/include/artsc -D_REENTRANT -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -g -Wall -W -O2 -pthread -Wall -Wno-switch -fomit-frame-pointer -I/usr/local/include/freetype2 -I/usr/local/include -DPIC -fPIC -DUSING_FREEBOX -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DPREFIX=\"/usr/local\" -DLIBDIR=\"/usr/local/lib\" -D_LARGEFILE_SOURCE -DUSING_OSS -DUSING_H264TOOLS -DUSING_XV -DUSING_FRONTEND -DUSING_CRC_IP_NETWORK_REC -DUSING_V4L -DUSING_DBOX2 -DUSING_FREEBOX -DUSING_HDHOMERUN -DUSING_IVTV -DUSING_BACKEND -DQT_NO_DEBUG -DQT_THREAD_SUPPORT -DQT_SHARED -DQT_TABLET_SUPPORT -I/usr/local/share/qt/mkspecs/freebsd-g++ -I. -I../../../../../../../local/include -I../../../../../../../X11R6/include -I../.. -I.. -I../libmyth -I../libavcodec -I../libavutil -I../libmythmpeg2 -Idvbdev -Impeg -I../libmythlivemedia/BasicUsageEnvironment/include -I../libmythlivemedia/groupsock/include -I../libmythlivemedia/liveMedia/include -I../libmythlivemedia/UsageEnvironment/include -I../../../../../../../local/include -I/usr/X11R6/include -o cardutil.o cardutil.cpp and it yields a struct-size of 128. is it the -std=c99? is it because this is on amd64? any help is greatly appreciated! regards, usleep