LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 01-24-2006, 05:43 AM   #1
kars_jk
LQ Newbie
 
Registered: Jan 2006
Posts: 3

Rep: Reputation: 0
Question Porting 32 bit application


Hello,
I have one application, written in C & assembly and it is running on Linux and Solaris. It is written for 32 bit platform . I have to port it to 64 bit platform.
From "C" point of view, I am looking for the following trouble spots
Pointer assignments
Bit handling

From assembly point of view: I am thinking of understanding existing assembly instructions and find out its equivalent (or impact on) 64 bit instructions.

Can anyone give me more views?

Regards,
Karthik.
 
Old 01-24-2006, 11:39 PM   #2
primo
Member
 
Registered: Jun 2005
Posts: 542

Rep: Reputation: 34
It's best to use int64_t / uint64_t when you really need 64 bits, then use int / unsigned int otherwise, as they are tipically less than or equal the register's size. For pointers you may use uintptr_t. Always use off_t for file offsets. Be careful with the use of explicit casting because they turn off compiler warnings about discrepancies between sizes, ie: when mapping files into memory, mmap() uses size_t but the size of the file is off_t (struct stat st.size). FreeBSD, 64-bit Solaris and 64-bit Linux (native 64-bits or with Largefile Support) use 64-bits off_t and 32-bits size_t, so you must hack a bit to fully map large files.

A few pointers:
http://developers.sun.com/prodtech/c...P64Issues.html
http://www.unix.org/version2/whatsnew/datasize.html
http://www.unix.org/version2/whatsnew/lfs20mar.html
http://www.unix.org/version2/whatsnew/lfs.html
http://unix.freshmeat.net/articles/view/709/

Last edited by primo; 01-24-2006 at 11:40 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
porting Window Application to Linux sjcoder Programming 3 12-18-2005 04:48 PM
Porting Solaris Application to Linux CaptainRon Solaris / OpenSolaris 5 10-01-2005 02:29 AM
driver porting to 64-bit-linux yogeshwar_s Programming 0 07-19-2005 09:18 AM
Huge Porting application question el_scrub Programming 5 06-10-2004 06:05 AM
Porting win32 application into Linux sergeyy Linux - Software 1 06-23-2003 08:57 AM


All times are GMT -5. The time now is 04:10 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration