summaryrefslogtreecommitdiff
path: root/src/common (follow)
Commit message (Collapse)AuthorAgeFilesLines
* core/memory: Check our memory fallbacks for out-of-bound behavior.Gravatar Markus Wick2021-05-292-0/+7
| | | | | | This makes it by far harder to crash yuzu. Also implement the 48bit masking of AARCH64 while touching this code.
* common/fs/file: Explicitly delete copy constructorsGravatar Lioncash2021-05-281-1/+4
| | | | | Relocates them to the same place the move equivalents are at for consistent viewing.
* common/fs/file: Devirtualize destructorGravatar Lioncash2021-05-281-1/+1
| | | | IOFile is a final class, so there's no need for a virtual destructor.
* common/fs/file: Default initialize IOFile membersGravatar Lioncash2021-05-281-2/+2
| | | | Prevents a potential uninitialized read vector in the move constructor.
* common: fs: Rework the Common Filesystem interface to make use of ↵Gravatar Morph2021-05-2520-1432/+2963
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | std::filesystem (#6270) * common: fs: fs_types: Create filesystem types Contains various filesystem types used by the Common::FS library * common: fs: fs_util: Add std::string to std::u8string conversion utility * common: fs: path_util: Add utlity functions for paths Contains various utility functions for getting or manipulating filesystem paths used by the Common::FS library * common: fs: file: Rewrite the IOFile implementation * common: fs: Reimplement Common::FS library using std::filesystem * common: fs: fs_paths: Add fs_paths to replace common_paths * common: fs: path_util: Add the rest of the path functions * common: Remove the previous Common::FS implementation * general: Remove unused fs includes * string_util: Remove unused function and include * nvidia_flags: Migrate to the new Common::FS library * settings: Migrate to the new Common::FS library * logging: backend: Migrate to the new Common::FS library * core: Migrate to the new Common::FS library * perf_stats: Migrate to the new Common::FS library * reporter: Migrate to the new Common::FS library * telemetry_session: Migrate to the new Common::FS library * key_manager: Migrate to the new Common::FS library * bis_factory: Migrate to the new Common::FS library * registered_cache: Migrate to the new Common::FS library * xts_archive: Migrate to the new Common::FS library * service: acc: Migrate to the new Common::FS library * applets/profile: Migrate to the new Common::FS library * applets/web: Migrate to the new Common::FS library * service: filesystem: Migrate to the new Common::FS library * loader: Migrate to the new Common::FS library * gl_shader_disk_cache: Migrate to the new Common::FS library * nsight_aftermath_tracker: Migrate to the new Common::FS library * vulkan_library: Migrate to the new Common::FS library * configure_debug: Migrate to the new Common::FS library * game_list_worker: Migrate to the new Common::FS library * config: Migrate to the new Common::FS library * configure_filesystem: Migrate to the new Common::FS library * configure_per_game_addons: Migrate to the new Common::FS library * configure_profile_manager: Migrate to the new Common::FS library * configure_ui: Migrate to the new Common::FS library * input_profiles: Migrate to the new Common::FS library * yuzu_cmd: config: Migrate to the new Common::FS library * yuzu_cmd: Migrate to the new Common::FS library * vfs_real: Migrate to the new Common::FS library * vfs: Migrate to the new Common::FS library * vfs_libzip: Migrate to the new Common::FS library * service: bcat: Migrate to the new Common::FS library * yuzu: main: Migrate to the new Common::FS library * vfs_real: Delete the contents of an existing file in CreateFile Current usages of CreateFile expect to delete the contents of an existing file, retain this behavior for now. * input_profiles: Don't iterate the input profile dir if it does not exist Silences an error produced in the log if the directory does not exist. * game_list_worker: Skip parsing file if the returned VfsFile is nullptr Prevents crashes in GetLoader when the virtual file is nullptr * common: fs: Validate paths for path length * service: filesystem: Open the mod load directory as read only
* Merge pull request #6357 from lioncash/compressionGravatar bunnei2021-05-244-7/+8
|\ | | | | common/compression: Make use of std::span
| * zstd_compression: Make use of std::spanGravatar Lioncash2021-05-242-3/+4
| | | | | | | | Allows for the incoming data stream to be non-allocating.
| * lz4_compression: Make use of std::spanGravatar Lioncash2021-05-242-4/+4
| | | | | | | | Allows making the incoming data stream non-allocating.
* | common: tree: Avoid a crash on nullptr dereference.Gravatar bunnei2021-05-201-0/+11
|/
* Merge pull request #6321 from lat9nq/per-game-cpuGravatar bunnei2021-05-202-7/+12
|\ | | | | configuration: Add CPU tab to game properties and slight per-game settings rework
| * general: Demote custom_rtc to regular settingGravatar lat9nq2021-05-172-2/+1
| |
| * configuration: Add CPU tab to game propertiesGravatar lat9nq2021-05-161-0/+6
| | | | | | | | | | | | Allows setting CPU accuracy to Accurate or Unsafe per-game, as well as the accuracy options for Unsafe. Debug is not allowed here as a per-game CPU accuracy.
| * general: Make CPU accuracy and related a Settings::SettingGravatar lat9nq2021-05-152-5/+5
| | | | | | | | | | Required to make CPU accuracy and unsafe settings available to use as a per-game setting.
* | Merge pull request #6297 from lioncash/common-convGravatar bunnei2021-05-191-1/+2
|\ \ | | | | | | parent_of_member: Make sign conversion explicit in OffsetOfImpl()
| * | parent_of_member: Make sign conversion explicit in OffsetOfImpl()Gravatar Lioncash2021-05-101-1/+2
| |/ | | | | | | | | Previously these conversions were implicit and causing quite a few warnings on clang.
* / common: tree: Avoid a nullptr dereference.Gravatar bunnei2021-05-111-1/+1
|/
* fixup! common: bit_util: Add BIT macro.Gravatar bunnei2021-05-051-2/+0
|
* common: parent_of_member: Fix build for OffsetOf().Gravatar bunnei2021-05-051-4/+4
|
* fixup! common: intrusive_red_black_tree: Disable static_assert that will not ↵Gravatar bunnei2021-05-051-5/+0
| | | | evaluate as constant on MSVC.
* common: Rename NON_COPYABLE/NON_MOVABLE with YUZU_ prefix.Gravatar bunnei2021-05-051-2/+2
|
* common: common_funcs: Add Size helper function.Gravatar bunnei2021-05-051-0/+15
|
* common: bit_util: Add BIT macro.Gravatar bunnei2021-05-051-0/+2
|
* common: intrusive_red_black_tree: Disable static_assert that will not ↵Gravatar bunnei2021-05-051-0/+4
| | | | evaluate as constant on MSVC.
* common: common_funcs: Add helper macros for non-copyable and non-moveable.Gravatar bunnei2021-05-051-0/+8
| | | | - Useful for scenarios where we do not want to inherit from NonCopyable.
* log/backend: Use in-class initializer for FileBackendGravatar Lioncash2021-04-202-6/+8
| | | | We can also avoid redundant constructions of the same string repeatedly.
* log/backend: Make use of erase_ifGravatar Lioncash2021-04-201-4/+4
| | | | Same behavior, but less verbose.
* Merge pull request #6199 from lioncash/log-nsGravatar bunnei2021-04-147-35/+44
|\ | | | | common/log: Move Log namespace into the Common namespace
| * log/backend: Correct order of const in copy constructorGravatar Lioncash2021-04-141-2/+5
| | | | | | | | | | Follows our predominant coding style. Also explicitly specifies the move constructor/assignment operator as well.
| * common/log: Move Log namespace into the Common namespaceGravatar Lioncash2021-04-147-33/+39
| | | | | | | | | | Forgot to move this over when I moved the rest of the source files with lacking namespaces over.
* | common: Move settings to common from core.Gravatar bunnei2021-04-147-2/+830
| | | | | | | | - Removes a dependency on core and input_common from common.
* | core: settings: Add setting for debug assertions and disable by default.Gravatar bunnei2021-04-141-2/+5
| | | | | | | | | | | | - This is a developer-only setting and no longer needs to be enabled by default. - Also adds "use_auto_stub" setting to SDL frontend while we are here. - Supersedes #1340.
* | nvidia_flags: Add missing header guardGravatar Lioncash2021-04-121-0/+2
|/ | | | Prevents potential inclusion compilation errors.
* Merge pull request #6099 from bunnei/derive-memGravatar bunnei2021-04-102-0/+44
|\ | | | | Kernel Rework: Derive memory regions from board layout.
| * common: common_sizes: Move sizes to the Common namespace.Gravatar bunnei2021-03-231-0/+4
| |
| * common: common_sizes: Move Invalid to Size_* prefix and add missing values.Gravatar bunnei2021-03-211-1/+7
| |
| * hle: kernel: board: k_system_control: Extend to include memory region sizes.Gravatar bunnei2021-03-211-0/+10
| |
| * common: Move common sizes to their own header for code reuse.Gravatar bunnei2021-03-212-0/+24
| |
* | Merge pull request #6162 from degasus/no_spin_loopsGravatar bunnei2021-04-091-1/+9
|\ \ | | | | | | video_core: Avoid spin loops.
| * | common/threadsafe_queue: Provide Wait() method.Gravatar Markus Wick2021-04-071-1/+9
| | | | | | | | | | | | | | | | | | | | | It shall block until there is something to consume in the queue. And use it for the GPU emulation instead of the spin loop. This is only in booting the emulator, however in BOTW this is the case for about 1 second.
* | | bgtc: Update to 12.x and implement OpenTaskServiceGravatar Morph2021-04-092-0/+2
|/ /
* / common: Move assert failure handling into a cpp file.Gravatar Markus Wick2021-04-043-6/+20
|/ | | | | | | | | | Advantage: Altering the handler does not need a full recompilation. Disadvantage: noreturn is droped, so the caller is a bit slower. We quite often run yuzu with a YOLO assertion handler. In fact, only very few games run at all with asserts. This patch allows developers to patch the handler without recompiling everything. The overhead of the missing "noreturn" attribute shoul be negletable.
* fiber: Double default stack sizeGravatar MerryMage2021-03-101-1/+1
| | | | Stack overflow occurs with some guest applications
* common: Fiber: use a reference for YieldTo.Gravatar bunnei2021-03-072-8/+6
| | | | - Fixes another small leak.
* common: fiber: Use weak_ptr when yielding.Gravatar bunnei2021-03-052-8/+13
| | | | | - Avoids a memory leak, as taking a strong reference of the fiber here causes a circular reference. - Supersedes #6006 with a more narrow fix.
* Revert "core: Switch to unique_ptr for usage of Common::Fiber."Gravatar bunnei2021-03-052-9/+9
|
* Merge pull request #6006 from bunnei/fiber-unique-ptrGravatar bunnei2021-03-042-9/+9
|\ | | | | core: Switch to unique_ptr for usage of Common::Fiber.
| * core: Switch to unique_ptr for usage of Common::Fiber.Gravatar bunnei2021-02-272-9/+9
| | | | | | | | | | - With using unique_ptr instead of shared_ptr, we have more explicit ownership of the context. - Fixes a memory leak due to circular reference of the shared pointer.
* | [network] Error handling reformGravatar comex2021-02-282-16/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `network.cpp` has several error paths which either: - report "Unhandled host socket error=n" and return `SUCCESS`, or - switch on a few possible errors, log them, and translate them to Errno; the same switch statement is copied and pasted in multiple places in the code Convert these paths to use a helper function `GetAndLogLastError`, which is roughly the equivalent of one of the switch statements, but: - handling more cases (both ones that were already in `Errno`, and a few more I added), and - using OS functions to convert the error to a string when logging, so it'll describe the error even if it's not one of the ones in the switch statement. - To handle this, refactor the logic in `GetLastErrorMsg` to expose a new function `NativeErrorToString` which takes the error number explicitly as an argument. And improve the Windows version a bit. Also, add a test which exercises two random error paths.
* | Merge pull request #5984 from jbeich/gcc-freebsdGravatar bunnei2021-02-271-0/+1
|\ \ | |/ |/| common,video-core: unbreak GCC 11 build on FreeBSD 13
| * common: add missing header after f3805376f726Gravatar Jan Beich2021-02-231-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In file included from src/video_core/dma_pusher.cpp:5: src/./common/cityhash.h:69:47: error: 'size_t' has not been declared 69 | [[nodiscard]] u64 CityHash64(const char* buf, size_t len); | ^~~~~~ src/./common/cityhash.h:73:55: error: 'size_t' has not been declared 73 | [[nodiscard]] u64 CityHash64WithSeed(const char* buf, size_t len, u64 seed); | ^~~~~~ src/./common/cityhash.h:77:56: error: 'size_t' has not been declared 77 | [[nodiscard]] u64 CityHash64WithSeeds(const char* buf, size_t len, u64 seed0, u64 seed1); | ^~~~~~ src/./common/cityhash.h:80:47: error: 'size_t' has not been declared 80 | [[nodiscard]] u128 CityHash128(const char* s, size_t len); | ^~~~~~ src/./common/cityhash.h:84:55: error: 'size_t' has not been declared 84 | [[nodiscard]] u128 CityHash128WithSeed(const char* s, size_t len, u128 seed); | ^~~~~~