Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Erik Jansson
LabComm
Commits
f323b4a7
Commit
f323b4a7
authored
Mar 20, 2014
by
Tommy Olofsson
Browse files
Archive builds with vx toolchain.
parent
bc52d70a
Changes
11
Hide whitespace changes
Inline
Side-by-side
.gitignore
View file @
f323b4a7
...
...
@@ -3,3 +3,7 @@
lib/c/liblabcomm.a
compiler/AST/
compiler/labComm.jar
examples/twoway/gen/
lib/csharp/labcomm.dll
lib/java/gen/
lib/java/labcomm.jar
lib/c/Makefile
View file @
f323b4a7
## Macros
UNAME_S
=
$(
shell
uname
-s
)
ALL_DEPS
=
liblabcomm.a liblabcomm.so.1
ifeq
($(UNAME_S),Linux)
CC
=
gcc
CFLAGS
=
-std
=
c99
-g
-Wall
-Werror
-O3
-I
.
-Itest
CFLAGS
=
-std
=
c99
-g
-Wall
-Werror
-O3
-I
.
-Itest
ifndef
TARGET
CC
=
gcc
else
ifeq
($(TARGET),vx)
CC
=
i586-wrs-vxworks-gcc
LD
=
i586-wrs-vxworks-ld
ALL_DEPS
:=
$(
filter-out
%.so.1,
$(ALL_DEPS)
)
CFLAGS
:=
$(CFLAGS)
-DLABCOMM_COMPAT
=
\"
labcomm_compat_vxworks.h
\"
else
@echo
'Invalid target.'
endif
LDFLAGS
=
-L
.
LDLIBS
=
-llabcomm
-lrt
MAKESHARED
=
gcc
-o
$1
-shared
-Wl
,-soname,
$2
$3
-lc
-lrt
...
...
@@ -57,7 +68,7 @@ endif
.PHONY
:
all run-test clean distclean
all
:
liblabcomm.a liblabcomm.so.1
all
:
$(ALL_DEPS)
liblabcomm.a
:
$(OBJS)
ar
-r
$@
$^
...
...
lib/c/labcomm.h
View file @
f323b4a7
...
...
@@ -24,8 +24,14 @@
#define _LABCOMM_H_
#include <stdarg.h>
#include <stdint.h>
#include <unistd.h>
#ifdef LABCOMM_COMPAT
#include LABCOMM_COMPAT
#else
#include <stdint.h>
#include <unistd.h>
#endif
#include "labcomm_error.h"
#include "labcomm_scheduler.h"
...
...
lib/c/labcomm_compat_vxworks.h
View file @
f323b4a7
#ifndef _LABCOMM_COMPAT_VXWORKS_H_
#define _LABCOMM_COMPAT_VXWORKS_H_
#ifndef __VXWORKS__
#error "__VXWORKS__" not defined
#endif
#include <types/vxTypes.h>
#include <stdio.h>
#if (CPU == PPC603)
#undef _LITTLE_ENDIAN
#endif
...
...
@@ -10,3 +16,5 @@
#undef _BIG_ENDIAN
#endif
#endif
lib/c/labcomm_decoder.c
View file @
f323b4a7
...
...
@@ -199,7 +199,9 @@ static int decode_typedef_or_sample(struct labcomm_decoder *d, int kind)
LABCOMM_IOCTL_WRITER_GET_BYTES_WRITTEN
,
&
signature
.
size
);
if
(
err
<
0
)
{
fprintf
(
stderr
,
"Failed to get size: %s
\n
"
,
strerror
(
-
err
));
/* fprintf(stderr, "Failed to get size: %s\n", strerror(-err)); */
labcomm_error_warning
(
d
->
error
,
LABCOMM_ERROR_BAD_WRITER
,
"Failed to get size: %s
\n
"
,
strerror
(
-
err
));
result
=
-
ENOENT
;
goto
free_signature_name
;
}
...
...
@@ -207,7 +209,9 @@ static int decode_typedef_or_sample(struct labcomm_decoder *d, int kind)
LABCOMM_IOCTL_WRITER_GET_BYTE_POINTER
,
&
signature
.
signature
);
if
(
err
<
0
)
{
fprintf
(
stderr
,
"Failed to get pointer: %s
\n
"
,
strerror
(
-
err
));
/* fprintf(stderr, "Failed to get pointer: %s\n", strerror(-err)); */
labcomm_error_warning
(
d
->
error
,
LABCOMM_ERROR_BAD_WRITER
,
"Failed to get pointer: %s
\n
"
,
strerror
(
-
err
));
result
=
-
ENOENT
;
goto
free_signature_name
;
}
...
...
lib/c/labcomm_error.h
View file @
f323b4a7
...
...
@@ -64,5 +64,7 @@ LABCOMM_ERROR(LABCOMM_ERROR_MEMORY,
"Could not allocate memory"
)
LABCOMM_ERROR
(
LABCOMM_ERROR_USER_DEF
,
"User defined error"
)
LABCOMM_ERROR
(
LABCOMM_ERROR_BAD_WRITER
,
"Decoder: writer_ioctl() failed"
)
#endif
lib/c/labcomm_fd_reader.c
View file @
f323b4a7
...
...
@@ -98,7 +98,7 @@ static int fd_fill(struct labcomm_reader *r,
int
err
;
r
->
pos
=
0
;
err
=
read
(
fd_reader
->
fd
,
r
->
data
,
r
->
data_size
);
err
=
read
(
fd_reader
->
fd
,
(
char
*
)
r
->
data
,
r
->
data_size
);
if
(
err
<=
0
)
{
r
->
count
=
0
;
r
->
error
=
-
EPIPE
;
...
...
lib/c/labcomm_fd_writer.c
View file @
f323b4a7
...
...
@@ -101,7 +101,7 @@ static int fd_flush(struct labcomm_writer *w,
start
=
0
;
err
=
0
;
while
(
start
<
w
->
pos
)
{
err
=
write
(
fd_context
->
fd
,
&
w
->
data
[
start
],
w
->
pos
-
start
);
err
=
write
(
fd_context
->
fd
,
(
char
*
)
&
w
->
data
[
start
],
w
->
pos
-
start
);
if
(
err
<=
0
)
{
break
;
}
...
...
lib/c/labcomm_private.h
View file @
f323b4a7
...
...
@@ -28,12 +28,12 @@
#else
#include <endian.h>
#include <stdio.h>
#include <stdint.h>
#include <unistd.h>
#endif
#include <stdint.h>
//#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "labcomm.h"
/*
...
...
lib/c/labcomm_scheduler.h
View file @
f323b4a7
...
...
@@ -22,8 +22,12 @@
#ifndef _LABCOMM_SCHEDULER_H_
#define _LABCOMM_SCHEDULER_H_
#include <unistd.h>
#include <stdint.h>
#ifdef LABCOMM_COMPAT
#include LABCOMM_COMPAT
#else
#include <unistd.h>
#include <stdint.h>
#endif
struct
labcomm_time
;
...
...
lib/c/labcomm_scheduler_private.h
View file @
f323b4a7
...
...
@@ -22,7 +22,12 @@
#ifndef _LABCOMM_SCHEDULER_PRIVATE_H_
#define _LABCOMM_SCHEDULER_PRIVATE_H_
#include <unistd.h>
#ifdef LABCOMM_COMPAT
#include LABCOMM_COMPAT
#else
#include <unistd.h>
#endif
#include "labcomm_scheduler.h"
struct
labcomm_time
{
...
...
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