page_32.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #ifndef _ASM_X86_PAGE_32_H
  2. #define _ASM_X86_PAGE_32_H
  3. #include <asm/page_32_types.h>
  4. #ifdef CONFIG_HUGETLB_PAGE
  5. #define HAVE_ARCH_HUGETLB_UNMAPPED_AREA
  6. #endif
  7. #define __phys_addr_nodebug(x) ((x) - PAGE_OFFSET)
  8. #ifdef CONFIG_DEBUG_VIRTUAL
  9. extern unsigned long __phys_addr(unsigned long);
  10. #else
  11. #define __phys_addr(x) __phys_addr_nodebug(x)
  12. #endif
  13. #define __phys_reloc_hide(x) RELOC_HIDE((x), 0)
  14. #ifdef CONFIG_FLATMEM
  15. #define pfn_valid(pfn) ((pfn) < max_mapnr)
  16. #endif /* CONFIG_FLATMEM */
  17. #ifndef __ASSEMBLY__
  18. #ifdef CONFIG_X86_USE_3DNOW
  19. #include <asm/mmx.h>
  20. static inline void clear_page(void *page)
  21. {
  22. mmx_clear_page(page);
  23. }
  24. static inline void copy_page(void *to, void *from)
  25. {
  26. mmx_copy_page(to, from);
  27. }
  28. #else /* !CONFIG_X86_USE_3DNOW */
  29. #include <linux/string.h>
  30. static inline void clear_page(void *page)
  31. {
  32. memset(page, 0, PAGE_SIZE);
  33. }
  34. static inline void copy_page(void *to, void *from)
  35. {
  36. memcpy(to, from, PAGE_SIZE);
  37. }
  38. #endif /* CONFIG_X86_3DNOW */
  39. #endif /* !__ASSEMBLY__ */
  40. #endif /* _ASM_X86_PAGE_32_H */