mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-27 06:34:11 +08:00
4bb0d3ec3e
i386 Inline asm cleanup. Use cr/dr accessor functions. Also, a potential bugfix. Also, some CR accessors really should be volatile. Reads from CR0 (numeric state may change in an exception handler), writes to CR4 (flipping CR4.TSD) and reads from CR2 (page fault) prevent instruction re-ordering. I did not add memory clobber to CR3 / CR4 / CR0 updates, as it was not there to begin with, and in no case should kernel memory be clobbered, except when doing a TLB flush, which already has memory clobber. I noticed that page invalidation does not have a memory clobber. I can't find a bug as a result, but there is definitely a potential for a bug here: #define __flush_tlb_single(addr) \ __asm__ __volatile__("invlpg %0": :"m" (*(char *) addr)) Signed-off-by: Zachary Amsden <zach@vmware.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
35 lines
1.1 KiB
C
35 lines
1.1 KiB
C
#ifndef AGP_H
|
|
#define AGP_H 1
|
|
|
|
#include <asm/pgtable.h>
|
|
#include <asm/cacheflush.h>
|
|
|
|
/*
|
|
* Functions to keep the agpgart mappings coherent with the MMU.
|
|
* The GART gives the CPU a physical alias of pages in memory. The alias region is
|
|
* mapped uncacheable. Make sure there are no conflicting mappings
|
|
* with different cachability attributes for the same page. This avoids
|
|
* data corruption on some CPUs.
|
|
*/
|
|
|
|
int map_page_into_agp(struct page *page);
|
|
int unmap_page_from_agp(struct page *page);
|
|
#define flush_agp_mappings() global_flush_tlb()
|
|
|
|
/* Could use CLFLUSH here if the cpu supports it. But then it would
|
|
need to be called for each cacheline of the whole page so it may not be
|
|
worth it. Would need a page for it. */
|
|
#define flush_agp_cache() wbinvd()
|
|
|
|
/* Convert a physical address to an address suitable for the GART. */
|
|
#define phys_to_gart(x) (x)
|
|
#define gart_to_phys(x) (x)
|
|
|
|
/* GATT allocation. Returns/accepts GATT kernel virtual address. */
|
|
#define alloc_gatt_pages(order) \
|
|
((char *)__get_free_pages(GFP_KERNEL, (order)))
|
|
#define free_gatt_pages(table, order) \
|
|
free_pages((unsigned long)(table), (order))
|
|
|
|
#endif
|