| Commit message (Collapse) | Author | Age |
|
|
|
|
| |
Threading is not used in the bootloader but the config optios are still
enabled so we must exclude including FreeRTOS.h.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The 16k FreeRTOS heap originally had all TCBs and stacks dynamically
allocated within it (plus semaphores and some other things). Now that
xTaskCreateStatic is used instead of xTaskCreate, the TCBs and stacks
are allocated statically and no longer use any of the FreeRTOS heap.
Therefore, the FreeRTOS stack can be shrunk by the amount that has been
made static. Furthermore, the TCBs and stack that are now static should
be placed in the .rtos_heaps section of RAM because this RAM is treated
specially by the bootloader (the bootloader executes from the first 16k
of RAM and loads the firmware into the section starting after the 16k).
After this patch the FreeRTOS heap (ucHeap) is 7200 bytes. The memory
available for the MicroPython heap is 54936 bytes (including GC overhead).
|
|
|
|
|
|
|
|
|
| |
In VStartSimpleLinkSpawnTask we change xTaskCreate to xTaskCreateStatic
so that the task is created using statically allocated memory for the TCB
and stack.
This means that xTaskCreate function is no longer needed (the static
version is now used exclusively).
|
|
|
|
|
|
| |
This function is no longer used. Having the .boot section attribute
meant that it was included in the firmware regargless of use. Without
this attribute the linker can remove the function.
|
|
|
|
|
| |
This config variable is now needed regardless of whether threading is
enabled or not.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Otherwise there could be a deadlock, with the GC's mutex and
thread_mutex.
|
| |
|
| |
|
| |
|
|
|
|
| |
Reduced the need for the FreeRTOS heap to allocate the mutex.
|
|
|
|
|
|
| |
This allows to statically allocate the TCB (thread control block) and
thread stack in the BSS segment, reducing the need for dynamic memory
allocation.
|
| |
|
| |
|
| |
|
|
|
|
| |
It's now accessed via the MP_STATE_THREAD macro.
|
|
|
|
|
|
|
| |
Now only the bits that really need to be written in assembler are written
in it, otherwise C is used. This means that the assembler code no longer
needs to know about the global state structure which makes it much easier
to maintain.
|
| |
|
|
|
|
|
| |
We rely on the port setting and adjusting the stack size so there is
enough room to recover from hitting the stack limit.
|
|
|
|
| |
Can create a new thread and run it. Does not use the GIL at this point.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a pristine copy (actually a subset of files) of upstream FreeRTOS
v9.0.0.
Modifications to the previous version of FreeRTOS (v8.1.2) included
addition of __attribute__ ((section (".boot"))) to the following
functions:
pxPortInitialiseStack
prvTaskExitError
prvPortStartFirstTask
xPortStartScheduler
vPortSetupTimerInterrupt
xTaskGenericCreate
vTaskStartScheduler
prvInitialiseTCBVariables
prvInitialiseTaskLists
prvAllocateTCBAndStack
This attribute will need to be reinstated on a case-by-case basis
because some of the above functions are now removed/changed.
|
|
|
|
| |
The GIL macros are needed even if threading is not enabled.
|
| |
|
| |
|
|
|
|
|
| |
There is no need since the GIL already makes gc and qstr operations
atomic.
|
|
|
|
|
| |
This makes the VM/runtime thread safe, at the cost of not being able to
run code in parallel.
|
| |
|
| |
|
|
|
|
| |
Qstr code accesses global state and needs to be made thread safe.
|
|
|
|
| |
Tests concurrent mutating access to: list, dict, set, bytearray.
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
SA_SIGINFO allows the signal handler to access more information about
the signal, especially useful in a threaded environment. The extra
information is not currently used but it may prove useful in the future.
|
|
|
|
|
|
|
|
|
|
|
| |
GC_EXIT() can cause a pending thread (waiting on the mutex) to be
scheduled right away. This other thread may trigger a garbage
collection. If the pointer to the newly-allocated block (allocated by
the original thread) is not computed before the switch (so it's just left
as a block number) then the block will be wrongly reclaimed.
This patch makes sure the pointer is computed before allowing any thread
switch to occur.
|
|
|
|
|
| |
This patch allows any given thread to do a proper garbage collection and
scan all the pointers of all active threads.
|
|
|
|
| |
So the underlying thread implementation can do any necessary bookkeeping.
|
| |
|
|
|
|
| |
As per PEP-475.
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
By using a single, global mutex, all memory-related functions (alloc,
free, realloc, collect, etc) are made thread safe. This means that only
one thread can be in such a function at any one time.
|
| |
|
| |
|
|
|
|
| |
Simply raises the SystemExit exception.
|
| |
|