Commit Graph

200 Commits (ac7671762d8385a3d136840f487ad009bc9130be)

Author SHA1 Message Date
Oleg Hahm 0ccf1043de doc: fixed broken doxygen references 8 years ago
Oleg Hahm 0c967c4d3f cpu: msp430: renamed msp430x16x to msp430fxyz 8 years ago
Oleg Hahm d92e9af91c doc: fixed broken param descriptions 8 years ago
Oleg Hahm df9c09d946 doc: fixed typos and other misspellings 8 years ago
René Kijewski 682af155e0 posix: Fix missing `restoreIRQ()` in `sem_post()` 8 years ago
René Kijewski f89e1f4a3d c++: `s/restrict/__restrict/`
`restrict` is not a keyword in C++, but `__restrict` is understood by
GCC-ish compilers.
8 years ago
Oleg Hahm 037571445c Merge pull request #1974 from OlegHahm/cleanup_licenses
licenses: fix miss-spelled & missing boiler plates
8 years ago
Oleg Hahm 39abba1bc2 licenses: fix miss-spelled & missing boiler plates 8 years ago
BytesGalore de3c3cebd0 c++: sys: add extern C to header files 8 years ago
Ludwig Ortmann eceb656c49 core,sys: fix storage types for irq API usage
* should not have any effect as long as `unsigned` and `int` are compatible
* also fix two cosmetic `unsigned int` -> `unsigned` for consistency
9 years ago
René Kijewski 677d690e2b core: introduce thread_yield_higher(), yield less
Fixes #1708.

Currently involuntary preemption causes the current thread not only to
yield for a higher prioritized thread, but all other threads of its own
priority class, too.

This PR adds the function `thread_yield_higher()`, which will yield the
current thread in favor of higher prioritized functions, but not for
threads of its own priority class.

Boards now need to implement `thread_yield_higher()` instead of
`thread_yield()`, but `COREIF_NG` boards are not affected in any way.

`thread_yield()` retains its old meaning: yield for every thread that
has the same or a higher priority.

This PR does not touch the occurrences of `thread_yield()` in the periph
drivers, because the author of this PR did not look into the logic of
the various driver implementations.
9 years ago
Ludwig Ortmann e40f4c1912 native/freebsd: fix usecond typdef 9 years ago
Oleg Hahm a50d44c195 posix: configure stdio only to uart0 if enabled 9 years ago
Oleg Hahm 218635027c Merge pull request #1508 from cgundogan/transport_layer_refactoring
transport_layer: Splitting UDP and TCP
9 years ago
Cenk Gündoğan 710c7e6cf6 transport_layer: Splitting UDP and TCP
Currently, the tcp and udp implementations are bound to each other in a
module called *destiny*. Thus, when using only one of them then the
other one gets also compiled into the binary and initialized,
which results in unnecessary RAM usage and workload for the CPU.

The approach in this PR defines a common module named *socket_base*,
which contains functions used by the posix layer. Compiled by it's own,
those functions return negative error codes, to symbolize upper layers
that they are not supported. When also including the modules *udp* or
*tcp* respectively, functions from *socket_base* get overwritten with the
correct functionality.

Defining *udp* or *tcp* in a Makefile also includes *socket_base*.
Defining *pnet* in a Makefile also includes *socket_base*.
9 years ago
Oleg Hahm 70ec73b038 Merge pull request #1561 from BytesGalore/fix_fd_parameter_warnings
sys/posix: changed parameters for `fd` from `kernel_pid_t` to `int`
9 years ago
Ludwig Ortmann b7992922ce fix license headers in non-.c files 9 years ago
René Kijewski 2cb4166c3e all over the place: use sched_active_pid
In many places we needlessly use `sched_active_thread->pid` whilst we
already have `sched_active_pid` with the same value, and one less
indirection.

