Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Sunxi Tools
Commits
ca7c2773
Commit
ca7c2773
authored
May 07, 2012
by
Alejandro Mery
Browse files
script_bin: generate_bin: calculate base offsets and write header
parent
91923712
Changes
1
Hide whitespace changes
Inline
Side-by-side
script_bin.c
View file @
ca7c2773
...
...
@@ -88,9 +88,37 @@ size_t calculate_bin_size(struct script *script,
return
bin_size
;
}
int
generate_bin
(
void
*
bin
,
size_t
bin_size
,
struct
script
*
script
,
int
generate_bin
(
void
*
bin
,
size_t
UNUSED
(
bin_size
)
,
struct
script
*
script
,
size_t
sections
,
size_t
entries
)
{
struct
script_bin_head
*
head
;
struct
script_bin_section
*
section
;
struct
script_bin_entry
*
entry
;
void
*
data
;
struct
list_entry
*
ls
,
*
le
;
pr_err
(
"bin generation not yet implemented
\n
"
);
head
=
bin
;
section
=
head
->
section
;
entry
=
(
void
*
)
section
+
sections
*
sizeof
(
*
section
);
data
=
(
void
*
)
entry
+
entries
*
sizeof
(
*
entry
);
pr_info
(
"head....:%p
\n
"
,
head
);
pr_info
(
"section.:%p (offset:%zu, each:%zu)
\n
"
,
section
,
(
void
*
)
section
-
bin
,
sizeof
(
*
section
));
pr_info
(
"entry...:%p (offset:%zu, each:%zu)
\n
"
,
entry
,
(
void
*
)
entry
-
bin
,
sizeof
(
*
entry
));
pr_info
(
"data....:%p (offset:%zu)
\n
"
,
data
,
(
void
*
)
data
-
bin
);
head
->
sections
=
sections
;
head
->
version
[
0
]
=
0
;
head
->
version
[
1
]
=
1
;
head
->
version
[
2
]
=
2
;
return
0
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment