Go to file
Tiago Medicci Serrano 50aeea2dc0 mm/iob: Simplify IOB alloc/free logic
- `g_iob_sem.semcount` must be equal to the total number of free IOBs.
It can also be negative if there are no free IOBs and there are threads
waiting for an IOB.
- g_throttle_sem.semcount represents the number of IOBs available for
throttled IOB allocations. Like any other semaphore, it should only go
negative if there is a thread waiting for it.
- Both semaphores are related to the same resource (free IOBs), hence,
they must be incremented/decremented simultaneously:
  - Whenever a IOB buffer is freed, if a thread is waiting for a
non-throttled IOB or a thread is waiting for a throttled IOB and we
have at least `CONFIG_IOB_THROTTLE` buffers available, the IOB is put
in the committed list (`g_iob_committed`). Otherwise, it is put in the
common free list (`g_iob_freelist`).
  - `g_iob_sem` is always incremented when an IOB buffer is freed, but
`g_throttle_sem` is incremented only if we have at least CONFIG_IOB_THROTTLE
buffers free.
  - Both semaphores are posted with the schedule locked to avoid any
mismatches in the semaphores count.
  - If a task is waiting for an IOB semaphore (`iob_allocwait`) is
awakened and would check the `g_iob_committed`. The highest priority
task waiting for a semaphore will be awakened first.
2024-06-25 15:21:00 +08:00
.github build(deps): bump github/super-linter from 5 to 6 2024-04-29 17:34:32 +08:00
arch riscv/nuttsbi: add MTVAL argument 2024-06-23 22:25:10 +08:00
audio Documentation: remove all migrated READMEs 2023-10-29 21:03:54 -03:00
binfmt Revert "sched: replace some global variables to macro" 2024-06-06 22:00:25 +08:00
boards fs: add backtrace to where file opens 2024-06-24 23:53:59 +08:00
cmake fix nxstyle 2024-05-13 22:24:36 +02:00
crypto fix(Kconfig): spellcheck "randon" to "random" 2024-06-15 17:40:18 +08:00
Documentation Documentation: Add docs for ipfilter 2024-06-20 09:43:05 +08:00
drivers serial/gdbstub: Change GDBSTUB_ to GDB_ 2024-06-24 23:51:43 +08:00
dummy
fs fs: add backtrace to where file opens 2024-06-24 23:53:59 +08:00
graphics video/vnc: add vnc_fb_register 2024-04-12 17:42:49 +08:00
include fs: add backtrace to where file opens 2024-06-24 23:53:59 +08:00
libs serial/gdbstub: Change GDBSTUB_ to GDB_ 2024-06-24 23:51:43 +08:00
mm mm/iob: Simplify IOB alloc/free logic 2024-06-25 15:21:00 +08:00
net net/tcp: fix missing error code propagation 2024-06-22 19:26:14 -03:00
openamp openamp/libmetal.cmake: sync with libmetal.defs 2024-03-28 16:07:49 +08:00
pass1
sched sched/tls: drop ta_argv and g_idleargv 2024-06-23 22:24:19 +08:00
syscall sem_open: return error code, sem returned by parameter 2024-06-06 02:40:50 +08:00
tools tools/ci/docker/linux/Dockerfile: add AVR32 GCC toolchain 2024-06-18 23:15:39 +08:00
video
wireless Remove the back slash from long literal string 2024-02-19 16:43:15 +01:00
.asf.yaml
.gitignore fs/vfat: Fix typo in the macro DIRSEC_BYTENDX 2024-02-03 12:46:08 -03:00
.yamllint
AUTHORS
CMakeLists.txt cmake:bugfix CMake compilation options settings should not use strings 2024-05-30 10:02:10 -03:00
CONTRIBUTING.md
INVIOLABLES.md
Kconfig Kconfig: move LTO options to Build Setup menu 2024-06-02 09:26:35 -03:00
LICENSE RP2040: Implement board_uniqueid() 2024-03-17 10:00:25 -03:00
Makefile
NOTICE
README.md Gathering community recommendations 2023-10-28 13:55:56 +08:00
ReleaseNotes

POSIX Badge License Issues Tracking Badge Contributors GitHub Build Badge Documentation Badge

Apache NuttX is a real-time operating system (RTOS) with an emphasis on standards compliance and small footprint. Scalable from 8-bit to 64-bit microcontroller environments, the primary governing standards in NuttX are POSIX and ANSI standards. Additional standard APIs from Unix and other common RTOSs (such as VxWorks) are adopted for functionality not available under these standards, or for functionality that is not appropriate for deeply-embedded environments (such as fork()).

For brevity, many parts of the documentation will refer to Apache NuttX as simply NuttX.

Getting Started

First time on NuttX? Read the Getting Started guide! If you don't have a board available, NuttX has its own simulator that you can run on terminal.

Documentation

You can find the current NuttX documentation on the Documentation Page.

Alternatively, you can build the documentation yourself by following the Documentation Build Instructions.

The old NuttX documentation is still available in the Apache wiki.

Supported Boards

NuttX supports a wide variety of platforms. See the full list on the Supported Platforms page.

Contributing

If you wish to contribute to the NuttX project, read the Contributing guidelines for information on Git usage, coding standard, workflow and the NuttX principles.

License

The code in this repository is under either the Apache 2 license, or a license compatible with the Apache 2 license. See the License Page for more information.