LinuxQuestions.org
Review your favorite Linux distribution.
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
 
Search this Thread
Old 12-07-2012, 01:20 AM   #1
srimaggi
LQ Newbie
 
Registered: Jul 2012
Posts: 2

Rep: Reputation: Disabled
Alignment problem on Xscale platform.


Hi,

I'm working on an xscale platform where the /etc/hosts file is corrupted. The IP values stored in HEX format in database are read and converted to IP using inet_ntoa(address) and /etc/hosts file is updated.

But for some reason the values read from the database are misaligned resulting in an invalid IP getting populated in the /etc/hosts file.


**************************************

void *data;
struct in_addr address;
:
:
data = somefunction() // that returns a void*

address.s_addr = *((in_addr_t *) data)
IpAddress = inet_ntoa (address);

printf ("address=%X, address.s_addr)

****************************************

Hex data stored in Database.
AC188800 (equivalent to 172.24.136.0)


On i686 architecture above code prints
address=8818AC

On PPC architecture it prints
address=AC188800

but on Xscale architecture it prints
address=ACACACAC


Eg: 2
Database entry: AC180011
i686 : 110018AC
PPC : AC180011
Xscale: 18000500


I read some posts that xscale platform has some alignment problems. Can you please confirm above code can result in any alignment problems and is there any solution for this problem??

Below is the linux version running on the xscale machine.
Linux baseserver 2.6.10-pne #1 Thu Nov 1 16:23:25 EDT 2012 armv5teb GNU/Linux

Let me know if any other details are needed.
 
  


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to solve alignment problem in 64 -bit arch kumar_bst Linux - Embedded & Single-board computer 2 05-13-2010 10:28 AM
Glabels alignment problem stoppage Linux - Software 0 03-07-2009 03:51 PM
LXer: Arcom introduces entry level Linux development platform for XScale CPU LXer Syndicated Linux News 0 10-06-2006 10:54 PM
Any javascript experts here? NS alignment problem WorldBuilder Programming 4 12-12-2003 08:46 AM
Lexmark Z53 Alignment Problem sarboras Mandriva 1 10-26-2003 05:36 AM


All times are GMT -5. The time now is 07:37 AM.

Main Menu
Advertisement
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