blob: 904f528cc8e82ae638e25a2bdeec23fed332eb7a [file] [log] [blame]
H. Peter Anvin1965aae2008-10-22 22:26:29 -07001#ifndef _ASM_X86_PAGE_32_H
2#define _ASM_X86_PAGE_32_H
Linus Torvalds1da177e2005-04-16 15:20:36 -07003
Jeremy Fitzhardinge51c78eb2009-02-08 22:52:14 -08004#include <asm/page_32_types.h>
Ingo Molnar3bf8f5a2008-02-09 00:15:06 +01005
Ingo Molnarbeb69432009-02-13 13:36:47 +01006#ifndef __ASSEMBLY__
7
Vegard Nossumaf5c2bd2008-10-03 17:54:25 +02008#define __phys_addr_nodebug(x) ((x) - PAGE_OFFSET)
Jiri Slabya1bf9632008-06-12 13:56:40 +02009#ifdef CONFIG_DEBUG_VIRTUAL
Jiri Slaby59ea7462008-06-12 13:56:40 +020010extern unsigned long __phys_addr(unsigned long);
Jiri Slabya1bf9632008-06-12 13:56:40 +020011#else
Vegard Nossumaf5c2bd2008-10-03 17:54:25 +020012#define __phys_addr(x) __phys_addr_nodebug(x)
Jiri Slabya1bf9632008-06-12 13:56:40 +020013#endif
Alexander Duyck7d742752012-11-16 13:55:46 -080014#define __phys_addr_symbol(x) __phys_addr(x)
Jeremy Fitzhardinge11b7c7d2008-01-30 13:32:44 +010015#define __phys_reloc_hide(x) RELOC_HIDE((x), 0)
16
17#ifdef CONFIG_FLATMEM
18#define pfn_valid(pfn) ((pfn) < max_mapnr)
19#endif /* CONFIG_FLATMEM */
20
Jeremy Fitzhardinge11b7c7d2008-01-30 13:32:44 +010021#ifdef CONFIG_X86_USE_3DNOW
22#include <asm/mmx.h>
23
24static inline void clear_page(void *page)
25{
26 mmx_clear_page(page);
27}
28
29static inline void copy_page(void *to, void *from)
30{
31 mmx_copy_page(to, from);
32}
33#else /* !CONFIG_X86_USE_3DNOW */
34#include <linux/string.h>
35
36static inline void clear_page(void *page)
37{
38 memset(page, 0, PAGE_SIZE);
39}
40
41static inline void copy_page(void *to, void *from)
42{
43 memcpy(to, from, PAGE_SIZE);
44}
45#endif /* CONFIG_X86_3DNOW */
46#endif /* !__ASSEMBLY__ */
47
H. Peter Anvin1965aae2008-10-22 22:26:29 -070048#endif /* _ASM_X86_PAGE_32_H */