Commit 49aea0fd authored by Russell King's avatar Russell King

ARM: nwfpe: allow debugging output to be configured at runtime

Enabling CONFIG_USER_DEBUG allows NWFPE to complain about every FP
exception, which with some programs can cause the kernel message log
to fill with NWFPE debug, swamping out other messages.

This change allows NWFPE debugging to be configured at run time.
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 8e2a43f5
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include "fpa11.h" #include "fpa11.h"
#include <linux/module.h> #include <linux/module.h>
#include <linux/moduleparam.h>
/* XXX */ /* XXX */
#include <linux/errno.h> #include <linux/errno.h>
...@@ -134,13 +135,17 @@ a SIGFPE exception if necessary. If not the relevant bits in the ...@@ -134,13 +135,17 @@ a SIGFPE exception if necessary. If not the relevant bits in the
cumulative exceptions flag byte are set and we return. cumulative exceptions flag byte are set and we return.
*/ */
#ifdef CONFIG_DEBUG_USER
/* By default, ignore inexact errors as there are far too many of them to log */
static int debug = ~BIT_IXC;
#endif
void float_raise(signed char flags) void float_raise(signed char flags)
{ {
register unsigned int fpsr, cumulativeTraps; register unsigned int fpsr, cumulativeTraps;
#ifdef CONFIG_DEBUG_USER #ifdef CONFIG_DEBUG_USER
/* Ignore inexact errors as there are far too many of them to log */ if (flags & debug)
if (flags & ~BIT_IXC)
printk(KERN_DEBUG printk(KERN_DEBUG
"NWFPE: %s[%d] takes exception %08x at %p from %08lx\n", "NWFPE: %s[%d] takes exception %08x at %p from %08lx\n",
current->comm, current->pid, flags, current->comm, current->pid, flags,
...@@ -179,3 +184,7 @@ module_exit(fpe_exit); ...@@ -179,3 +184,7 @@ module_exit(fpe_exit);
MODULE_AUTHOR("Scott Bambrough <scottb@rebel.com>"); MODULE_AUTHOR("Scott Bambrough <scottb@rebel.com>");
MODULE_DESCRIPTION("NWFPE floating point emulator (" NWFPE_BITS " precision)"); MODULE_DESCRIPTION("NWFPE floating point emulator (" NWFPE_BITS " precision)");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
#ifdef CONFIG_DEBUG_USER
module_param(debug, int, 0644);
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment