[riot-commits] [RIOT-OS/RIOT] 0e724e: cpu/fe310: don't call thread_yield when sched_acti...

Kaspar Schleiser noreply at github.com
Mon Sep 16 16:51:41 CEST 2019


  Branch: refs/heads/master
  Home:   https://github.com/RIOT-OS/RIOT
  Commit: 0e724e3d5d5229b2316e878a5861b7ef07618ede
      https://github.com/RIOT-OS/RIOT/commit/0e724e3d5d5229b2316e878a5861b7ef07618ede
  Author: Sören Tempel <soeren+git at soeren-tempel.net>
  Date:   2019-08-28 (Wed, 28 Aug 2019)

  Changed paths:
    M cpu/fe310/cpu.c

  Log Message:
  -----------
  cpu/fe310: don't call thread_yield when sched_active_thread is invalid

As the comment above cpu_switch_context_exit notes:

	sched_active_thread is not valid when cpu_switch_context_exit() is called.

Unfortunately, thread_yield(), which is called directly by
cpu_switch_context_exit(), uses sched_active_thread possibly resulting
in a null pointer dereference.

Solution: Trigger a software interrupt to perform a context switch and
let sched_run() determine the next valid thread from there.


  Commit: 071c2b2c5f72bd47d4ec2c7180ad22b4e550d38e
      https://github.com/RIOT-OS/RIOT/commit/071c2b2c5f72bd47d4ec2c7180ad22b4e550d38e
  Author: Kaspar Schleiser <kaspar at schleiser.de>
  Date:   2019-09-16 (Mon, 16 Sep 2019)

  Changed paths:
    M cpu/fe310/cpu.c

  Log Message:
  -----------
  Merge pull request #12109 from nmeum/pr/riscv_context_switch

cpu/fe310: don't call thread_yield when sched_active_thread is invalid


Compare: https://github.com/RIOT-OS/RIOT/compare/a3375db15ee9...071c2b2c5f72


More information about the commits mailing list