diff options
author | Will Deacon <will.deacon@arm.com> | 2013-01-17 07:31:45 -0500 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2013-02-11 13:24:18 -0500 |
commit | ec45d1cfd3cb65121fc52f39efc17d832f4f7b91 (patch) | |
tree | f588db6111ee97aeddd69e05646cd49c31b353a0 /arch/arm64/kernel/process.c | |
parent | 3a0310eb369aae985d6409d8ff1340146578e5c1 (diff) |
arm64: mm: update CONTEXTIDR register to contain PID of current process
This patch is a port of 575320d62 ("ARM: 7445/1: mm: update CONTEXTIDR
register to contain PID of current process") from ARM that introduces a
new Kconfig option which, when enabled, causes the kernel to write the
PID of the current task into the CONTEXTIDR register on context switch.
This is useful when analysing hardware trace, since writes to this
register can be configured to emit an event into the trace stream.
Signed-off-by: Will Deacon <will.deacon@arm.com>
[catalin.marinas@arm.com: contextidr_thread_switch() moved to mmu_context.h]
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'arch/arm64/kernel/process.c')
-rw-r--r-- | arch/arm64/kernel/process.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c index cb0956bc96ed..a8fbd7eaa2ed 100644 --- a/arch/arm64/kernel/process.c +++ b/arch/arm64/kernel/process.c | |||
@@ -45,9 +45,10 @@ | |||
45 | 45 | ||
46 | #include <asm/compat.h> | 46 | #include <asm/compat.h> |
47 | #include <asm/cacheflush.h> | 47 | #include <asm/cacheflush.h> |
48 | #include <asm/fpsimd.h> | ||
49 | #include <asm/mmu_context.h> | ||
48 | #include <asm/processor.h> | 50 | #include <asm/processor.h> |
49 | #include <asm/stacktrace.h> | 51 | #include <asm/stacktrace.h> |
50 | #include <asm/fpsimd.h> | ||
51 | 52 | ||
52 | static void setup_restart(void) | 53 | static void setup_restart(void) |
53 | { | 54 | { |
@@ -319,6 +320,7 @@ struct task_struct *__switch_to(struct task_struct *prev, | |||
319 | /* the actual thread switch */ | 320 | /* the actual thread switch */ |
320 | last = cpu_switch_to(prev, next); | 321 | last = cpu_switch_to(prev, next); |
321 | 322 | ||
323 | contextidr_thread_switch(next); | ||
322 | return last; | 324 | return last; |
323 | } | 325 | } |
324 | 326 | ||