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
315a590a
Commit
315a590a
authored
May 06, 2012
by
Alejandro Mery
Browse files
bin2fex: renamed script_* structs to script_bin_*
parent
fa9dede4
Changes
2
Show whitespace changes
Inline
Side-by-side
bin2fex.c
View file @
315a590a
...
@@ -57,9 +57,9 @@ static int find_full_match(const char *s, size_t l, const char **list)
...
@@ -57,9 +57,9 @@ static int find_full_match(const char *s, size_t l, const char **list)
/**
/**
*/
*/
static
inline
int
decompile_gpio
(
struct
script_section
*
section
,
static
inline
int
decompile_gpio
(
struct
script_
bin_
section
*
section
,
struct
script_
sectio
n_entry
*
entry
,
struct
script_
bi
n_entry
*
entry
,
struct
script_gpio_value
*
gpio
,
struct
script_
bin_
gpio_value
*
gpio
,
int
length
,
FILE
*
out
)
int
length
,
FILE
*
out
)
{
{
int
ok
=
1
;
int
ok
=
1
;
...
@@ -110,8 +110,8 @@ static int decompile_single_mode(const char *name)
...
@@ -110,8 +110,8 @@ static int decompile_single_mode(const char *name)
else
else
return
-
1
;
return
-
1
;
}
}
static
inline
int
decompile_single
(
struct
script_section
*
section
,
static
inline
int
decompile_single
(
struct
script_
bin_
section
*
section
,
struct
script_
sectio
n_entry
*
entry
,
struct
script_
bi
n_entry
*
entry
,
int32_t
*
d
,
int32_t
*
d
,
int
length
,
FILE
*
out
)
int
length
,
FILE
*
out
)
{
{
...
@@ -142,10 +142,10 @@ static inline int decompile_single(struct script_section *section,
...
@@ -142,10 +142,10 @@ static inline int decompile_single(struct script_section *section,
/**
/**
*/
*/
static
int
decompile_section
(
void
*
bin
,
size_t
UNUSED
(
bin_size
),
static
int
decompile_section
(
void
*
bin
,
size_t
UNUSED
(
bin_size
),
struct
script_section
*
section
,
struct
script_
bin_
section
*
section
,
FILE
*
out
)
FILE
*
out
)
{
{
struct
script_
sectio
n_entry
*
entry
=
PTR
(
bin
,
section
->
offset
<<
2
);
struct
script_
bi
n_entry
*
entry
=
PTR
(
bin
,
section
->
offset
<<
2
);
int
ok
=
1
;
int
ok
=
1
;
fprintf
(
out
,
"[%s]
\n
"
,
section
->
name
);
fprintf
(
out
,
"[%s]
\n
"
,
section
->
name
);
...
@@ -195,8 +195,8 @@ static int decompile(void *bin, size_t bin_size, FILE *out)
...
@@ -195,8 +195,8 @@ static int decompile(void *bin, size_t bin_size, FILE *out)
{
{
int
i
;
int
i
;
struct
{
struct
{
struct
script_head
head
;
struct
script_
bin_
head
head
;
struct
script_section
sections
[];
struct
script_
bin_
section
sections
[];
}
*
script
=
bin
;
}
*
script
=
bin
;
pr_info
(
"version: %d.%d.%d
\n
"
,
script
->
head
.
version
[
0
],
pr_info
(
"version: %d.%d.%d
\n
"
,
script
->
head
.
version
[
0
],
...
@@ -206,7 +206,7 @@ static int decompile(void *bin, size_t bin_size, FILE *out)
...
@@ -206,7 +206,7 @@ static int decompile(void *bin, size_t bin_size, FILE *out)
/* TODO: SANITY: compare head.sections with bin_size */
/* TODO: SANITY: compare head.sections with bin_size */
for
(
i
=
0
;
i
<
script
->
head
.
sections
;
i
++
)
{
for
(
i
=
0
;
i
<
script
->
head
.
sections
;
i
++
)
{
struct
script_section
*
section
=
&
script
->
sections
[
i
];
struct
script_
bin_
section
*
section
=
&
script
->
sections
[
i
];
if
(
!
decompile_section
(
bin
,
bin_size
,
section
,
out
))
if
(
!
decompile_section
(
bin
,
bin_size
,
section
,
out
))
return
1
;
/* failure */
return
1
;
/* failure */
...
...
bin2fex.h
View file @
315a590a
...
@@ -19,24 +19,24 @@
...
@@ -19,24 +19,24 @@
#include <stdint.h>
#include <stdint.h>
struct
script_head
{
struct
script_
bin_
head
{
int32_t
sections
;
int32_t
sections
;
int32_t
version
[
3
];
int32_t
version
[
3
];
};
};
struct
script_section
{
struct
script_
bin_
section
{
char
name
[
32
];
char
name
[
32
];
int32_t
length
;
int32_t
length
;
int32_t
offset
;
int32_t
offset
;
};
};
struct
script_
sectio
n_entry
{
struct
script_
bi
n_entry
{
char
name
[
32
];
char
name
[
32
];
int32_t
offset
;
int32_t
offset
;
int32_t
pattern
;
int32_t
pattern
;
};
};
struct
script_gpio_value
{
struct
script_
bin_
gpio_value
{
int32_t
port
;
int32_t
port
;
int32_t
port_num
;
int32_t
port_num
;
int32_t
mul_sel
;
int32_t
mul_sel
;
...
...
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