LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-03-2006, 04:45 PM   #1
ashlesha
Member
 
Registered: May 2005
Location: PA
Distribution: Ubuntu
Posts: 204

Rep: Reputation: 30
cannot comprehend this code!


I have a query about the following:

u32 pin_func;

pin_func = 0;
/* not valid for 1550 */
#ifdef CONFIG_AU1X00_USB_DEVICE
// 2nd USB port is USB device
pin_func = au_readl(SYS_PINFUNC) & (u32)(~0x8000);
au_writel(pin_func, SYS_PINFUNC);


Now SYS_PINFUNC is defined as 0xB190002C
the (u32)(~0x8000) means 0xB190002C & 0xFFFF1FFF right?

Then the original value of SYS_PINFUNC remains unchanged..so what is the
purpose of the above code?

Also how is u32 defined exactly?


Thanks
Ashlesha.
 
Old 08-03-2006, 06:46 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917
Impossible to tell from that snippet; I suggest you look through the include
files to find out ;}


Cheers,
Tink
 
Old 08-04-2006, 01:32 AM   #3
ciotog
Member
 
Registered: Mar 2004
Location: Canada
Distribution: Slackware current
Posts: 728
Blog Entries: 2

Rep: Reputation: 43
Quote:
Originally Posted by ashlesha
Now SYS_PINFUNC is defined as 0xB190002C
the (u32)(~0x8000) means 0xB190002C & 0xFFFF1FFF right?
No, ~0x80000 is 0xFFF7FFFF (subtract 0x8000 from 0xFFFFFFFF)

Quote:
Also how is u32 defined exactly?
It's an unsigned 32 bit value

EDIT: Also you're &ing the result of au_readl(SYS_PINFUNC) and (~0x8000), not the value SYS_PINFUNC and (~0x8000)

Last edited by ciotog; 08-04-2006 at 01:35 AM.
 
Old 08-04-2006, 11:50 AM   #4
ashlesha
Member
 
Registered: May 2005
Location: PA
Distribution: Ubuntu
Posts: 204

Original Poster
Rep: Reputation: 30
thanks! yeah..i realised that a little late..will fig out what the sys_pinfunc value is etc..

this is part of the Board support code for the AMD DB1500 board.

-Ashlesha.
 
  


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
small syntax problem with C code (implemented in Code Composer Studio) illiniguy3043 Programming 6 01-07-2008 02:14 AM
What do I fail to comprehend about subfs? djuhl30 Linux - Hardware 5 02-24-2006 11:55 PM
User Preferences: Use HTML code instead of vB code? (vB code is overrated) stefanlasiewski LQ Suggestions & Feedback 5 07-26-2005 01:37 AM
Editing buttons (quote, code etc.) add the code to the end vharishankar LQ Suggestions & Feedback 2 09-13-2004 09:32 AM
Open Firmware code for booting OS from SATA : sample code available somewhere ? drsparikh Linux - Hardware 0 03-12-2004 11:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:55 PM.

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
Open Source Consulting | Domain Registration