Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #ifndef __ARM_MMU_H |
| 2 | #define __ARM_MMU_H |
| 3 | |
Russell King | 002547b | 2006-06-20 20:46:52 +0100 | [diff] [blame] | 4 | #ifdef CONFIG_MMU |
| 5 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 6 | typedef struct { |
Russell King | 516793c | 2007-05-17 10:19:23 +0100 | [diff] [blame] | 7 | #ifdef CONFIG_CPU_HAS_ASID |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 8 | unsigned int id; |
Thomas Gleixner | bd31b85 | 2009-07-03 08:44:46 -0500 | [diff] [blame] | 9 | raw_spinlock_t id_lock; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 10 | #endif |
Russell King | ff0daca | 2006-06-29 20:17:15 +0100 | [diff] [blame] | 11 | unsigned int kvm_seq; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 12 | } mm_context_t; |
| 13 | |
Russell King | 516793c | 2007-05-17 10:19:23 +0100 | [diff] [blame] | 14 | #ifdef CONFIG_CPU_HAS_ASID |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 15 | #define ASID(mm) ((mm)->context.id & 255) |
MyungJoo Ham | 28c22d7 | 2010-11-23 11:39:23 +0100 | [diff] [blame] | 16 | |
| 17 | /* init_mm.context.id_lock should be initialized. */ |
| 18 | #define INIT_MM_CONTEXT(name) \ |
Thomas Gleixner | bd31b85 | 2009-07-03 08:44:46 -0500 | [diff] [blame] | 19 | .context.id_lock = __RAW_SPIN_LOCK_UNLOCKED(name.context.id_lock), |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 20 | #else |
| 21 | #define ASID(mm) (0) |
| 22 | #endif |
| 23 | |
Russell King | 002547b | 2006-06-20 20:46:52 +0100 | [diff] [blame] | 24 | #else |
| 25 | |
| 26 | /* |
| 27 | * From nommu.h: |
| 28 | * Copyright (C) 2002, David McCullough <davidm@snapgear.com> |
| 29 | * modified for 2.6 by Hyok S. Choi <hyok.choi@samsung.com> |
| 30 | */ |
| 31 | typedef struct { |
Russell King | 002547b | 2006-06-20 20:46:52 +0100 | [diff] [blame] | 32 | unsigned long end_brk; |
| 33 | } mm_context_t; |
| 34 | |
| 35 | #endif |
| 36 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 37 | #endif |