`thread_getpid()` is made `static inline` so that there is no penalty in
using this function over accessing `sched_active_pid` directly.
9 years ago
René Kijewski f3fcc1d5dd pthread: pthread_barrier should call yield 9 years ago
Martin Landsmann 28f4e510ad changed parameters form `kernel_pid_t` to `int` 9 years ago
Oleg Hahm 1de5c2b4a0 fixed remaining variables to kernel_pid_t 9 years ago
Oleg Hahm 74fbff1df2 net: changed name of internal variable
To avoid naming conflicts + made variable static and volatile as it
should be.
9 years ago
Oleg Hahm 0ad7b170ed make kernel_pid_t comparisons consistent 9 years ago
Oleg Hahm aa2ecf6216 initialize kernel_pid_t correctly 9 years ago
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.
9 years ago
Ludwig Ortmann c2b2e4554b core/queue: queue -> priority_queue
Rename queue to priority queue, because that's what it is.
9 years ago
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.
9 years ago
Ludwig Ortmann d55da67fb6 Merge pull request #1329 from LudwigOrtmann/riot_license
RIOT default license header change
9 years ago
Ludwig Ortmann 3ca4f18479 doc: use lgplv2.1-short license header instead of lgpl-short-riot 9 years ago
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.
9 years ago
Ludwig Ortmann b8aa5dbaf8 Merge pull request #1496 from LudwigOrtmann/osx-fixup
native: reenable compilation on osx
9 years ago
René Kijewski 4032a22719 queue: add queue_t root type 9 years ago
Ludwig Ortmann 3d6124c905 native: reenable compilation on osx 9 years ago
Ludwig Ortmann b6846e31fc doc: fix most occurences of FU as an author
.. but only if there are other authors as well
9 years ago
Sebastian Sontberg af3c54e3a2 pnet: Fix INADDR_ANY and INADDR_BROADCAST
INADDR_ANY and INADDR_BROADCAST should not be initializers.
9 years ago
René Kijewski ba1a15535b core: remove extra thread_create_arg() function 9 years ago
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.
9 years ago
Christian Mehlis 2350809536 pnet: silence unused argument warnings 9 years ago
René Kijewski 05a4bf7f04 Merge pull request #1057 from Kijewski/sched_switch-current_prio
core: imply current_prio in `sched_switch()`
9 years ago
Cenk Gündoğan 56298378ee pnet: accept should return a new generated file descriptor
From man page:
On success, these system calls return a nonnegative integer that is a
descriptor for the accepted socket. On error, -1 is returned, and errno
is set appropriately.
9 years ago
Martin Lenders 2362623490 Fix trailing whitespaces
Fixes #1138
9 years ago
René Kijewski 4e4f908379 Initial import of the x86 port
Currently this works only in qemu.
9 years ago
René Kijewski a6fd5bff92 core: imply current_prio in `sched_switch()`
There is no need to supply the current priority to `sched_switch()`,
when this function can easily tell the value of
`active_thread->priority` itself.
9 years ago
Christian Mehlis 0aa87a8ee7 Merge pull request #1208 from Kijewski/issue-1199
documentation: fix doxygen for `pthread_*.h`
9 years ago
René Kijewski e135bdc266 documentation: fix doxygen for `pthread_*.h`
The pthread header files aren't in the doxygen page anymore after #1137,
because I `@file`'d the `.c` files, not the `.h` files.

This change moves doxygen boilerplate.

Closes #1199.
9 years ago
Oleg Hahm ef5ec344fd core: prefix API functions correctly
Also changed names for bitarithm functions and rename thread_pid to sched_active_pid.
9 years ago
Ludwig Ortmann 2314915ff2 license: fix license header grammar
insert missing "is"
9 years ago
Martin Landsmann 61b0331980 added `pthread_cond.h` to `pthread.h`
adjusted `test_pthread_condition_variable\main.c` includes reflecting the above change
9 years ago
BytesGalore f4a994ac89 Merge pull request #1076 from BytesGalore/remove_return_from_noreturn_function
sys:posix:pthread removed explicit `return;` from `pthread_exit()`
9 years ago
Martin fc532ad891 added else branch in `pthread_exit()` to avoid calling explicit `return;`
however, this won't help to completely eliminate the warning on returning from a `noreturn` function
9 years ago
Martin 619039e0e2 add pthread condition variable implementation 9 years ago
BytesGalore 9d4d98c9ea Merge pull request #1025 from BytesGalore/add_out_of_bounds_check
sys:posix:pthread added check to avoid array out of bound access
9 years ago
Martin 345e76a0d7 added check to avoid array out of boud access 9 years ago
René Kijewski 9a5a8a2452 Add pthread_rwlock test 9 years ago
René Kijewski 10d36df795 pthread: implement reader/writer lock 9 years ago
René Kijewski 3101083f13 pthread: fix spinlock 9 years ago
René Kijewski 3e6bebadd3 Add missing doxygen for pthread funs and structs 9 years ago
Martin e159d0b38a changed return value to 0 on lookup fail in pthread_self() 9 years ago
Martin f3566f0b8a changed pthread_self() to return thread IDs > 0 9 years ago
Oleg Hahm 8a86f493b4 Merge pull request #821 from Kijewski/pthrad_cleanup
posix: Add pthread_cleanup handlers
9 years ago
René Kijewski eaca16d07a Add pthread_barrier_t documentation 9 years ago
René Kijewski 9202a482d5 Add `pthread_barrier_*` functions
Compare [`pthread_barrier_init`][1].

  [1]: http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_barrier_init.html
9 years ago
René Kijewski b44b88a6ed pthread_cleanup: better documentation 9 years ago
René Kijewski b54962689a posix: Add pthread_cleanup handlers
With `pthread_cleanup_(push|pop)` you can define a function that should
be ran if the thread is exited while it is inside this scope. A thread
can be ended here through an explicit call to `pthread_exit()`, or if
cancellation was requested and a cancellation point was hit.

