Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
unaligned.c File Reference
#include <linux/jiffies.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/sched.h>
#include <linux/signal.h>
#include <linux/ratelimit.h>
#include <asm/uaccess.h>

Go to the source code of this file.

Macros

#define DPRINTF(fmt, args...)
 
#define RFMT   "%08lx"
 
#define FIXUP_BRANCH(lbl)
 
#define FIXUP_BRANCH_CLOBBER   "r1"
 
#define OPCODE1(a, b, c)   ((a)<<26|(b)<<12|(c)<<6)
 
#define OPCODE2(a, b)   ((a)<<26|(b)<<1)
 
#define OPCODE3(a, b)   ((a)<<26|(b)<<2)
 
#define OPCODE4(a)   ((a)<<26)
 
#define OPCODE1_MASK   OPCODE1(0x3f,1,0xf)
 
#define OPCODE2_MASK   OPCODE2(0x3f,1)
 
#define OPCODE3_MASK   OPCODE3(0x3f,1)
 
#define OPCODE4_MASK   OPCODE4(0x3f)
 
#define OPCODE_LDH_I   OPCODE1(0x03,0,0x1)
 
#define OPCODE_LDW_I   OPCODE1(0x03,0,0x2)
 
#define OPCODE_LDD_I   OPCODE1(0x03,0,0x3)
 
#define OPCODE_LDDA_I   OPCODE1(0x03,0,0x4)
 
#define OPCODE_LDCD_I   OPCODE1(0x03,0,0x5)
 
#define OPCODE_LDWA_I   OPCODE1(0x03,0,0x6)
 
#define OPCODE_LDCW_I   OPCODE1(0x03,0,0x7)
 
#define OPCODE_LDH_S   OPCODE1(0x03,1,0x1)
 
#define OPCODE_LDW_S   OPCODE1(0x03,1,0x2)
 
#define OPCODE_LDD_S   OPCODE1(0x03,1,0x3)
 
#define OPCODE_LDDA_S   OPCODE1(0x03,1,0x4)
 
#define OPCODE_LDCD_S   OPCODE1(0x03,1,0x5)
 
#define OPCODE_LDWA_S   OPCODE1(0x03,1,0x6)
 
#define OPCODE_LDCW_S   OPCODE1(0x03,1,0x7)
 
#define OPCODE_STH   OPCODE1(0x03,1,0x9)
 
#define OPCODE_STW   OPCODE1(0x03,1,0xa)
 
#define OPCODE_STD   OPCODE1(0x03,1,0xb)
 
#define OPCODE_STWA   OPCODE1(0x03,1,0xe)
 
#define OPCODE_STDA   OPCODE1(0x03,1,0xf)
 
#define OPCODE_FLDWX   OPCODE1(0x09,0,0x0)
 
#define OPCODE_FLDWXR   OPCODE1(0x09,0,0x1)
 
#define OPCODE_FSTWX   OPCODE1(0x09,0,0x8)
 
#define OPCODE_FSTWXR   OPCODE1(0x09,0,0x9)
 
#define OPCODE_FLDWS   OPCODE1(0x09,1,0x0)
 
#define OPCODE_FLDWSR   OPCODE1(0x09,1,0x1)
 
#define OPCODE_FSTWS   OPCODE1(0x09,1,0x8)
 
#define OPCODE_FSTWSR   OPCODE1(0x09,1,0x9)
 
#define OPCODE_FLDDX   OPCODE1(0x0b,0,0x0)
 
#define OPCODE_FSTDX   OPCODE1(0x0b,0,0x8)
 
#define OPCODE_FLDDS   OPCODE1(0x0b,1,0x0)
 
#define OPCODE_FSTDS   OPCODE1(0x0b,1,0x8)
 
#define OPCODE_LDD_L   OPCODE2(0x14,0)
 
#define OPCODE_FLDD_L   OPCODE2(0x14,1)
 
#define OPCODE_STD_L   OPCODE2(0x1c,0)
 
#define OPCODE_FSTD_L   OPCODE2(0x1c,1)
 
#define OPCODE_LDW_M   OPCODE3(0x17,1)
 
#define OPCODE_FLDW_L   OPCODE3(0x17,0)
 
#define OPCODE_FSTW_L   OPCODE3(0x1f,0)
 
#define OPCODE_STW_M   OPCODE3(0x1f,1)
 
#define OPCODE_LDH_L   OPCODE4(0x11)
 
#define OPCODE_LDW_L   OPCODE4(0x12)
 
#define OPCODE_LDWM   OPCODE4(0x13)
 
#define OPCODE_STH_L   OPCODE4(0x19)
 
#define OPCODE_STW_L   OPCODE4(0x1A)
 
#define OPCODE_STWM   OPCODE4(0x1B)
 
#define MAJOR_OP(i)   (((i)>>26)&0x3f)
 
#define R1(i)   (((i)>>21)&0x1f)
 
#define R2(i)   (((i)>>16)&0x1f)
 
#define R3(i)   ((i)&0x1f)
 
#define FR3(i)   ((((i)<<1)&0x1f)|(((i)>>6)&1))
 
#define IM(i, n)   (((i)>>1&((1<<(n-1))-1))|((i)&1?((0-1L)<<(n-1)):0))
 
#define IM5_2(i)   IM((i)>>16,5)
 
#define IM5_3(i)   IM((i),5)
 
#define IM14(i)   IM((i),14)
 
#define ERR_NOTHANDLED   -1
 
#define ERR_PAGEFAULT   -2
 

Functions

void die_if_kernel (char *str, struct pt_regs *regs, long err)
 
void handle_unaligned (struct pt_regs *regs)
 
int check_unaligned (struct pt_regs *regs)
 

Variables

int unaligned_enabled __read_mostly = 1
 

Macro Definition Documentation

#define DPRINTF (   fmt,
  args... 
)

Definition at line 36 of file unaligned.c.

#define ERR_NOTHANDLED   -1

Definition at line 127 of file unaligned.c.

#define ERR_PAGEFAULT   -2

Definition at line 128 of file unaligned.c.

#define FIXUP_BRANCH (   lbl)
Value:
"\tldil L%%" #lbl ", %%r1\n" \
"\tldo R%%" #lbl "(%%r1), %%r1\n" \
"\tbv,n %%r0(%%r1)\n"

Definition at line 45 of file unaligned.c.

#define FIXUP_BRANCH_CLOBBER   "r1"

Definition at line 50 of file unaligned.c.

#define FR3 (   i)    ((((i)<<1)&0x1f)|(((i)>>6)&1))

Definition at line 121 of file unaligned.c.

#define IM (   i,
  n 
)    (((i)>>1&((1<<(n-1))-1))|((i)&1?((0-1L)<<(n-1)):0))

Definition at line 122 of file unaligned.c.

#define IM14 (   i)    IM((i),14)

Definition at line 125 of file unaligned.c.

#define IM5_2 (   i)    IM((i)>>16,5)

Definition at line 123 of file unaligned.c.

#define IM5_3 (   i)    IM((i),5)

Definition at line 124 of file unaligned.c.

#define MAJOR_OP (   i)    (((i)>>26)&0x3f)

Definition at line 117 of file unaligned.c.

#define OPCODE1 (   a,
  b,
  c 
)    ((a)<<26|(b)<<12|(c)<<6)

Definition at line 53 of file unaligned.c.

#define OPCODE1_MASK   OPCODE1(0x3f,1,0xf)

Definition at line 57 of file unaligned.c.

#define OPCODE2 (   a,
  b 
)    ((a)<<26|(b)<<1)

Definition at line 54 of file unaligned.c.

#define OPCODE2_MASK   OPCODE2(0x3f,1)

Definition at line 58 of file unaligned.c.

#define OPCODE3 (   a,
  b 
)    ((a)<<26|(b)<<2)

Definition at line 55 of file unaligned.c.

#define OPCODE3_MASK   OPCODE3(0x3f,1)

Definition at line 59 of file unaligned.c.

#define OPCODE4 (   a)    ((a)<<26)

Definition at line 56 of file unaligned.c.

#define OPCODE4_MASK   OPCODE4(0x3f)

Definition at line 60 of file unaligned.c.

#define OPCODE_FLDD_L   OPCODE2(0x14,1)

Definition at line 101 of file unaligned.c.

#define OPCODE_FLDDS   OPCODE1(0x0b,1,0x0)

Definition at line 97 of file unaligned.c.

#define OPCODE_FLDDX   OPCODE1(0x0b,0,0x0)

Definition at line 95 of file unaligned.c.

#define OPCODE_FLDW_L   OPCODE3(0x17,0)

Definition at line 106 of file unaligned.c.

#define OPCODE_FLDWS   OPCODE1(0x09,1,0x0)

Definition at line 91 of file unaligned.c.

#define OPCODE_FLDWSR   OPCODE1(0x09,1,0x1)

Definition at line 92 of file unaligned.c.

#define OPCODE_FLDWX   OPCODE1(0x09,0,0x0)

Definition at line 87 of file unaligned.c.

#define OPCODE_FLDWXR   OPCODE1(0x09,0,0x1)

Definition at line 88 of file unaligned.c.

#define OPCODE_FSTD_L   OPCODE2(0x1c,1)

Definition at line 103 of file unaligned.c.

#define OPCODE_FSTDS   OPCODE1(0x0b,1,0x8)

Definition at line 98 of file unaligned.c.

#define OPCODE_FSTDX   OPCODE1(0x0b,0,0x8)

Definition at line 96 of file unaligned.c.

#define OPCODE_FSTW_L   OPCODE3(0x1f,0)

Definition at line 107 of file unaligned.c.

