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

331 Commits

Author SHA1 Message Date
Ludwig Ortmann
b43fa2327e native/tramp.S: use ret instead of manual return 2014-05-15 11:38:24 +02:00
Ludwig Ortmann
e0a1217f20 native: refactor one debug/errx use in irq_cpu.c 2014-05-15 11:37:18 +02:00
Thomas Eichinger
7a031e5669 net: handle macro redefinitions for OS X
undefine macros and reorder header includes to get rid of system
defined macros on OS X

fixes #1165
2014-05-14 19:43:58 +02:00
René Kijewski
d98ebf62cd native: fixup #1145: function declaration 2014-05-14 16:54:34 +02:00
René Kijewski
8038e96d09 Merge pull request #1119 from Kijewski/error_old-style-definition
Exterminate old-style function definitions
2014-05-14 13:31:30 +02:00
Ludwig Ortmann
166b88f1ae native: internal getpid syscall 2014-05-14 09:13:57 +02:00
Ludwig Ortmann
4c961bfb6e native: refactor getpid calls 2014-05-14 09:13:57 +02:00
Ludwig Ortmann
27eb2aedc1 native: update README
Move README to to README.md
Fix spelling and markup
2014-05-13 11:25:34 +02:00
René Kijewski
628419eb11 Exterminate old-style function declaration/prototypes 2014-05-12 21:57:09 +02:00
René Kijewski
9a9caf2c68 Exterminate old-style function definitions 2014-05-12 21:57:09 +02:00
Jan S
e7cf6bf745 removed unreachable code 2014-05-09 23:45:07 +02:00
Jan S
350e34f924 typo fix 2014-05-09 23:38:38 +02:00
René Kijewski
6f3d0871aa core/cpu: put __builtin_unreachable() into one place 2014-05-07 19:24:55 +02:00
Hauke Petersen
7545eff784 core/cpu/board: moved F_CPU define to board 2014-05-06 10:36:09 +02:00
René Kijewski
4c66f72ba3 Merge pull request #1022 from LudwigOrtmann/issue_505
native: update support for FreeBSD
2014-04-26 15:51:54 +02:00
Ludwig Ortmann
c2b9d94a0c native: add tapsetup-freebsd.sh 2014-04-20 07:31:40 +02:00
Ludwig Ortmann
42aa3d9f5b native: update support for FreeBSD
works with FreeBSD 10.0 amd64/i386

fixes: #505
2014-04-20 07:31:40 +02:00
Ludwig Ortmann
6044dc28dc native: add help option
Closes: #840
2014-04-19 12:44:11 +02:00
René Kijewski
542a2e5d9d Merge pull request #995 from Kijewski/issue-993
Make: exterminate 'clean' buildtarget clutter
2014-04-18 16:11:15 +02:00
900db3436a native: optionally exit() after last thread has ended
Used when compiled with NATIVE_AUTO_EXIT defined.
2014-04-12 15:47:01 +02:00
René Kijewski
300d6b3e35 Make: exterminate 'clean' buildtarget
Closes #993.

We do not need to descend into the modules to know what to do on
`make clean BOARD=blub`. We can just invoke `rm -rf bin/blub`.

This PR only keeps the descending into the USEPKGs, since they might
want to delete cached/downloaded/extracted data.
2014-04-09 23:07:52 +02:00
Ludwig Ortmann
9f24ae2e62 Merge pull request #946 from Kijewski/native-write
native: don't use RIOT read/write in UART
2014-04-09 18:17:09 +02:00
Ludwig Ortmann
b9ffc1a99e fixup for #710: use subfolder in bin dirs (native)
Update native Makefiles to provide changed object target paths
Fixes #989
2014-04-09 15:25:05 +02:00
Oleg Hahm
aeb54158f6 cpu: satisfy compiler in crash.c 2014-04-09 12:27:53 +02:00
Oleg Hahm
1e9a43d0f8 Merge pull request #778 from LudwigOrtmann/dependency_files
Make: Prepend path to dependency info files with sed
2014-04-08 23:22:21 +02:00
René Kijewski
2749531324 Merge pull request #789 from LudwigOrtmann/native_gprof
native profiling tools support
2014-04-05 02:26:15 +02:00
Ludwig Ortmann
91814e52ae make: replace MAKEBASE with RIOTBASE
closes https://github.com/RIOT-OS/RIOT/issues/959
2014-04-01 16:40:28 +02:00
Ludwig Ortmann
b2930113ef remove some newlines 2014-04-01 10:47:12 +02:00
Ludwig Ortmann
a1aa0df9ae change new/overlooked Makefiles 2014-04-01 10:44:10 +02:00
Ludwig Ortmann
1bd3f7bb86 pipe through sed instead
addresses: https://github.com/RIOT-OS/RIOT/pull/778#discussion_r10041955
2014-04-01 10:44:10 +02:00
René Kijewski
0b75a11291 native: don't use RIOT read/write in UART 2014-03-30 22:33:50 +02:00
Hauke Petersen
8a937e1a1c hwtimer: clean up of interfaces to board/cpu 2014-03-26 13:19:18 +01:00
Ludwig Ortmann
0501fe8980 native: config_load: set PID as id, net address 2014-03-18 08:07:30 +01:00
Oleg Hahm
3c54edf4d6 Merge pull request #822 from LudwigOrtmann/reboot_signature
core: change reboot signature.
2014-03-16 18:42:23 +01:00
Ludwig Ortmann
8ef02d3b9d native profiling support
only works with Linux for now
2014-03-14 12:50:50 +01:00
Ludwig Ortmann
9b61d95545 make: don't ignore failures in for loops
Add `|| exit 1` to all constructs like `@for i in $(DIRS) ; do "$(MAKE)" -C $$i ; done ;`, so that compilation stops on the first error.
2014-03-12 11:09:04 +01:00
Ludwig Ortmann
063a15ce9b Change reboot signature.
Change from `void reboot(void)` to `int reboot(int mode)`.
Move reboot definition to core, rename architecture implementations
from reboot to reboot_arch.
Declare reboot mode(s) in kernel.h, reboot_arch in kernel_internal.h
Currently only one reboot mode is handled, its use is enforced.

