blob: 1592a4264488e2c0646c5500fc6e4b8c44d5247a [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002#ifndef __ARM_MMU_H
3#define __ARM_MMU_H
4
Russell King002547b2006-06-20 20:46:52 +01005#ifdef CONFIG_MMU
6
Linus Torvalds1da177e2005-04-16 15:20:36 -07007typedef struct {
Russell King516793c2007-05-17 10:19:23 +01008#ifdef CONFIG_CPU_HAS_ASID
Will Deacon8a4e3a92013-02-28 17:47:36 +01009 atomic64_t id;
Catalin Marinasbdae73c2013-07-23 16:15:36 +010010#else
11 int switch_pending;
Linus Torvalds1da177e2005-04-16 15:20:36 -070012#endif
Will Deacon8a4e3a92013-02-28 17:47:36 +010013 unsigned int vmalloc_seq;
Russell King48be69a2013-07-24 00:29:18 +010014 unsigned long sigpage;
Nathan Lynch1713ce72015-03-25 19:13:16 +010015#ifdef CONFIG_VDSO
16 unsigned long vdso;
17#endif
Nicolas Pitre382e67a2017-08-11 00:53:39 -040018#ifdef CONFIG_BINFMT_ELF_FDPIC
19 unsigned long exec_fdpic_loadmap;
20 unsigned long interp_fdpic_loadmap;
21#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070022} mm_context_t;
23
Russell King516793c2007-05-17 10:19:23 +010024#ifdef CONFIG_CPU_HAS_ASID
Will Deaconb5466f82012-06-15 14:47:31 +010025#define ASID_BITS 8
26#define ASID_MASK ((~0ULL) << ASID_BITS)
Victor Kamenskya1af3472013-10-07 08:48:23 -070027#define ASID(mm) ((unsigned int)((mm)->context.id.counter & ~ASID_MASK))
Linus Torvalds1da177e2005-04-16 15:20:36 -070028#else
29#define ASID(mm) (0)
30#endif
31
Russell King002547b2006-06-20 20:46:52 +010032#else
33
34/*
35 * From nommu.h:
36 * Copyright (C) 2002, David McCullough <davidm@snapgear.com>
37 * modified for 2.6 by Hyok S. Choi <hyok.choi@samsung.com>
38 */
39typedef struct {
Will Deacon8a4e3a92013-02-28 17:47:36 +010040 unsigned long end_brk;
Nicolas Pitre50b2b2e2017-07-22 01:02:40 -040041#ifdef CONFIG_BINFMT_ELF_FDPIC
42 unsigned long exec_fdpic_loadmap;
43 unsigned long interp_fdpic_loadmap;
44#endif
Russell King002547b2006-06-20 20:46:52 +010045} mm_context_t;
46
47#endif
48
Linus Torvalds1da177e2005-04-16 15:20:36 -070049#endif