RE: porting from 32 bit to 64 bit linux

"Delaney, Pam" <[email protected]> Tue, 25 Mar 2003 07:59:06 -0600
Newsgroups gmane.linux.redhat.ia64.general
Message-ID <[email protected]>
As the original email said, in general, migration to
IA64 is seamless.

You can run into problems if you use casting, if
your HW has specific requirements, or if unexpected pads
in structures can cause you a problem.

Here is an example. The HW uses all 32bit registers
and we wish to write the scatter-gather enteries for an IO.
Assume that the basic scatter-gather element is 

struct foo {
	uint size;
	dma_addr_t phys;
};

First, note that since dma_addr_t is 8 bytes, it will be on
an 8byte boundary resulting in a 4byte pad. Also, the HW
has 32bit registers, so the driver must convert the dma_addr_t
into 2 4-byte chuncks.  The driver must also be aware that
in writing the adjacent entries, it cannot do
	pfoo++
because pfoo++ will increment by 16 bytes not 12 and the
HW expects the scatter-gather entries to be adjacent.

For migration, check structure alignments, if at all possible,
all pointers, dma_addr_t should be on 8byte alignments;
if you do any casting, check sizes and you may, or may not,
need to modify this code; if you have HW restrictions, like that
above, where registers have size restrictions, check your
code to see if you need to make any modifications.

You may not need to do anything at all :-)

Cheers,
	pamela

> -----Original Message-----
> From: Prasanta Sadhukhan [mailto:[email protected]]
> Sent: Tuesday, March 25, 2003 7:22 AM
> To: [email protected]
> Subject: Re: porting from 32 bit to 64 bit linux
> Importance: High
> 
> 
> Thanks for the reply.
> But I want to know one further thing.
> What i need to note in order to change from 32 bit pointers to 64 bit
> pointers?
> does it mean all the uint32 pointers has to be changed to uint64?
> 
> Thanks & regards
> Prasanta
> 
> "Delaney, Pam" wrote:
> 
> >
> >
> > You shouldn't have to do much, if anything,
> > depending on how your existing code is written.
> > If you already handle 64bit pointers and physical addresses,
> > and as long as you have no assembly in your driver,
> > (IA64 does not permit assembly)
> > you shouldn't have to make any changes.
> >
> > -pamela
> >
> > > -----Original Message-----
> > > From: Prasanta Sadhukhan [mailto:[email protected]]
> > > Sent: Tuesday, March 25, 2003 12:44 AM
> > > To: [email protected]
> > > Subject: porting from 32 bit to 64 bit linux
> > >
> > >
> > > Hello,
> > >
> > > I want to port linux(redhat linux 8.0) driver from 32 bit 
> to 64 bit
> > > Intel architecture.
> > > Can anyone tell me what change has to be done in driver code
> > > to support
> > > 64 bit architecture... or where can I find relevant information.
> > > Will the same change work for 32 bit architecture also.
> > >
> > > Any help will be highly appreciated.
> > >
> > > Thanks in advance.
> > > Regards,
> > >
> > >
> > >
> > >
> > >
> > > _______________________________________________
> > > ia64-list mailing list
> > > [email protected]
> > > https://listman.redhat.com/mailman/listinfo/ia64-list
> > >
> 
> --
> ***********************************************************
> | Prasanta Sadhukhan : Senior Engineer                     |
> |                    : Networking & Communications Group  |
> | Company            : Tata Elxsi Ltd., Bangalore         |
> | Phone              : +91-80-8410222             |
> **********************************************************
> 
> 
> 
> 
> _______________________________________________
> ia64-list mailing list
> [email protected]
> https://listman.redhat.com/mailman/listinfo/ia64-list
>