Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Michel Roelofs
dt_ctrl
Commits
fd5f452f
Commit
fd5f452f
authored
Jan 13, 2021
by
Jeroen Vreeken
Browse files
Compile on aarch64 (Rpi)
parent
03f528e2
Changes
4
Hide whitespace changes
Inline
Side-by-side
common/include/dynarg.h
View file @
fd5f452f
...
...
@@ -164,7 +164,57 @@ do { \
#define va_free(list) free(((char *)(list).__ap) - sizeof(char *)*2)
#endif
/* defined(__arm__) && defined(__ARM_EABI__) */
/* defined(__arm__) && defined(__ARM_EABI__) */
#elif defined(__aarch64__)
/*
typedef struct va_list {
void * stack; // next stack param
void * gr_top; // end of GP arg reg save area
void * vr_top; // end of FP/SIMD arg reg save area
int gr_offs; // offset from gr_top to next GP register arg
int vr_offs; // offset from vr_top to next FP/SIMD register arg
} va_list;
*/
#define va_new(list) \
do {\
char *ptr;\
\
ptr = malloc(8);\
(list).__stack = ptr;\
(list).__gr_top = ptr;\
(list).__vr_top = ptr;\
(list).__gr_offs = 0;\
(list).__vr_offs = 0;\
} while (0)
#define va_add(list, type, val) \
do { \
char *ptr_start = (list).__gr_top;\
char *ptr_end = (list).__vr_top;\
size_t size = ptr_end - ptr_start;\
\
size_t typesize = sizeof(type);\
if (typesize < 8) {\
typesize = 8;\
} else if (typesize > 8) {\
typesize = 16;\
}\
ptr_start = realloc(ptr_start, size + typesize);\
ptr_end = ptr_start + size;\
type tmpval = val; \
memcpy(ptr_end, &tmpval, sizeof(tmpval));\
ptr_end += typesize;\
\
(list).__stack = ptr_start;\
(list).__gr_top = ptr_start;\
(list).__vr_top = ptr_end;\
} while (0)
#define va_free(list) free((list).__gr_top)
#endif
/* defined(__aarch64__) */
#endif
/* _INCLUDE_DYNARG_H_ */
console/console/mod_websocket_dt/mod_websocket_dt.c
View file @
fd5f452f
...
...
@@ -438,20 +438,20 @@ static size_t on_message(void *plugin_private,
memcpy
(
text
,
buffer
,
buffer_size
);
text
[
buffer_size
]
=
0
;
sscanf
(
text
,
"%
a
s "
,
&
cmd
);
sscanf
(
text
,
"%
m
s "
,
&
cmd
);
if
(
!
strcmp
(
cmd
,
"trace"
))
{
int
freq
;
char
*
variable
;
sscanf
(
text
,
"%*s %d %
a
s"
,
&
freq
,
&
variable
);
sscanf
(
text
,
"%*s %d %
m
s"
,
&
freq
,
&
variable
);
start_trace
(
priv
,
freq
,
variable
);
}
else
if
(
!
strcmp
(
cmd
,
"command"
))
{
char
*
ident
;
char
*
command
;
sscanf
(
text
,
"%*s %
a
s"
,
&
ident
);
sscanf
(
text
,
"%*s %
m
s"
,
&
ident
);
command
=
text
+
strlen
(
cmd
)
+
strlen
(
ident
)
+
2
;
do_command
(
ident
,
command
);
...
...
@@ -463,7 +463,7 @@ static size_t on_message(void *plugin_private,
struct
command
*
command
;
enum
command_value_type
vtype
;
sscanf
(
text
,
"%*s %
a
s %
a
s"
,
&
name
,
&
type
);
sscanf
(
text
,
"%*s %
m
s %
m
s"
,
&
name
,
&
type
);
if
(
!
strcmp
(
type
,
"bool"
))
{
int
v
;
sscanf
(
text
,
"%*s %*s %*s %d"
,
&
v
);
...
...
@@ -487,7 +487,7 @@ static size_t on_message(void *plugin_private,
}
else
if
(
!
strcmp
(
cmd
,
"status"
))
{
char
*
ident
;
sscanf
(
text
,
"%*s %
a
s"
,
&
ident
);
sscanf
(
text
,
"%*s %
m
s"
,
&
ident
);
start_status
(
priv
,
ident
);
}
else
{
server
->
send
(
priv
->
server
,
MESSAGE_TYPE_TEXT
,
...
...
console/console/spg_auth.c
View file @
fd5f452f
...
...
@@ -250,7 +250,7 @@ static void update_status(struct status_server *stat_srv)
{
static
time_t
last
=
0
;
time_t
now
;
char
status
[
1
00
];
char
status
[
1
36
];
now
=
time
(
NULL
);
if
(
now
==
last
)
...
...
@@ -258,8 +258,8 @@ static void update_status(struct status_server *stat_srv)
last
=
now
;
snprintf
(
status
,
99
,
"%s %e %e
\n
"
,
current_auth
,
az_offset
,
el_offset
);
status
[
99
]
=
0
;
snprintf
(
status
,
135
,
"%s %e %e
\n
"
,
current_auth
,
az_offset
,
el_offset
);
status
[
135
]
=
0
;
status_server_send
(
stat_srv
,
status
);
}
...
...
console/console/trace_log.c
View file @
fd5f452f
...
...
@@ -43,7 +43,7 @@ int main (int argc, char **argv)
int
r
;
char
buf
[
10
];
char
linebuf
[
1000
];
char
outbuf
[
10
00
];
char
outbuf
[
10
24
];
int
linepos
;
char
*
az_pos
=
"Azimuth_Position"
;
char
*
el_pos
=
"Elevation_Position"
;
...
...
Write
Preview
Supports
Markdown
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