Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
selfmod.c File Reference
#include <linux/interrupt.h>
#include <asm/selfmod.h>

Go to the source code of this file.

Macros

#define OPCODE_IMM   0xB0000000
 
#define OPCODE_LWI   0xE8000000
 
#define OPCODE_LWI_MASK   0xEC000000
 
#define OPCODE_RTSD   0xB60F0008 /* return from func: rtsd r15, 8 */
 
#define OPCODE_ADDIK   0x30000000
 
#define OPCODE_ADDIK_MASK   0xFC000000
 
#define IMM_BASE   (OPCODE_IMM | (BARRIER_BASE_ADDR >> 16))
 
#define LWI_BASE   (OPCODE_LWI | (BARRIER_BASE_ADDR & 0x0000ff00))
 
#define LWI_BASE_MASK   (OPCODE_LWI_MASK | (BARRIER_BASE_ADDR & 0x0000ff00))
 
#define ADDIK_BASE   (OPCODE_ADDIK | (BARRIER_BASE_ADDR & 0x0000ff00))
 
#define ADDIK_BASE_MASK   (OPCODE_ADDIK_MASK | (BARRIER_BASE_ADDR & 0x0000ff00))
 
#define MODIFY_INSTR
 

Functions

void selfmod_function (const int *arr_fce, const unsigned int base)
 

Macro Definition Documentation

#define ADDIK_BASE   (OPCODE_ADDIK | (BARRIER_BASE_ADDR & 0x0000ff00))

Definition at line 29 of file selfmod.c.

#define ADDIK_BASE_MASK   (OPCODE_ADDIK_MASK | (BARRIER_BASE_ADDR & 0x0000ff00))

Definition at line 30 of file selfmod.c.

#define IMM_BASE   (OPCODE_IMM | (BARRIER_BASE_ADDR >> 16))

Definition at line 26 of file selfmod.c.

#define LWI_BASE   (OPCODE_LWI | (BARRIER_BASE_ADDR & 0x0000ff00))

Definition at line 27 of file selfmod.c.

#define LWI_BASE_MASK   (OPCODE_LWI_MASK | (BARRIER_BASE_ADDR & 0x0000ff00))

Definition at line 28 of file selfmod.c.

#define MODIFY_INSTR
Value:
{ \
pr_debug("%s: curr instr, (%d):0x%x, next(%d):0x%x\n", \
__func__, i, addr[i], i + 1, addr[i + 1]); \
addr[i] = OPCODE_IMM + (base >> 16); \
/* keep instruction opcode and add only last 16bits */ \
addr[i + 1] = (addr[i + 1] & 0xffff00ff) + (base & 0xffff); \
__invalidate_icache(addr[i]); \
__invalidate_icache(addr[i + 1]); \
pr_debug("%s: hack instr, (%d):0x%x, next(%d):0x%x\n", \
__func__, i, addr[i], i + 1, addr[i + 1]); }

Definition at line 32 of file selfmod.c.

#define OPCODE_ADDIK   0x30000000

Definition at line 23 of file selfmod.c.

#define OPCODE_ADDIK_MASK   0xFC000000

Definition at line 24 of file selfmod.c.

#define OPCODE_IMM   0xB0000000

Definition at line 19 of file selfmod.c.

#define OPCODE_LWI   0xE8000000

Definition at line 20 of file selfmod.c.

#define OPCODE_LWI_MASK   0xEC000000

Definition at line 21 of file selfmod.c.

#define OPCODE_RTSD   0xB60F0008 /* return from func: rtsd r15, 8 */

Definition at line 22 of file selfmod.c.

Function Documentation

void selfmod_function ( const int arr_fce,
const unsigned int  base 
)

Definition at line 47 of file selfmod.c.