Rationale:
A reboot function is already defined in <unistd.h> on BSD systems.
(See: http://www.openbsd.org/cgi-bin/man.cgi?query=reboot&sektion=2)
This patch not only allows native to build sensibly on these systems
but also streamlines RIOTs compatability with existing software.
2014-03-10 11:14:27 +01:00
Martin Lenders
49b1f44b2e Merge pull request #804 from LudwigOrtmann/native_include_separation
native/make: Don't use INCLUDES for building any native at all.
2014-03-03 15:12:56 +01:00
Ludwig Ortmann
2cd3f04fc6 Don't use INCLUDES for building any native at all.
native modules will never need the dynamic INCLUDES, so we define our
own NATIVEINCLUDES. Due to the current make structure, the only way to
not use INCLUDES is to redefine the build rules.
2014-02-27 10:30:30 +01:00
Ludwig Ortmann
470bd7f17f Fixup for #685
- use DEVELHELP for native as well
- fix function name in documentation
- improve documentation language/spelling
2014-02-26 21:49:54 +01:00
Oleg Hahm
0c14597ec2 Merge pull request #685 from rousselk/panic
Panic
2014-02-26 16:26:27 +01:00
Oleg Hahm
07b0cd8863 added gettimeofday syscall
RIOT's gettimeofday needs to be called from syscalls.c to assure that gcc actually links it.

If an RTC if available and enabled it will be used instead.
2014-02-25 17:41:45 +01:00
Kévin Roussel
03fe9de135 Implemented crash-handling mechanism for 'native' platform 2014-02-25 10:50:51 +01:00
Christian Mehlis
261d414649 native: removed unreachable code 2014-02-25 09:02:39 +01:00
Ludwig Ortmann
86812c2abb make calloc "usable" early on
closes #741

Old versions of the gnu libc uses calloc to allocate dymanic memory
when some error occurs in dlsym.
This results in a segfault as natives calloc wrapper has not been
initialized yet.
As this is a circular dependency and the libc can cope with this, we
just return NULL from the calloc wrapper and hope for the best.

Recent libc versions use a static buffer instead.
2014-02-22 13:08:45 +01:00
Christian Mehlis
0309fecc19 fix warning: invalid suffix on literal
C++11 requires a space between
literal and identifier [-Wliteral-suffix]
2014-02-18 17:05:01 +01:00
Oleg Hahm
b42496475a Merge pull request #724 from rousselk/reboot
Reboot
2014-02-18 13:33:49 +01:00
Christian Mehlis
6578669e46 Merge pull request #718 from Kijewski/issue-693
"Exterminate `} else {`"
2014-02-18 12:42:54 +01:00
Christian Mehlis
cb9c5d00de repace project by application in documentation 2014-02-18 12:28:32 +01:00
Kévin Roussel
dc6f920f33 Merge remote-tracking branch 'origin/reboot' into reboot 2014-02-17 12:00:19 +01:00
René Kijewski
2349d0806e "Exterminate } else {" 2014-02-16 23:29:47 +01:00
Ludwig Ortmann
561eefab07 implement rudimentary native reboot 2014-02-14 16:20:36 +01:00
René Kijewski
102dc45382 Eliminate findstring in more places 2014-02-14 14:30:16 +01:00
Christian Mehlis
d794900386 Merge pull request #666 from LudwigOrtmann/native_valgrind_config
Native valgrind config
2014-02-12 11:01:34 +01:00
Ludwig Ortmann
114aaa65e5 Merge pull request #626 from LudwigOrtmann/issue_621
add EUI-64 support for nativenet
2014-02-11 19:30:23 +01:00
Ludwig Ortmann
336c5159b2 use pkg-config to add valgrind include path
makes knowledge of VALGRIND_VALGRIND_H vs. VALGRIND_H optional
2014-02-11 19:22:39 +01:00
Ludwig Ortmann
2525920426 remove trailing whitespace and newlines 2014-02-11 18:45:06 +01:00
Ludwig Ortmann
d5d3bbcd44 add EUI-64 support for nativenet 2014-02-10 08:33:57 +01:00
Martin
6a29d18324 changed assignment to const char* 2014-02-10 08:29:22 +01:00
Martin
174a75102b changed clonedev assignment according to const string 2014-02-10 08:21:32 +01:00
Oleg Hahm
62046d6ea0 Merge pull request #649 from BytesGalore/fix_missing_typecasts
Fix added missing typecasts to stack (arm/msba2) and send/receive buffer (native)
2014-02-07 12:25:08 +01:00
Martin
f19ec9649f added typecast for starck_start in native 2014-02-07 09:14:58 +01:00
Ludwig Ortmann
5681fcc481 native readme update 2014-02-04 18:41:38 +01:00
Ludwig Ortmann
f04eaa3d20 update native readme 2014-02-01 12:10:08 +01:00
Ludwig Ortmann
fd083c95a6 check for active_thread != NULL in syscalls.c before using it
fixes #498
2014-01-31 09:31:22 +01:00
Ludwig Ortmann
f0340b90a2 guard pre-err() warn() calls 2014-01-29 19:13:49 +01:00
Ludwig Ortmann
176f379c7a dont err() but warn() if no thread exists in native_isr_entry 2014-01-29 18:44:42 +01:00
Ludwig Ortmann
796b656e31 force-debug (eINT && in_isr) in DEVELHELP 2014-01-29 18:44:42 +01:00
Ludwig Ortmann
6f5d4dcdb4 block all signals per default 2014-01-29 18:44:42 +01:00
Ludwig Ortmann
bdd4252961 guard setitimer 2014-01-29 18:44:42 +01:00
Ludwig Ortmann
0766b92f7b Don't unblock signals again.
A late signal could kill the process otherwise.
2014-01-29 18:44:42 +01:00
Ludwig Ortmann
2c80f68d62 handle more errors and remove race condition in native_isr_entry 2014-01-29 18:44:42 +01:00
Ludwig Ortmann
a55e85f8d0 guard swapcontext in _native_syscall_leave 2014-01-29 18:44:42 +01:00
Ludwig Ortmann
7f1db86ae2 handle some should-be impossible paths 2014-01-29 18:44:41 +01:00
Ludwig Ortmann
573b154f44 handle select errors EAGAIN | EWOULDBLOCK in lpm 2014-01-29 18:44:18 +01:00
Ludwig Ortmann
3c087107f2 fix call to err() 2014-01-29 16:54:36 +01:00
Ludwig Ortmann
f04c3dc433 Merge pull request #559 from LudwigOrtmann/native_syscall_guards
Native syscall guards
2014-01-24 09:36:26 -08:00
Ludwig Ortmann
d8745e2861 add local debug macro
addresses https://github.com/RIOT-OS/RIOT/pull/559#issuecomment-33241773
2014-01-24 18:26:44 +01:00
Ludwig Ortmann
b22380990f fix DEBUG in syscalls 2014-01-24 17:30:47 +01:00
Ludwig Ortmann
4939473afb guard malloc/free family 2014-01-24 17:30:47 +01:00
Ludwig Ortmann
7685357990 Merge pull request #547 from LudwigOrtmann/native_hwtimer_fix
Native hwtimer fix
2014-01-24 08:10:42 -08:00
Ludwig Ortmann
7148f1db23 change wording
addresses https://github.com/RIOT-OS/RIOT/pull/555#discussion_r9118361
2014-01-23 17:25:41 +01:00
Ludwig Ortmann
f58b312129 improve error messages when tap ioctls fail 2014-01-23 17:16:00 +01:00
Ludwig Ortmann
e32bfa53d0 fix overdue mitigation 2014-01-23 00:03:23 +01:00
Ludwig Ortmann
91ebc1d0b5 improve debug messages 2014-01-22 22:19:53 +01:00
Ludwig Ortmann
332cf8807f fix callback offset 2014-01-22 22:19:53 +01:00
Ludwig Ortmann
855eea6a53 add missing newlines 2014-01-22 18:26:53 +01:00
Ludwig Ortmann
2b4a323a18 unclutter native_isr_entry a bit
remove heap_address - hopefully superflous, does not work in valgrind
remove stale TODO
2014-01-21 17:39:43 +01:00
Ludwig Ortmann
7789bbca16 fix signal trampoline
save and use the program counter on stack
removes race condition in trampoline
also push/pop full memory words explicitly
2014-01-21 17:39:15 +01:00
Ludwig Ortmann
98a2d554b5 osx fixes 2014-01-21 12:30:53 +01:00
Ludwig Ortmann
fc6cd24ece reduce HWTIMERMINOFFSET 2014-01-15 12:40:55 +01:00
Ludwig Ortmann
dbcc898bcc update internal timer on hwtimer_arch_set 2014-01-15 12:40:03 +01:00
Ludwig Ortmann
d3a1c1bda7 add comment
addresses https://github.com/RIOT-OS/RIOT/pull/501#discussion_r8881054
2014-01-15 11:24:59 +01:00
Ludwig Ortmann
921b70d5e8 fix pre-init
set the internal relative time - don't rely on hwtimer_now() being
called externally
2014-01-14 17:23:15 +01:00
Ludwig Ortmann
396f6c2819 fix debug msg 2014-01-14 17:23:03 +01:00
Ludwig Ortmann
6fe1ecd1b4 Merge pull request #479 from LudwigOrtmann/nativenet_lenchck
Nativenet length check and cleanup
2014-01-10 01:47:35 -08:00
Oleg Hahm
fe575d52df Merge pull request #364 from OlegHahm/float_stack_sizes
added a dedicated stacksize for float printfs
2014-01-09 10:48:38 -08:00
Thomas Eichinger
dadd64e2f9 Merge pull request #473 from LudwigOrtmann/nativenet_osx_xmas
add io signal generating child for nativenet in osx
2014-01-09 07:14:34 -08:00
Ludwig Ortmann
83db6f6364 remove superflous include 2014-01-09 12:33:02 +01:00
Ludwig Ortmann
76b017aefd check payload length validity
make sure the payload does not exceed the amount of data received
2014-01-08 14:58:57 +01:00
Ludwig Ortmann
ac0ec1f6b3 nativenet clean up
Make nativenet tap payload type consistent with radio_packet_t
Also remove a trailing space
2014-01-08 14:57:11 +01:00
Ludwig Ortmann
98d1136761 update native README 2014-01-07 10:20:58 +01:00
Oleg Hahm
775c0dee5c added missing mute prefixes in nativenet and shell 2014-01-05 16:11:08 +01:00
Oleg Hahm
9df07f9238 muting compiler and binutils optionally
Instead of muting all compiler and other binutils output by default,
introduce a variable to make this behaviour configurable.
2014-01-05 16:11:08 +01:00
Oleg Hahm
c7d985d371 removed redundant include pathes from Makefiles 2014-01-05 16:11:08 +01:00
Oleg Hahm
26c50522d5 simplified and unified cpu build structure 2014-01-05 16:11:07 +01:00
Ludwig Ortmann
ea8b735232 fix nativenet_send documentation 2013-12-24 11:57:54 +01:00
Ludwig Ortmann
648bdaeed6 add io signal generating child for nativenet in osx 2013-12-24 11:54:00 +01:00
Ludwig Ortmann
1ac1646837 further clean up / filtering for cpu 2013-12-23 00:18:21 +01:00
Ludwig Ortmann
cf87e647c0 make native includes RIOT posix compatible 2013-12-22 23:26:54 +01:00
Ludwig Ortmann
ef315ed662 improve nativenet send functions return type 2013-12-21 16:56:42 +01:00
Ludwig Ortmann
751cfe6475 fix native hwtimer
The hardware timer used relative offsets that were never updated
before. This leads to two problems:
a) later timers will get pushed into the future by the amount of
   previous timers
