Messages in this thread | | | Subject | Re: Strange virtual/physical address of global data | Date | Thu, 21 Sep 2000 23:36:31 +0100 (BST) | From | Alan Cox <> |
| |
> 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:
Module data isnt guaranteed to be in dmaable memory (nor btw is the stack but you were lucky). If you want to use virt_to_bus() and friends for stuff like DMA you must kmalloc the buffers
- 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/
| |