-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
yaml --- r: 258324 b: refs/heads/master c: 0ab4c02 h: refs/heads/master v: v3
- Loading branch information
Jon Medhurst
authored and
Tixy
committed
Jul 13, 2011
1 parent
6824dea
commit 0a8e070
Showing
5 changed files
with
110 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
--- | ||
refs/heads/master: 221bf15ffd2ad6cdc624aa4274f706499501c123 | ||
refs/heads/master: 0ab4c02ddae2e1d32d686a7773608f6c44fb2a83 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
/* | ||
* arch/arm/kernel/kprobes-common.c | ||
* | ||
* Copyright (C) 2011 Jon Medhurst <tixy@yxit.co.uk>. | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 2 as | ||
* published by the Free Software Foundation. | ||
*/ | ||
|
||
#include <linux/kernel.h> | ||
#include <linux/kprobes.h> | ||
|
||
#include "kprobes.h" | ||
|
||
|
||
static unsigned long __kprobes __check_eq(unsigned long cpsr) | ||
{ | ||
return cpsr & PSR_Z_BIT; | ||
} | ||
|
||
static unsigned long __kprobes __check_ne(unsigned long cpsr) | ||
{ | ||
return (~cpsr) & PSR_Z_BIT; | ||
} | ||
|
||
static unsigned long __kprobes __check_cs(unsigned long cpsr) | ||
{ | ||
return cpsr & PSR_C_BIT; | ||
} | ||
|
||
static unsigned long __kprobes __check_cc(unsigned long cpsr) | ||
{ | ||
return (~cpsr) & PSR_C_BIT; | ||
} | ||
|
||
static unsigned long __kprobes __check_mi(unsigned long cpsr) | ||
{ | ||
return cpsr & PSR_N_BIT; | ||
} | ||
|
||
static unsigned long __kprobes __check_pl(unsigned long cpsr) | ||
{ | ||
return (~cpsr) & PSR_N_BIT; | ||
} | ||
|
||
static unsigned long __kprobes __check_vs(unsigned long cpsr) | ||
{ | ||
return cpsr & PSR_V_BIT; | ||
} | ||
|
||
static unsigned long __kprobes __check_vc(unsigned long cpsr) | ||
{ | ||
return (~cpsr) & PSR_V_BIT; | ||
} | ||
|
||
static unsigned long __kprobes __check_hi(unsigned long cpsr) | ||
{ | ||
cpsr &= ~(cpsr >> 1); /* PSR_C_BIT &= ~PSR_Z_BIT */ | ||
return cpsr & PSR_C_BIT; | ||
} | ||
|
||
static unsigned long __kprobes __check_ls(unsigned long cpsr) | ||
{ | ||
cpsr &= ~(cpsr >> 1); /* PSR_C_BIT &= ~PSR_Z_BIT */ | ||
return (~cpsr) & PSR_C_BIT; | ||
} | ||
|
||
static unsigned long __kprobes __check_ge(unsigned long cpsr) | ||
{ | ||
cpsr ^= (cpsr << 3); /* PSR_N_BIT ^= PSR_V_BIT */ | ||
return (~cpsr) & PSR_N_BIT; | ||
} | ||
|
||
static unsigned long __kprobes __check_lt(unsigned long cpsr) | ||
{ | ||
cpsr ^= (cpsr << 3); /* PSR_N_BIT ^= PSR_V_BIT */ | ||
return cpsr & PSR_N_BIT; | ||
} | ||
|
||
static unsigned long __kprobes __check_gt(unsigned long cpsr) | ||
{ | ||
unsigned long temp = cpsr ^ (cpsr << 3); /* PSR_N_BIT ^= PSR_V_BIT */ | ||
temp |= (cpsr << 1); /* PSR_N_BIT |= PSR_Z_BIT */ | ||
return (~temp) & PSR_N_BIT; | ||
} | ||
|
||
static unsigned long __kprobes __check_le(unsigned long cpsr) | ||
{ | ||
unsigned long temp = cpsr ^ (cpsr << 3); /* PSR_N_BIT ^= PSR_V_BIT */ | ||
temp |= (cpsr << 1); /* PSR_N_BIT |= PSR_Z_BIT */ | ||
return temp & PSR_N_BIT; | ||
} | ||
|
||
static unsigned long __kprobes __check_al(unsigned long cpsr) | ||
{ | ||
return true; | ||
} | ||
|
||
kprobe_check_cc * const kprobe_condition_checks[16] = { | ||
&__check_eq, &__check_ne, &__check_cs, &__check_cc, | ||
&__check_mi, &__check_pl, &__check_vs, &__check_vc, | ||
&__check_hi, &__check_ls, &__check_ge, &__check_lt, | ||
&__check_gt, &__check_le, &__check_al, &__check_al | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters