waitpid() cannot be used in kernel mode unless SCHED_HAVE_PARENT is
selected -> add dependency if BUILD_KERNEL is selected.
Why? Because without SCHED_HAVE_PARENT waitpid() works in a non-standard
way, meaning it does not use SIGCHLD to wake the parent, as it should.
Also, returning the child status via stat_loc corrupts memory as stat_loc
points to the parent's address environment:
pid_t nxsched_waitpid(pid_t pid, int *stat_loc, int options)
{
...
group->tg_statloc = stat_loc;
...
}
And later when the status is returned, the child writes to tg_statloc,
which points to the parent's address environment -> random memory
corruption:
static inline void nxtask_exitwakeup(FAR struct tcb_s *tcb, int status)
{
...
if (group->tg_statloc != NULL)
{
*group->tg_statloc = status << 8;
}
...
}
GRAN_ALIGNED should check that the memory block's alignment (log2align)
is correct, not that the memory block is aligned with the granule size.
This fixes DEBUGASSERT() in mm_granfree:
_assert: Assertion failed : at file: mm_gran/mm_granfree.c:49
The assertion triggers if granule size != alignment.
Cache the next timeout value in the drivers instance and update the mtimecmp value once. This is advantageous as the opensbi ecall to set the timer is expensive in systems which don't have the supervisor mode timer extension.
umm_memdump() should be always declared otherwise we get error when DEBUG_MM=n:
sched/task/task_exithook.c:468:7: error: implicit declaration of function ‘umm_memdump’; did you mean ‘mm_memdump’? [-Wimplicit-function-declaration]
This patch changes how user service calls are executed:
Instead of using the common interrupt logic, execute the user service
call directly.
Why? When a user makes a service call request, all of the service call
parameters are already loaded into the correct registers, thus it makes
no sense to first clobber them and then reload them, which is what the
old logic does. It is much more effective to run the system call directly.
During a user system call the interrupts must be re-enabled, which the
new logic does as soon as we know the exception is a user service call
request.
This patch does NOT change the behavior of reserved system calls (like
switch_context), only the user service call request is affected.
Also, convert the type to union; we don't need the list element once
the item has been popped from the free list (the linkage is never needed
when the item is in use).
This provides an alternate tickless scheduling method, which uses the riscv
mtimer as a timebase, allowing the time and timeh registers to used
throughout an application.
The exiting tickless method, using Litex's timer0 has been left in place, as
it is a more performant option, but currently has the potential issue
identified in #11189.
when repeatedly enabling and disabling string-controlled configurations,
the generated toolchain configuration may be incorrect.
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
This adds basic API description for ADC and DAC peripherals. External
ADC/DAC controllers are listed as well.
Signed-off-by: Michal Lenc <michallenc@seznam.cz>
MCP794XX supports digital trimming that periodically adds or subtracts
clock cycles, resulting in small adjustments in the internal timing.
This way inaccuracies of clock source can be compensated.
This commit adds option to set the trimming register for MCP794XX.
Signed-off-by: Michal Lenc <michallenc@seznam.cz>
This commit adds configuration option CONFIG_MCP794XX_DATETIME_UTC.
If set, the datetime is stored in UTC instead of local time. The
default value is kept at local time to keep backwards compatibility
with devices currently using the RTC.
Signed-off-by: Michal Lenc <michallenc@seznam.cz>
Embedded flash can have user signature area on SAMv7. This is a 512
bytes large page whose data are not erased by asserting ERASE pin or by
software ERASE command.
This commit adds arch to board interface for this area. It is possible
to perform read, write and erase operation. SAMV7_USER_SIGNATURE option
has to be set in the configuration.
Signed-off-by: Michal Lenc <michallenc@seznam.cz>
This temporary fix is just to unblock CI errors:
```
Configuration/Tool: imx93-evk/bootloader
...
aarch64-none-elf-ld: region `ocram' overflowed by 88 bytes
```
Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
The definition of nxsched_process_cpuload_ticks uses clock_t, which is
portable across uint32_t and uint64_t timers, and works if CONFIG_SYSTEM_TIME64 is
defined.