- 01 Feb, 2023 3 commits
-
-
Julie Stamp authored
Detail: Add case labels for gain and lose caret events in rlib/win.c Admin: This is in support of Ticket #426; To plot its own caret Draw will need to receive these events. Version 6.17. Tagged as 'RISC_OSLib-6_17'
-
Timothy E Baldwin authored
Presence of LDREX does not imply presence of LDREXB. If LDREX is not available SWP was being used, so a word sized operation is appropriate. Version 6.16. Not tagged
-
Jeffrey Lee authored
CheckIfSwpAvailable currently uses an error environment handler to detect the case where SWP isn't available. However there are a number of things the OS does before it invokes the error handler which could have unwanted effects - e.g. issuing Service_Error & ErrorV, clearing the hourglass, closing redirection file handles, and setting the CAO to point to the error handler. In particular the latter was found to cause the current disc image + PlingSystem to get fatally stuck on ARM2 machines - when Boot.Desktop runs any *Repeat command, application space was being shrunk to zero when Repeat calls Wimp_Initialise. Fix these problems by changing the SWP detection to directly hook on to the undefined instruction vector. See also https://www.riscosopen.org/forum/forums/4/topics/17688#posts-137994 Version 6.16. Not tagged
-
- 28 Dec, 2022 1 commit
-
-
Jeffrey Lee authored
Back in RISCOS_Lib 5.35, a bug was introduced in ErrorHandler where it would try saving the registers to a garbage address for SCL builds where SASTMhatbroken is false. This bug has gone unnoticed until now because up until a few months ago, SASTMhatbroken was always true (commit 3b7d39bd in RISCOS_Lib 6.13). Move the offending line of code out of the SASTMhatbroken block so that register capturing will work correctly for all build configs. Fixes issue reported on the forums (tested with a ROM build on Pi 4): https://www.riscosopen.org/forum/forums/4/topics/17647 Version 6.16. Tagged as 'RISC_OSLib-6_16'
-
- 21 Sep, 2022 1 commit
-
-
ROOL authored
Detail: Sync the disc copies of the compiler's internal headers from cc 5.89. Add <stdalign.h> and <stdnoreturn.h> and <uchar.h> in support of C18. Now the compiler sets __STDC_VERSION__ appropriately on the nightly builds it is no longer necessary to use predefine 'DDE' to enable those additions. Version 6.15. Tagged as 'RISC_OSLib-6_15'
-
- 20 Aug, 2022 4 commits
-
-
Jeffrey Lee authored
For pre-ARMv6K, we generally have two sets of atomic routines available: * Fast routines which use a SWP spinlock, but are unsafe for use from interrupt handlers and the like * Safe routines which disable IRQs, but (in usermode) are much slower due to requiring SWI calls to enable/disable IRQs. Currently CLib decides which set of routines to use: modules get the slow & safe ones, while applications get the fast & unsafe ones. This change gives control of that choice to the program, by introducing the _kernel_init_flags variable. The stub code will (weakly) import this symbol and pass the value to CLib when calling the init SWI. CLib will then use the value to decide whether to fill the stubs with the safe or unsafe versions of the routines. With this change, the default is now to use the slow & safe routines, for both modules and applications. This is to ensure that code which is written/tested for ARMv6K+ machines won't run into unexpected issues when r...
-
Jeffrey Lee authored
They need more optimisation before they're worth using over the ARMv7 routines; probably rewriting so that there are separate instances for barriers vs. non-barriers.
-
Jeffrey Lee authored
This implementation relies heavily on a new set of _kernel_atomic_* functions which implement all the atomic operations. Multiple different implementations of the functions are provided, to cater to all machines from ARMv2 to ARMv8. When targeting multiple CPU architectures, multiple variants will be compiled into the module, and the most appropriate variant will be selected at runtime when the client's stubs are filled in (using an extended version of the existing PickRoutineVariant system). Currently ROM clients will just use the variant for the oldest enabled architecture, to avoid the performance hit of runtime switching on every function call. The 40 new routines have been placed in a new library chunk (#6), so that old CLibs will properly reject any client that tries to use them, and to avoid ~500B of stubs bloat for programs that don't use them. Test & benchmark code is provided in the test/atomic folder.
-
Jeffrey Lee authored
-
- 16 Jun, 2022 1 commit
-
-
Ben Avison authored
Prior to C18, you couldn't have duplicate typedefs (even if identical) so if you `#include` both `<stdio.h>` and `"swis.h"` the `typedef __va_list` conflicted if you specified `-c90` or `-c99`. (The header was already incompatible with `-pcc`.) Version 6.13. Not tagged
-
- 15 Jun, 2022 3 commits
-
-
Ben Avison authored
The (previously StrongARM-bracketed) code was overallocating stack space by 3 words in order to retain compatibility with the now-deleted dynamic code build variant. Version 6.13. Tagged as 'RISC_OSLib-6_13'
-
Ben Avison authored
These are typically useful for wrapper functions that want to do something before and/or after a SWI call, and which therefore need to pass a pointer to their own variadic arguments into the guts of _swi or _swix. The pairs of functions _swi and _vswi, and _swix and _vswix, are almost identical, differing only in argument marshalling. There being only two additional entries, I didn't think it was worth introducing a whole new library chunk. Instead, I've tacked them onto the end of chunk 2 (the basic clib functions). Note that this means that any applications that use these new entries will need to take responsibility for RMEnsuring this version of the SharedCLibrary module and softloading a newer one if necessary.
-
Ben Avison authored
Harvard caches are here to stay - can't conceive why we'd ever want to build binaries that didn't support them again. SASTMhatbroken is now conditional on the target (i.e. lowest supported) architecture being 4 or below - i.e. the workaround for the StrongARM bug isn't needed for ROMs targeting ARMv5 or above.
-
- 21 May, 2022 1 commit
-
-
Ben Avison authored
Version 6.12. Not tagged
-
- 16 May, 2022 3 commits
-
-
Ben Avison authored
Detail: * Enable GitLab CI * Address issues identified by CI jobs, excluding those related to cppcheck * Enable GitLab CD for stubs (used implicitly when linker is invoked by cc) Version 6.12. Tagged as 'RISC_OSLib-6_12'
-
Ben Avison authored
Detail: * Remove empty directories and have the Makefiles create them * Consolidate and complete .gitignore
-
Ben Avison authored
Detail: * GNUmakefile: add translation of Makefile to GNU make / cross-compilation requirements (this component is too non-standard to make much use of the shared makefiles) * Makefile: comment out rules for objects that aren't used for any targets, for clarity; don't clean files that are never created * Various: change to using OS-agnostic filename path syntax * Various: ensure case matches for filename paths (don't assume host filing system is case-agnostic)
-
- 22 Nov, 2021 1 commit
-
-
Stuart Swales authored
Detail: fminf(x,y) / fmaxf(x,y) corrupted the result when x==y and x!=0.0 due to ANDing/ORRing a single precision register with the high word of a double precision register pair when fixing up signs for mixed +/- 0 parameters in an analogous fashion to fmax/fmin (which are correct). Version 6.11. Tagged as 'RISC_OSLib-6_11'
-
- 13 Nov, 2021 2 commits
-
-
Stuart Swales authored
Detail: modff() single precision function yielded wrong results for both fractional and integral part for most numbers because the wrong exponent bias was subtracted. Version 6.10. Tagged as 'RISC_OSLib-6_10'
-
Stuart Swales authored
Version 6.09. Not tagged
-
- 06 Feb, 2021 1 commit
-
-
Timothy E Baldwin authored
If the current directory is not it's root these are not equivalent. Version 6.09. Tagged as 'RISC_OSLib-6_09'
-
- 05 Sep, 2020 1 commit
-
-
Ben Avison authored
This utilises a weak symbol import so that if the symbol `Resources` resolves at link time, it is called to discover the address of the resource file data block(s) to be installed in ResourceFS. If this fails, it drops back to using the `s.ResFiles` source file as previously, thereby ensuring compatibility with components that have not yet been converted to use ResGen. Since `Resources` is the default area name (and thus discovery function name) used for ResGen in the shared makefiles, this makes it as simple as possible to utilise it. Version 6.08. Tagged as 'RISC_OSLib-6_08'
-
- 06 Jul, 2020 1 commit
-
-
Jeffrey Lee authored
As noted in https://www.riscosopen.org/forum/forums/9/topics/15359, MRS instructions which are executed in user mode may return unknown values for the CPSR E, A, I, F and M fields on ARMv8 CPUs. At the moment the only observed deviation from normal behaviour is that CPUs which lack AArch32 privileged-mode support may return zero for the fields. This was found to confuse some 26 vs. 32 bit mode checks in CLib. Clearly we're a long way away from having a version of RISC OS which can run on a CPU that lacks AArch32 privileged mode support, but we can still try and make sure user-mode applications are compatible with them. So this change adjusts the mode checks in the stubs and overlay manager so that programs linked with them should function correctly (TEQ is now used instead of MRS) Note that once we do start porting RISC OS to one of the troublesome CPUs, there are many more potentially troublesome MRS's within the module code that will need adjusting, especially if CPUs start returning values other than zero. Version 6.07. Tagged as 'RISC_OSLib-6_07'
-
- 09 May, 2020 2 commits
-
-
Jeffrey Lee authored
Use extended scroll requests to handle mouse wheel scrolling, to avoid the "thumbing" code getting confused and thinking the user is dragging the scrollbar (the "thumbing" mode of scrolling isn't desirable for the mouse wheel, because it largely ignores the requested scroll distance) This change allows Edit & SrcEdit (and anything else using txtar) to handle the scroll wheel better, now that the WindowScroll module is controlling things. Version 6.06. Tagged as 'RISC_OSLib-6_06'
-
ROOL authored
Detail: Export sprite_put_mask_scaled when UROM. Also, delete sprite_put_greyscaled() which has been unimplemented in SpriteExtend since RISC OS 3.60. Admin: Required by Paint bounty. Version 6.05. Not tagged
-
- 06 May, 2020 4 commits
-
-
ROOL authored
Detail: Was (trying to) clear the M32 flag in {CONFIG}=32. Ref: https://www.riscosopen.org/forum/forums/1/topics/15080?page=1#posts-99441 Makefile updated to only pass rlib's txt switch when building rlib. Version 6.05. Tagged as 'RISC_OSLib-6_05'
-
ROOL authored
Detail: alloc.c - Add aligned_alloc(). Since softloaded versions of the C library can't rely on OS_Module 24 being available there is a fallback implementation for older kernels. stdlib.c - Add quick_exit() and at_quick_exit(). Also fix bug in _Exit; a missing loop pre-decrement led to only checking a single (out of array bounds!) vector. time.c - Add timespec_get(). cl_entry2 - 4 new functions added to the stubs. Reduce spare CLib static workspace to absorb the quick_exit() handlers, remove the unused words from armsys.c so they're all accounted for in one space. Admin: In order that the functions can be defined in the stubs now (despite not having a compiler to support C11/C18) they are enabled when 'DDE' is defined so that C library builds work.
-
ROOL authored
Detail: assert.h - definition of static_assert complex.h - definition of CMPLX[F|L] float.h - various implementation defines stdio.h - hide gets() as it's been withdrawn wchar.h - guard mbstate_t as it can also be in uchar.h, fix missing __valist definition Admin: In order that the functions can be defined in the stubs now (despite not having a compiler to support C11/C18) they are enabled when 'DDE' is defined so that C library builds work.
-
ROOL authored
Detail: Remove undocumented 't' mode which forcibly timestamped files, since other operating systems use this to denote a text file (as opposed to 'b' binary mode). Add 'x' mode per ISO9899:2018 * only applies to 'w' mode files (not 'r' or 'a') * file must not exist prior to creation * beyond that we rely on RISC OS' policy of only allowing a file to be opened once for writing as our exclusivity Also fix bug in check for 'Protected disc' error, which only trigged for fsnumber_ADFS (8). Admin: Tested in a ROM build with a simple test harness.
-
- 22 Apr, 2020 1 commit
-
-
Robert Sprowson authored
The spec of os_byte() requires 2 valid pointers, since the return values are unconditionally written to them. Use a dummy pointer for the unwanted result, not 0. Fixes application crash https://www.riscosopen.org/forum/forums/1/topics/15189#posts-101073. Version 6.04. Tagged as 'RISC_OSLib-6_04'
-
- 20 Jul, 2019 1 commit
-
-
Robert Sprowson authored
The change of MIN() to a macro in RISC_OSLib-6_02 tripped up as it called the argument number parse function twice, which advances the parsing offset as a sideeffect. Read it once, then evaluate MIN(). Mark the string argument to txtar__readoptnum() as const. Ref: https://www.riscosopen.org/forum/forums/11/topics/14632 Version 6.03. Tagged as 'RISC_OSLib-6_03'
-
- 29 Jun, 2019 2 commits
-
-
Robert Sprowson authored
Share a (macro) definition with txt1 rather than having lots of local functions scattered around. Version 6.02. Tagged as 'RISC_OSLib-6_02'
-
Robert Sprowson authored
Only suppress the '*' when an existing file is dropped into an empty window, not if via scrap (ie. an application supporting the clipboard, but not the ram fetch protocol). Fixes ticket #461.
-
- 09 Jun, 2019 1 commit
-
-
ROOL authored
Detail: Add missing function draw_create_diag() to the ROM version of RISC_OSLib, required by Paint-2_24 and later. To keep ROM footprint to a minimum, export only that function; this also avoids adding static workspace and needing to increase RlibSpace. Version 6.01. Tagged as 'RISC_OSLib-6_01'
-
- 17 Mar, 2019 1 commit
-
-
ROOL authored
Detail: Add wimp_autoscroll to rlib entries. Version 6.00. Not tagged
-
- 16 Mar, 2019 1 commit
-
-
ROOL authored
Detail: Export fenv.h (omitted in error). Add FP_FAST_FMAL and FP_FAST_FMA defines per C standard Submission for ARMv7 Compiler bounty. Add Wimp_AutoScroll supporting function to rlib. Export various related defines for autoscroll use. Submission for Clipboard Support bounty. Version 6.00. Tagged as 'RISC_OSLib-6_00'
-
- 09 Feb, 2019 1 commit
-
-
ROOL authored
Detail: The fix applied to all menus in event.c revision 4.6 didn't take into account the offset of -16 already applied to iconbar menus. Admin: Tested with Draw-1_31. Version 5.99. Tagged as 'RISC_OSLib-5_99'
-
- 26 Jan, 2019 1 commit
-
-
Robert Sprowson authored
colourtran.c: Swap round arg names to colourtran_colournumbertoGCOL to match prototype. txtar.c: Avoid incorrect use of strncat buffer limit, and possible unterminated string after strncpy, by reexpressing using snprintf. txtedit.c: Avoid incorrect use of strncat buffer limit by reexpressing using snprintf. Avoid potential NULL pointer dereference by moving the filename copy inside the 'if' which confirms it's non-NULL. txtfind.c: Remove repeated check of repls being valid. Free repls on error. Free pat on error. xfersend.c: Fix potential out of bounds array access (of leaf[]) if the leafname length exceeds the space in the Wimp message. Found by cppcheck static analysis. txtopt.c/h: Sprinkle in some consts. event.c: Open menu at the Style Guide approved offset of 64. xfersend.c: Remove redundant check of xfersend__filename being NULL in xfersend__suggest_leaf() as all paths leading to it being called ensure the allocation exists (also, it would have strcpy'd garbage due to malloc not clearing the allocation). Removed unused header txtover.h. Version 5.98. Tagged as 'RISC_OSLib-5_98'
-
- 11 Jun, 2018 1 commit
-
-
Jeffrey Lee authored
Detail: kernel/s/k_body - CPSR_f is the correct field for the NZCV flags, not _c Admin: Untested Version 5.97. Tagged as 'RISC_OSLib-5_97'
-
- 10 Jun, 2018 1 commit
-
-
Jeffrey Lee authored
Detail: The kernel has a 'callback postponement flag' which will be set whenever an X SWI, called from user mode, returns a pointer to an error (and the error block looks like it's in RAM). Although this flag will help prevent the error buffer from being overwritten by any errors generated by callbacks, it will also have the effect of blocking Alt-Break and CLib's Escape handler, due to them both being reliant on callbacks. Since the flag may persist for a long time, it can be dangerous to leave the OS in this state (the flag can only be cleared by a SWI call from user mode - which may never happen if the program is stuck in a bad state). So to combat this, CLib will now make some effort to try and avoid leaving the postponement flag in situations where it shouldn't be needed. File changes: - c/armsys: - Change _sys_flen to return 0 for TTY streams, since calling OS_Args for them isn't going to generate any useful result (previously it was generating an err...
-