lkml.org 
[lkml]   [2000]   [Sep]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectStrange virtual/physical address of global data
I wrote a little module to test virt_to_phys:

unsigned long test_data;

int init_module(void)
{
void *virt = &test_data;
unsigned long phys = virt_to_phys(virt);

When I run this and check the valur of virt and phys, it appears that phys is
outside the range of physical memory! That is, if I have 512MB of RAM, then
phys is equal to about 520M. However, if I make test_data a local variable:


int init_module(void)
{
unsigned long test_data;
void *virt = &test_data;
unsigned long phys = virt_to_phys(virt);

Then I get a number which makes sense (less than 512M)

Could someone explain this to me?



--
Timur Tabi - ttabi@interactivesi.com
Interactive Silicon - http://www.interactivesi.com

When replying to a mailing-list message, please don't cc: me, because then I'll just get two copies of the same message.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:38    [W:0.044 / U:3.148 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site