summaryrefslogtreecommitdiff
path: root/arch/x86/lib/physmem.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2014-10-10 08:21:52 -0600
committerSimon Glass <sjg@chromium.org>2014-10-28 20:42:51 -0600
commit7bddac947da91431655c9d7be030b94c1c9a8699 (patch)
tree801fe83586b2aa56a53b97293b2d4eed7d45bd8a /arch/x86/lib/physmem.c
parent6c499abe05f93d9f53338b9831196efeede5f2e0 (diff)
downloadu-boot-imx-7bddac947da91431655c9d7be030b94c1c9a8699.zip
u-boot-imx-7bddac947da91431655c9d7be030b94c1c9a8699.tar.gz
u-boot-imx-7bddac947da91431655c9d7be030b94c1c9a8699.tar.bz2
x86: Move paging functions into cpu.c
These functions really don't belong in physmem as they relate to the cpu. Move them. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'arch/x86/lib/physmem.c')
-rw-r--r--arch/x86/lib/physmem.c33
1 files changed, 3 insertions, 30 deletions
diff --git a/arch/x86/lib/physmem.c b/arch/x86/lib/physmem.c
index b57b2c3..c3c709e 100644
--- a/arch/x86/lib/physmem.c
+++ b/arch/x86/lib/physmem.c
@@ -10,6 +10,7 @@
#include <common.h>
#include <physmem.h>
+#include <asm/cpu.h>
#include <linux/compiler.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -112,41 +113,13 @@ static void x86_phys_enter_paging(void)
x86_phys_map_page(page_addr, page_addr, 0);
}
- /* Turn on paging */
- __asm__ __volatile__(
- /* Load the page table address */
- "movl %0, %%cr3\n\t"
- /* Enable pae */
- "movl %%cr4, %%eax\n\t"
- "orl $0x00000020, %%eax\n\t"
- "movl %%eax, %%cr4\n\t"
- /* Enable paging */
- "movl %%cr0, %%eax\n\t"
- "orl $0x80000000, %%eax\n\t"
- "movl %%eax, %%cr0\n\t"
- :
- : "r" (pdpt)
- : "eax"
- );
+ cpu_enable_paging_pae((ulong)pdpt);
}
/* Disable paging and PAE mode. */
static void x86_phys_exit_paging(void)
{
- /* Turn off paging */
- __asm__ __volatile__ (
- /* Disable paging */
- "movl %%cr0, %%eax\n\t"
- "andl $0x7fffffff, %%eax\n\t"
- "movl %%eax, %%cr0\n\t"
- /* Disable pae */
- "movl %%cr4, %%eax\n\t"
- "andl $0xffffffdf, %%eax\n\t"
- "movl %%eax, %%cr4\n\t"
- :
- :
- : "eax"
- );
+ cpu_disable_paging_pae();
}
/*