Commit Graph

115 Commits

Author SHA1 Message Date
Michael Scire
e3da8b8cb1 ncm: update for new add on content/attr changes 2022-10-12 09:15:45 -07:00
Michael Scire
07494b1d42 lr: add support for location resolver disable commands 2022-10-12 09:15:45 -07:00
Michael Scire
56f28f9ce5 util: prevent optimizer from removing endian-swapped writes 2022-10-12 09:15:38 -07:00
Michael Scire
54b6d5f40b optional: add c++23 monadic interface 2022-04-29 16:14:20 -07:00
Michael Scire
ddd98cb20b util: update some bit utility logic 2022-04-04 17:47:04 -07:00
Michael Scire
767f4a9913 util: pointer traits only if <memory>/stratosphere 2022-04-04 17:46:54 -07:00
Michael Scire
7a0bfc4397 util: add pointer utils, use to constrain fs pointers 2022-04-04 17:46:54 -07:00
Michael Scire
a9aef5024c util: update function dtors, update gitignore 2022-03-23 09:15:54 -07:00
Michael Scire
0d2e2df552 strat: revise fs unsupported operation results, add overflow utils 2022-03-23 09:15:53 -07:00
Michael Scire
5febe40d50 fs: fix clang-build, os: StackGuardManager 2022-03-23 09:15:52 -07:00
Michael Scire
a9e2c6a9c0 fs: first pass at compressed storage (works on iridium with wip hac2l code) 2022-03-23 09:15:51 -07:00
Michael Scire
6c3eb5b121 lib: simplify pragma macros 2022-03-23 09:15:48 -07:00
Michael Scire
d7a9c7ec4c ams: support building unit test programs on windows/linux/macos 2022-03-23 09:15:46 -07:00
Michael Scire
9436b9a555 ams: deduplicate static initialization logic 2022-01-19 16:28:54 -08:00
Léo Lam
2916512fb7 Minor header fixes to reduce parsing issues with Clang (#1700)
* Work around Clang's incomplete C++20 support for omitting typename

* vapours: fix Clang error about missing return in constexpr function

* stratosphere: fix call to non-constexpr strlen in constexpr function

strlen being constexpr is a non-compliant GCC extension; Clang
explicitly rejects it: https://reviews.llvm.org/D23692

* stratosphere: add a bunch of missing override specifiers

* stratosphere: work around Clang consteval bug

Minimal example: https://godbolt.org/z/MoM64v93M

The issue seems to be that Clang does not consider f(x) to be a
constant expression if x comes from a template argument that isn't
a non-type auto template argument (???)

We can work around this by relaxing GetMessageHeaderForCheck (by using
constexpr instead of consteval). This produces no functional changes
because the result of GetMessageHeaderForCheck() is assigned to a
constexpr variable, so the result is guaranteed to be computed
at compile-time.

* stratosphere: fix missing require clauses in definitions

GCC not requiring the require clauses to be repeated for member
definitions is actually a compiler bug:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96830

Clang rejects declarations with missing require clauses.

* Fix ALWAYS_INLINE_LAMBDA and parameter list relative order

While GCC doesn't seem to care about the position of the always_inline
attribute relative to the parameter list, Clang is very picky
and requires the attribute to appear after the parameter list
(and before a trailing return type)

* stratosphere: fix static constexpr member variable with incomplete type

GCC accepts this for some reason (because of the lambda?) but Clang
correctly rejects this.
2021-11-30 16:34:43 -08:00
Léo Lam
12d0ba172f util/string_view: fix nonnull attribute argument number
Argument 1 is the this pointer, not the string.
2021-11-02 17:19:35 -07:00
Michael Scire
a0f0dc3ba1 crypto: implement md5, which now used by sprof 2021-10-26 01:11:19 -07:00
Michael Scire
2eab77fe5a util: add trait/macro for is_constexpr_constructible 2021-10-26 01:11:17 -07:00
Michael Scire
8f761e928c kern: optimize timespan -> tick codegen, improve .text layout 2021-10-26 01:11:14 -07:00
SciresM
823c0df6b9 kern: avoid constexpr init for many objects (avoids unnecessary memory clear) (#1668) 2021-10-26 01:11:13 -07:00
Michael Scire
00353a05e9 kern: use new AtomicRef, use Atomic<bool> 2021-10-26 01:11:13 -07:00
Michael Scire
0d1ec0739f util: better match true std::atomic semantics 2021-10-26 01:11:13 -07:00
Michael Scire
d3b358bbb9 kern/util: use custom atomics wrapper to substantially improve codegen 2021-10-26 01:11:12 -07:00
Michael Scire
573769303b kern: update scheduler for 13.0.0 change, fix some ctz/clz bugs 2021-10-26 01:11:11 -07:00
Michael Scire
960c5c19f9 ams: improve offsetof style consistency 2021-10-26 01:11:10 -07:00
Michael Scire
191d2941b5 util: improve (and use) offsetof that's """standard compliant""" 2021-10-26 01:11:10 -07:00
Michael Scire
21cb300537 constexpr: resign ourselves to gcc dropping void -> T support 2021-10-26 01:11:10 -07:00
Michael Scire
05c7ba6439 kern/util: update structure layouts to match Nintendo (saves 0x10 per KThread/KSession) 2021-10-26 01:11:09 -07:00
Michael Scire
96190af3dc util: fix consteval CountTrailingZeroes impl 2021-10-15 23:54:38 -07:00
Michael Scire
116e41f790 exo/vapours: refactor member variables to m_ over this-> 2021-10-15 23:54:34 -07:00
Michael Scire
3b5f56ab9f ams: replace most remaining operator & with std::addressof 2021-10-15 23:54:34 -07:00
Michael Scire
fd1b6d4578 libstrat: enable -Wextra, -Werror
This caught an embarrassingly large number of bugs.
2021-10-07 23:06:28 -07:00
Michael Scire
002422d5dc ams: the copyright^H^H^H^H^H^H^Hmplex plane is the algebraic closure of the reals 2021-10-07 23:06:25 -07:00
Michael Scire
8ecddf498a kern: use util::BitFlagSet for capability flags 2021-10-07 23:06:18 -07:00
Michael Scire
a8bccc95ab sprofile: fully reimplement sprof:bg + sprof:sp 2021-09-19 10:35:33 -07:00
SciresM
277d2193e2 LogManager: implement system module, client api, logging api (#1617)
Some notes:

* Unless `atmosphere!enable_log_manager` is true, Nintendo's log manager will be used instead.
  * This prevents paying memory costs for LM when not enabling logging.
  * To facilitate this, Atmosphere's log manager has a different program id from Nintendo's.
  * `atmosphere!enable_htc` implies `atmosphere!enable_log_manager`.
* LogManager logs to tma, and the SD card (if `lm!enable_sd_card_logging` is true, which it is by default).
* Binary logs are saved to `lm!sd_card_log_output_directory`, which is `atmosphere/binlogs` by default.
2021-09-19 10:35:25 -07:00
Michael Scire
dc3f54a713 ams: std::optional -> util::optional 2021-07-12 01:59:51 -07:00
Michael Scire
acee57e888 loader: avoid UB when doing count trailing zeros 2021-04-30 10:04:09 -07:00
Michael Scire
888b39fa50 ams: assume gcc 11 2021-04-29 03:04:54 -07:00
Michael Scire
d8e35f2277 exo/meso: update for gcc 11 compatibility 2021-04-29 03:04:54 -07:00
Michael Scire
2d67f66c44 util: add compile-time validation tests for intrusive red black trees 2021-04-29 03:04:53 -07:00
Michael Scire
2ccba9adbb util: implement red black trees as templates over macros 2021-04-29 03:04:53 -07:00
Michael Scire
3ebf91304e kern: update Initialize0 for new changes 2021-04-11 03:59:15 -07:00
Michael Scire
9b47aa6e08 ams: prefer construct_at/destroy_at over placement new/explicit destructor 2021-04-11 03:59:04 -07:00
Michael Scire
1861791c1c ams: remove TYPED_STORAGE() macro in favor of template 2021-04-11 03:59:03 -07:00
Michael Scire
042de46692 htc: implement HtclowDriver 2021-04-11 03:58:35 -07:00
Michael Scire
c44177cbcc htc: implement service channel parsing (ReceiveReadyPacket) 2021-04-11 03:58:32 -07:00
Michael Scire
e4d44fb376 util: add FixedSet 2021-02-15 19:51:57 -08:00
Michael Scire
5f5b9a2831 util: add FixedMap::clear 2021-02-15 19:51:57 -08:00
Michael Scire
663e99d1f3 util: various FixedMap fixes 2021-02-15 19:51:56 -08:00