#define OPCODE_FSTWS   OPCODE1(0x09,1,0x8)

Definition at line 93 of file unaligned.c.

#define OPCODE_FSTWSR   OPCODE1(0x09,1,0x9)

Definition at line 94 of file unaligned.c.

#define OPCODE_FSTWX   OPCODE1(0x09,0,0x8)

Definition at line 89 of file unaligned.c.

#define OPCODE_FSTWXR   OPCODE1(0x09,0,0x9)

Definition at line 90 of file unaligned.c.

#define OPCODE_LDCD_I   OPCODE1(0x03,0,0x5)

Definition at line 67 of file unaligned.c.

#define OPCODE_LDCD_S   OPCODE1(0x03,1,0x5)

Definition at line 75 of file unaligned.c.

#define OPCODE_LDCW_I   OPCODE1(0x03,0,0x7)

Definition at line 69 of file unaligned.c.

#define OPCODE_LDCW_S   OPCODE1(0x03,1,0x7)

Definition at line 77 of file unaligned.c.

#define OPCODE_LDD_I   OPCODE1(0x03,0,0x3)

Definition at line 65 of file unaligned.c.

#define OPCODE_LDD_L   OPCODE2(0x14,0)

Definition at line 100 of file unaligned.c.

#define OPCODE_LDD_S   OPCODE1(0x03,1,0x3)

Definition at line 73 of file unaligned.c.

#define OPCODE_LDDA_I   OPCODE1(0x03,0,0x4)

Definition at line 66 of file unaligned.c.

#define OPCODE_LDDA_S   OPCODE1(0x03,1,0x4)

Definition at line 74 of file unaligned.c.

#define OPCODE_LDH_I   OPCODE1(0x03,0,0x1)

Definition at line 63 of file unaligned.c.

#define OPCODE_LDH_L   OPCODE4(0x11)

Definition at line 110 of file unaligned.c.

#define OPCODE_LDH_S   OPCODE1(0x03,1,0x1)

Definition at line 71 of file unaligned.c.

#define OPCODE_LDW_I   OPCODE1(0x03,0,0x2)

Definition at line 64 of file unaligned.c.

#define OPCODE_LDW_L   OPCODE4(0x12)

Definition at line 111 of file unaligned.c.

#define OPCODE_LDW_M   OPCODE3(0x17,1)

Definition at line 105 of file unaligned.c.

#define OPCODE_LDW_S   OPCODE1(0x03,1,0x2)

Definition at line 72 of file unaligned.c.

#define OPCODE_LDWA_I   OPCODE1(0x03,0,0x6)

Definition at line 68 of file unaligned.c.

#define OPCODE_LDWA_S   OPCODE1(0x03,1,0x6)

Definition at line 76 of file unaligned.c.

#define OPCODE_LDWM   OPCODE4(0x13)

Definition at line 112 of file unaligned.c.

#define OPCODE_STD   OPCODE1(0x03,1,0xb)

Definition at line 81 of file unaligned.c.

#define OPCODE_STD_L   OPCODE2(0x1c,0)

Definition at line 102 of file unaligned.c.

#define OPCODE_STDA   OPCODE1(0x03,1,0xf)

Definition at line 85 of file unaligned.c.

#define OPCODE_STH   OPCODE1(0x03,1,0x9)

Definition at line 79 of file unaligned.c.

#define OPCODE_STH_L   OPCODE4(0x19)

Definition at line 113 of file unaligned.c.

#define OPCODE_STW   OPCODE1(0x03,1,0xa)

Definition at line 80 of file unaligned.c.

#define OPCODE_STW_L   OPCODE4(0x1A)

Definition at line 114 of file unaligned.c.

#define OPCODE_STW_M   OPCODE3(0x1f,1)

Definition at line 108 of file unaligned.c.

#define OPCODE_STWA   OPCODE1(0x03,1,0xe)

Definition at line 84 of file unaligned.c.

#define OPCODE_STWM   OPCODE4(0x1B)

Definition at line 115 of file unaligned.c.

#define R1 (   i)    (((i)>>21)&0x1f)

Definition at line 118 of file unaligned.c.

#define R2 (   i)    (((i)>>16)&0x1f)

Definition at line 119 of file unaligned.c.

#define R3 (   i)    ((i)&0x1f)

Definition at line 120 of file unaligned.c.

#define RFMT   "%08lx"

Definition at line 42 of file unaligned.c.

Function Documentation

int check_unaligned ( struct pt_regs regs)

Definition at line 712 of file unaligned.c.

void die_if_kernel ( char str,
struct pt_regs regs,
long  err 
)

Definition at line 243 of file traps.c.

void handle_unaligned ( struct pt_regs regs)

Definition at line 448 of file unaligned.c.

Variable Documentation

int unaligned_enabled __read_mostly = 1

Definition at line 130 of file unaligned.c.