[fpc-devel] Problems with fpioctl on ARM debian linux and FPC2.6

2012-06-19 Thread Stefan Fischer
Hello, I have a project, where I have to write a driver for /dev/spidev0.0, but I have problems with fpioctl. I believe that I have problems with the parameter passing or type casting of fpioctl. In some forums, I've found mysterios Pointer(PtrInt(xx) syntax like that: fpioctl(fd,funcnum,

Re: [fpc-devel] Problems with fpioctl on ARM debian linux and FPC2.6

2012-06-19 Thread Jonas Maebe
Stefan Fischer wrote on Tue, 19 Jun 2012: My code snipet is below: spi_ioc_transfer_t = record tx_buf_ptr : pointer; rx_buf_ptr : pointer; len: longword; delay_usec : word; speed_hz : longword; bits_per_word : byte; cs_change : byte; pad:

Re: [fpc-devel] Problems with fpioctl on ARM debian linux and FPC2.6

2012-06-19 Thread Henry Vermaak
On 19 June 2012 14:17, Jonas Maebe jonas.ma...@elis.ugent.be wrote: Stefan Fischer wrote on Tue, 19 Jun 2012: My code snipet is below: spi_ioc_transfer_t = record    tx_buf_ptr   : pointer;    rx_buf_ptr   : pointer;    len    : longword;    delay_usec  : word;    speed_hz     :

Re: [fpc-devel] Problems with fpioctl on ARM debian linux and FPC2.6

2012-06-19 Thread Jonas Maebe
Henry Vermaak wrote on Tue, 19 Jun 2012: Also, the buffers need to be u64. Is the pointer type in pascal always 64 bit? u64 is defined as unsigned long. unsigned long is the same size as a pointer on Linux. Jonas ___ fpc-devel maillist -

Re: [fpc-devel] Problems with fpioctl on ARM debian linux and FPC2.6

2012-06-19 Thread Stefan Fischer
I've changed to following: added packrecord c flipped speed_hz and delay_usec fields same problem. I don't know whats really wrong. Is there any debug possibility? Am 19.06.2012 um 15:24 schrieb Jonas Maebe: Henry Vermaak wrote on Tue, 19 Jun 2012: Also, the buffers need to be u64. Is

Re: [fpc-devel] Problems with fpioctl on ARM debian linux and FPC2.6

2012-06-19 Thread Henry Vermaak
On 19 June 2012 18:04, Stefan Fischer sfisc...@basis.biz wrote: I've changed to following: added packrecord c flipped speed_hz and delay_usec fields same problem. I don't know whats really wrong. Is there any debug possibility? Have you tried looking at errno? Do any of the other ioctls

Re: [fpc-devel] Problems with fpioctl on ARM debian linux and FPC2.6

2012-06-19 Thread Henry Vermaak
On 19 June 2012 18:20, Henry Vermaak henry.verm...@gmail.com wrote: Have you tried looking at errno?  Do any of the other ioctls succeed Sorry, errno - GetLastOSError() Henry ___ fpc-devel maillist - fpc-devel@lists.freepascal.org

RE : [fpc-devel] Problems with fpioctl on ARM debian linux and FPC2.6

2012-06-19 Thread Ludo Brands
I've changed to following: added packrecord c flipped speed_hz and delay_usec fields same problem. I don't know whats really wrong. Is there any debug possibility? Are you sure about the conversion (*SPI_IOC_MESSAGE(1)*) 1075866368? That is 40206B00 hex. 6B is the letter 'k'

Re: RE : [fpc-devel] Problems with fpioctl on ARM debian linux and FPC2.6

2012-06-19 Thread Henry Vermaak
On 19 June 2012 18:37, Ludo Brands ludo.bra...@free.fr wrote: Are you sure about the conversion (*SPI_IOC_MESSAGE(1)*) 1075866368? That is I can confirm that a c program spits out this number for SPI_IOC_MESSAGE(1). Henry ___ fpc-devel maillist -

