diff options
author | Jimi Xenidis <jimix@pobox.com> | 2011-09-29 10:55:14 +0000 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2011-11-25 14:11:28 +1100 |
commit | c3dcf53a3fcb01f1d98f6b0cf440bb781dbcbc34 (patch) | |
tree | 8b0271a59dc103db39b3e8259419b9b549c89eae /arch/powerpc/mm/icswx.h | |
parent | fac26ad4f9cb794c9d1032f55f40a31cb55be09a (diff) |
powerpc/icswx: Simple ACOP fault handler
This patch adds a fault handler that responds to illegal Coprocessor
types. Currently all CTs are treated and illegal. There are two ways
to report the fault back to the application. If the application used
the record form ("icswx.") then the architected "reject" is emulated.
If the application did not used the record form ("icswx") then it is
selectable by config whether the failure is silent (as architected) or
a SIGILL is generated.
In all cases pr_warn() is used to log the bad CT.
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 | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/arch/powerpc/mm/icswx.h b/arch/powerpc/mm/icswx.h index 07514e49498e..42176bd0884c 100644 --- a/arch/powerpc/mm/icswx.h +++ b/arch/powerpc/mm/icswx.h @@ -36,4 +36,27 @@ extern void free_cop_pid(int free_pid); #define free_cop_pid(p) #endif +/* + * These are implementation bits for architected registers. If this + * ever becomes architecture the should be moved to reg.h et. al. + */ +/* UCT is the same bit for Server and Embedded */ +#define ICSWX_DSI_UCT 0x00004000 /* Unavailable Coprocessor Type */ + +#ifdef CONFIG_PPC_BOOK3E +/* Embedded implementation gives us no hints as to what the CT is */ +#define ICSWX_GET_CT_HINT(x) (-1) +#else +/* Server implementation contains the CT value in the DSISR */ +#define ICSWX_DSISR_CTMASK 0x00003f00 +#define ICSWX_GET_CT_HINT(x) (((x) & ICSWX_DSISR_CTMASK) >> 8) +#endif + +#define ICSWX_RC_STARTED 0x8 /* The request has been started */ +#define ICSWX_RC_NOT_IDLE 0x4 /* No coprocessor found idle */ +#define ICSWX_RC_NOT_FOUND 0x2 /* No coprocessor found */ +#define ICSWX_RC_UNDEFINED 0x1 /* Reserved */ + +extern int acop_handle_fault(struct pt_regs *regs, unsigned long address, + unsigned long error_code); #endif /* !_ARCH_POWERPC_MM_ICSWX_H_ */ |