mmu.h 732 Bytes
Newer Older
Linus Torvalds's avatar
Linus Torvalds committed
1
2
3
#ifndef __ARM_MMU_H
#define __ARM_MMU_H

4
5
#ifdef CONFIG_MMU

Linus Torvalds's avatar
Linus Torvalds committed
6
typedef struct {
7
#ifdef CONFIG_CPU_HAS_ASID
Linus Torvalds's avatar
Linus Torvalds committed
8
	unsigned int id;
9
	raw_spinlock_t id_lock;
Linus Torvalds's avatar
Linus Torvalds committed
10
#endif
11
	unsigned int kvm_seq;
Linus Torvalds's avatar
Linus Torvalds committed
12
13
} mm_context_t;

14
#ifdef CONFIG_CPU_HAS_ASID
Linus Torvalds's avatar
Linus Torvalds committed
15
#define ASID(mm)	((mm)->context.id & 255)
16
17
18

/* init_mm.context.id_lock should be initialized. */
#define INIT_MM_CONTEXT(name)                                                 \
19
	.context.id_lock    = __RAW_SPIN_LOCK_UNLOCKED(name.context.id_lock),
Linus Torvalds's avatar
Linus Torvalds committed
20
21
22
23
#else
#define ASID(mm)	(0)
#endif

24
25
26
27
28
29
30
31
32
33
34
35
36
#else

/*
 * From nommu.h:
 *  Copyright (C) 2002, David McCullough <davidm@snapgear.com>
 *  modified for 2.6 by Hyok S. Choi <hyok.choi@samsung.com>
 */
typedef struct {
	unsigned long		end_brk;
} mm_context_t;

#endif

Linus Torvalds's avatar
Linus Torvalds committed
37
#endif