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

1268 Commits

Author SHA1 Message Date
René Kijewski
b31e5a8675 core: introduce KERNEL_PID_FIRST and KERNEL_PID_LAST 2014-08-17 19:50:34 +02:00
René Kijewski
89a26b7331 Merge pull request #1562 from Kijewski/the-first-two-commits-of-the-branch-issue-198
posix: minor pthread_barrier clean up
2014-08-15 14:44:54 +02:00
René Kijewski
d1d8fb2b68 sys: remove lib/hashtable.c
Quoting myself:

> The code of sys/lib/hashtable.c is very badly adapted for embedded
> systems. The used primes are huge, and the limit is entirely
> unrealistic. Why do we ship this file?

In #1564 we came to the conclusion that we don't need this code.

Closes #1564.
2014-08-13 21:21:39 +02:00
Martine Lenders
4a2450b464 Merge pull request #1522 from OlegHahm/crypto_cleanup
crypto: get rid of compiler warnings
2014-08-12 02:18:25 +02:00
René Kijewski
f3fcc1d5dd pthread: pthread_barrier should call yield 2014-08-11 16:22:38 +02:00
Martin Landsmann
28f4e510ad changed parameters form kernel_pid_t to int 2014-08-11 13:10:12 +02:00
Oleg Hahm
1de5c2b4a0 fixed remaining variables to kernel_pid_t 2014-08-07 17:29:53 +02:00
Oleg Hahm
74fbff1df2 net: changed name of internal variable
To avoid naming conflicts + made variable static and volatile as it
should be.
2014-08-07 16:31:27 +02:00
Oleg Hahm
93ef4346e9 ccnl: duplicate variable names
Some variables had multiple definitions, but could be removed or
declared with a smaller scope.
2014-08-07 16:31:27 +02:00
Oleg Hahm
0ad7b170ed make kernel_pid_t comparisons consistent 2014-08-07 16:31:27 +02:00
Oleg Hahm
aa2ecf6216 initialize kernel_pid_t correctly 2014-08-07 16:31:27 +02:00
Oleg Hahm
c2b0423918 core: renamed KERNEL_PID_NULL to KERNEL_PID_UNDEF
As @authmillenon pointed out the "null" in the old name is somewhat
misleading, since the actual value is -1.
2014-08-07 16:31:27 +02:00
Oleg Hahm
4b1a2f32eb net: fix kernel_pid_t checks
KERNEL_PID_NULL is a negative number. If kernel_pid_t variables are
initialized to this value, one have to check for lt/gte 0.
2014-08-07 16:31:27 +02:00
Kevin Funk
e8141ca5d8 cbor: CBOR implementation for RIOT-OS
This is a malloc-free implementation of the Concise Binary Object
Representation (CBOR) data format for the RIOT-OS.

This implementation mostly stand-alone, and it should be pretty easy to
port to other platforms. We're only using the C STL and some custom
network-related functionaliy which could be easily replaced by depending
on arpa/inet.h.

The CBOR API is straight-forward to use and provides encoding/decoding
functionality for all major C types, such as:
- int
- uint64_t
- int64_t
- float
- double
- char*
- struct tm
- time_t

It is possible to conditionally compile this module via CFLAGS:
- CBOR_NO_SEMANTIC_TAGGING: All semantic-tagging features removed
- CBOR_NO_CTIME: All ctime related features removed
- CBOR_NO_FLOAT: All floating-point related features removed
- CBOR_NO_PRINT: All features depending on printf removed
2014-08-05 19:49:51 +02:00
René Kijewski
2b91605f58 Merge pull request #1535 from LudwigOrtmann/transceiver_volatile
sys/transceiver: make transceiver_pid volatile
2014-08-05 19:39:43 +02:00
René Kijewski
a5fe9078c8 Merge pull request #1293 from Kijewski/issue-1287
core: only store the stack size for DEVELHELP (implementation)
2014-08-05 18:56:29 +02:00
Ludwig Ortmann
1efdf99dfe core/priority_queue: add dynamic initializers
- priority_queue_init
- priority_queue_node_init
2014-08-05 17:57:45 +02:00
Ludwig Ortmann
c2b2e4554b core/queue: queue -> priority_queue
Rename queue to priority queue, because that's what it is.
2014-08-05 17:57:45 +02:00
Ludwig Ortmann
232dd781ae sys/transceiver: make transceiver_pid volatile
- because it is
2014-08-02 14:10:28 +02:00
René Kijewski
9e3830a72b core: only store the stack size for DEVELHELP
`tcp_t::stack_size` is only examined by the shell command `ps` and
`DEBUG_PRINT`. For the latter one only if `DEVELHELP` was enabled.

