Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
Zipr Backend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Open Source Software
Zipr Backend
Commits
f4b53caf
Commit
f4b53caf
authored
5 years ago
by
Jason Hiser
Browse files
Options
Downloads
Patches
Plain Diff
added patching for bc1f and bc1t
parent
ef66c8c9
No related branches found
No related tags found
No related merge requests found
Pipeline
#6030
failed
5 years ago
Stage: clean
Stage: build
Stage: test
Changes
1
Pipelines
8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/patcher_mips32.cpp
+9
-4
9 additions, 4 deletions
src/patcher_mips32.cpp
with
9 additions
and
4 deletions
src/patcher_mips32.cpp
+
9
−
4
View file @
f4b53caf
...
...
@@ -64,9 +64,12 @@ void ZiprPatcherMIPS32_t::ApplyNopToPatch(RangeAddress_t addr)
void
ZiprPatcherMIPS32_t
::
ApplyPatch
(
RangeAddress_t
from_addr
,
RangeAddress_t
to_addr
)
{
const
auto
mask6
=
0b111111
;
const
auto
first_byte
=
(
uint8_t
)
memory_space
[
from_addr
+
0
];
const
auto
top6bits
=
(
first_byte
>>
2
)
&
mask6
;
const
auto
mask6
=
0b111111
;
const
auto
first_byte
=
(
uint8_t
)
memory_space
[
from_addr
+
0
];
const
auto
second_byte
=
(
uint8_t
)
memory_space
[
from_addr
+
1
];
const
auto
top6bits
=
(
first_byte
>>
2
)
&
mask6
;
const
auto
top16bits
=
(
uint32_t
(
first_byte
)
<<
8
)
|
second_byte
;
const
auto
top16bits_nocc
=
top16bits
&
~
(
0b11100
);
if
(
...
...
@@ -75,7 +78,9 @@ void ZiprPatcherMIPS32_t::ApplyPatch(RangeAddress_t from_addr, RangeAddress_t to
top6bits
==
0b000111
||
// bgtz,
top6bits
==
0b000110
||
// blez,
top6bits
==
0b000110
||
// blez,
top6bits
==
0b000101
// bne
top6bits
==
0b000101
||
// bne
top16bits_nocc
==
0b0100010100000000
||
// bc1f
top16bits_nocc
==
0b0100010100000001
// bc1t
)
{
const
auto
new_offset
=
(
int32_t
)((
to_addr
)
-
(
from_addr
+
4
))
>>
2
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment