Merge tag 'for-4.1' of git://git.kernel.org/pub/scm/linux/kernel/git/kishon/linux...
[deliverable/linux.git] / arch / arm64 / include / asm / proc-fns.h
CommitLineData
9cce7a43
CM
1/*
2 * Based on arch/arm/include/asm/proc-fns.h
3 *
4 * Copyright (C) 1997-1999 Russell King
5 * Copyright (C) 2000 Deep Blue Solutions Ltd
6 * Copyright (C) 2012 ARM Ltd.
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 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20#ifndef __ASM_PROCFNS_H
21#define __ASM_PROCFNS_H
22
23#ifdef __KERNEL__
24#ifndef __ASSEMBLY__
25
26#include <asm/page.h>
27
28struct mm_struct;
6732bc65 29struct cpu_suspend_ctx;
9cce7a43
CM
30
31extern void cpu_cache_off(void);
32extern void cpu_do_idle(void);
33extern void cpu_do_switch_mm(unsigned long pgd_phys, struct mm_struct *mm);
34extern void cpu_reset(unsigned long addr) __attribute__((noreturn));
5e051531
AC
35void cpu_soft_restart(phys_addr_t cpu_reset,
36 unsigned long addr) __attribute__((noreturn));
6732bc65
LP
37extern void cpu_do_suspend(struct cpu_suspend_ctx *ptr);
38extern u64 cpu_do_resume(phys_addr_t ptr, u64 idmap_ttbr);
9cce7a43
CM
39
40#include <asm/memory.h>
41
130c93fd
WD
42#define cpu_switch_mm(pgd,mm) \
43do { \
44 BUG_ON(pgd == swapper_pg_dir); \
45 cpu_do_switch_mm(virt_to_phys(pgd),mm); \
46} while (0)
9cce7a43
CM
47
48#define cpu_get_pgd() \
49({ \
50 unsigned long pg; \
51 asm("mrs %0, ttbr0_el1\n" \
52 : "=r" (pg)); \
53 pg &= ~0xffff000000003ffful; \
54 (pgd_t *)phys_to_virt(pg); \
55})
56
57#endif /* __ASSEMBLY__ */
58#endif /* __KERNEL__ */
59#endif /* __ASM_PROCFNS_H */
This page took 0.153626 seconds and 5 git commands to generate.