diff options
author | Jimi Xenidis <jimix@pobox.com> | 2011-09-29 06:55:12 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2011-11-24 22:11:27 -0500 |
commit | 9d670280908013004f173b2b86414d9b6918511b (patch) | |
tree | bd7a7483ae7455cb481c72df907a3b4362e121c2 /arch/powerpc/mm/icswx.h | |
parent | 5182a131ddf988fe4f5cef9964dbfb64a188b0c3 (diff) |
powerpc: Split ICSWX ACOP and PID processing
Some processors, like embedded, that already have a PID register that
is managed by the system. This patch separates the ACOP and PID
processing into separate files so that the ACOP code can be shared.
Signed-off-by: Jimi Xenidis <jimix@pobox.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/mm/icswx.h')
-rw-r--r-- | arch/powerpc/mm/icswx.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/arch/powerpc/mm/icswx.h b/arch/powerpc/mm/icswx.h new file mode 100644 index 00000000000..07514e49498 --- /dev/null +++ b/arch/powerpc/mm/icswx.h | |||
@@ -0,0 +1,39 @@ | |||
1 | #ifndef _ARCH_POWERPC_MM_ICSWX_H_ | ||
2 | #define _ARCH_POWERPC_MM_ICSWX_H_ | ||
3 | |||
4 | /* | ||
5 | * ICSWX and ACOP Management | ||
6 | * | ||
7 | * Copyright (C) 2011 Anton Blanchard, IBM Corp. <anton@samba.org> | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or | ||
10 | * modify it under the terms of the GNU General Public License | ||
11 | * as published by the Free Software Foundation; either version | ||
12 | * 2 of the License, or (at your option) any later version. | ||
13 | * | ||
14 | */ | ||
15 | |||
16 | #include <asm/mmu_context.h> | ||
17 | |||
18 | /* also used to denote that PIDs are not used */ | ||
19 | #define COP_PID_NONE 0 | ||
20 | |||
21 | static inline void sync_cop(void *arg) | ||
22 | { | ||
23 | struct mm_struct *mm = arg; | ||
24 | |||
25 | if (mm == current->active_mm) | ||
26 | switch_cop(current->active_mm); | ||
27 | } | ||
28 | |||
29 | #ifdef CONFIG_PPC_ICSWX_PID | ||
30 | extern int get_cop_pid(struct mm_struct *mm); | ||
31 | extern int disable_cop_pid(struct mm_struct *mm); | ||
32 | extern void free_cop_pid(int free_pid); | ||
33 | #else | ||
34 | #define get_cop_pid(m) (COP_PID_NONE) | ||
35 | #define disable_cop_pid(m) (COP_PID_NONE) | ||
36 | #define free_cop_pid(p) | ||
37 | #endif | ||
38 | |||
39 | #endif /* !_ARCH_POWERPC_MM_ICSWX_H_ */ | ||