32 Commits

Author SHA1 Message Date
GaryOderNichts
2016e429c1 wutnewlib: fix lock_try_acquire
Some checks failed
C/C++ CI / ubuntu-latest (push) Has been cancelled
2026-02-16 19:10:34 +01:00
fincs
afa43f676d wutnewlib: implement new unified threading syscalls (replaces wutstdc++) (#434)
Some checks failed
C/C++ CI / ubuntu-latest (push) Has been cancelled
2026-01-25 19:33:25 +01:00
GaryOderNichts
2c98cc91aa Run clang-format
Some checks failed
C/C++ CI / ubuntu-latest (push) Has been cancelled
`find . -regex '.*\.\(cpp\|hpp\|cu\|cuh\|c\|h\)' -exec clang-format -style=file -i {} \;`
2025-06-05 11:06:04 +01:00
GaryOderNichts
5fdc7ffe85 wutnewlib: Remove obsolete declarations to fix compiling with GCC 15 2025-05-24 20:56:14 +02:00
Maschell
c1457779be wut_newlib: Implement __syscall_abort and __syscall_assert_func (#359) 2024-04-22 19:05:00 +01:00
Maschell
1adf4740c7 wutnewlib: implement abort, assert and assert_func (#337)
* wutnewlib: implement abort, assert and assert_func

* wut_newlib: Trigger trap instruction on assert/abort

* wut_newlib: Replace snprintf with cafe-os equivalent.
2024-01-15 18:36:59 +01:00
Maschell
071345feb2 Implement wut_set_thread_specific/wut_get_thread_specific as weak functions 2023-06-20 21:35:53 +02:00
GaryOderNichts
3ae38b15c7 Implement __syscall_getreent (#318) 2023-05-21 14:03:48 +01:00
Dave Murphy
803b1417c4 refactor for devkitPPC r42 2023-04-15 23:46:41 +01:00
GaryOderNichts
42292fadc6 wutnewlib: Use OSCompareAndSwapAtomicEx for sbrk 2022-08-05 23:31:10 +02:00
GaryOderNichts
4b81e19867 wutnewlib: Replace built-in atomics with OS* atomics 2022-08-05 23:31:10 +02:00
GaryOderNichts
f1b5da996f Replace the CafeOS default heap with a custom one (#221) 2022-06-30 21:05:11 +02:00
Maschell
c0e4eb7ae8 wutdevoptab: simplify the __wut_fs_translate_time implementation 2022-06-04 19:23:30 +02:00
Maschell
cd6b4fb45d Fix syscall_clock implementation 2022-04-15 17:02:03 +01:00
fincs
03c3d42d38 wutnewlib: replace dynamic allocation of OSMutex with static table 2022-03-05 17:58:51 +01:00
GaryOderNichts
712843cd58 wutnewlib: fix gettod 2021-02-09 20:17:56 +00:00
Dave Murphy
b168032339 fix exit sequence 2020-06-07 13:09:11 +01:00
Dave Murphy
e096dad4c5 reworked syscalls interface 2020-06-07 13:09:11 +01:00
Ash Logan
f92657e8b5 coreinit: Use rplwrap for exit (__rplwrap_exit) 2019-04-22 12:43:37 +10:00
fincs
26ac7b3ff2 wutmalloc: Bugfixes, see details:
- Added (dummy) __init/fini_wut_malloc stubs called by wutcrt
  in order to ensure that wutmalloc gets linked in
- malloc/realloc/calloc now properly set errno to ENOMEM during failure
- realloc no longer fails if ptr==NULL (in this case it works
  like a regular malloc)
- realloc no longer does an out of bounds copy if the new size
  is smaller than the old size
- free(NULL) is now supported as per the C standard
- Disabled sbrk/malloc-lock support code in wutnewlib because
  newlib's malloc is replaced with wutmalloc
2019-02-12 12:46:34 +01:00
fincs
ee3bb10df4 First pass at adopting a devkitPro-style build system, see details:
- Added wut_rules and wut/rpx/rpl.specs to share/
- Replaced wut's CMake-based buildsystem with a standard Makefile
- Conflated all wut libraries into a single libwut.a library
- wut's old buildsystems (CMake & plain make) are broken as a result,
  this will be fixed in the future
- Docs, tests and samples are not buildable either at the moment
- wutcrt/wutnewlib:
  - RPX start function is __rpx_start, while RPL is __rpl_start
  - __init/fini_wut_* functions are no longer weak
  - __init_wut/__fini_wut are instead weak
  - Removed _exit implementation
  - exit syscall now points to _Exit instead of pointing to itself
- wutstdc++:
  - Renamed .cc files to .cpp
  - Temporarily disabled, due to an issue that will be addressed shortly
- wutdevoptab:
  - Fixed uninitialized variable warnings in __wut_fs_read/write
2019-02-12 12:46:28 +01:00
James Benton
f9799cf3dd Fix __init_wut_sbrk_heap. 2018-06-15 13:59:30 +01:00
James Benton
98b6f6ec2f wutnewlib: Allow custom fixed sbrk heap size.
So now either uses 90% of the available base heap, or allocates a fixed
sized heap from the default heap.
2018-06-14 09:32:37 +01:00
James Benton
1471ea4338 Change wutnewlib to implement malloc family of functions.
This allows us to forward them straight to default heap functions, this
is better than having to allocate a fixed heap for sbrk as it allows
people to better mix usage malloc & default heap functions.
2018-06-13 18:38:53 +01:00
James Benton
d5effaaf88 coreinit: Cleanup memory heap functions.
Move files to mem*heap.h.
Use MEMHeapHandle everywhere to reduce need for unecessary casts.
Rename types to match the function names better (e.g. Frame -> Frm).
2018-05-30 13:13:37 +01:00
James Benton
f7a698388c wutnewlib: Implement the new __syscalls from upcoming devkitPPC release. 2018-05-28 11:40:22 +01:00
James Benton
b4a6eb2f78 Split out crt from wutnewlib to wutcrt.
Can now optionally link newlib, stdc++, devoptab.
2018-05-27 12:12:49 +01:00
James Benton
ac8a42fa7c Change to using new gthreads implementation.
Assuming that --enable-threads=dkp gets merged into devkitPPC r31... :)
2018-05-26 18:25:36 +01:00
James Benton
37228a095d Disable call to __fini as it breaks stuff. 2018-05-26 18:18:16 +01:00
James Benton
9a3cbcd2ef wutnewlib: Call __fini for global dtors.
main calls __eabi which calls __init, but main doesn't call __fini?
y u do this
2018-05-25 21:20:39 +01:00
James Benton
a5a1bac28c wutnewlib: Add sleep and usleep implementation. 2018-05-25 17:13:54 +01:00
James Benton
5b8b60b390 Add newlib syscalls. 2018-05-25 11:31:44 +01:00