cpu-single.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * linux/arch/unicore32/include/asm/cpu-single.h
  3. *
  4. * Code specific to PKUnity SoC and UniCore ISA
  5. *
  6. * Copyright (C) 2001-2010 GUAN Xue-tao
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License version 2 as
  10. * published by the Free Software Foundation.
  11. */
  12. #ifndef __UNICORE_CPU_SINGLE_H__
  13. #define __UNICORE_CPU_SINGLE_H__
  14. #include <asm/page.h>
  15. #include <asm/memory.h>
  16. #ifdef __KERNEL__
  17. #ifndef __ASSEMBLY__
  18. #define cpu_switch_mm(pgd, mm) cpu_do_switch_mm(virt_to_phys(pgd), mm)
  19. #define cpu_get_pgd() \
  20. ({ \
  21. unsigned long pg; \
  22. __asm__("movc %0, p0.c2, #0" \
  23. : "=r" (pg) : : "cc"); \
  24. pg &= ~0x0fff; \
  25. (pgd_t *)phys_to_virt(pg); \
  26. })
  27. struct mm_struct;
  28. /* declare all the functions as extern */
  29. extern void cpu_proc_fin(void);
  30. extern int cpu_do_idle(void);
  31. extern void cpu_dcache_clean_area(void *, int);
  32. extern void cpu_do_switch_mm(unsigned long pgd_phys, struct mm_struct *mm);
  33. extern void cpu_set_pte(pte_t *ptep, pte_t pte);
  34. extern void cpu_reset(unsigned long addr) __attribute__((noreturn));
  35. #endif /* __ASSEMBLY__ */
  36. #endif /* __KERNEL__ */
  37. #endif /* __UNICORE_CPU_SINGLE_H__ */