This PR guards the member `tcp_t::stack_size` in `#ifdef DEVELHELP`.
Only if DEVELHELP was activated its value get printed by `ps`.

Closes #1287.
2014-08-02 00:35:41 +02:00
Oleg Hahm
2015796154 ccnl: pass relay_pid as pointer 2014-08-01 12:02:59 +02:00
Oleg Hahm
983d056c75 core: harmonizes the data type for the process ID
Instead of using differing integer types use kernel_pid_t for process
identifier. This type is introduced in a new header file to avoid
circular dependencies.
2014-08-01 12:02:54 +02:00
Oleg Hahm
5dc38a3e8c sixlowpan: some additional debugging 2014-08-01 00:15:34 +02:00
Oleg Hahm
f2b9e20716 sixlowpan: decrement processing semaphore when discarding 2014-08-01 00:14:45 +02:00
Oleg Hahm
feca0d73c8 crypto: get rid of compiler warnings 2014-08-01 00:04:55 +02:00
Ludwig Ortmann
d55da67fb6 Merge pull request #1329 from LudwigOrtmann/riot_license
RIOT default license header change
2014-07-31 23:12:47 +02:00
Ludwig Ortmann
5fdce06b3b doc: use lgplv2.1-short license header instead of lgplv2-short-v1 2014-07-31 22:57:20 +02:00
Ludwig Ortmann
3ca4f18479 doc: use lgplv2.1-short license header instead of lgpl-short-riot 2014-07-31 22:57:20 +02:00
Cenk Gündoğan
ca5b45e264 converting tabs to spaces in sys (#1439)
This PR converts tabs to white spaces.
The statement I used for the conversion:
```find . -name "*.[ch]" -exec zsh -c 'expand -t 4 "$0" > /tmp/e && mv /tmp/e "$0"' {} \;```
Afterwards, I had a quick overview of the converted files to prevent odd indentation.
2014-07-31 20:51:50 +02:00
Ludwig Ortmann
b8aa5dbaf8 Merge pull request #1496 from LudwigOrtmann/osx-fixup
native: reenable compilation on osx
2014-07-31 07:32:07 +02:00
René Kijewski
4032a22719 queue: add queue_t root type 2014-07-30 21:10:22 +02:00
Ludwig Ortmann
3d6124c905 native: reenable compilation on osx 2014-07-30 10:23:28 +02:00
Ludwig Ortmann
b6846e31fc doc: fix most occurences of FU as an author
.. but only if there are other authors as well
2014-07-29 17:23:11 +02:00
René Kijewski
6fae042a60 core: remove unneeded calls to mutex_init() 2014-07-29 09:33:24 +02:00
René Kijewski
0ab1b86e5f Add generic char pipe implementation 2014-07-28 23:21:27 +02:00
René Kijewski
02aeca02db ringbuffer: add static initializer 2014-07-28 20:56:12 +02:00
René Kijewski
201152a6d3 ringbuffer: add documentation 2014-07-28 20:56:12 +02:00
René Kijewski
a346276d30 ringbuffer: don't overwrite in ringbuffer_add 2014-07-28 20:44:02 +02:00
René Kijewski
47950e8bab ringbuffer: remove pointer to the end
There is no need for an explicit pointer to the end of the buffer.
2014-07-28 20:44:02 +02:00
René Kijewski
726af8d44e ringbuffer: fix parameter types
It is a bad idea to use signed types for lengths.
Mark pointers a `restrict`, since the ringbuffer is not thread safe
anyway.
2014-07-28 20:44:02 +02:00
René Kijewski
67856d63d9 ringbuffer: add convenience functions
This patch add `peek` functionality, and empty and full helpers.
2014-07-28 20:44:01 +02:00
René Kijewski
aaa95a281a ringbuffer: remove example 2014-07-28 20:44:01 +02:00
Ludwig Ortmann
1fd762d3bc Merge pull request #1403 from LudwigOrtmann/transceiver_fixup
sys/transcevier: fix more loop integers
2014-07-28 09:19:47 +02:00
Christian Mehlis
e2052cb6a9 Merge pull request #1026 from mehlis/ccnl-helper-thread
ccnl: refactor ccn lite stack
2014-07-18 21:27:13 +02:00
Christian Mehlis
70c863b3b1 Merge pull request #1320 from mehlis/ccnl-timeouts
ccnl: change timeouts to useful values
2014-07-18 21:26:09 +02:00
Christian Mehlis
d2b78a398f ccnl: finish rebase 2014-07-18 21:06:40 +02:00
Christian Mehlis
54bf710c69 ccnl: fix function name 2014-07-18 20:50:37 +02:00
Christian Mehlis
0aad35f33c ccnl: normalize time before using it 2014-07-18 20:47:26 +02:00
Christian Mehlis
5bc873d8ca ccnl: change timeouts to useful values 2014-07-18 20:47:26 +02:00
Christian Mehlis
7c10101e83 ccnl: prevent race condition on teardown 2014-07-18 20:08:29 +02:00
Christian Mehlis
9b5eedeea8 ccnl: use stacksize main for all threads 2014-07-18 20:08:29 +02:00
Christian Mehlis
cebffb2ccf ccnl: make relay start on RIOT startup 2014-07-18 20:07:15 +02:00
Christian Mehlis
085e386f2d ccnl: make theRelay use dynamic memory 2014-07-18 20:04:13 +02:00
Christian Mehlis
51fa2ec5c5 ccnl: use vtimer instead of rtc 2014-07-18 20:04:13 +02:00
Christian Mehlis
0b390040f4 ccnl: use a second helper thread to handle e.g. timeouts 2014-07-18 20:01:11 +02:00
René Kijewski
e1705622b7 vtimer: fix crash on spurious hwtimer callback
It seems that there are corner cases where a vtimer was removed, but
still there comes a hwtimer callback. This is a bug somewhere in the
vtimer or hwtimer. If there still was a vtimer set, then the next one
gets called before its time. If there was no other vtimer scheduled,
then `timer->action(timer)` crashes.

This PR simply fixes the crash, but does not attempt to find the more
fundamental bug.
2014-07-18 14:42:52 +02:00
Oleg Hahm
04493cc026 Merge pull request #1407 from LudwigOrtmann/issue-571
sys/vtimer: spin on short duration in vtimer_sleep
2014-07-16 22:14:27 +02:00
Oleg Hahm
344f702366 shell: prepare a rudimentary IEEE 802.15.4 packet
The transceiver module expects an `ieee802154_packet_t` instead of a
`radio_packet_t` if the device supports the IEEE 802.15.4 packet format.
This commit fixes the corresponding transceiver shell command for
`txtsnd` to set destination address (short address mode), payload, and
length accordingly.
2014-07-16 16:07:49 +02:00
René Kijewski
d4ff405e21 Merge pull request #1401 from LudwigOrtmann/scnetif_error
sys/net_if, make: fixup
2014-07-15 01:18:43 +02:00
Hauke Petersen
7ec61c578d vtimer: renamed e|dINT to disable|restoreIRQ 2014-07-14 18:10:06 +02:00
Ludwig Ortmann
428e085c53 sys/shell: fix error when not using sixlowpan
```
/sys/shell/commands/sc_net_if.c:631:27: error: ‘IPV6_MAX_ADDR_STR_LEN’ undeclared (first use in this function)
             char addr_str[IPV6_MAX_ADDR_STR_LEN];
                           ^
```
2014-07-14 18:00:05 +02:00
Sebastian Sontberg
af3c54e3a2 pnet: Fix INADDR_ANY and INADDR_BROADCAST
INADDR_ANY and INADDR_BROADCAST should not be initializers.
2014-07-14 14:13:13 +02:00
Ludwig Ortmann
66b76a5a41 sys/transcevier: fix more loop integers 2014-07-13 15:52:33 +02:00
Ludwig Ortmann
3e965f926a sys/vtimer: spin on short duration in vtimer_sleep
closes #571
2014-07-13 06:56:17 +02:00
Christian Mehlis
7169fd1107 Merge pull request #1362 from OlegHahm/ccnl_eliminate_warning
CCN_lite eliminate warning
2014-07-10 23:56:39 +02:00
Oleg Hahm
a6e97a4f75 Merge pull request #1034 from Kijewski/vtimer-callbacks
vtimer: fix callback usage
2014-07-10 17:12:23 +02:00
Ludwig Ortmann
a992d4d848 sys/transceiver: use size_t instead of u8 in loops 2014-07-10 14:11:48 +02:00
Ludwig Ortmann
8e93886d36 sys/transceiver: refactor un/register
remove race conditions
make less restrictive (allow double-un/registers)
make loops more readable
2014-07-10 14:11:48 +02:00
Ludwig Ortmann
d034cfac29 sys/transceiver: implement transceiver_unregister 2014-07-10 14:11:48 +02:00
Ludwig Ortmann
c264338e31 sys/transceiver: fix t9r_register API compliance 2014-07-10 14:11:48 +02:00
René Kijewski
ba1a15535b core: remove extra thread_create_arg() function 2014-07-09 10:28:23 +02:00
Oleg Hahm
1518d6ac64 Merge pull request #1390 from cgundogan/fix_socket_internal_t_packed_attr
destiny: deleting packed attribute from socket_internal_t
2014-07-08 22:33:54 +02:00
Cenk Gündoğan
8724eb1169 destiny: Adjust TCP_STACK_SIZE
Currently, the TCP_STACK_SIZE is `KERNEL_CONF_STACKSIZE_DEFAULT`.
However, since printf statements are used in the tcp relevant code,
this stack size is too small (esp. for MSBA2).
2014-07-08 21:30:58 +02:00
Cenk Gündoğan
b5e7460d45 destiny: deleting packed attribute from socket_internal_t
While testing the tcp implementation on MSBA2 I noticed that
the value of `tcp_input_buffer_end` gets changed whenever acquiring or
releasing the mutex of the struct on the server side.

After deleting the packed attribute of the struct this problem was
resolved and the value stayed the same after acquiring and releasing.

This problem could maybe arise from badly placed cache lines due to
missing padding... I am not sure.

Anyway, I guess using the packed attribute is useless here and makes it
more error-prone.
2014-07-08 20:40:55 +02:00
Ludwig Ortmann
295f32ac1b sys/ps: fix comment style, superfluous declaration 2014-07-04 16:38:22 +02:00
Ludwig Ortmann
70dae32a3f sys/ps: s/float/int for runtime
The high precision isn't needed, use per mille instead.
Circumvents printf problems on some platforms.

Also: prevent division by zero.
2014-07-04 16:38:22 +02:00
Oleg Hahm
53f7bea52f Merge pull request #1167 from fabianbrandt/rpl_base_split
Split RPL into core and mode related functions.
2014-07-04 11:21:05 +02:00
Fabian Brandt
7fb462cd2c Split RPL into core and mode related functions. 2014-07-03 20:23:57 +02:00
Fabian Brandt
62236e5d54 Introducing a source routing header for RPL. 2014-07-02 20:35:14 +02:00
Oleg Hahm
613caf3914 ccnl: eliminated empty translation unit warning 2014-07-02 19:23:14 +02:00
Oleg Hahm
0affcaf6e1 ccnl: fixed commenting style 2014-07-02 19:22:55 +02:00
René Kijewski
63dd8546af Merge pull request #1335 from Kijewski/fix-all-warnings-for-native-and-qemu-i386
Fix all warnings for native and qemu-i386
2014-07-02 10:58:48 +02:00
Christian Mehlis
381fec1fa8 Merge pull request #1301 from cgundogan/fix_tcp_handshake_seq_ack_rfc_compliancy
destiny: wireshark revealed wrong seq/ack nr. in tcp handshake
2014-06-30 22:05:23 +02:00
René Kijewski
3063e3c2b1 Fix all warnings for native and qemu-i386
Missing returns, unused variables (only used for debugging), empty
translation units, missing function prototypes, and GNU extensions.
2014-06-24 16:50:32 +02:00
Oleg Hahm
fda7ce12d2 Merge pull request #1321 from cgundogan/fix_missing_ack_bit
destiny: set ack bit for (almost) all segments after syn
2014-06-24 11:16:37 +02:00
Cenk Gündoğan
75546fcf6c destiny: set ack bit for (almost) all segments after syn
The current implementation does not set the ack bit
for outgoing data segments and the fin segment.

However, RFC793 states that all segments
should have an ack bit set in order to present a valid
ack nr. in outgoing segments.

Currently, data segments and acknowledgement segments
are distinguished by the existence of their ack bit.
With the new assumption, that both of these types of
segments need an ack bit set, I had to change several
parts of the current implementation to make this
decision by inspecting the payload size.

destiny: added parens
2014-06-24 10:44:11 +02:00
Cenk Gündoğan
400286168f destiny: wireshark revealed wrong seq/ack nr. in tcp handshake
Capturing the tcp handshake with wireshark revealed that the
sequence and ack nrs. are not rfc compliant.
I did the changes based on
http://tools.ietf.org/html/rfc793#page-52 to http://tools.ietf.org/html/rfc793#page-72
2014-06-24 10:21:23 +02:00
Oleg Hahm
9f39226108 shell: added command to print all ignored addresses 2014-06-24 10:11:06 +02:00
Oleg Hahm
36b9f7e7d7 Merge pull request #1257 from Kijewski/shell-fix-newline
shell: fix newlines
2014-06-22 23:56:36 +02:00
Oleg Hahm
6f17f0c60a Merge pull request #1105 from Kijewski/shell-print-not-found
shell: print command if not found
2014-06-22 21:03:30 +02:00
Oleg Hahm
eedc16815c Merge pull request #891 from OlegHahm/rpl_debug
net: some debug code
2014-06-22 19:27:18 +02:00
Hauke Petersen
839955cd05 sys: added color module 2014-06-22 13:53:01 +02:00
René Kijewski
14601c0c38 Merge pull request #1299 from phiros/timex_bugfix_and_improvement
Timex bugfix and improvement
2014-06-19 13:18:15 +02:00
Philipp Rosenkranz
0bf6ce22f3 added conv function from uint64 to timex_t and one minor bug fix 2014-06-19 12:40:24 +02:00
René Kijewski
467b41ad49 make: easifier usage of module subdirectories
Many modules have subdirectories. Often these subdirectories should only
be included under certain circumstances. Modules that use submodules
currently need to use this pattern:

```make
DIRS = …

all: $(BINDIR)$(MODULE).a
   @for i in $(DIRS) ; do $(MAKE) -C $$i ; done ;

include $(RIOTBASE)/Makefile.base

clean::
   @for i in $(DIRS) ; do $(MAKE) -C $$i clean ; done ;
```

This PR moves the `all:` and `clean::` boilerplate into `Makefile.base`.
2014-06-17 15:49:32 +02:00
René Kijewski
840c0f0a57 make: detect their module name automatically
For many modules the `Makefile` contains a line like
```
MODULE:=$(shell basename $(CURDIR))
```
This conclusively shows that we do not have to set the module name
manually.

This PR removes the need to set the module name manually, if it is the
same as the basename. E.g. for `…/sys/vtimer/Makefile` the variable
make `MODULE` will still be `vtimer`, because it is the basename of the
Makefile.
2014-06-17 15:49:32 +02:00
Christian Mehlis
997dcd7e88 Merge pull request #1302 from cgundogan/fix_tcp_header_data_offset
destiny: using a bit field for tcp_header->data_offset is more convenient
2014-06-14 15:40:49 +02:00
Christian Mehlis
50a07d9874 Merge pull request #1280 from cgundogan/fix_send_tcp_error_check
destiny: fixed condition for error handling of send_tcp in destiny_socket_send
2014-06-12 09:55:37 +02:00
Christian Mehlis
2350809536 pnet: silence unused argument warnings 2014-06-11 13:36:41 +02:00
Oleg Hahm
f6cd96b023 Merge pull request #1300 from cgundogan/fix_wrong_byte_order_ipv6_length
destiny: change byte order of ipv6_header->length
2014-06-09 22:01:41 +02:00