b) if a short timer is set continuously, a longer timer will never be
   called

Example:
a)
Timer a with 500 ms is set, timer b with 600 ms is set.
timer a expires after 500 ms, timer b will be set to expire in 600 ms
which totals to 1100 ms.
b)
Timer a is set to 500 ms, timer b is set to 600 ms.
Timer a expires and is set again. Now timer a will expire in 500 ms
and timer b will be pushed further into the future. Repeating this
will lead to b never expiring.
2013-12-20 18:55:47 +01:00
Martin Lenders
69809928d3 Make UART0_BUFSIZE configurable by CPU 2013-12-20 11:10:42 +01:00
Oleg Hahm
903ec54a43 making include directives consistent 2013-12-19 15:31:37 +01:00
Oleg Hahm
ead2e117a1 Merge pull request #439 from OlegHahm/thread_yield_prototype
put prototype for thread_yield() in core/include
2013-12-18 13:36:55 -08:00
Christian Mehlis
2a9aac7f0b Merge pull request #423 from OlegHahm/fix_warnings
Fix warnings
2013-12-18 12:02:37 -08:00
Oleg Hahm
2cdfc5b585 Merge pull request #382 from OlegHahm/transceiver_return
transceiver return signed values for sending
2013-12-18 09:33:32 -08:00
Oleg Hahm
d87d827d88 transceiver return signed values for sending
negative values indicate an error value
2013-12-18 18:22:59 +01:00
Oleg Hahm
227c847135 put prototype for thread_yield() in core/include 2013-12-18 17:47:49 +01:00
Hauke Petersen
edcabf7cb6 Fixed a lot of comments by removing tabs and correcting format. 2013-12-16 14:00:33 +01:00
Hauke Petersen
3785fe956b Fixed doxygen comments, focused on file headers and group definitions 2013-12-16 14:00:24 +01:00
Ludwig Ortmann
0817675f5e fix native hwtimer unsetting
reverts bug introduced by 2bfb062
2013-12-14 00:12:47 +01:00
Ludwig Ortmann
d03d7b1773 clean up native hwtimer 2013-12-14 00:07:49 +01:00
Oleg Hahm
72586f7a6d limit maximum payload size to 255 for nativenet if 6lowpan is used 2013-12-13 18:53:48 +01:00
Christian Mehlis
2bfb06230a fix: native hwtimer backend emulation
searching for the next pending timer was broken
this commit rewrites this functionality
2013-12-11 16:22:14 +01:00
Christian Mehlis
b17ffabce5 reduce minimal timer from 100ms to 10ms 2013-12-10 22:08:49 +01:00
Ludwig Ortmann
916757cf4c implement err.h
valgrind reported invalid reads/writes with glibc err[x]|warn[x] (in
glibc printf) when stdio had been redirected in between.

define _progname (pointing to argv[0])
2013-12-10 17:00:01 +01:00
Ludwig Ortmann
864267f238 daemonization, io socket and file redirection 2013-12-10 17:00:01 +01:00
Christian Mehlis
faa7b0c702 Merge pull request #394 from LudwigOrtmann/native_fix_include
fix native stdlib.h include
2013-12-03 02:26:30 -08:00
Ludwig Ortmann
2d7c328870 fix native stdlib.h include
Fixes segfault in OSX introduced by 45ffdea
2013-12-02 11:39:22 +01:00
Ludwig Ortmann
1c128f5ed6 improve valgrind section 2013-12-02 11:17:25 +01:00
Ludwig Ortmann
d6c213fb47 fix grammar in license header 2013-11-23 13:11:56 +01:00
Ludwig Ortmann
2f53c0d32f rework sigmasks
only mask signals actively being used
always enable shutdown
2013-11-23 11:21:40 +01:00
Ludwig Ortmann
0c6050a814 mask all signals in signal handler 2013-11-23 11:21:40 +01:00
Ludwig Ortmann
0a6dba11e5 mitigate against signals when signals are off 2013-11-23 11:21:40 +01:00
Ludwig Ortmann
5e1eadc353 add in_isr sighndl safeguard 2013-11-23 11:21:40 +01:00
Ludwig Ortmann
3a04671912 replace 1 with EXIT_FAILURE in all err calls 2013-11-23 11:21:40 +01:00
Ludwig Ortmann
3ca8181c73 reset context before makecontext call, check
check return value of swapcontext
2013-11-23 11:21:40 +01:00
Ludwig Ortmann
709cc9c158 add toa to packets in nativenet
also change order of fields to reflect radio types header
2013-11-22 10:55:49 +01:00
Oleg Hahm
6a1fcaf288 added a dedicated stacksize for float printfs 2013-11-21 20:41:28 +01:00
Christian Mehlis
45ffdeaf52 add missing stdlib.h include 2013-11-21 00:26:13 +01:00
Oleg Hahm
19f4f45445 added some debug output for the network stack 2013-11-14 10:46:21 +01:00
Ludwig Ortmann
01e30016d6 add lpm syscall barrier for native w/out UART 2013-11-13 23:43:26 +01:00
Ludwig Ortmann
c764728398 pre-init native hwtimer
make it behaver more like a regular timer
2013-11-13 01:31:31 +01:00
Ludwig Ortmann
1df56ed47b cope with SIGIO behaviour
SIGIO appears to be edge triggered, therefore we need to read
continuously until no more data is available
2013-11-13 00:01:42 +01:00
Ludwig Ortmann
2c7070bf0c disable interrupts for sighnd ctx switch 2013-11-13 00:01:42 +01:00
Ludwig Ortmann
9f080c54c6 fix race in thread_yield, cpu_switch_context_exit
call *context only with interrupts disabled, use isr trampoline for
this if necessary
2013-11-13 00:01:42 +01:00
Ludwig Ortmann
7b9d199ec8 make system calls safer/clean up headers
wrap some libc functions that do system calls (terminal output)
wrap read/write with syscall guard
define real_read/write (next dynamic linker find for read/write)
guard system calls in remaining code
introduce native_internhal.h
throw out some debug statements that break things
clean up includes a bit
declare board_init in native_internhal.h
add -ldl to LINKFLAGS for cpu/syscalls
2013-11-13 00:01:42 +01:00
Ludwig Ortmann
bad523831b allow for custom tap names 2013-11-08 13:59:26 +01:00
Christian Mehlis
4f4c4bfedd use radio_packet_length_t for native frames 2013-10-29 20:36:13 +01:00