Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
FORMUS3IC_LAS3
/
embb
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
5c422de0
authored
8 years ago
by
Michael Schmid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
works OK with 3 cores -> spinlock problems
parent
41f038e0
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
6 deletions
+18
-6
TC_Toolchain.cmake
+1
-1
base_c/src/core_set.c
+1
-1
base_c/src/memory_allocation.c
+16
-4
No files found.
TC_Toolchain.cmake
View file @
5c422de0
...
...
@@ -17,7 +17,7 @@ SET(CMAKE_CXX_COMPILER C:/HighTec/toolchains/tricore/v4.6.6.0-infineon-1.1/bin/t
SET
(
CMAKE_FIND_ROOT_PATH C:/HighTec/toolchains/tricore/v4.6.6.0-infineon-1.1
)
# path to FreeRTOS
SET
(
FREE_RTOS_LIB_PATH C:/Data/Projekte/FreeRTOS_
TC27x
)
SET
(
FREE_RTOS_LIB_PATH C:/Data/Projekte/FreeRTOS_
AppKit_TC277
)
# search for programs in the build host directories
SET
(
CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH
)
...
...
This diff is collapsed.
Click to expand it.
base_c/src/core_set.c
View file @
5c422de0
...
...
@@ -127,7 +127,7 @@ void embb_core_set_init(embb_core_set_t* core_set, int initializer) {
#ifdef EMBB_PLATFORM_THREADING_RTOSTASKS
#ifdef __TriCore__
#define CORE_COUNT
2
//scm34681: 3
#define CORE_COUNT
3
//scm34681: 3
#endif
...
...
This diff is collapsed.
Click to expand it.
base_c/src/memory_allocation.c
View file @
5c422de0
...
...
@@ -44,8 +44,11 @@ enum {
void
*
embb_alloc
(
size_t
bytes
)
{
size_t
bytes_to_allocate
=
2
*
sizeof
(
size_t
)
+
bytes
;
#ifdef EMBB_OS_FREERTOS
void
*
allocated
=
pvPortMalloc
(
bytes_to_allocate
);
#else
void
*
allocated
=
malloc
(
bytes_to_allocate
);
#endif
if
(
allocated
==
NULL
)
return
NULL
;
...
...
@@ -74,8 +77,11 @@ void embb_free(void * ptr) {
embb_atomic_fetch_and_add_long
(
&
embb_bytes_allocated
,
(
long
)(
0
-
(
size_t
)(
*
bytes_allocated
)));
#ifdef EMBB_OS_FREERTOS
vPortFree
((
size_t
*
)
ptr
-
2
);
#else
free
((
size_t
*
)
ptr
-
2
);
#endif
}
void
*
embb_alloc_aligned
(
size_t
alignment
,
size_t
size
)
{
...
...
@@ -97,8 +103,11 @@ void* embb_alloc_aligned(size_t alignment, size_t size) {
size_t
additional_bytes
=
sizeof
(
size_t
)
*
3
;
size_t
bytes_to_allocate
=
(
n
+
1
)
*
alignment
+
(
additional_bytes
-
1
);
#ifdef EMBB_OS_FREERTOS
char
*
allocated
=
(
char
*
)
pvPortMalloc
(
bytes_to_allocate
);
#else
char
*
allocated
=
(
char
*
)
malloc
(
bytes_to_allocate
);
#endif
if
(
allocated
==
NULL
)
return
NULL
;
...
...
@@ -146,8 +155,11 @@ void embb_free_aligned(void* ptr) {
embb_atomic_fetch_and_add_long
(
&
embb_bytes_allocated
,
(
long
)((
long
)
0
-
ptr_conv
[
-
3
]));
#ifdef EMBB_OS_FREERTOS
vPortFree
((
void
*
)
ptr_conv
[
-
2
]);
#else
free
((
void
*
)
ptr_conv
[
-
2
]);
#endif
}
size_t
embb_get_bytes_allocated
()
{
...
...
This diff is collapsed.
Click to expand it.
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