summaryrefslogtreecommitdiffstats
path: root/cpukit/score (follow)
Commit message (Collapse)AuthorAgeFilesLines
* rtems: Add new clock manager directivesSebastian Huber2021-11-151-0/+56
| | | | Update #4527.
* score: Add _Timecounter_Set_NTP_update_second()Sebastian Huber2021-11-151-5/+25
| | | | | | | Allow the installation of an NTP update second handler which may be used by an NTP service. Update #2348.
* score: Optimize timehand updates for non-SMPSebastian Huber2021-11-151-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-151-3/+22
|
* score: Initialize timehand generation to UINT_MAXSebastian Huber2021-11-151-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-151-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-151-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-151-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-151-1/+1
| | | | MFC after: 1 week
* Remove "All Rights Reserved" fromEd Maste2021-11-151-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-151-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-151-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-151-1/+31
| | | | | MFC after: 1 week Sponsored by: The FreeBSD Foundation
* Changes that improve DTrace FBT reliabilityRobert Watson2021-11-151-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-151-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-151-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-151-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-151-1/+0
| | | | No functional changes.
* Initialize timehands linkage much earlier.Konstantin Belousov2021-11-151-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-151-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-151-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-151-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-151-2/+1
|
* Move most of the contents of opt_compat.hBrooks Davis2021-11-151-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-151-1/+1
|
* Use atomic_load(9) to read ppsinfo sequence numbers.Konstantin Belousov2021-11-151-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-151-0/+2
|
* score: Introduce CPU budget operationsSebastian Huber2021-11-1517-122/+242
| | | | | | | | | | | | | | This patch set replaces the CPU budget algorithm enumeration with a set of CPU budget operations which implement a particular CPU budget algorithm. This helps to hide the CPU budget algorithm implementation details from the general thread handling. The CPU budget callouts are turned into CPU budget operations. This slightly reduces the size of the thread control block. All schedulers used the default scheduler tick implementation. The tick scheduler operation is removed and the CPU budget operations are directly used in _Watchdog_Tick() if the executing thread uses a CPU budget algorithm. This is performance improvement for all threads which do not use a CPU budget algorithm (default behaviour).
* score: Do not shadow parameterSebastian Huber2021-11-151-4/+4
|
* bsps/aarch64: Set interrupt level correctlyKinsey Moore2021-11-011-5/+11
| | | | | | The existing code is functional but inccorrect and blindly modifies the other masking bits. It is important to preserve those other bits since they control masking of important system events.
* aarch64: Break out MMU definitionsKinsey Moore2021-11-011-0/+97
| | | | | | This moves the AArch64 MMU memory type definitions into cpukit for use by libdebugger since remapping of memory is required to insert software breakpoints.
* cpukit/aarch64: Use correct debug register namesKinsey Moore2021-11-011-16/+1096
| | | | | | | The N used in the breakpoint and watchpoint register names is intended to be an integer between 0 and 15 (inclusive) and will not compile when used as is. This adds the accessors necessary to access all of these breakpoint and watchpoint registers.
* cpukit: Compare the function resultKinsey Moore2021-11-011-1/+1
| | | | | Compare the function result instead of the function pointer for non-SMP builds.
* cpukit: Add signal mapping supportKinsey Moore2021-10-291-0/+104
| | | | | | This adds a confdef option allowing an application to request mapping machine exceptions to POSIX signals. This is required for some languages such as Ada.
* cpukit/aarch64: Add exception extensions supportKinsey Moore2021-10-294-84/+292
| | | | | This adds the function implementations necessary to add exception extensions support to AArch64.
* cpukit: Add exception extensionsKinsey Moore2021-10-291-0/+63
| | | | | | | | This adds the set of functions necessary to allow more generic handling of machine exceptions. This initial patch offers the ability to manipulate a CPU_Exception_frame and resume execution using that exception information with or without thread dispatch. These functions are gated behind the RTEMS_EXCEPTION_EXTENSIONS configuration option.
* score: Move code block to separate functionSebastian Huber2021-10-251-26/+32
| | | | | Move a code block to the new function _Thread_Scheduler_withdraw_nodes() to ease code review.
* score: Do not shadow lock_context local variableSebastian Huber2021-10-251-2/+0
|
* rtems: Fix rate monotonic statisticsSebastian Huber2021-10-252-9/+94
| | | | | | | | | | | | | | | The rate monotonic period statistics were affected by rtems_cpu_usage_reset(). The logic to detect and work around a CPU usage reset was broken. The Thread_Contol::cpu_time_used is changed to contain the processor time used throughout the entire lifetime of the thread. The new member Thread_Contol::cpu_time_used_at_last_reset is added to contain the processor time used at the time of the last reset through rtems_cpu_usage_reset(). This decouples the resets of the CPU usage and the rate monotonic period statistics. Update #4528.
* score: Optimize default idle task stack allocatorSebastian Huber2021-10-251-3/+9
| | | | Update #4524.
* microblaze: Rework for RTEMS 6Alex White2021-10-1312-1490/+963
| | | | | This reworks the existing MicroBlaze architecture port and BSP to achieve basic functionality using the latest RTEMS APIs.
* bsps: Add MicroBlaze FPGA BSPHesham ALMatary2021-10-135-79/+238
|
* score: Add MicroBlaze portJoel Sherrill2021-10-134-0/+1626
|
* Add support for IDLE Thread stack allocatorJoel Sherrill2021-10-112-3/+68
| | | | | | | | 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 #4524.
* score: _Thread_queue_Surrender_priority_ceiling()Sebastian Huber2021-10-111-2/+2
| | | | | | | | Do not use a direct thread dispatch in _Thread_queue_Surrender_priority_ceiling() since it may be used in condition variables using POSIX mutexes. Close #4526.
* improve the format error reporting on i386Zacchaeus Leung2021-10-041-4/+4
|
* cpukit/aarch64: Use correct interrupt level typesKinsey Moore2021-10-012-4/+4
| | | | | All other architectures use uint32_t for interrupt levels and there is no reason not to do so on AArch64.
* cpukit/aarch64: Use correct context register setsKinsey Moore2021-10-012-55/+123
| | | | | | | Context validation for AArch64 was ported from the ARM implementation without a reinterpretation of the actual requirements. The spcontext01 test just happened to pass because the set of scratch registers in ARM is a subset of the scratch registers in AArch64.
* score: Add Thread_queue_Deadlock_statusSebastian Huber2021-10-013-37/+47
| | | | | | Replace the boolen return value with the new enum Thread_queue_Deadlock_status. This improves the code readability. Improve documentation. Shorten function names.
* score: Avoid dead code in thread queue surrenderSebastian Huber2021-10-011-12/+67
| | | | | | | | For uniprocessor configurations, this patch removes dead code in the _Thread_queue_Surrender() and _Thread_queue_Surrender_priority_ceiling() functions. Dead code is removed from _Thread_queue_Surrender_sticky().