summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* libmisc/shell/edit: Return if no memory in move_gap5.35Chris Johns2023-01-301-0/+3
| | | | Closes #4565
* libmisc/shell/edit: Fix closing the editorChris Johns2023-01-301-11/+4
| | | | Closes #4564
* libmisc/shell/chmod: Fix multiple file arguments to the commandChris Johns2023-01-301-1/+1
| | | | Closes #4558
* cpukit/fdt: Free index before container5.2Kinsey Moore2022-10-031-2/+2
| | | | | | | Ensure that the index is released before the structure containing it is freed and NULLed. Updates #4460
* cpukit/fdt: Check correct allocationKinsey Moore2022-10-031-1/+1
| | | | | | | | The second allocation check was mistakenly rechecking the first allocation. It now checks the correct allocation and ensures that names is not NULL. Updates #4462
* cpukit/include: Fix including in C++Chris Johns2022-08-2712-20/+47
| | | | Closes #4709
* score: Fix unlimited objects supportSebastian Huber2022-07-182-9/+32
| | | | | | | | Commit 21275b58a5a69c3c838082ffc8a7a3641f32ea9a ("score: Static Objects_Information initialization") introduced an off-by-one error in the maintenance of inactive objects. Close #4676.
* score: Fix _Objects_Active_count()Sebastian Huber2022-07-181-5/+13
| | | | | | | With unlimited objects the object maximum may be larger than the sum of active and inactive objects. Update #4676.
* Synchronize all file descriptors in sync()Sebastian Huber2022-05-171-81/+12
| | | | | | | Synchronize all file descriptors and not just the ones associated with a FILE object. Close #4655.
* posix: Fix use of clock for relative timesSebastian Huber2022-05-041-13/+18
| | | | Close #4429.
* heap: Fix heap statistics with protection enabledSebastian Huber2022-05-043-9/+14
| | | | Close #4643.
* imfs: Fix index underrun when extending empty fileChristian Mauderer2022-04-072-2/+31
| | | | | | | | | | | | | | | | | | | | | | | Currently the following sequence causes a endless loop when extending an IMFS file: - Create a file with zero length and close it. - Make sure nearly no allocatable memory is left. - Open the file and write enough data into it that more than the remaining memory will be used. In that case when extending the IMFS file, the file currently need zero blocks. If allocating enough new blocks fails, the already allocated new blocks will be freed again. The comparison of block>=old_blocks that has been used prior to this patch compared two unsigned numbers. If old_blocks was zero, the comparison of these two numbers always evaluated to true. This patch frees the last block in a separate step to avoid this problem. Fixes #4638
* bsp/atsam: Improve UART / USART tx performanceChristian Mauderer2022-02-151-4/+5
| | | | | | | | | | | | | Put the next character into the send buffer if the buffer is empty and not when the last character has been sent out to the line. This improves the performance slightly. Before that patch, the receive path was faster than the transmit path. Therefore a simple echo could drop characters on a busy connection. With this patch sending and receiving has about the same performance so that no characters are lost. Fixes #4611
* bsp/atsam/i2c: Add error return and fix edge casesChristian Mauderer2022-02-102-59/+47
| | | | | | | | | | The driver didn't return with an error on (for example) a NACK on the bus. This adds the expected error return. Due to the new case that a transfer can be interrupted on an error, there were some new edge cases. This patch therefore also fixes these edge cases by removing the transfer_state that more or less duplicated the interrupt states. Fixes #4591
* bsp/atsam/i2c: Simplify driverChristian Mauderer2022-02-102-69/+45
| | | | | | | | | | Do some clean ups. Remove superfluous variables. Eliminate some overly complex logic (information about transfer and remaining bytes has been tracked redundantly in multiple variables). This patch doesn't change the behavior of the driver. Update #4591
* termios: Pass number of sent chars to l_startChristian Mauderer2022-02-102-3/+8
| | | | | | | | | | | | | At the moment the line discipline start function (l_start) has no possibility to get feedback about the number of characters that have been sent. This patch passes that information via an additional parameter. The change might trigger a warning on existing code because of a pointer mismatch but it shouldn't break it. An existing function with the old API will just ignore the additional parameter. Update #4494
* bsp/atsam: Optionally use DMA for UART RxChristian Mauderer2022-01-182-5/+190
| | | | | | | | | | | | If the system is busy with other interrupts and the UART is set to a fast baud rate, it's possible to loose UART interrupts and therefore characters. This allows to optionally enable a DMA for the UARTs so that a number of lost interrupts can be tolerated. The number of DMAs on this chip is limited and not not all applications need that feature. Therefore the DMA is disabled by default. Close #4577
* bsp/atsam: Merge USART and UART driverChristian Mauderer2022-01-181-225/+60
| | | | | | | | | | If no extended features of the USART are used and if the comparison feature of the UART is not used, the two modules are compatible. The drivers were nearly identical except for some names of the defines. This patch merges the two drivers into one. Update #4577
* untar: Make behavior similar to GNU or BSD tarChristian Mauderer2021-12-095-29/+282
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | RTEMS untar implementation had problems with overwriting or integrating archives into existing directory structures. This patch adapts the behavior to mimic that of a GNU tar or BSD tar and extends the tar01 test to check for the behavior. That is: * If a directory structure exists, the files from the archive will be integrated. Existing files are overwritten. * If a file exists and the archive contains a directory with the same name, the file is removed and a directory is created. In the above example: if l1/l2 is a file it will be overwritten with a new directory. * If a directory exists and the archive contains a file with the same name, the directory will be replaced if it is empty. If it contains files, the result is an error. * An archive also can contain only a file without the parent directories. If in that case one of the parent directories exists as a file extracting the archive results in an error. In the example: if l1/l2 is a file and the archive doesn't contain the directories but only the file l1/l2/x.txt that would be an error. * In case of an error, it is possible that the archive has been partially extracted. Closes #4552
* score: Fix atomic stores for C++Sebastian Huber2021-12-071-3/+3
| | | | Close #4567.
* score: Add _Timecounter_Set_NTP_update_second()Sebastian Huber2021-11-162-3/+44
| | | | | | | Allow the installation of an NTP update second handler which may be used by an NTP service. Update #4549.
* score: Optimize timehand updates for non-SMPSebastian Huber2021-11-161-8/+36
| | | | | | In uniprocessor configurations, the timehand updates are done with interrupts disabled. So, it is impossible to observe a generation number of zero.
* score: Port large time delta support to RTEMSSebastian Huber2021-11-162-5/+24
|
* score: Initialize timehand generation to UINT_MAXSebastian Huber2021-11-161-1/+1
| | | | | This leads to a timehand generation overflow right at the system start and helps to get code coverage in test programs.
* timecounter: Load the currently selected tc once in tc_windup()Mark Johnston2021-11-161-7/+16
| | | | | | | | Reported by: Sebastian Huber <sebastian.huber@embedded-brains.de> Reviewed by: kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32729
* kern_tc.c: Scaling/large delta recalculationSebastian Huber2021-11-161-38/+50
| | | | | | | | | | | | | | | | | | | | | This change is a slight performance optimization for systems with a slow 64-bit division. The th->th_scale and th->th_large_delta values only depend on the timecounter frequency and the th->th_adjustment. The timecounter frequency of a timehand only changes when a new timecounter is activated for the timehand. The th->th_adjustment is only changed by the NTP second update. The NTP second update is not done for every call of tc_windup(). Move the code block to recalculate the scaling factor and the large delta of a timehand to the new helper function recalculate_scaling_factor_and_large_delta(). Call recalculate_scaling_factor_and_large_delta() when a new timecounter is activated and a NTP second update occurred. MFC after: 1 week
* timecounter: Lock the timecounter listMark Johnston2021-11-161-10/+30
| | | | | | | | | | | | | | | | | Timecounter registration is dynamic, i.e., there is no requirement that timecounters must be registered during single-threaded boot. Loadable drivers may in principle register timecounters (which can be switched to automatically). Timecounters cannot be unregistered, though this could be implemented. Registered timecounters belong to a global linked list. Add a mutex to synchronize insertions and the traversals done by (mpsafe) sysctl handlers. No functional change intended. Reviewed by: imp, kib MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32511
* timecounter: Let kern.timecounter.stepwarnings be set as a tunableMark Johnston2021-11-161-1/+1
| | | | MFC after: 1 week
* Remove "All Rights Reserved" fromEd Maste2021-11-161-1/+0
| | | | | | | | | FreeBSD Foundation sys/ copyrights These ones were unambiguous cases where the Foundation was the only listed copyright holder (in the associated license block). Sponsored by: The FreeBSD Foundation
* kern: clarify boot timeWarner Losh2021-11-161-1/+7
| | | | | | | | | | | | | | In FreeBSD, the current time is computed from uptime + boottime. Uptime is a continuous, smooth function that's monotonically increasing. To effect changes to the current time, boottime is adjusted. boottime is mutable and shouldn't be cached against future need. Document the current implementation, with the caveat that we may stop stepping boottime on resume in the future and will step uptime instead (noted in the commit message, but not in the code). Sponsored by: Netflix Reviewed by: phk, rpokala Differential Revision: https://reviews.freebsd.org/D30116
* Make kern.timecounter.hardware tunableKonstantin Belousov2021-11-161-5/+18
| | | | | | | Noted and reviewed by: kevans MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D29122
* Add ddb 'show timecounter' command.Konstantin Belousov2021-11-161-1/+31
| | | | | MFC after: 1 week Sponsored by: The FreeBSD Foundation
* Changes that improve DTrace FBT reliabilityRobert Watson2021-11-161-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | on freebsd/arm64: - Implement a dtrace_getnanouptime(), matching the existing dtrace_getnanotime(), to avoid DTrace calling out to a potentially instrumentable function. (These should probably both be under KDTRACE_HOOKS. Also, it's not clear to me that they are correct implementations for the DTrace thread time functions they are used in .. fixes for another commit.) - Don't allow FBT to instrument functions involved in EL1 exception handling that are involved in FBT trap processing: handle_el1h_sync() and do_el1h_sync(). - Don't allow FBT to instrument DDB and KDB functions, as that makes it rather harder to debug FBT problems. Prior to these changes, use of FBT on FreeBSD/arm64 rapidly led to kernel panics due to recursion in DTrace. Reliable FBT on FreeBSD/arm64 is reliant on another change from @andrew to have the aarch64 instrumentor more carefully check that instructions it replaces are against the stack pointer, which can otherwise lead to memory corruption. That change remains under review. MFC after: 2 weeks Reviewed by: andrew, kp, markj (earlier version), jrtc27 (earlier version) Differential revision: https://reviews.freebsd.org/D27766
* Remove double-calls to tc_get_timecount()Konstantin Belousov2021-11-161-3/+0
| | | | | | | | | | | to warm timecounters. It seems that second call does not add any useful state change for all implemented timecounters. Discussed with: bde Sponsored by: The FreeBSD Foundation MFC after: 3 weeks
* Mark more nodes as CTLFLAG_MPSAFEPawel Biernacki2021-11-161-13/+24
| | | | | | | | | | | | | | | | | | or CTLFLAG_NEEDGIANT (17 of many) r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are still not MPSAFE (or already are but aren’t properly marked). Use it in preparation for a general review of all nodes. This is non-functional change that adds annotations to SYSCTL_NODE and SYSCTL_PROC nodes using one of the soon-to-be-required flags. Mark all obvious cases as MPSAFE. All entries that haven't been marked as MPSAFE before are by default marked as NEEDGIANT Approved by: kib (mentor, blanket) Commented by: kib, gallatin, melifaro Differential Revision: https://reviews.freebsd.org/D23718
* Consolidate read code for timecountersKonstantin Belousov2021-11-161-145/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | and fix possible overflow in bintime()/binuptime(). The algorithm to read the consistent snapshot of current timehand is repeated in each accessor, including the details proper rollup detection and synchronization with the writer. In fact there are only two different kind of readers: one for bintime()/binuptime() which has to do the in-place calculation, and another kind which fetches some member from struct timehand. Extract the logic into type-checked macros, GETTHBINTIME() for bintime calculation, and GETTHMEMBER() for safe read of a structure' member. This way, the synchronization is only written in bintime_off() and getthmember(). In bintime_off(), use overflow-safe calculation of th_scale * delta(timecounter). In tc_windup, pre-calculate the min delta value which overflows and require slow algorithm, into the new timehands th_large_delta member. This part with overflow fix was written by Bruce Evans. Reported by: Mark Millard <marklmi@yahoo.com> (the overflow issue) Tested by: pho Discussed with: emaste Sponsored by: The FreeBSD Foundation (kib) MFC after: 3 weeks
* Remove duplicated empty lines from kern/*.cMateusz Guzik2021-11-161-1/+0
| | | | No functional changes.
* Initialize timehands linkage much earlier.Konstantin Belousov2021-11-161-12/+22
| | | | | | Reported and tested by: trasz Sponsored by: The FreeBSD Foundation MFC after: 1 week
* Make timehands count selectable at boottime.Konstantin Belousov2021-11-161-5/+45
| | | | | | | | | | | Tested by: O'Connor, Daniel <darius@dons.net.au> Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D21563 This patch was modified by Sebastian Huber <sebastian.huber@embedded-brains.de> to adjust it for RTEMS. See comment in the patch.
* Instead of using an incomplete list of platformsOlivier Houchard2021-11-161-1/+2
| | | | | that uses 64bits time_t in 32bits mode, special case amd64, as i386 is the only arch that still uses 32bits time_t.
* Create a new macro for static DPCPU data.Andrew Turner2021-11-161-2/+2
| | | | | | | | | | | | | | On arm64 (and possible other architectures) we are unable to use static DPCPU data in kernel modules. This is because the compiler will generate PC-relative accesses, however the runtime-linker expects to be able to relocate these. In preparation to fix this create two macros depending on if the data is global or static. Reviewed by: bz, emaste, markj Sponsored by: ABT Systems Ltd Differential Revision: https://reviews.freebsd.org/D16140
* tc: bcopy -> memcpyMateusz Guzik2021-11-161-2/+1
|
* Move most of the contents of opt_compat.hBrooks Davis2021-11-161-1/+0
| | | | | | | | | | | | | | | | | | | | to opt_global.h. opt_compat.h is mentioned in nearly 180 files. In-progress network driver compabibility improvements may add over 100 more so this is closer to "just about everywhere" than "only some files" per the guidance in sys/conf/options. Keep COMPAT_LINUX32 in opt_compat.h as it is confined to a subset of sys/compat/linux/*.c. A fake _COMPAT_LINUX option ensure opt_compat.h is created on all architectures. Move COMPAT_LINUXKPI to opt_dontuse.h as it is only used to control the set of compiled files. Reviewed by: kib, cem, jhb, jtl Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14941
* score: Remove FreeBSD identifierSebastian Huber2021-11-161-1/+1
|
* Use atomic_load(9) to read ppsinfo sequence numbers.Konstantin Belousov2021-11-161-4/+4
| | | | | | | | | | In this case volatile qualifiers enusre that a compiler does not optimize the accesses out. Reviewed by: alc, jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D13534
* SPDX: use the Beerware identifier.Pedro F. Giffuni2021-11-161-0/+2
|
* kern_tc.c: Remove unused codeSebastian Huber2021-11-161-6/+0
| | | | This fix relates to a Coverity issue (PW.DECLARED_BUT_NOT_REFERENCED).
* Add support for IDLE Thread stack allocatorJoel Sherrill2021-10-0715-8/+373
| | | | | | | | Add a stack allocator hook specifically for allocation of IDLE thread stacks. This allows the user to decide if IDLE thread stacks are statically allocated or handled by the same custom allocator mechanism as other thread stacks. Closes #4520.
* powerpc/motorola_powerpc: Map LibBSD bus space to the PCI base addressChris Johns2021-09-221-2/+32
| | | | Closes #4516
* powerpc/io: Make [out/in] le and be calls conditionalChris Johns2021-09-221-0/+8
| | | | | | | | - These calls clash with the Linux IO header in LibBSD. Making these conditional here means BSPs build and the imported Linux header is untouched. Updates #4245