diff options
| author | H. Peter Anvin <hpa@zytor.com> | 2007-10-17 12:04:37 -0400 |
|---|---|---|
| committer | Thomas Gleixner <tglx@inhelltoy.tec.linutronix.de> | 2007-10-17 14:16:12 -0400 |
| commit | 6619a8fb594486363783cc4a8372e4d4ee4b913e (patch) | |
| tree | 83130702b16dae3ccae5be54acd18993474ff757 /drivers/char/agp | |
| parent | 9689ba8ad0dc27c0a2ce40eb4c0f8fb66551119c (diff) | |
x86: Create clflush() inline, remove hardcoded wbinvd
Create an inline function for clflush(), with the proper arguments,
and use it instead of hard-coding the instruction.
This also removes one instance of hard-coded wbinvd, based on a patch
by Bauder de Oliveira Costa.
[ tglx: arch/x86 adaptation ]
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Glauber de Oliveira Costa <gcosta@redhat.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'drivers/char/agp')
| -rw-r--r-- | drivers/char/agp/efficeon-agp.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/char/agp/efficeon-agp.c b/drivers/char/agp/efficeon-agp.c index d78cd09186..cac0009ceb 100644 --- a/drivers/char/agp/efficeon-agp.c +++ b/drivers/char/agp/efficeon-agp.c | |||
| @@ -221,7 +221,7 @@ static int efficeon_create_gatt_table(struct agp_bridge_data *bridge) | |||
| 221 | SetPageReserved(virt_to_page((char *)page)); | 221 | SetPageReserved(virt_to_page((char *)page)); |
| 222 | 222 | ||
| 223 | for (offset = 0; offset < PAGE_SIZE; offset += clflush_chunk) | 223 | for (offset = 0; offset < PAGE_SIZE; offset += clflush_chunk) |
| 224 | asm volatile("clflush %0" : : "m" (*(char *)(page+offset))); | 224 | clflush((char *)page+offset); |
| 225 | 225 | ||
| 226 | efficeon_private.l1_table[index] = page; | 226 | efficeon_private.l1_table[index] = page; |
| 227 | 227 | ||
| @@ -268,15 +268,16 @@ static int efficeon_insert_memory(struct agp_memory * mem, off_t pg_start, int t | |||
| 268 | *page = insert; | 268 | *page = insert; |
| 269 | 269 | ||
| 270 | /* clflush is slow, so don't clflush until we have to */ | 270 | /* clflush is slow, so don't clflush until we have to */ |
| 271 | if ( last_page && | 271 | if (last_page && |
| 272 | ((unsigned long)page^(unsigned long)last_page) & clflush_mask ) | 272 | (((unsigned long)page^(unsigned long)last_page) & |
| 273 | asm volatile("clflush %0" : : "m" (*last_page)); | 273 | clflush_mask)) |
| 274 | clflush(last_page); | ||
| 274 | 275 | ||
| 275 | last_page = page; | 276 | last_page = page; |
| 276 | } | 277 | } |
| 277 | 278 | ||
| 278 | if ( last_page ) | 279 | if ( last_page ) |
| 279 | asm volatile("clflush %0" : : "m" (*last_page)); | 280 | clflush(last_page); |
| 280 | 281 | ||
| 281 | agp_bridge->driver->tlb_flush(mem); | 282 | agp_bridge->driver->tlb_flush(mem); |
| 282 | return 0; | 283 | return 0; |
