Rev 3031 | Rev 4104 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3031 | Rev 3260 | ||
---|---|---|---|
Line 105... | Line 105... | ||
105 | if (size & (size - 1)) |
105 | if (size & (size - 1)) |
106 | ++order; |
106 | ++order; |
Line 107... | Line 107... | ||
107 | 107 | ||
108 | return order; |
108 | return order; |
- | 109 | } |
|
- | 110 | ||
- | 111 | extern int x86_clflush_size; |
|
- | 112 | ||
- | 113 | static inline void clflush(volatile void *__p) |
|
- | 114 | { |
|
- | 115 | asm volatile("clflush %0" : "+m" (*(volatile char*)__p)); |
|
- | 116 | } |
|
- | 117 | ||
- | 118 | void |
|
- | 119 | drm_clflush_virt_range(char *addr, unsigned long length) |
|
- | 120 | { |
|
- | 121 | char *end = addr + length; |
|
- | 122 | mb(); |
|
- | 123 | for (; addr < end; addr += x86_clflush_size) |
|
- | 124 | clflush(addr); |
|
- | 125 | clflush(end - 1); |
|
- | 126 | mb(); |
|
- | 127 | return; |
|
- | 128 | }> |