1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
Commit Graph

42 Commits

Author SHA1 Message Date
Karl Fessel
05f114d0af doc: fix unbalaced grouping
- most were trivial
    - missing group close or open
    - extra space
    - no doxygen comment
- name commad might open an implicit group
    this hould also be implicit cosed but does not happen somtimes
- crazy: internal declared groups have to be closed internal
2022-09-14 15:05:25 +02:00
Marian Buschsieweke
196ba5e3ff
pkg/tlsf: add -Wno-cast-align 2021-12-03 10:12:34 +01:00
Jan Romann
4384795cb9
treewide: Remove excessive newlines 2021-08-13 19:50:38 +02:00
Marian Buschsieweke
84169266b4
pkg/tlsf: fix possible overflow in calloc implementation 2021-05-05 08:58:31 +02:00
MrKevinWeiss
6bd6091938 pkg/*/Kconfig: Add simple kconfig pkgs
This adds many basic `PACKAGE_*` to Kconfig:
- pkg/Kconfig
- pkg/c25519/Kconfig
- pkg/cayenne-lpp/Kconfig
- pkg/cifra/Kconfig
- pkg/cn-cbor/Kconfig
- pkg/driver_atwinc15x0/Kconfig
- pkg/driver_bme680/Kconfig
- pkg/emlearn/Kconfig
- pkg/gemmlowp/Kconfig
- pkg/hacl/Kconfig
- pkg/heatshrink/Kconfig
- pkg/jsmn/Kconfig
- pkg/libb2/Kconfig
- pkg/libcose/Kconfig
- pkg/libfixmath/Kconfig
- pkg/libhydrogen/Kconfig
- pkg/lora-serialization/Kconfig
- pkg/micro-ecc/Kconfig
- pkg/microcoap/Kconfig
- pkg/minmea/Kconfig
- pkg/monocypher/Kconfig
- pkg/nanocbor/Kconfig
- pkg/nanopb/Kconfig
- pkg/qDSA/Kconfig
- pkg/qcbor/Kconfig
- pkg/relic/Kconfig
- pkg/talking_leds/Kconfig
- pkg/tiny-asn1/Kconfig
- pkg/tinycbor/Kconfig
- pkg/tinycrypt/Kconfig
- pkg/tlsf/Kconfig
- pkg/tweetnacl/Kconfig
- pkg/u8g2/Kconfig
- pkg/ubasic/Kconfig
- pkg/ucglib/Kconfig
- pkg/utensor/Kconfig
- pkg/yxml/Kconfig
2021-04-08 16:34:36 +02:00
9bd22dba79
pkg: silent make commands with RIOT_CI_BUILD=1 2021-03-12 16:05:18 +01:00
Leandro Lanzieri
81cb769cad
makefiles: avoid building archives when compiling 2020-09-04 15:01:10 +02:00
385ad95701
pkg: adapt 'simple' packages to the new organization 2020-06-26 09:25:43 +02:00
a009684336
pkg: use Makefile.base to build pkg modules when possible 2020-06-12 18:44:49 +02:00
9464c34467
pkg: don't copy Makefile in package build directory
Instead use the '-f' option of the make command
2020-06-12 18:44:48 +02:00
Gaëtan Harter
ca5d13cc2a pkg/*: adapt to new state file targets
Prepare for handling pkg state with files. So it requires having the
path defined before declaring targets. In addition, it cleans up the
old git-download target.
2020-01-08 20:55:19 +01:00
2f873569b7
pkg/tlsf: whitelist 32bit architectures
The package is not compatible with 8 or 16 bit architectures
2019-12-04 08:04:50 +01:00
9ac32c6dd7 pkg/tlsf: fix typos 2019-11-23 22:39:38 +01:00
Juan Carrano
cc907fa54e pkg/tlsf: Fix the way system functions are overriden.
The correct way to overrride the malloc family of functions in newlib-nano is
to provide the *_r (reentrant) variants. Newlib implements the "normal"
functions on top of these (see the newlib source code). Also, internally it calls
the *_r functions when allocating buffers.

If only the "normal" non-reentrant functions are provided this will mean that
some of the code will still use the vanilla newlib allocator. Furthermore, if
one uses the whole heap as a pool for TLSF then the system may in the best case
crash as there is no enough memory for its internall allocations or in the worst
case function eratically (this depends on how the heap reserved, there is an
upcomming series of commits in that direction).

This commit splits the handling between newlib and native. It also prepares the
ground for future work on the pool initialization.

Right now I could only test this in ARM and native and I cannot ensure it will
work on other platforms. Replacing the system's memory allocator is not something
that can be taken lightly and will inevitably require diving into the depths of
the libc. Therefore I would say that using TLSF as a system wide allocator is ATM
supported officially only on those plaftorms.

Testing:

Aside from reading the newlib sources, you can see the issue in a live system
using the debugger.

Compile any example (with or without tlsf-malloc), grab a debugger and place
a breakpoint in sbrk and _sbrk_r. Doing a backtrace will reveal it gets called
by _malloc_r.
2019-09-17 21:18:50 +02:00
Juan Carrano
ad4d883c4f pkg/tlsf: fix double pointer.
A (void*) function was declared as (void**) because one of the void pointers
was hidden behind a typedef. Because of the way a void* works, this has no
consequences, but it is confusing.
2019-08-16 19:17:32 +02:00
Jose Alamos
6089f4a10c doc/mem_management: add implementations and utils 2018-09-27 10:54:39 +02:00
Martine Lenders
82c318224b tlsf: fix for llvm
The `__GNUC__` is also available in `clang` as is just used to provide
the major version of a GNU-C compatible compiler [[1]]. So I check for
`tlsf` if the `alloc_size()` is available by using the combination of
macros as proposed here: https://stackoverflow.com/a/43205345/395687

[1]: https://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html
2018-07-31 21:35:29 +02:00
Cenk Gündoğan
0009213072 tlsf: add custom walker to get total free / used sizes 2018-06-12 09:43:48 +02:00
Juan Carrano
cf686bde2d pkg/tlsf: Refactor the TLSF package and bring back original TLSF api.
- Cleanup package makefile.
- Download directly from git.
- Remove giant patch.
- Implement malloc function as a contrib package.
- Update ccn example.
- Update ps command.
2018-05-18 15:41:07 +02:00
7142a273dd pkg/*: put $(MAKE) in quotes in all packages 2017-12-18 14:53:54 +01:00
Hauke Petersen
29ee609a2f Merge pull request #7266 from kaspar030/pkg-prepare
make: introduce pkg-prepare target
2017-08-29 17:53:35 +02:00
c4ebd18be2 pkg: enhance doxygen packages documentation 2017-07-03 09:56:07 +02:00
98bb1f2781 pkg: add prepare targets 2017-06-28 14:39:05 +02:00
c1cd257544 pkg: tlsf: use dlcache 2017-06-17 17:00:55 +02:00
8d88781e05 make: pkg: make use of PKGDIRBASE 2017-03-10 14:18:44 +01:00
47f6ff3056 Merge pull request #6237 from kaspar030/rename_AD_to_Q
make: rename AD to Q
2017-01-17 16:16:02 +01:00
79d2f9e574 pkg: tlsf: add license information 2017-01-09 00:49:38 +01:00
f44763f346 make: adapt Makefiles to AD -> Q rename 2016-12-22 12:12:38 +01:00
Oleg Hahm
e443d3a0ff pkg tlsf: undefined left-shifting of neg. values 2016-05-27 14:49:15 +02:00
Oleg Hahm
d4732952b2 pkg tlsf: add usage statistics 2016-05-27 13:48:06 +02:00
b3c5446209 pkg: tlsf: build in board directory 2016-03-25 14:28:04 +01:00
DipSwitch
0bb4748a94 core: Fix/refactor function naming in core/incude/irq.h 2016-03-20 16:47:34 +01:00
c63a924778 pkg: adapt to RIOTPKG 2016-03-05 03:05:32 +01:00
Oleg Hahm
3b5f1f949f pkg tlsf: use pkg directory for sources
The TLSF package was the only one using the $(BINDIR) instead of a subdirectory of pkg/. This commit changes this.
2016-01-31 14:33:08 +01:00
Martine Lenders
4dc851244d pkg: unify git paradigms for packages 2016-01-26 23:22:47 +01:00
Oleg Hahm
a87927ed1a pkg tlsf: change URL for upstream TLSF archive 2016-01-26 12:23:18 +01:00
Oleg Hahm
60e283e6a2 pkg tlsf: add tlsf initialization function
The init function was patched out, but is actually required to compile without warnings with -pedantic enabled.

This patch also updates ccn-lite and x86 support accordingly.
2015-12-15 16:42:43 +01:00
Joakim Gebart
336a450106 pkg: Add .gitattributes to ignore whitespace errors inside some included patch files. 2015-05-09 11:35:15 +02:00
René Kijewski
a70ee0f022 make: centralize wget/curl & unzip/7z feature test
With many open PRs that could benefit from loading SDKs when needed,
instead adding vast amounts of code to RIOTs master, this PR provides
the "functions" `$(DOWNLOAD_TO_STDOUT)`, `$(DOWNLOAD_TO_FILE)`, and
`$(UNZIP_HERE)`.

The first "function" takes one argument, the URL from where to download
the content. It is then piped to stdout. To be used e.g. with `tar xz`.

The second "function" taken two arguments, the destination file name,
and the source URL. If the previous invocation was interrupted, then the
download gets continued, if possible.

The last "function" takes one argument, the source ZIP file. The file
gets extracted into the cwd, so best use this "function" with
`cd $(SOME_WHERE) &&`.

The clumsy name `$(UNZIP_HERE)` is taken because the program "unzip"
takes the environment variable `UNZIP` as the source file, even if
another file name was given on the command line. The rationale for that
is that the hackers of "unzip" hate their users. Also they sacrifice
hamsters to Satan.
2014-08-21 19:07:52 +02:00
René Kijewski
ee02a0f654 x86: fix download script for OSX
Mac OSX does not have `wget`, but `curl`.
It does not understand `tar xJ`, but `tar xj`.
2014-06-03 22:36:00 +02:00
René Kijewski
054f9fd026 make: fix clean together with TLSF 2014-05-24 19:22:18 +02:00
René Kijewski
88e8915dfe Add TLSF (two level segregated fit) PKG
This is my second take on #669, because I was asked to separate it from #764.

This change adds a malloc implementation as a PKG, which uses *TLSF* (two
level segregated fit).

The patch file removes the 64bit capatibilities, debug functions, and the
option to have multiple "control blocks" (a control block holds multiple
memory pools). It wraps `malloc()` and friends in `disableIRQ() … restoreIRQ()`.

The implemention does not support 16bit platforms, yet, but probably only some
constants would need fixing. I limited the maximum size of a memory pool to
2**30 bytes = 1GB.

This PKG is not meant to be used by applicitions directly, but by the boards.
The board's initialition code needs to call
`int tlsf_add_pool(void *mem, size_t bytes)` for every free memory region it
has. If the board in using newlib, then this call needs to happen before the
first call to `puts`, `printf`, and friends, because newlib allocates the
control data IO streams (stdin, stdout, stderr) on the heap. Adding a small
(e.g. 1kB) pool before proper board initialization would be a possible solution.

Please read the additional information in the website of the implementator,
http://tlsf.baisoku.org/:

> TLSF (two level segregated fit) is a relatively new memory
allocator designed for embedded systems. It boasts constant
time O(1) malloc/free response time and a 4-byte block
overhead. Though it typically is slightly slower than other
allocators such as dlmalloc, it has no worst-case behavior.

> The original implementation, which comes alongside the white
paper, is distributed under the GNU GPL/LGPL. The code found
here is an original implementation, released into the public
domain, therefore is not subject to any licensing restrictions.

> Features:
 -  O(1) cost for malloc, free, realloc, memalign
 -  Extremely low overhead per allocation (4 bytes)
 -  Low overhead per pool (~3kB)
 -  Low fragmentation
 -  Compiles to only a few kB of code and data

> Caveats:
 -  Currently, assumes architecture can make 4-byte aligned accesses
 -  Not designed to be thread safe; the user must provide this

> Known Issues:
Due to the internal block structure size and the implementation
details of tlsf_memalign, there is worst-case behavior when requesting
small (<16 byte) blocks aligned to 8-byte boundaries. Overuse of memalign
will generally increase fragmentation, but this particular case will leave
lots of unusable "holes" in the heap. The solution would be to internally
align all blocks to 8 bytes, but this will require significantl changes
to the implementation. Contact me if you are interested.
2014-05-20 03:17:09 +02:00