Commit Graph

1563 Commits

Author SHA1 Message Date
LC
ff0b14ee62 Merge pull request #4511 from lioncash/build2
General: Tidy up clang-format warnings part 2
2020-08-13 15:13:21 -04:00
b724a4d90c General: Tidy up clang-format warnings part 2 2020-08-13 14:19:08 -04:00
e143adc3cf Merge pull request #4493 from jbeich/dragonfly
common/virtual_buffer: drop unused includes
2020-08-11 12:52:50 -04:00
1c3490a8db General: Tidy up clang-format warnings 2020-08-08 20:08:44 -04:00
8e86fa7e60 common/concepts: Rename IsBaseOf to DerivedFrom
This makes it more inline with its currently unavailable standardized
analogue std::derived_from.

While we're at it, we can also make the template match the requirements
of the standardized variant as well.
2020-08-07 08:09:57 -04:00
f5d538f118 Merge pull request #4483 from lioncash/constexpr-hex
partition_data_manager: Make data arrays constexpr
2020-08-06 23:14:14 -04:00
7f0f37fca7 partition_data_manager: Make data arrays constexpr
Previously the constructor for all of these would run at program
startup, consuming time before the application can enter main().

This is also particularly dangerous, given the logging system wouldn't
have been initialized properly yet, yet the program would use the logs
to signify an error.

To rectify this, we can replace the literals with constexpr functions
that perform the conversion at compile-time, completely eliminating the
runtime cost of initializing these arrays.
2020-08-06 02:41:58 -04:00
d37f0b29e2 Fix thread naming on Linux, which limits names to 15 bytes.
- In `SetCurrentThreadName`, when on Linux, truncate to 15 bytes, as (at
  least on glibc) `pthread_set_name_np` will otherwise return `ERANGE` and
  do nothing.
- Also, add logging in case `pthread_set_name_np` returns an error
  anyway.  This is Linux-specific, as the Apple and BSD versions of
  `pthread_set_name_np return `void`.
- Change the name for CPU threads in multi-core mode from
  "yuzu:CoreCPUThread_N" (19 bytes) to "yuzu:CPUCore_N" (14 bytes) so it
  fits into the Linux limit.  Some other thread names are also cut off,
  but I didn't bother addressing them as you can guess them from the
  truncated versions.  For a CPU thread, truncation means you can't see
  which core it is!
2020-08-05 20:34:49 -07:00
d888ac7d20 Merge pull request #4477 from lioncash/log-desig
logging/backend: Make use of designated initializers
2020-08-05 22:34:12 -04:00
238208ee30 common/virtual_buffer: drop unused includes
On DragonFly and NetBSD build fails with

src/common/virtual_buffer.cpp
src/common/virtual_buffer.cpp:16:10: fatal error: sys/sysinfo.h: No such file or directory
 #include <sys/sysinfo.h>
          ^~~~~~~~~~~~~~~
2020-08-05 21:36:35 +00:00
4a2d9c6454 Merge pull request #4444 from lioncash/volatile
common/atomic_ops: Don't cast away volatile from pointers
2020-08-05 14:22:36 -04:00
8725b37a35 logging/backend: Make use of designated initializers
Same behavior, less code.
2020-08-03 10:37:48 -04:00
9b75481755 ipc: Allow all trivially copyable objects to be passed directly into WriteBuffer (#4465)
* ipc: Allow all trivially copyable objects to be passed directly into WriteBuffer

With the support of C++20, we can use concepts to deduce if a type is an STL container or not.

* More agressive concept for stl containers

* Add -fconcepts

* Move to common namespace

* Add Common::IsBaseOf
2020-08-03 07:28:54 -04:00
6c7292de33 Merge pull request #4263 from lat9nq/fix-screencaps-2
screenshots: Option to save screenshots immediately in a specified directory + Linux workaround
2020-08-03 21:00:14 +10:00
e3f0c93230 common/atomic_ops: Don't cast away volatile from pointers
Preserves the volatility of the pointers being casted.
2020-07-28 04:36:53 -04:00
45cf48bd0a Merge pull request #4415 from lioncash/maybe
virtual_buffer: Mark size parameter of FreeMemoryPages() as [[maybe_unused]]
2020-07-25 21:35:09 -07:00
LC
e3503de588 common/string_util: Remove unimplemented function prototype (#4414)
This function was relocated to log.h as a constexpr function, so this
can be removed.
2020-07-25 15:37:51 +02:00
2e511246fa lz4_compression: Make use of std::span in interfaces
Allows compressing the data and size parameters into one.
2020-07-25 03:17:04 -04:00
c5bdccfecb zstd_compression: Make use of std::span in interfaces
Allows condensing the data and size parameters into a single argument.
2020-07-25 03:11:56 -04:00
ca6ff01333 virtual_buffer: Mark size parameter of FreeMemoryPages() as [[maybe_unused]]
This isn't used on Windows, but is used on non-Windows operating
systems.
2020-07-25 03:04:27 -04:00
3848155c42 common: Add a screenshots directory
Adds a screenshots directory as a path managed by FileUtil.
2020-07-20 22:51:02 -04:00
db43b37e15 alignment: explicitly include <new> after 723edb4c06
In file included from src/core/hle/kernel/memory/page_table.cpp:5:
src/./common/alignment.h:67:68: error: no member named 'align_val_t' in namespace 'std'
        return static_cast<T*>(::operator new (n * sizeof(T), std::align_val_t{Align}));
                                                              ~~~~~^
src/./common/alignment.h:71:51: error: no member named 'align_val_t' in namespace 'std'
        ::operator delete (p, n * sizeof(T), std::align_val_t{Align});
                                             ~~~~~^
2020-07-18 23:06:16 +00:00
723edb4c06 alignment: Simplify AlignmentAllocator implementation
With C++20, much of the allocator interface has been simplified, so we
can make the same adjustments.
2020-07-17 08:30:12 -04:00
9f027b1af2 common/swap: Make use of std::endian
Allows removing a bunch of defines in favor of a two liner.
2020-07-14 16:26:54 -04:00
80a0f2a118 common/alignment: Fix compilation errors (#4303) 2020-07-12 16:45:49 +02:00
1074c87f18 Revert "Port citra-emu/citra#5441: "Common: remove a mod from AlignUp"" 2020-07-11 19:28:09 -04:00
a4306b9e56 Common: remove a mod from AlignUp (#5441)
In cases where the size is not a known constant when inlining, AlignUp<std::size_t> currently generates two 64-bit div instructions.
This generates one div and a cmov which is significantly cheaper.
2020-07-11 18:39:00 +02:00
bd2feb6873 cmake: Fix libfmt linking errors 2020-07-10 14:04:06 +10:00
95cd2e17ab cmake: fix fmt linking when found
This is a new attempt at #4206 that shouldn't break windows builds.

If someone else could test on windows, it would be much appreciated.
Previously, the build bot passed but the actual builds failed.
2020-07-09 11:35:28 -04:00
98fcd3ba5d Revert "cmake: fix fmt linking" 2020-07-02 22:53:12 -04:00
064b7bfa5f Merge pull request #4206 from RealJohnGalt/linkfix
cmake: fix fmt linking
2020-07-02 22:23:39 -04:00
3b1683a152 common: switch to nullptr for sysctl's empty new value 2020-06-30 23:00:18 +00:00
e6085ea35f common: add sysconf() fallback
src/common/memory_detect.cpp:15:10: fatal error: 'sys/sysinfo.h' file not found
 #include <sys/sysinfo.h>
          ^~~~~~~~~~~~~~~
2020-06-29 22:41:22 +00:00
765e37aa35 cmake: fix fmt linking
On gcc/ld, and clang/lld, fmt::v6 symbols are excluded, so linking
fails. This fixes the issue.

Note: This was included in the FindBoost changes I shared with
BlinkHawk, however only they were merged. I'm not sure if it was missed,
or if there was an issue with this part of the change.
2020-06-29 07:10:07 -04:00
2f8947583f Core/Common: Address Feedback. 2020-06-27 18:20:06 -04:00
7fd7d05838 Common/Kernel: Corrections and small bug fixing. 2020-06-27 11:36:21 -04:00
3165152396 Common/NativeClockx86: Reduce native clock accuracy further. 2020-06-27 11:36:18 -04:00
7b1804dab4 Common/AtomicOps: Correct GCC Intrinsic argument ordering. 2020-06-27 11:36:16 -04:00
467d43570e Clang Format. 2020-06-27 11:36:14 -04:00
528b19a842 General: Tune the priority of main emulation threads so they have higher priority than less important helper threads. 2020-06-27 11:36:09 -04:00
534466754f X64 Clock: Reduce accuracy to be less or equal to guest accuracy. 2020-06-27 11:35:55 -04:00
cd1c38be8d ARM/Memory: Correct Exclusive Monitor and Implement Exclusive Memory Writes. 2020-06-27 11:35:37 -04:00
18dcb09342 HostTiming: Pause the hardware clock on pause. 2020-06-27 11:35:10 -04:00
e31425df38 General: Recover Prometheus project from harddrive failure
This commit: Implements CPU Interrupts, Replaces Cycle Timing for Host 
Timing, Reworks the Kernel's Scheduler, Introduce Idle State and 
Suspended State, Recreates the bootmanager, Initializes Multicore 
system.
2020-06-27 11:35:06 -04:00
0ea4a8bcc4 Merge pull request #3396 from FernandoS27/prometheus-1
Implement SpinLocks, Fibers and a Host Timer
2020-06-28 01:34:07 +10:00
7b893c7963 Common: Fix non-conan build 2020-06-26 12:25:19 -04:00
97ba520434 common/telemetry: Add AVX512 to telemetry 2020-06-20 00:31:37 -04:00
d6474b4aca common/cpu_detect: Add AVX512 detection 2020-06-20 00:31:37 -04:00
e77ee67bfa Common/Fiber: Address Feedback and Correct Memory leaks. 2020-06-18 16:29:27 -04:00
b6655aa2e4 Common/Fiber: Implement Rewind on Boost Context. 2020-06-18 16:29:27 -04:00