blob: cf0c81fc93e2285b14d165f0fcb8694554b62ca0 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef __ARM_MMU_H
2#define __ARM_MMU_H
3
Russell King002547b2006-06-20 20:46:52 +01004#ifdef CONFIG_MMU
5
Linus Torvalds1da177e2005-04-16 15:20:36 -07006typedef struct {
Russell King516793c2007-05-17 10:19:23 +01007#ifdef CONFIG_CPU_HAS_ASID
Linus Torvalds1da177e2005-04-16 15:20:36 -07008 unsigned int id;
Thomas Gleixnerbd31b852009-07-03 08:44:46 -05009 raw_spinlock_t id_lock;
Linus Torvalds1da177e2005-04-16 15:20:36 -070010#endif
Russell Kingff0daca2006-06-29 20:17:15 +010011 unsigned int kvm_seq;
Russell King10d98aa2013-07-24 00:29:18 +010012 unsigned long sigpage;
Linus Torvalds1da177e2005-04-16 15:20:36 -070013} mm_context_t;
14
Russell King516793c2007-05-17 10:19:23 +010015#ifdef CONFIG_CPU_HAS_ASID
Linus Torvalds1da177e2005-04-16 15:20:36 -070016#define ASID(mm) ((mm)->context.id & 255)
MyungJoo Ham28c22d72010-11-23 11:39:23 +010017
18/* init_mm.context.id_lock should be initialized. */
19#define INIT_MM_CONTEXT(name) \
Thomas Gleixnerbd31b852009-07-03 08:44:46 -050020 .context.id_lock = __RAW_SPIN_LOCK_UNLOCKED(name.context.id_lock),
Linus Torvalds1da177e2005-04-16 15:20:36 -070021#else
22#define ASID(mm) (0)
23#endif
24
Russell King002547b2006-06-20 20:46:52 +010025#else
26
27/*
28 * From nommu.h:
29 * Copyright (C) 2002, David McCullough <davidm@snapgear.com>
30 * modified for 2.6 by Hyok S. Choi <hyok.choi@samsung.com>
31 */
32typedef struct {
Russell King002547b2006-06-20 20:46:52 +010033 unsigned long end_brk;
34} mm_context_t;
35
36#endif
37
David Howells9f97da72012-03-28 18:30:01 +010038/*
39 * switch_mm() may do a full cache flush over the context switch,
40 * so enable interrupts over the context switch to avoid high
41 * latency.
42 */
43#define __ARCH_WANT_INTERRUPTS_ON_CTXSW
44
Linus Torvalds1da177e2005-04-16 15:20:36 -070045#endif