Oops, I didn't mean it that way. I just wanted to know whether we're allowed to call devmap_devmem_setup from attach routine in the driver. I'm getting a dump to check what's going on. Bhaskar.
-----Original Message----- From: Dan Mick [mailto:dan.m...@sun.com] Sent: Thursday, September 17, 2009 3:29 AM To: Jayaraman, Bhaskar Cc: Garrett D'Amore; opensolaris-code@opensolaris.org Subject: Re: [osol-code] Doubt in ddi_regs_map_setup! "my driver is crashing. Any idea why this could be happening?" Surely you realize no one can possibly answer this question without something like actual information, right? Jayaraman, Bhaskar wrote: > Ok I changed the call to devmap_devmem_setup() but my driver is crashing. Any > idea why this could be happening? I'm calling it from the 'attach' routine > which I hope is allowed. Also all my callbacks do nothing and return 0 unless > they're void i.e. I'm not setting the pvtp pointers in the callbacks or > anything. > Regards, > Bhaskar. > > -----Original Message----- > From: Garrett D'Amore [mailto:garr...@damore.org] > Sent: Tuesday, September 15, 2009 7:35 PM > To: Jayaraman, Bhaskar > Cc: opensolaris-code@opensolaris.org > Subject: Re: [osol-code] Doubt in ddi_regs_map_setup! > > Jayaraman, Bhaskar wrote: >> Hi, I'm making this call on my driver's BAR1 which has a physical >> address 0xf2000008 written on it. So I'm assuming that when I call a >> hat_getpfnum(kas.a_hat, returned_address), I should get the physical >> page frame number. >> >> Instead I get 0xffffffff as its return value (which is definitely some >> error). Also the virtual address that ddi_regs_map_setup is returning >> 0xc000 as the virtual address for the physical address in the BAR1. >> >> Please note that hat_getpfnum returns proper values for other virtual >> addresses. Can someone help me understand what is going on in my case? >> > > I'm not sure exactly why this is failing, but you do know that > hat_getkpfnum() is an obsolete interface, right? Its been obsolete for > quite a long time now. (I think maybe as far back as Solaris 8.) > > If you're using this for mmap(), you should try implementing a > devmap(9e) routine instead. > > -- Garrett >> Regards, >> >> Bhaskar. >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> opensolaris-code mailing list >> opensolaris-code@opensolaris.org >> http://mail.opensolaris.org/mailman/listinfo/opensolaris-code >> > > _______________________________________________ > opensolaris-code mailing list > opensolaris-code@opensolaris.org > http://mail.opensolaris.org/mailman/listinfo/opensolaris-code _______________________________________________ opensolaris-code mailing list opensolaris-code@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/opensolaris-code