Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
PYNQ
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
paulrr2
PYNQ
Commits
f6c63418
Commit
f6c63418
authored
6 years ago
by
Peter Ogden
Committed by
Graham Schelle
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix issue with SDSoC constructor being called multiple times (#617)
parent
c0f45c87
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
sdbuild/packages/libsds/xlnkutils/Makefile
+9
-4
9 additions, 4 deletions
sdbuild/packages/libsds/xlnkutils/Makefile
sdbuild/packages/libsds/xlnkutils/wrapper.c
+28
-3
28 additions, 3 deletions
sdbuild/packages/libsds/xlnkutils/wrapper.c
with
37 additions
and
7 deletions
sdbuild/packages/libsds/xlnkutils/Makefile
+
9
−
4
View file @
f6c63418
ARCH
:=
$(
shell getconf LONG_BIT
)
SDSLIB
:=
libsds_lib_
$(
ARCH
)
.a
all
:
libsds_lib.so
all
:
libsds_lib.so
libsds_internal.so
.PHONY
:
all
libsds_lib.so
:
gcc wrapper.c
-fPIC
-shared
-rdynamic
-o
libsds_lib.so
-Wl
,--whole-archive libsds_lib_
$(
ARCH
)
.a
-l
pthread
-Wl
,--no-whole-archive
libsds_lib.so
:
wrapper.c libsds_internal.so
gcc wrapper.c
-fPIC
-shared
-rdynamic
-o
libsds_lib.so
-lpthread
-ldl
-L
.
-lsds_internal
libsds_internal.so
:
$(SDSLIB)
gcc
-shared
-rdynamic
-o
libsds_internal.so
-Wl
,--whole-archive
$(
SDSLIB
)
-Wl
,--no-whole-archive
clean
:
-
rm
-f
*
.so
install
:
libsds_lib.so
install
:
libsds_lib.so
libsds_internal.so libxlnk_cma.h
cp
-avf
libsds_lib.so /usr/lib/
cp
-avf
libsds_internal.so /usr/lib/
cp
-arvf
libxlnk_cma.h /usr/include/
This diff is collapsed.
Click to expand it.
sdbuild/packages/libsds/xlnkutils/wrapper.c
+
28
−
3
View file @
f6c63418
#define _GNU_SOURCE
#include
<stdio.h>
#include
<string.h>
#include
<stdint.h>
#include
"libxlnk_cma.h"
#include
<linux/ioctl.h>
#include
<errno.h>
#include
<dlfcn.h>
#define RESET_IOCTL _IOWR('X', 101, unsigned long)
...
...
@@ -15,9 +17,30 @@ void sds_free(void*);
void
*
sds_mmap
(
void
*
phy_addr
,
size_t
size
,
void
*
virtual_addr
);
void
sds_munmap
(
void
*
virtal_addr
);
/* CF helper functions */
void
cf_xlnk_open
(
int
last
);
void
cf_xlnk_init
(
int
arg
);
int
cf_xlnk_open
(
int
last
)
{
static
void
(
*
next_ptr
)(
int
)
=
NULL
;
if
(
!
next_ptr
)
{
*
(
void
**
)(
&
next_ptr
)
=
dlsym
(
RTLD_NEXT
,
"cf_xlnk_open"
);
next_ptr
(
1
);
}
}
void
cf_xlnk_init
(
int
first
)
{
static
void
(
*
next_ptr
)(
int
)
=
NULL
;
if
(
!
next_ptr
)
{
*
(
void
**
)(
&
next_ptr
)
=
dlsym
(
RTLD_NEXT
,
"cf_xlnk_init"
);
next_ptr
(
1
);
}
}
void
cf_context_init
(
void
)
{
static
void
(
*
next_ptr
)(
void
)
=
NULL
;
if
(
!
next_ptr
)
{
*
(
void
**
)(
&
next_ptr
)
=
dlsym
(
RTLD_NEXT
,
"cf_context_init"
);
next_ptr
();
}
}
/* Functional prototpes from xlnk */
...
...
@@ -96,7 +119,9 @@ void _xlnk_reset() {
__attribute__
((
constructor
))
void
open_xlnk
(
void
)
{
cf_context_init
();
cf_xlnk_open
(
1
);
cf_xlnk_init
(
1
);
}
void
cma_flush_cache
(
void
*
buf
,
unsigned
int
phys_addr
,
int
size
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment