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

254 Commits

Author SHA1 Message Date
Marian Buschsieweke
21151691d7
cpu/native: Fix C11 atomic sizes for musl
musl and glibc have different types for fast atomic integers. This
selects the correct size depending on the used library.
2024-06-05 22:04:43 +02:00
Marian Buschsieweke
f34cd3f7c1
cpu/native: fix build with musl
This changes a bunch of things that allows building with the musl C lib,
provided that `libucontext-dev` and `pkg-config` are installed.

Note that installing libucontext makes absolutely zero sense on C libs
that do natively provide this deprecated System V API, such as glibc.
Hence, it no sane glibc setup is expected to ever have libucontext
installed.

A main pain point was that argv and argc are expected to be passed to
init_fini handlers, but that is actually a glibc extension. This just
parses `/proc/self/cmdline` by hand to populate argv and argc during
startup, unless running on glibc.
2024-05-31 12:18:33 +02:00
Karl Fessel
2bdca8d6c9
Merge pull request #16809 from kfessel/p-backtrace-fix
native/backtrace: improve its print capabilitys and test
2024-05-08 19:57:18 +00:00
Karl Fessel
37627ce2b8 native/backtrace: improve print capabilitys and test 2024-05-08 12:53:57 +02:00
Gilles DOFFE
ebf95d2545 cpu/native: enhance GPIO mocking with 2D array representation
This commit introduces a more robust GPIO mocking mechanism by utilizing
a 2-dimensional array. Each element of the array holds a gpio_mock_t
structure describing a pin's attributes such as value, mode, flank,
interruption callback, and callback argument.

This enhancement allows for the arbitrary simulation of GPIOs across
various microcontroller architectures using the current API, while
maintaining consistency through the use of the GPIO_PIN macro.

Additionally, it should be noted that only the maximum number of ports
and maximum number of pins can be altered according to the context.

The implemented API in gpio_mock.c remains rudimentary, providing no
validation but fulfilling the required functions. However, it remains
customizable as all its functions are marked as weak.

Signed-off-by: Gilles DOFFE <g.doffe@gmail.com>
2024-03-24 23:12:24 +01:00
Mihai Renea
795415d59e cpu/native/periph/uart: uart_poweroff() closes the file descriptor 2024-02-09 12:55:40 +01:00
Frederik Haxel
0c2cfe99e6 native64: Add Linux/x86_64 board
Adds a separate board for native64 instead of the `NATIVE_64BIT` workaround.
The files in `boards/native64` are more or less dummy files and just include
the `boards/native` logic (similar to `openlabs-kw41z-mini-256kib`).
The main logic for native is in `makefiles/arch/native.inc.mk`, `cpu/native`
and `boards/native`.

The remaining changes concern the build system, and change native board checks
to native CPU checks to cover both boards.
2024-02-05 22:01:40 +01:00
Frederik Haxel
16eff9b6ed native: Linux/x86_64 support
Initial version to test 64 bit compatibility.

Instead of a separate board, the inital version for Linux/x86_64 is enabled
by setting the environment variable `NATIVE_64BIT=y` and compiling as usual.

Not currently implemented:
* Architectures other than x86_64 or operating systems other than Linux
    * No FreeBSD support
    * No Aarch support
* Rust support for x86_64
2024-01-30 16:33:19 +01:00
Armin Wolf
6070c57e21 cpu/native: Add support for periph_timer_query_freqs
Add support for querying the frequency supported by
`periph_timer`. This allows applications which require
this feature to run on the `native` board.

Signed-off-by: Armin Wolf <W_Armin@gmx.de>
2024-01-30 02:01:50 +01:00
bors[bot]
718a4513b5
Merge #19368 #19529 #19531
19368: debug: add DEBUG_BREAKPOINT() macro, set breakpoint on failed assertion r=benpicco a=benpicco



19529: cpu/stm32/periph/dac: optimize setting DAC r=benpicco a=Enoch247

### Contribution description

The current implmentation right shifted the 16 bit value passed into `dac_set()` down to the 12 bits that the DAC is actually capable of. This patch drops the shift and instead writes the 16 bit value to the DAC's left aligned 12 bit wide data holding register.


### Testing procedure

do something like:
``` c
#include "perip/dac.h"

int main(void)
{
    dac_set(DAC_LINE(0), 0xffff/2);
    return 0;
}
```
- observe DAC's output is half of vref


### Issues/PRs references

- none known


19531: tests/unittests: allow passing `UNIT_TESTS` via env r=benpicco a=kaspar030



Co-authored-by: Benjamin Valentin <benpicco@beuth-hochschule.de>
Co-authored-by: Joshua DeWeese <jdeweese@primecontrols.com>
Co-authored-by: Kaspar Schleiser <kaspar@schleiser.de>
2023-05-02 18:08:42 +00:00
Marian Buschsieweke
c3500eb6e0
tree wide: fix typos in comments found by codespell
This will not change generated binaries, only the Doxygen output and
source code will have less typos.
2023-05-02 09:52:06 +02:00
Benjamin Valentin
fe4cc9169d cpu/native: define ARCHITECTURE_BREAKPOINT() 2023-04-27 13:19:17 +02:00
Benjamin Valentin
006ad81c0c cpu/native: wire up more fs related syscalls 2023-04-25 13:28:20 +02:00
Teufelchen1
10cada1b8d native/syscalls: rename real_clock_gettime to clock_gettime 2023-04-17 15:21:52 +02:00
bors[bot]
d4d91492cd
Merge #18100 #19121 #19164 #19169
18100: core/assert: print backtrace on failed assertion r=kaspar030 a=benpicco



19121: socket_zep: only report size of single datagram r=kaspar030 a=benpicco



19164: cpu/sam0_common: move adc_res_t to common code r=dylad a=benpicco



19169: tests/driver_ws281x: don't overwrite board definition r=benpicco a=benpicco





Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
Co-authored-by: Benjamin Valentin <benjamin.valentin@bht-berlin.de>
2023-01-18 23:59:58 +00:00
Benjamin Valentin
81625fd5f2 doc: sort all stdio implementations into sys_stdio group 2023-01-13 11:08:22 +01:00
Benjamin Valentin
8a80e70e5e cpu/native: syscalls: provide real_recv() 2023-01-10 14:24:16 +01:00
Teufelchen1
c9e9a8d2f1 native: Remove code used for __MACH__ target 2022-12-22 17:57:25 +01:00
Teufelchen1
35a06c4806 boards/native: Remove macOS as native target 2022-10-25 19:11:23 +02:00
Benjamin Valentin
0aa931ad7d cpu/native: povide real_ftell() function 2022-09-29 14:55:27 +02:00
Benjamin Valentin
ea917f4b07 cpu: cpu_print_last_instruction() -> cpu_get_caller_pc() 2022-09-15 10:49:56 +02:00
Teufelchen1
1231807bab Documentation: Renaming OS X to macOS 2022-06-23 17:25:48 +02:00
Martine Lenders
c4e202ae67
Merge pull request #17709 from benpicco/cpu/native-tap_wired
netdev_tap: make 'wired' property configurable
2022-06-01 02:24:43 +02:00
Benjamin Valentin
f61c12e008 netdev_tap: make 'wired' property configurable
`netdev_tap` is a virtual interface, make it possible to simulate both
a wired and a wireless interface.
2022-05-23 15:27:35 +02:00
Francisco Molina
0d7eb36247 boards/native: only one CAN_DLL by default 2022-04-20 14:40:06 +02:00
Jens Wetterich
4dfeafcabd cpu/native/netdev_tap: Add to netdev_register 2022-02-11 07:54:11 +01:00
Benjamin Valentin
fc4cd0484b cpu/native: change mtd_native_dev_t parent name to base
This brings it in line with the other MTD implementations.
2022-02-09 12:21:53 +01:00
Jose Alamos
db815aa779
ieee802154/hal: migrate to request_op and confirm_op 2022-01-10 13:57:02 +01:00
b206658b51
cpu/native: define default CLOCK_CORECLOCK constant 2021-12-15 12:41:36 +01:00
José Alamos
ce8cda2fd8
Merge pull request #16932 from benpicco/socket_zep-hal
socket_zep: port to radio HAL
2021-12-07 18:24:33 +01:00
Benjamin Valentin
fa2d9bde56 socket_zep: port to radio HAL 2021-11-18 11:51:14 +01:00
Francisco
96e2ad1f0e
Merge pull request #16956 from fjmolinas/pr_native_relative_stacksize
cpu/native/include: other stacksizes based on default
2021-10-26 09:04:16 +02:00
Francisco Molina
5070489aa6 cpu/native/include: other stacksizes based on default 2021-10-25 09:13:21 +02:00
Benjamin Valentin
1a2984b786 cpu/native: fix build with gcc 11
This fixes the following warning with GCC 11.2:

    cpu/native/include/native_internal.h:153:13: error: variably modified ‘__isr_stack’ at file scope
      153 | extern char __isr_stack[SIGSTKSZ];
          |             ^~~~~~~~~~~
    cpu/native/include/native_internal.h:154:13: error: variably modified ‘__end_stack’ at file scope
      154 | extern char __end_stack[SIGSTKSZ];
2021-10-12 14:56:11 +02:00
Jean-Pierre De Jesus DIAZ
d1f9cd0647 cpu/native: fix doxygen grouping warnings
Signed-off-by: Jean-Pierre De Jesus DIAZ <me@jeandudey.tech>
2021-09-11 12:45:15 +02:00
benpicco
1407559f33
Merge pull request #15773 from benpicco/tools/zep_dispatch-topology
tools/zep_dispatch: add support for advanced topologies
2021-07-07 12:14:43 +02:00
136c630870
cpu/native: make thread size defines overridable 2021-05-07 13:12:01 +02:00
Benjamin Valentin
99341a3dc4 cpu/native: export send() as real_send() 2021-02-20 20:35:33 +01:00
Martine Lenders
de4ee0f934
Merge pull request #15562 from benpicco/socket_zep_register
socket_zep: register with netdev, provide EUI-64 as command line parameter
2021-02-20 20:32:01 +01:00
Benjamin Valentin
17199dbb1c socket_zep: allow to specify MAC address of ZEP device
Add a command-line parameter for setting the EUI-64 of a ZEP device.
This allows a native node to use a persistent ZEP address across reboots.
2021-02-16 18:57:27 +01:00
Benjamin Valentin
1acbd6e560 cpu/native: add periph/flashpage implementation
Add a simple RAM-backed flashpage implementation for native, to
allow for easier testing of flashpage based applications / features.
2021-02-05 23:31:46 +01:00
Benjamin Valentin
d8918c24fa socket_zep: register with netdev 2021-01-25 22:59:01 +01:00
517fc585b1
cpu/native: Add dummy thread_arch.h header 2021-01-22 09:21:46 +01:00
Benjamin Valentin
d7ed3418b5 cpu/native: pm: fix build with pm_layered 2020-12-08 18:24:02 +01:00
1d5e2e9cd9 all: remove traces of kernel_types.h
Automatically removed using:

    $ git grep -l kernel_types | xargs sed -i '/^#include .kernel_types/d'
2020-11-25 17:52:34 +01:00
Marian Buschsieweke
dd48ced151
cpu/*/atomic_utils_arch.h: Add volatile qualifier 2020-11-24 14:00:52 +01:00
Martine Lenders
a07d3e0fc9
Merge pull request #14755 from benpicco/examples/gnrc_border_router-native
examples/gnrc_border_route: simplify ZEP setup on native
2020-11-13 18:41:03 +01:00
Benjamin Valentin
90f3c15084 socket_zep: send dummy HELLO packet on connect 2020-11-13 18:10:57 +01:00
792e031a95
Merge pull request #14331 from maribu/atomic_utils
sys/atomic_utils: Functions for atomic access
2020-11-12 21:44:53 +01:00
Marian Buschsieweke
56a54a773e
cpu/native: Add atomic_utils_arch.h 2020-11-10 10:55:14 +01:00