blob: 14ad6e4e87d11477ca350b7dbf6ff7e6017a7cc4 [file] [log] [blame]
Catalin Marinas9cce7a42012-03-05 11:49:28 +00001/*
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;
Lorenzo Pieralisi6732bc62013-07-17 10:14:45 +010029struct cpu_suspend_ctx;
Catalin Marinas9cce7a42012-03-05 11:49:28 +000030
Catalin Marinas9cce7a42012-03-05 11:49:28 +000031extern void cpu_do_idle(void);
32extern void cpu_do_switch_mm(unsigned long pgd_phys, struct mm_struct *mm);
Lorenzo Pieralisi6732bc62013-07-17 10:14:45 +010033extern void cpu_do_suspend(struct cpu_suspend_ctx *ptr);
34extern u64 cpu_do_resume(phys_addr_t ptr, u64 idmap_ttbr);
Catalin Marinas9cce7a42012-03-05 11:49:28 +000035
36#include <asm/memory.h>
37
Will Deacon130c93f2015-03-19 15:43:00 +000038#define cpu_switch_mm(pgd,mm) \
39do { \
40 BUG_ON(pgd == swapper_pg_dir); \
41 cpu_do_switch_mm(virt_to_phys(pgd),mm); \
42} while (0)
Catalin Marinas9cce7a42012-03-05 11:49:28 +000043
Catalin Marinas9cce7a42012-03-05 11:49:28 +000044#endif /* __ASSEMBLY__ */
45#endif /* __KERNEL__ */
46#endif /* __ASM_PROCFNS_H */