Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions cpu/native/Kconfig
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
# Copyright (c) 2020 HAW Hamburg
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
#
# SPDX-FileCopyrightText: 2020 HAW Hamburg
# SPDX-License-Identifier: LGPL-2.1-only

config CPU_ARCH_NATIVE
bool
Expand Down
15 changes: 6 additions & 9 deletions cpu/native/async_read.c
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
/*
* Copyright (C) 2015 Ludwig Knüpfer <ludwig.knuepfer@fu-berlin.de>,
* Martine Lenders <mlenders@inf.fu-berlin.de>
* Kaspar Schleiser <kaspar@schleiser.de>
* Ell-i open source co-operative
* Takuo Yonezawa <Yonezawa-T2@mail.dnp.co.jp>
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
* SPDX-FileCopyrightText: 2015 Ludwig Knüpfer <ludwig.knuepfer@fu-berlin.de>,
* SPDX-FileCopyrightText: 2015 Martine Lenders <mlenders@inf.fu-berlin.de>
* SPDX-FileCopyrightText: 2015 Kaspar Schleiser <kaspar@schleiser.de>
* SPDX-FileCopyrightText: 2015 Ell-i open source co-operative
* SPDX-FileCopyrightText: 2015 Takuo Yonezawa <Yonezawa-T2@mail.dnp.co.jp>
* SPDX-License-Identifier: LGPL-2.1-only
*/

/**
Expand Down
7 changes: 2 additions & 5 deletions cpu/native/backtrace/backtrace.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
/*
* Copyright (C) 2017 Freie Universität Berlin
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
* SPDX-FileCopyrightText: 2017 Freie Universität Berlin
* SPDX-License-Identifier: LGPL-2.1-only
*/

/**
Expand Down
7 changes: 2 additions & 5 deletions cpu/native/cli_eui_provider/eui_provider.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
/*
* Copyright (C) 2020 Benjamin Valentin
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
* SPDX-FileCopyrightText: 2020 Benjamin Valentin
* SPDX-License-Identifier: LGPL-2.1-only
*/

/**
Expand Down
9 changes: 3 additions & 6 deletions cpu/native/cpu.c
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
/*
* Copyright (C) 2016 Kaspar Schleiser <kaspar@schleiser.de>
* 2013 Ludwig Knüpfer <ludwig.knuepfer@fu-berlin.de>
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
* SPDX-FileCopyrightText: 2016 Kaspar Schleiser <kaspar@schleiser.de>
* SPDX-FileCopyrightText: 2013 Ludwig Knüpfer <ludwig.knuepfer@fu-berlin.de>
* SPDX-License-Identifier: LGPL-2.1-only
*/

/**
Expand Down Expand Up @@ -70,7 +67,7 @@
/* ISR -> user switch function */

void _isr_switch_to_user(void) {
DEBUG_CPU("... ISR: switching to user thread, calling setcontext(PID %" PRIkernel_pid ")\n\n", thread_getpid());

Check warning on line 70 in cpu/native/cpu.c

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters

ucontext_t *context = _native_user_context();
_native_interrupts_enabled = true;
Expand Down Expand Up @@ -210,7 +207,7 @@
makecontext(&_end_context, sched_task_exit, 0);

(void)VALGRIND_STACK_REGISTER(_end_context.uc_stack.ss_sp,
(char *)_end_context.uc_stack.ss_sp + _end_context.uc_stack.ss_size);

Check warning on line 210 in cpu/native/cpu.c

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters
VALGRIND_DEBUG("VALGRIND_STACK_REGISTER(%p, %p)\n",
(void*)_end_context.uc_stack.ss_sp,
(void*)((char *)_end_context.uc_stack.ss_sp + _end_context.uc_stack.ss_size));
Expand Down
7 changes: 2 additions & 5 deletions cpu/native/fs/native_fs.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
/*
* Copyright (C) 2023 ML!PA Consulting GmbH
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
* SPDX-FileCopyrightText: 2023 ML!PA Consulting GmbH
* SPDX-License-Identifier: LGPL-2.1-only
*/

/**
Expand Down
7 changes: 2 additions & 5 deletions cpu/native/include/architecture_arch.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
/*
* Copyright (C) 2020 Otto-von-Guericke-Universität Magdeburg
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
* SPDX-FileCopyrightText: 2020 Otto-von-Guericke-Universität Magdeburg
* SPDX-License-Identifier: LGPL-2.1-only
*/

#pragma once
Expand Down
7 changes: 2 additions & 5 deletions cpu/native/include/async_read.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
/*
* Copyright (C) 2015 Takuo Yonezawa <Yonezawa-T2@mail.dnp.co.jp>
*
* This file is subject to the terms and conditions of the GNU Lesser General
* Public License v2.1. See the file LICENSE in the top level directory for
* more details.
* SPDX-FileCopyrightText: 2015 Takuo Yonezawa <Yonezawa-T2@mail.dnp.co.jp>
* SPDX-License-Identifier: LGPL-2.1-only
*/

#pragma once
Expand Down
7 changes: 2 additions & 5 deletions cpu/native/include/atomic_utils_arch.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
/*
* Copyright (C) 2020 Otto-von-Guericke-Universität Magdeburg
*
* This file is subject to the terms and conditions of the GNU Lesser General
* Public License v2.1. See the file LICENSE in the top level directory for more
* details.
* SPDX-FileCopyrightText: 2020 Otto-von-Guericke-Universität Magdeburg
* SPDX-License-Identifier: LGPL-2.1-only
*/

#pragma once
Expand Down
7 changes: 2 additions & 5 deletions cpu/native/include/backtrace.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
/*
* Copyright (C) 2017 Freie Universität Berlin
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
* SPDX-FileCopyrightText: 2017 Freie Universität Berlin
* SPDX-License-Identifier: LGPL-2.1-only
*/

#pragma once
Expand Down
7 changes: 2 additions & 5 deletions cpu/native/include/can_params.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
/*
* Copyright (C) 2016 OTA keys S.A.
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
* SPDX-FileCopyrightText: 2016 OTA keys S.A.
* SPDX-License-Identifier: LGPL-2.1-only
*/

#pragma once
Expand Down
7 changes: 2 additions & 5 deletions cpu/native/include/candev_linux.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
/*
* Copyright (C) 2016 OTA keys S.A.
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
* SPDX-FileCopyrightText: 2016 OTA keys S.A.
* SPDX-License-Identifier: LGPL-2.1-only
*/

#pragma once
Expand Down
7 changes: 2 additions & 5 deletions cpu/native/include/cpu.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
/*
* Copyright (C) 2013 - 2016 Ludwig Knüpfer <ludwig.knuepfer@fu-berlin.de>
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
* SPDX-FileCopyrightText: 2013-2016 Ludwig Knüpfer <ludwig.knuepfer@fu-berlin.de>
* SPDX-License-Identifier: LGPL-2.1-only
*/

#pragma once
Expand Down Expand Up @@ -40,7 +37,7 @@
*/
/**
* @brief The CPU supports unaligned memory access.
* Even if the underlying architecture does not support it, the kernel will take care of it.

Check warning on line 40 in cpu/native/include/cpu.h

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters
*/
#define CPU_HAS_UNALIGNED_ACCESS

Expand Down
7 changes: 2 additions & 5 deletions cpu/native/include/cpu_conf.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
/*
* Copyright (C) 2013 Ludwig Knüpfer <ludwig.knuepfer@fu-berlin.de>
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
* SPDX-FileCopyrightText: 2013 Ludwig Knüpfer <ludwig.knuepfer@fu-berlin.de>
* SPDX-License-Identifier: LGPL-2.1-only
*/

#pragma once
Expand Down
7 changes: 2 additions & 5 deletions cpu/native/include/eeprom_native.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
/*
* Copyright (C) 2019 Inria
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
* SPDX-FileCopyrightText: 2019 Inria
* SPDX-License-Identifier: LGPL-2.1-only
*/

#pragma once
Expand Down
7 changes: 2 additions & 5 deletions cpu/native/include/gpiodev_linux.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
/*
* Copyright (C) 2019 Benjamin Valentin
*
* This file is subject to the terms and conditions of the GNU Lesser General
* Public License v2.1. See the file LICENSE in the top level directory for
* more details.
* SPDX-FileCopyrightText: 2019 Benjamin Valentin
* SPDX-License-Identifier: LGPL-2.1-only
*/

#pragma once
Expand Down
7 changes: 2 additions & 5 deletions cpu/native/include/mtd_native.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
/*
* Copyright (C) 2016 OTA keys S.A.
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
* SPDX-FileCopyrightText: 2016 OTA keys S.A.
* SPDX-License-Identifier: LGPL-2.1-only
*/

#pragma once
Expand Down
7 changes: 2 additions & 5 deletions cpu/native/include/native_cli_eui_provider.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
/*
* Copyright (C) 2020 Benjamin Valentin
*
* This file is subject to the terms and conditions of the GNU Lesser General
* Public License v2.1. See the file LICENSE in the top level directory for
* more details.
* SPDX-FileCopyrightText: 2020 Benjamin Valentin
* SPDX-License-Identifier: LGPL-2.1-only
*/

#pragma once
Expand Down
9 changes: 3 additions & 6 deletions cpu/native/include/native_internal.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
/*
* Copyright (C) 2013, 2014 Ludwig Knüpfer
* Copyright (C) 2025 carl-tud
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
* SPDX-FileCopyrightText: 2013-2014 Ludwig Knüpfer
* SPDX-FileCopyrightText: 2025 carl-tud
* SPDX-License-Identifier: LGPL-2.1-only
*/

#pragma once
Expand Down Expand Up @@ -128,13 +125,13 @@
int native_unregister_interrupt(int sig);

/**
* @brief Calls signal handlers for pending signal, then exits ISR context and performs context switch

Check warning on line 128 in cpu/native/include/native_internal.h

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters
* @pre Intended to be called from **ISR context**
* @private
*
* The context switch back to userspace is performed using @ref `cpu_switch_context_exit`.
*
* @note While it would have been possible to separate this method's functionality into two functions, `setcontext` requires us to have a single function.

Check warning on line 134 in cpu/native/include/native_internal.h

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters
*/
void _native_call_sig_handlers_and_switch(void);

Expand All @@ -150,7 +147,7 @@
/**
* @name System Calls
*
* We wrap system calls and syscall-invoking library calls to ensure **no context switches occur during a system call**.

Check warning on line 150 in cpu/native/include/native_internal.h

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters
* @{
*/
/**
Expand Down Expand Up @@ -179,8 +176,8 @@
*
* Decrements internal pending syscall counter.
*
* If there are other pending system calls and when not already in an ISR context, this function switches to the ISR context and

Check warning on line 179 in cpu/native/include/native_internal.h

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters
* calls signals handlers. This is done through @ref `_native_call_sig_handlers_and_switch`. Returns to userspace

Check warning on line 180 in cpu/native/include/native_internal.h

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters
* thereafter.
*/
void _native_syscall_leave(void);
Expand Down Expand Up @@ -213,7 +210,7 @@
extern volatile uintptr_t _native_user_fptr;

/**
* @brief A boolean variable indicating whether program execution currently takes place in an ISR context

Check warning on line 213 in cpu/native/include/native_internal.h

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters
*/
extern volatile int _native_in_isr;

Expand All @@ -228,7 +225,7 @@
extern ucontext_t *_native_isr_context;

/**
* @brief Resets internal `in_ISR` barrier switch and resumes execution on the currently scheduled thread

Check warning on line 228 in cpu/native/include/native_internal.h

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters
* @pre Intended to be executed in userspace
* @private
*
Expand Down
7 changes: 2 additions & 5 deletions cpu/native/include/netdev_tap.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
/*
* Copyright (C) 2015 Kaspar Schleiser <kaspar@schleiser.de>
*
* This file is subject to the terms and conditions of the GNU Lesser General
* Public License v2.1. See the file LICENSE in the top level directory for
* more details.
* SPDX-FileCopyrightText: 2015 Kaspar Schleiser <kaspar@schleiser.de>
* SPDX-License-Identifier: LGPL-2.1-only
*/

#pragma once
Expand Down
7 changes: 2 additions & 5 deletions cpu/native/include/netdev_tap_params.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
/*
* Copyright (C) 2017 Freie Universität Berlin
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
* SPDX-FileCopyrightText: 2017 Freie Universität Berlin
* SPDX-License-Identifier: LGPL-2.1-only
*/

#pragma once
Expand Down
7 changes: 2 additions & 5 deletions cpu/native/include/periph_conf.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
/*
* Copyright (C) 2014 Ludwig Knüpfer <ludwig.knuepfer@fu-berlin.de>
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
* SPDX-FileCopyrightText: 2014 Ludwig Knüpfer <ludwig.knuepfer@fu-berlin.de>
* SPDX-License-Identifier: LGPL-2.1-only
*/

#pragma once
Expand Down
7 changes: 2 additions & 5 deletions cpu/native/include/periph_cpu.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
/*
* Copyright (C) 2015 Freie Universität Berlin
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
* SPDX-FileCopyrightText: 2015 Freie Universität Berlin
* SPDX-License-Identifier: LGPL-2.1-only
*/

#pragma once
Expand Down
7 changes: 2 additions & 5 deletions cpu/native/include/socket_zep.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
/*
* Copyright (C) 2016 Freie Universität Berlin
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
* SPDX-FileCopyrightText: 2016 Freie Universität Berlin
* SPDX-License-Identifier: LGPL-2.1-only
*/

#pragma once
Expand Down
7 changes: 2 additions & 5 deletions cpu/native/include/socket_zep_params.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
/*
* Copyright (C) 2016 Freie Universität Berlin
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
* SPDX-FileCopyrightText: 2016 Freie Universität Berlin
* SPDX-License-Identifier: LGPL-2.1-only
*/

#pragma once
Expand Down
7 changes: 2 additions & 5 deletions cpu/native/include/spidev_linux.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
/*
* Copyright (C) 2019 Frank Hessel <frank@fhessel.de>
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
* SPDX-FileCopyrightText: 2019 Frank Hessel <frank@fhessel.de>
* SPDX-License-Identifier: LGPL-2.1-only
*/

#pragma once
Expand Down
7 changes: 2 additions & 5 deletions cpu/native/include/syscalls.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
/*
* Copyright (C) 2013 Ludwig Knüpfer <ludwig.knuepfer@fu-berlin.de>
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
* SPDX-FileCopyrightText: 2013 Ludwig Knüpfer <ludwig.knuepfer@fu-berlin.de>
* SPDX-License-Identifier: LGPL-2.1-only
*/

#pragma once
Expand Down
9 changes: 3 additions & 6 deletions cpu/native/include/thread_arch.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
/*
* Copyright (C) 2021 Koen Zandberg <koen@bergzand.net>
* 2021 Inria
*
* This file is subject to the terms and conditions of the GNU Lesser General
* Public License v2.1. See the file LICENSE in the top level directory for more
* details.
* SPDX-FileCopyrightText: 2021 Koen Zandberg <koen@bergzand.net>
* SPDX-FileCopyrightText: 2021 Inria
* SPDX-License-Identifier: LGPL-2.1-only
*/

#pragma once
Expand Down
7 changes: 2 additions & 5 deletions cpu/native/include/tty_uart.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
/*
* Copyright (C) 2015 Takuo Yonezawa <Yonezawa-T2@mail.dnp.co.jp>
*
* This file is subject to the terms and conditions of the GNU Lesser General
* Public License v2.1. See the file LICENSE in the top level directory for
* more details.
* SPDX-FileCopyrightText: 2015 Takuo Yonezawa <Yonezawa-T2@mail.dnp.co.jp>
* SPDX-License-Identifier: LGPL-2.1-only
*/

#pragma once
Expand Down
9 changes: 3 additions & 6 deletions cpu/native/include/util/ucontext.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
/*
* Copyright (C) 2013 - 2016 Ludwig Knüpfer <ludwig.knuepfer@fu-berlin.de>
* Copyright (C) 2025 carl-tud
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
* SPDX-FileCopyrightText: 2013-2016 Ludwig Knüpfer <ludwig.knuepfer@fu-berlin.de>
* SPDX-FileCopyrightText: 2025 carl-tud
* SPDX-License-Identifier: LGPL-2.1-only
*/

#pragma once
Expand Down
7 changes: 2 additions & 5 deletions cpu/native/include/util/valgrind.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
/*
* Copyright (C) 2025 carl-tud
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
* SPDX-FileCopyrightText: 2025 carl-tud
* SPDX-License-Identifier: LGPL-2.1-only
*/

#pragma once
Expand Down
7 changes: 2 additions & 5 deletions cpu/native/irq.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
/*
* Copyright (C) 2013 Ludwig Knüpfer <ludwig.knuepfer@fu-berlin.de>
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
* SPDX-FileCopyrightText: 2013 Ludwig Knüpfer <ludwig.knuepfer@fu-berlin.de>
* SPDX-License-Identifier: LGPL-2.1-only
*/

/**
Expand Down
Loading