LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices

Reply
 
Search this Thread
Old 06-10-2009, 03:19 PM   #1
rashmikant
LQ Newbie
 
Registered: Dec 2008
Posts: 7

Rep: Reputation: 1
compile error: invalid operands for binary >> for pgd_index(addr) macro


Hi all,
I am writing a driver for a pci device and am trying to translate a virtual address to locate its page table entry using the set of macros in asm/pgtable.h

I am giving a void * to pgd_index(addr) macro to give me a relative position in Page global directory.
But instead while compiling, it gives me an error saying:
error: invalid operands to binary >> (have void * and 'int')

I don't understand what is wrong because as I know, I am supposed to pass a virtual address to the macro to get the pgd index.

Thanks for help.

Rashmikant
 
Old 06-10-2009, 03:36 PM   #2
rashmikant
LQ Newbie
 
Registered: Dec 2008
Posts: 7

Original Poster
Rep: Reputation: 1
i figured it out. The macro requires an unsigned long to resolve the error. But I dont understand why because the definition of macro says it requires a void pointer.

Rashmikant
 
  


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
invalid operands of types ‘<unresolved overloaded function type>’ and ‘double’ to jus71n742 Programming 2 01-05-2009 12:27 AM
why get compiler error: suffix or operands invalid for 'push' (or 'pop') maxreason Programming 1 08-10-2008 10:42 AM
Error: suffix or operands invalid for `push' in 64 machine arya Linux - General 1 04-19-2007 10:32 AM
what does "prog7.c:11: error: invalid operands to binary %" mean hubabuba Programming 6 11-16-2004 11:13 AM
gcc: invalid operands ajacques Linux - General 1 10-25-2004 07:31 AM


All times are GMT -5. The time now is 02:43 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