diff options
author | Paul Mundt <lethal@linux-sh.org> | 2010-01-27 07:56:57 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2010-01-27 07:56:57 -0500 |
commit | 08b36c4a02b5a9db609fc6d93b9c41d7fa75713c (patch) | |
tree | 3399d6e0ae71eecbf3cc348324becf536f0f1b99 | |
parent | 485773f3e401fca31c112c1ff24797e42ff87afd (diff) |
sh: Optimize runtime disabling of trapped I/O.
Presently trapped I/O is only registered if it's not explicitly disabled
for the platforms that select it openly. From the fault path this runs
through an address lookup before figuring out that nothing matches and
falls back through the error path, but we can forego the lookup
completely by testing if it's been explicitly disabled. This provides a
measurable speedup for things like qemu that rely on runtime disabling.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-rw-r--r-- | arch/sh/kernel/io_trapped.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/sh/kernel/io_trapped.c b/arch/sh/kernel/io_trapped.c index 16b83cc89a41..4a8bb4eeb8ad 100644 --- a/arch/sh/kernel/io_trapped.c +++ b/arch/sh/kernel/io_trapped.c | |||
@@ -271,6 +271,8 @@ int handle_trapped_io(struct pt_regs *regs, unsigned long address) | |||
271 | insn_size_t instruction; | 271 | insn_size_t instruction; |
272 | int tmp; | 272 | int tmp; |
273 | 273 | ||
274 | if (trapped_io_disable) | ||
275 | return 0; | ||
274 | if (!lookup_tiop(address)) | 276 | if (!lookup_tiop(address)) |
275 | return 0; | 277 | return 0; |
276 | 278 | ||