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
18 changes: 8 additions & 10 deletions Documentation/implementation/smp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ SMP can be enabled on NuttX with the following configuration settings:
This setting provides the stack size for the IDLE task on CPUS 1
through ``(CONFIG_SMP_NCPUS-1)``.

This section provides the origin design specification for the implemention.
This section provides the origin design specification for the implementation.
As a result, you may find that the test uses future and conditional tenses
when describing the implementation of SMP on NuttX.

Expand Down Expand Up @@ -189,7 +189,7 @@ The Current Task
----------------

There is a lot of logic in the RTOS now that obtains the TCB for the currently
excuting task by examining the head of the ``g_readytorun`` list.
executing task by examining the head of the ``g_readytorun`` list.
You will see this assignment in many places, both in the core OS logic
in ``nuttx/sched`` but also in architecture-specific logic under
``nuttx/arch``:
Expand Down Expand Up @@ -495,11 +495,9 @@ The following new, internal OS interfaces are proposed:
void spin_unlock(FAR spinlock_t *lock);

Where the type ``spinlock_t`` is defined in MCU-specific header files.
These new spinlock interfaces would also use the MCU-specific interface:

.. code-block:: c

spinlock_t up_testset(FAR spinlock_t *lock);
These spinlock interfaces are implemented using the generic atomic
operations provided by :file:`include/nuttx/atomic.h`
(e.g. :c:func:`atomic_xchg_acquire`, :c:func:`atomic_cmpxchg_acquire`).

.. note::

Expand All @@ -509,7 +507,7 @@ These new spinlock interfaces would also use the MCU-specific interface:
Yes, probably. One solution might be lock the thread
to a CPU if it holds the lock?

There is also a risk is that the thread holding the lock will be pre-empted
There is also a risk is that the thread holding the lock will be preempted
by the OS scheduler while holding the lock. If this happens, other threads
on other CPUs will be left spinning (repeatedly trying to acquire the lock),
while the thread holding the lock is not making progress towards releasing it.
Expand Down Expand Up @@ -586,7 +584,7 @@ CPU resources.
Thus, ``sched_lock()`` and its companion, ``sched_unlcok()``,
are used to implement some critical sections.

Currnetly, Pre-emption is disabled using a simple lockcount in the TCB.
Currently, Pre-emption is disabled using a simple lockcount in the TCB.
When the scheduling is locked, the lockcount is incremented;
when the scheduler is unlocked, the lockcount is decremented.
If the lockcount for the task at the head of the ``g_readytorun``
Expand Down Expand Up @@ -833,7 +831,7 @@ in ``sched.h``.
int sched_getaffinity(pid_t pid, size_t cpusetsize, FAR cpu_set_t *mask);
#endif

There are similar interfaces for a ``pthread`` prototyped in ``phtread.h``:
There are similar interfaces for a ``pthread`` prototyped in ``pthread.h``:

.. code-block:: c

Expand Down
13 changes: 0 additions & 13 deletions Documentation/reference/os/smp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,6 @@ For a technical description of the NuttX implementation of SMP,
see the NuttX `SMP Wiki
Page <https://cwiki.apache.org/confluence/display/NUTTX/SMP>`__.

.. c:function:: spinlock_t up_testset(volatile FAR spinlock_t *lock)

Perform and atomic test and set operation on the provided spinlock.

:param lock: The address of spinlock object.

:return: The spinlock is always locked upon return. The value
of previous value of the spinlock variable is returned,
either SP_LOCKED if the spinlock was previously locked
(meaning that the test-and-set operation failed to obtain the lock)
or SP_UNLOCKED if the spinlock was previously unlocked
(meaning that we successfully obtained the lock)

.. c:function:: int up_cpu_index(void)

Return an index in the range of 0 through (CONFIG_SMP_NCPUS-1)
Expand Down
15 changes: 0 additions & 15 deletions Documentation/reference/user/13_boardctl.rst
Original file line number Diff line number Diff line change
Expand Up @@ -228,18 +228,3 @@ Graphics

:dependencies: Base NX terminal logic provides :c:func:`nxterm_ioctl_tap`.

Testing
-------

.. c:macro:: BOARDIOC_TESTSET

Access architecture-specific up_testset() operation

:Argument: A pointer to a write-able spinlock object. On success
the preceding spinlock state is returned: 0=unlocked,
1=locked.

:configuration: CONFIG_BOARDCTL_TESTSET

:dependencies: Architecture-specific logic provides :c:func:`up_testset`.

15 changes: 0 additions & 15 deletions arch/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ config ARCH_SIM
select ARCH_HAVE_SYSCALL_HOOKS
select ARCH_HAVE_TICKLESS
select ARCH_HAVE_POWEROFF
select ARCH_HAVE_TESTSET
select ARCH_HAVE_VFORK if !HOST_WINDOWS
select ARCH_HAVE_SETJMP
select ARCH_HAVE_CUSTOMOPT
Expand Down Expand Up @@ -141,7 +140,6 @@ config ARCH_X86_64
select ARCH_HAVE_FPU
select ARCH_HAVE_DPFPU
select ARCH_HAVE_MULTICPU
select ARCH_HAVE_TESTSET
select ARCH_HAVE_INTERRUPTSTACK
select ARCH_HAVE_CUSTOMOPT
select ARCH_HAVE_THREAD_LOCAL
Expand Down Expand Up @@ -624,23 +622,10 @@ config ARCH_HAVE_DYNAMIC_UDELAY
after a failure - the implementation should always re-read current
hardware settings as anything stored in memory may be corrupted.)

config ARCH_HAVE_TESTSET
bool
default n

config ARCH_HAVE_CUSTOM_TESTSET
bool
default n
select ARCH_HAVE_TESTSET

config ARCH_HAVE_THREAD_LOCAL
bool
default n

config ARCH_HAVE_FETCHADD
bool
default n

config ARCH_HAVE_RTC_SUBSECONDS
bool
default n
Expand Down
Loading
Loading