`pthread_cleanup_*` is mostly only useful together with cancellation
points, and cancellation points are only useful with a cleanup
functionality. Cancellation points are at least partially implemented by
means of `pthread_testcancel()`.

C.f. ["Cancellation Points"][1].

  [1]: http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_09_05_02
9 years ago
René Kijewski de29e4184c Add include paths automatocally for USEMODULES
Application developers use `$(USEMODULES)` in their Makefiles to have
the relevant functionally automagically added to their apps. This even
does basic dependency tracking by means of `Makefile.dep`.

But an important thing is missing: the automatic adding of include
paths. This is inconvenient, error prone, and will hinder the RIOT core
developers in future to change folder structures.
9 years ago
Christian Mehlis 5733015c27 correct copyright and doxygen 9 years ago
Christian Mehlis 60feb7ea37 posix: move posix semaphore in posix module 9 years ago
René Kijewski 46031a0540 posix: Disable debug output of pthreads
`DEBUG_ENABLED` should be enabled during debugging, and disabled
afterwards.
9 years ago
Christian Mehlis 1cc5fa57c1 Merge pull request #839 from mehlis/posix-sleep
posix: added sleep and usleep
9 years ago
Christian Mehlis 1a438b64a5 posix: added sleep and usleep 9 years ago
Christian Mehlis 64fc465a6a pthread: mutex - return the right values 9 years ago
Oleg Hahm 32f918abe8 simplified sched_switch
sched_switch can check ISR itself.
9 years ago
Christian Mehlis 2de9619f21 Merge pull request #758 from Kijewski/issue-755
Fix `pthread_self()` confusion
9 years ago
René Kijewski ca4337ab4d Fix `pthread_self()` confusion
This fixes #755.

The pthread ID cannot be reused as soon as the thread ends, because
another thread needs to join it first. `pthread_self()` uses the native
(i.e. RIOT's) thread ID to distinguish itself. A native thread ID can be
reused as soon as the thread ends, since the core knows no join
operation.

In order to not confuse itself with an earlier zombie thread (i.e a dead
non-detached thread, that was not joined, yet), we need to invalidate
the associated native thread ID.

This approach is sane since a dead thread won't call `pthread_self()`
anymore.
9 years ago
René Kijewski cb423c0ac4 Fix linkage of pthread_reaper_stack 9 years ago
Christian Mehlis e865022a31 pthread: initial add 9 years ago
Ludwig Ortmann 2525920426 remove trailing whitespace and newlines 9 years ago
Martin Lenders 5001925831 Fix my licensing 9 years ago
Oleg Hahm 90f977e7e2 making socket.h MSP430 ready 9 years ago
Oleg Hahm caf1433389 changed condition in fd.c to check for MCU instead of checking for the board 9 years ago
Martin Lenders 4333467e02 Add auxilary headers 9 years ago
Martin Lenders 419225753c Wrap RIOT socket API 9 years ago
Martin Lenders 96489b85c6 Define stdin, stdout and stderr 9 years ago
Martin Lenders ab654573e5 Implementation of close() 9 years ago
Martin Lenders abe65b09bb Implement file descriptor table
Needed for pnet
9 years ago
Martin Lenders f9ae76fa4b Start POSIX net [pnet] module 9 years ago
Oleg Hahm 593ee623b6 simplify and unify include pathes
additional:
* exporting include path in sys is mandatory for subfolders
* removed duplicate object file in linker call
9 years ago
Oleg Hahm 903ec54a43 making include directives consistent 9 years ago
Hauke Petersen 2df82017a8 Fixed doxygen inconsistensies in sys 9 years ago
Oleg Hahm 9817043ada Merge pull request #375 from LudwigOrtmann/license_header_fix
fix grammar in license header
9 years ago
Ludwig Ortmann d6c213fb47 fix grammar in license header 9 years ago
Oleg Hahm 1f50d91332 making the pedantic gcc happy 9 years ago
Oleg Hahm 726db0518c added stddef include to strings.h for size_t 10 years ago
Martin Lenders 9f9a48db9f Minor documentation fixes 10 years ago
Martin Lenders af578b6497 Add POSIX compatible case insensitive compare 10 years ago
Oliver Hahm 5c52e1ce2e coding conventions for most of system libraries 10 years ago
Oliver Hahm 0d6d8390c0 * updated copyright and license headers in various files 10 years ago
Oliver Hahm 7a4dec1830 * replaced new Makefile name in Makefiles 10 years ago
Oliver Hahm 5ffe5a9c27 * renamed makefiles to Makefile 10 years ago
Oleg Hahm 5df0bd0cc4 * updated and integrated makefiles
* added some auto dependencies
10 years ago