summaryrefslogtreecommitdiff
path: root/tools/hooks.py
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2012-07-08 02:46:59 +0200
committerTreeki <treeki@gmail.com>2012-07-08 02:46:59 +0200
commit613e30a894cddcdc11c8da140bae35090247c8ec (patch)
tree274cbfccc9e1795d13e1f2fe69d172d4b469877a /tools/hooks.py
parent1c3e5a0b1c62829d78960c4d99e4928ccf73625f (diff)
downloadkamek-613e30a894cddcdc11c8da140bae35090247c8ec.tar.gz
kamek-613e30a894cddcdc11c8da140bae35090247c8ec.zip
added PALv2, made Kamek link all regions at the same time
Diffstat (limited to '')
-rwxr-xr-xtools/hooks.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/tools/hooks.py b/tools/hooks.py
index 388efcb..7252489 100755
--- a/tools/hooks.py
+++ b/tools/hooks.py
@@ -48,10 +48,10 @@ class Hook(object):
self.context.hooks.append(self)
# validate the hook's data
- current_config_name = builder.config_short_name
+ current_build_name = builder.current_build_name
for field in self.required_data:
- field = field.replace('%CONFIG%', current_config_name)
+ field = field.replace('%BUILD%', current_build_name)
if field not in data:
raise ValueError, 'hook %s : %s is missing the field %s' % (module.moduleName, data['name'], field)
@@ -63,13 +63,13 @@ class Hook(object):
class BasicPatchHook(Hook):
"""Hook that simply patches data to an address"""
- required_data = ['addr_%CONFIG%', 'data']
+ required_data = ['addr_%BUILD%', 'data']
def __init__(self, builder, module, data):
Hook.__init__(self, builder, module, data)
def create_patches(self):
- addr = self.data['addr_%s' % self.builder.config_short_name]
+ addr = self.data['addr_%s' % self.builder.current_build_name]
hex_data = self.data['data']
@@ -86,7 +86,7 @@ class BasicPatchHook(Hook):
class BranchInsnHook(Hook):
"""Hook that replaces the instruction at a specific address with a branch"""
- required_data = ['branch_type', 'src_addr_%CONFIG%']
+ required_data = ['branch_type', 'src_addr_%BUILD%']
def __init__(self, builder, module, data):
Hook.__init__(self, builder, module, data)
@@ -95,9 +95,9 @@ class BranchInsnHook(Hook):
try:
target_func = self.data['target_func']
except KeyError:
- target_func = self.data['target_func_%s' % self.builder.config_short_name]
+ target_func = self.data['target_func_%s' % self.builder.current_build_name]
- src_addr = self.data['src_addr_%s' % self.builder.config_short_name]
+ src_addr = self.data['src_addr_%s' % self.builder.current_build_name]
is_symbol_name = isinstance(target_func, str)
if is_symbol_name:
@@ -118,7 +118,7 @@ class BranchInsnHook(Hook):
class AddFunctionPointerHook(Hook):
"""Hook that places a function pointer at an address"""
- required_data = ['src_addr_%CONFIG%']
+ required_data = ['src_addr_%BUILD%']
def __init__(self, builder, module, data):
Hook.__init__(self, builder, module, data)
@@ -127,9 +127,9 @@ class AddFunctionPointerHook(Hook):
try:
target_func = self.data['target_func']
except KeyError:
- target_func = self.data['target_func_%s' % self.builder.config_short_name]
+ target_func = self.data['target_func_%s' % self.builder.current_build_name]
- src_addr = self.data['src_addr_%s' % self.builder.config_short_name]
+ src_addr = self.data['src_addr_%s' % self.builder.current_build_name]
is_symbol_name = isinstance(target_func, str)
if is_symbol_name:
@@ -146,13 +146,13 @@ class AddFunctionPointerHook(Hook):
class NopInsnHook(Hook):
"""Hook that NOPs out the instruction(s) at an address"""
- required_data = ['area_%CONFIG%']
+ required_data = ['area_%BUILD%']
def __init__(self, builder, module, data):
Hook.__init__(self, builder, module, data)
def create_patches(self):
- area = self.data['area_%s' % self.builder.config_short_name]
+ area = self.data['area_%s' % self.builder.current_build_name]
if isinstance(area, list):
addr, end = area