Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 53754
b: refs/heads/master
c: fbc16f2
h: refs/heads/master
v: v3
  • Loading branch information
Glauber de Oliveira Costa authored and Andi Kleen committed May 2, 2007
1 parent 7399db3 commit e2f8bfe
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 30 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f9d09645d6157fefa18ff75930737060c8092ddb
refs/heads/master: fbc16f2c2a0e16dbd75ac85d3b6db97f92b642ba
7 changes: 6 additions & 1 deletion trunk/include/asm-x86_64/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ static inline unsigned long read_cr3(void)
return cr3;
}

static inline void write_cr3(unsigned long val)
{
asm volatile("movq %0,%%cr3" :: "r" (val) : "memory");
}

static inline unsigned long read_cr4(void)
{
unsigned long cr4;
Expand All @@ -98,7 +103,7 @@ static inline unsigned long read_cr4(void)

static inline void write_cr4(unsigned long val)
{
asm volatile("movq %0,%%cr4" :: "r" (val));
asm volatile("movq %0,%%cr4" :: "r" (val) : "memory");
}

#define stts() write_cr0(8 | read_cr0())
Expand Down
33 changes: 5 additions & 28 deletions trunk/include/asm-x86_64/tlbflush.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,41 +3,18 @@

#include <linux/mm.h>
#include <asm/processor.h>

static inline unsigned long get_cr3(void)
{
unsigned long cr3;
asm volatile("mov %%cr3,%0" : "=r" (cr3));
return cr3;
}

static inline void set_cr3(unsigned long cr3)
{
asm volatile("mov %0,%%cr3" :: "r" (cr3) : "memory");
}
#include <asm/system.h>

static inline void __flush_tlb(void)
{
set_cr3(get_cr3());
}

static inline unsigned long get_cr4(void)
{
unsigned long cr4;
asm volatile("mov %%cr4,%0" : "=r" (cr4));
return cr4;
}

static inline void set_cr4(unsigned long cr4)
{
asm volatile("mov %0,%%cr4" :: "r" (cr4) : "memory");
write_cr3(read_cr3());
}

static inline void __flush_tlb_all(void)
{
unsigned long cr4 = get_cr4();
set_cr4(cr4 & ~X86_CR4_PGE); /* clear PGE */
set_cr4(cr4); /* write old PGE again and flush TLBs */
unsigned long cr4 = read_cr4();
write_cr4(cr4 & ~X86_CR4_PGE); /* clear PGE */
write_cr4(cr4); /* write old PGE again and flush TLBs */
}

#define __flush_tlb_one(addr) \
Expand Down

0 comments on commit e2f8bfe

Please sign in to comment.