Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


Merge branch 'devel'
[palacios.git] / kitten / arch / x86_64 / mm / phys_addr.c
1 #include <arch/page.h>
2
3 extern unsigned long phys_base;
4
5 /**
6  * This converts a kernel virtual address to a physical address.
7  *
8  * NOTE: This function only works for kernel virtual addresses in the kernel's
9  *       identity mapping of all of physical memory. It will not work for the
10  *       fixmap, vmalloc() areas, or any other type of virtual address.
11  */
12 unsigned long
13 __phys_addr(unsigned long virt_addr)
14 {
15         /* Handle kernel symbols */
16         if (virt_addr >= __START_KERNEL_map)
17                 return virt_addr - __START_KERNEL_map + phys_base;
18         /* Handle kernel data */
19         return virt_addr - PAGE_OFFSET;
20 }
21