RE : RE : [fpc-devel] Problems with fpioctl on ARM debian linux andFPC2.6

2012-06-19 Thread Ludo Brands
Are you sure about the conversion (*SPI_IOC_MESSAGE(1)*) 1075866368? That is I can confirm that a c program spits out this number for SPI_IOC_MESSAGE(1). And what is sizeof (struct spi_ioc_transfer) in c? Because that would indicate that u64 needs to be indeed 64 bits. I have seen

[fpc-devel] location of instantfpc executable

2012-06-19 Thread Dirk
Hi, I periodically build FPC trunk on WinXP (using make clean all + make install). I then build the arm-wince cross-compiler (using make clean all install CROSSCOMPILE=1). In both cases the instantfpc executable ends up the bin directory, leaving me effectively only with the WinCE version. Would

Re: RE : RE : [fpc-devel] Problems with fpioctl on ARM debian linux andFPC2.6

2012-06-19 Thread Henry Vermaak
On 19 June 2012 19:02, Ludo Brands ludo.bra...@free.fr wrote: And what is sizeof (struct spi_ioc_transfer) in c? 32. Because that would indicate that u64 needs to be indeed 64 bits. I have seen u64 defined as typedef unsigned long long for ARM. long is 32 bits on my arm laptop, so that

RE : RE : RE : [fpc-devel] Problems with fpioctl on ARM debian linuxandFPC2.6

2012-06-19 Thread Ludo Brands
32. Because that would indicate that u64 needs to be indeed 64 bits. I have seen u64 defined as typedef unsigned long long for ARM. long is 32 bits on my arm laptop, so that makes sense. So the struct should be translated as spi_ioc_transfer_t = record tx_buf_ptr : qword;

Re: RE : RE : RE : [fpc-devel] Problems with fpioctl on ARM debian linuxandFPC2.6

2012-06-19 Thread Henry Vermaak
On 19 June 2012 19:42, Ludo Brands ludo.bra...@free.fr wrote: So the struct should be translated as spi_ioc_transfer_t = record    tx_buf_ptr   : qword;    rx_buf_ptr   : qword;    len    : longword;    speed_hz     : longword;    delay_usec  : word;    bits_per_word : byte;    cs_change

Re: [fpc-devel] Problems with fpioctl on ARM debian linux and FPC2.6

2012-06-19 Thread Stefan Fischer
after some experiments, tx.. and rx_buf_ptr has to be 64 bits. On fps on arm, the pointer type is translated to 32 Bits. Ludo's suggestions to use qword (64Bit) is correct. Is there a possibility to use pointer type with 64 Bits? How ? spi_ioc_transfer_t = record tx_buf_ptr,dummytx:

Re: [fpc-devel] Problems with fpioctl on ARM debian linux and FPC2.6

2012-06-19 Thread Henry Vermaak
On 19 June 2012 14:21, Henry Vermaak henry.verm...@gmail.com wrote: Also, the buffers need to be u64.  Is the pointer type in pascal always 64 bit? The answer to this is no, so you can't use pascal pointer types for the buffers. Henry ___ fpc-devel

[fpc-devel] Windows 64bit SEH exception handling

2012-06-19 Thread tomek
Hello, with reference to http://bugs.freepascal.org/view.php?id=12742 about random crash with Windows OpenDialog Box only on Win7 64bit. Today I compile trunk-fpc with TEST_WIN64_SEH support and it seems that this bug is resolved with SEH. I checked a few times to make sure that this is due to

Re: [fpc-devel] Windows 64bit SEH exception handling

2012-06-19 Thread Sergei Gorelkin
19.06.2012 23:43, tomek пишет: Hello, with reference to http://bugs.freepascal.org/view.php?id=12742 about random crash with Windows OpenDialog Box only on Win7 64bit. Today I compile trunk-fpc with TEST_WIN64_SEH support and it seems that this bug is resolved with SEH. I checked a few times