Skip to content
Snippets Groups Projects
Commit 119dcf14 authored by Satyajit Desai's avatar Satyajit Desai
Browse files

dcc_parser: Fix offset calculation for second offset

Length from the first offset/length pair needs to be taken
into consideration for the second offset calculation. This
fixes the parser to account for it.

Change-Id: Id053c7b097f9898280fb120d0cf2457f24532d5f
parent 55d593a1
No related branches found
No related tags found
No related merge requests found
......@@ -79,6 +79,7 @@ def read_config(config_pt):
link_second_arg = 8
# We return zero and fail
on_zero_link_len = 0
track_len = 0
else:
address_descriptor = 0
link_descriptor = 0x3 << 30
......@@ -88,6 +89,8 @@ def read_config(config_pt):
link_second_arg = 7
#indicates end of list
on_zero_link_len = -1
#word size
track_len = 4
while True:
word = config_pt.read(4)
......@@ -107,9 +110,10 @@ def read_config(config_pt):
elif descriptor == address_descriptor:
base = ((val & 0x0FFFFFFF) << 4)
offset = 0
length = 1
elif descriptor == link_descriptor:
for i in range(0, 2):
offset = offset + (val & 0xFF) * 4
offset = offset + (val & 0xFF) * 4 + (length - 1) * track_len
val = val >> 8
length = (val & 0x7f)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment