Summary:
- This commit fixes global IRQ control logic
- In previous implementation, g_cpu_irqset for a remote CPU was
set in sched_add_readytorun(), sched_remove_readytorun() and
up_schedule_sigaction()
- In this implementation, they are removed.
- Instead, in the pause handler, call enter_critical_setion()
which will call up_cpu_paused() then acquire g_cpu_irqlock
- So if a new task with irqcount > 1 restarts on the remote CPU,
the CPU will only hold a critical section. Thus, the issue such as
'POSSIBLE FOR TWO CPUs TO HOLD A CRITICAL SECTION' could be resolved.
- Fix nxsched_resume_scheduler() so that it does not call spin_clrbit()
if a CPU does not hold a g_cpu_irqset
- Fix nxtask_exit() so that it acquires g_cpu_irqlock
- Update TODO
Impact:
- All SMP implementations
Testing:
- Tested with smp, ostest with the following configurations
- Tested with spresense:wifi_smp (NCPUS=2,4)
- Tested with sabre-6quad:smp (QEMU, dev board)
- Tested with maix-bit:smp (QEMU)
- Tested with esp32-core:smp (QEMU)
- Tested with lc823450-xgevk:rndis
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
Summary:
- I noticed that Cortex-A SGI can be masked
- We thought the SGI is not maskable
- Although I can not remember how I tested it before
- It actually works as expected now
- Also, fixed the number of remaining bugs in TODO
Impact:
- No impact
Testing:
- Tested with sabre-6quad:smp (QEMU and dev board)
- Add the following code in up_idle() before calling asm("WFI");
+ if (0 != up_cpu_index())
+ {
+ up_irq_save();
+ }
- Run the hello app, you can see "Hello, World!!"
- But nsh will freeze soon because arm_pause_handler is not called.
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
Follow the POSIX description.
SIGTSTP should be sent when the Ctrl-Z characters is encountered, not SIGSTP.
Testing:
Built with hifive1-revb:nsh (CONFIG_SERIAL_TERMIOS=y, CONFIG_SIG_DEFAULT=y and CONFIG_TTY_SIGTSTP=y)
since it doesn't need anymore with the follow patch:
commit e7d9260014
Author: Xiang Xiao <xiaoxiang@xiaomi.com>
Date: Mon Feb 17 20:19:25 2020 +0800
arch: Customize the typedef of size_t instead of intptr_t
To ensure size_t same as toolchain definition in the first place and
rename CXX_NEWLONG to ARCH_SIZET_LONG. The change also check whether
__SIZE_TYPE__ exist before CONFIG_ARCH_SIZET_LONG so our definition
can align with toolchain(gcc/clang) definition automatically.
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
and remove the special handling in the stack dump
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ia1ef9a427bd4c7f6cee9838d0445f29cfaca3998
-Move task_init() and task_activate() prototypes from include/sched.h to include/nuttx/sched.h. These are internal OS functions and should not be exposed to the user.
-Remove references to task_init() and task_activate() from the User Manual.
-Rename task_init() to nxtask_init() since since it is an OS internal function
-Rename task_activate() to nxtask_activate since it is an OS internal function
- Remove per-thread errno from the TCB structure (pterrno)
- Remove get_errno() and set_errno() as functions. The macros are still available as stubs and will be needed in the future if we need to access the errno from a different address environment (KERNEL mode).
- Add errno value to the tls_info_s structure definitions
- Move sched/errno to libs/libc/errno. Replace old TCB access to the errno with TLS access to the errno.
Because we can get the same function by CONSOLE_SYSLOG/syslog_console_init.
BTW, it isn't a good choice to use g_ramlogfops as /dev/console since nsh
will read back what it send out which will surprise most people.
To ensure size_t same as toolchain definition in the first place and rename CXX_NEWLONG to ARCH_SIZET_LONG. The change also check whether __SIZE_TYPE__ exist before CONFIG_ARCH_SIZET_LONG so our definition can align with toolchain(gcc/clang) definition automatically.
Author: patacongo <spudarnia@yahoo.com>
Todo (#34)
* Documentation/NuttXCCodingStandard.html: Remove requirement to decorate ignored returned values with (void).
* TODO: Update TODO list
Co-authored-by: Gregory Nutt <gnutt@nuttx.org>
board/boarctl.c: Add support for the new BOARDIOC_ROMDISK command. This allows applications to create ROMFS block drivers without illegal direct calls to romdisk_register.
include/sys/boardctl.h: Add basic definitions to support a ROM disk creation boardctl() command.
Squashed commit of the following:
net/: Fix some naming inconsistencies, Fix final compilation issies.
net/inet/inet_close(): Now that we have logic to drain the buffered TX data, we can implement a proper lingering close.
net/inet,tcp,udp: Add functions to wait for write buffers to drain.
net/udp: Add support for notification when the UDP write buffer becomes empty.
net/tcp: Add support for notification when the TCP write buffer becomes empty.
Squashed commit of the following:
Update TODO list
graphics/nxbe: The moverectangle renderer now supports updates to the per-window framebuffer (unclipped) as well as the graphics device memory (clipped).
graphics/nxbe: The filltrapezond renderer now supports updates to the per-window framebuffer (unclipped) as well as the graphics device memory (clipped).
graphics/nxbe: The getrectangle method now returns data from the per-window framebuffer if available.
graphics/nxbe: The fillrectangle renderer now supports updates to the per-window framebuffer (unclipped) as well as the graphics device memory (clipped).
graphics/nxmu: If a window supports a per-window framebuffer, then redraw callbacks are suppressed and the device content is updated from the shadow, per-window framebuffer. graphics/nxbe: The copyrectangle renderer now supports updates to the per-window framebuffer (unclipped) as well as the graphics device memory (clipped).
graphics/nxbe/nxbe_setsize.c: Reallocate the per-window framebuffer when the window size changes.