RE: sys32_ioctl issue
Kevin Curtis <[email protected]>
| Newsgroups | gmane.linux.aurora.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi It's me again!,
fixed the ioctl problem without having to add to the
arch/sparc64/kernel/ioctl32.c by using SIOCDEVPRIVATE (not sure why this
wasn't used in the first place). Did you know that you don't seem to be
able to use the following form of the ioctl() function:
ioctl (fd, SIOCDEVPRIVATE, NULL);
It seem you have to supply a value for arg???
Anyway, the card has now been primed for downloading, but the first attempt
to write to the card pulls an exception as follows:
Apr 29 17:13:37 icarus kernel: FarSync X.25 Sockets for Linux. Version 0.2
Apr 29 17:13:37 icarus kernel: FarSync X.25 driver 2.01 (c) 2002 FarSite
Communications Ltd.
Apr 29 17:13:37 icarus kernel: fsxsk0-fsxsk1: FarSync T2P IRQ6945088, 2
ports
Apr 29 17:13:37 icarus kernel: fsxsk2-fsxsk2: FarSync T1U IRQ6944576, 1
ports
Apr 29 17:13:37 icarus kernel: fsx25: The value of the debug flag is 0
Apr 29 17:14:07 icarus kernel: fsc_mem_ioctl: 89fb, effff920
Apr 29 17:14:07 icarus kernel: fsc_mem_write: 8192
Apr 29 17:14:07 icarus kernel: About to do r/w operation at buf =
0000000000024b50 card->mem = 000001ff80100000 pos = 0 count = 2000
Unable to handle kernel paging request at virtual address 0000000080100000
Apr 29 17:14:07 icarus kernel: tsk->{mm,active_mm}->context =
000000000000051d
Apr 29 17:14:07 icarus kernel: tsk->{mm,active_mm}->pgd = fffff8002c7a2000
Apr 29 17:14:07 icarus kernel: \|/ ____ \|/
Apr 29 17:14:07 icarus kernel: "@'/ .. \`@"
Apr 29 17:14:07 icarus kernel: /_| \__/ |_\
Apr 29 17:14:07 icarus kernel: \__U_/
Apr 29 17:14:07 icarus kernel: fsx25load(1319): Oops
^^^^^
very cute
the code for this is
static int
rw_card_mem ( struct fsc_card_info *card, char *buf, size_t count, loff_t
*offp,
int verify_type )
{
loff_t pos;
/* First check the user has access to the buffer */
if ( verify_area ( verify_type, buf, count )) {
return -EFAULT;
}
/* Limit transfer to our maximum window size of 1Mb */
pos = *offp;
if ( count + pos > 0x100000 ) {
if ( pos >= 0x100000 ) {
return 0; /* EOF */
}
count = 0x100000 - *offp;
}
printk("About to do r/w operation at buf = %p card->mem = %p pos =
%x count = %x\n", buf, card->mem, pos, count);
if ( verify_type == VERIFY_WRITE ) {
__copy_to_user ( buf, card->mem + pos, count );
} else {
__copy_from_user ( card->mem + pos, buf, count );
}
/* Update file position and we're done */
*offp += count;
return count;
}
so it looks as though __copy_from_user looses the top half of the IO
address??
Any more pointers wellcome.
Kevin
-----Original Message-----
From: Tom 'spot' Callaway [mailto:[email protected]]
Sent: 29 April 2003 15:49
To: [email protected]
Subject: Re: [aurora-sparc-devel] sys32_ioctl issue
On Tue, 2003-04-29 at 09:43, Kevin Curtis wrote:
> Hi,
> many thanks to the list for getting me of the ground with porting
> our Intel 32 bit drivers to sparc64. I have now managed to compile and
load
> the driver module successfully.
>
> The next step is to load our card with it's firmware. We do this through
an
> ioctl interface to the driver with a loader program. I was getting on
fine
> with this until I came to the first ioctl operation. In the 32 bit Intel
> version the ioctl command is calculated (with the _IO macro) as 0x7800,
and
> this comes out as 0x20007800 on sparc64 with the same calculation. The
> sys32_ioctl function reports the following error:
> Apr 29 15:37:16 icarus kernel: sys32_ioctl(fsx25load:5058): Unknown cmd
> fd(3) cmd(20007800) arg(00000000)
>
> How is sys32_ioctl making the conversion of the ioctl and what does my
> fsx25load program or driver need to do to solve the problem?
Sparc64 ioctls have to be listed in the list inside
arch/sparc64/kernel/ioctl32.c, and translated if needed.
~spot
---
Tom "spot" Callaway <tcallawa(a)redhat*com> SAIR LCA, RHCE
Red Hat Enterprise Architect :: http://www.redhat.com
Project Leader for Aurora Sparc Linux :: http://auroralinux.org
GPG: D786 8B22 D9DB 1F8B 4AB7 448E 3C5E 99AD 9305 4260
The words and opinions reflected in this message do not necessarily
reflect those of my employer, Red Hat, and belong solely to me.
"Immature poets borrow, mature poets steal." --- T. S. Eliot
_______________________________________________
aurora-sparc-devel mailing list
[email protected]
http://lists.linuxpower.org/mailman/listinfo/aurora-sparc-devel