summaryrefslogtreecommitdiff
path: root/src/common
AgeCommit message (Collapse)Author
2025-02-08common: improve host memory mapping validationZephyron
- Add maximum memory size limit of 512GB (Overkill) - Implement additional safety checks for memory mapping: * Validate non-zero addresses * Verify address alignment * Add length validation against maximum size - Remove redundant assertion for host_offset alignment - Remove potentially problematic mapping verification - Improve error logging for invalid mapping attempts These changes enhance memory safety by adding proper bounds checking and validation before performing memory mappings, while removing a potentially problematic post-mapping verification step.
2025-02-02vulkan: Fix parameter naming consistency for Android compilationZephyron
Renames 'size' parameter to 'length' in IsValidMapping() methods to avoid conflicts with Android NDK macros that define 'size'. This fixes compilation issues on Android platforms where the 'size' macro is defined.
2025-02-01common/nvdrv: improve memory validation and error handlingZephyron
Implements several improvements to memory handling and validation: - host_memory: Add IsValidMapping() and IsDirectMappingEnabled() methods to validate memory access - host_memory: Fix virtual base offset calculation to use proper pointer arithmetic - host_memory: Add size field to track allocation size - nvhost_ctrl_gpu: Return InvalidState instead of InvalidValue for TPC mask buffer size validation - Update copyright year for citron The changes improve memory safety by adding explicit validation checks and fixing pointer arithmetic in the virtual memory implementation.
2025-02-01common: add missing <memory> include in common_types.hZephyron
Adds missing <memory> header include in common_types.h. This header is needed for std::unique_ptr and other smart pointer types that may be used by code including this header.
2025-02-01nvdrv: Add GetTpcMasks2 support and improve memory mapping validationZephyron
This commit makes two main changes: 1. Adds support for GetTpcMasks2 (ioctl 0x13) in nvhost_ctrl_gpu: - Implements new GetTpcMasks2 method to handle TPC mask queries - Adds IoctlGetTpcMasks structure to store mask parameters - Returns conservative single TPC configuration for compatibility 2. Enhances memory mapping validation in HostMemory: - Adds verification check after memory mapping operations - Improves error handling for direct mapped address enabling - Adds logging for mapping and direct address failures Additional changes: - Updates copyright headers to include citron Emulator Project - Improves error handling and validation in several paths - Adds debug logging for TPC mask operations This improves GPU virtualization support and memory mapping reliability.
2025-02-01string_util: Replace deprecated wstring_convert with direct UTF conversionsZephyron
Removes usage of std::wstring_convert and std::codecvt_utf8_utf16 which are deprecated since C++17. Implements direct UTF conversions for: - UTF16ToUTF8: Manual conversion with proper surrogate pair handling - UTF8ToUTF16: Direct conversion supporting full Unicode range - UTF8ToUTF32: New implementation with proper code point extraction The new implementations are more robust and handle edge cases better while avoiding deprecated functionality. Windows-specific code paths remain unchanged using the existing UTF16W conversions. This change improves maintainability and removes compiler warnings about deprecated features while maintaining full Unicode support.
2025-02-01common: Improve error handling in host memory managementZephyron
Add proper error handling and recovery mechanisms for memory mapping operations instead of using assertions.
2025-01-28ui: Update repository URLs to git.citron-emu.orgZephyron
Updates all GitHub repository URLs to point to the new self-hosted Git instance at git.citron-emu.org. This includes: - Links in the About dialog UI and translations - Android app string resources - Documentation/wiki links - Source code comments The website URL (citron-emu.org) and support links remain unchanged.
2025-01-14Revert incorrect copyright attribution for non-contributed filesZephyron
- In commit b3facaa6bb30cdc39f2b7d632fef1e3bfeee7785, the copyright header was updated to include "Citron Homebrew Project" across multiple files, regardless of whether any contributions were made. - This commit removes the incorrect attribution and reverts the copyright header to its previous state. - Copyright attribution should only be added when meaningful contributions have been made to the file. - This commit ensures proper compliance with copyright standards and maintains correct attribution to the respective contributors. - Special thanks to Tachi for pointing out the need for these corrections and ensuring that proper attribution practices are followed.
2025-01-06common: Use consistent cache line size in RingBufferZephyron
Replace hardcoded 128-byte alignment with a defined CACHE_LINE_SIZE constant of 64 bytes for the atomic indices in RingBuffer. This value is more appropriate for most modern CPU architectures and simplifies the implementation by using a consistent value regardless of compiler support for hardware_interference_size. Changes: - Add CACHE_LINE_SIZE constant set to 64 bytes - Use CACHE_LINE_SIZE for atomic index alignment in both code paths - Remove outdated TODO comment about hardware_destructive_interference_size
2025-01-04core: Add support for 10GB and 12GB memory configurationsZephyron
- Add Memory_10Gb and Memory_12Gb to MemoryLayout enum - Update memory layout settings to support up to 12GB - Add SMC enums for 10GB and 12GB memory sizes and arrangements - Increase MainMemorySizeMax from 8GB to 12GB - Add memory pool size calculations for 10GB and 12GB configurations - Update UI translations for new memory options
2025-01-02impl(Multiplayer): Switched API To Enable MultiplayerZephyron
2024-12-31core: Update copyright headersZephyron
- Update copyright headers to include Citron Homebrew Project - Add 2025 to copyright years
2024-12-31chore: update project references and add Citron copyrightZephyron
- Replaced all references to the old project name with Citron. - Added Citron copyright information alongside existing notices in all files.
2024-02-26Merge pull request #13159 from liamwhite/web-errorliamwhite
core: enable error applet, add stubs for web applet
2024-02-26settings: remove global override for smash on amdvlkLiam
2024-02-24settings: enable error appletLiam
2024-02-24common/ring_buffer: Include <limits> headerwheremyfoodat
2024-02-23Merge pull request #13100 from liamwhite/audio-ipcliamwhite
audio: move to new ipc
2024-02-22Merge pull request #13001 from liamwhite/scaled-availabilityNarr the Reg
vulkan_device: don't use fixed cap for memory limits
2024-02-20audio: rewrite IAudioDeviceLiam
2024-02-19scope_exit: Make constexprFearlessTobi
Allows the use of the macro in constexpr-contexts. Also avoids some potential problems when nesting braces inside it.
2024-02-18vulkan_device: don't use fixed cap for memory limitsLiam
2024-02-17android: Input mappingt895
2024-02-11Merge pull request #12756 from liamwhite/applet-multiprocess-hwcNarr the Reg
general: applet multiprocess
2024-02-09Merge pull request #12920 from t895/jni-commonliamwhite
android: Move JNI setup and helpers to common
2024-02-09general: add default configurations for applet modeLiam
2024-02-08common: fs: Expand android macrost895
2024-02-08android: Move JNI setup and helpers to commont895
2024-02-08Merge pull request #12914 from FernandoS27/vc-refactorliamwhite
VideoCore Refactor Part 1.
2024-02-05Common: Rename SplitRangeSet to OverlapRangeSetFernando Sahmkow
2024-02-05typed_address: test values are unsignedLiam
2024-02-05Buffer Cache: Refactor to use Range sets insteadFernando Sahmkow
2024-02-04Common: Introduce Range SetsFernando Sahmkow
2024-02-04VideoCore: Move Slot Vector to CommonFernando Sahmkow
2024-02-02service: fs: Skip non user id foldersNarr the Reg
2024-01-31Merge pull request #12869 from FernandoS27/smmu-fixesliamwhite
SMMU: A set of different fixes.
2024-01-31smmu: use new range mutex construction for protecting countersLiam
2024-01-31settings: Allow audio sink, input, and output to be set per gamet895
2024-01-29Merge pull request #12814 from Kelebek1/time_new_ipcliamwhite
Move time services to new IPC and add debug printing
2024-01-27atomic_ops: Fix MSVCMerry
2024-01-27atomic_ops: Remove volatile qualifierMerry
2024-01-27atomic_ops: Reduce code duplication with templatesMerry
Also fixes builds on unusual toolchains where: - u32 is unsigned int - u64 is unsigned long long - uintptr_t is unsigned long
2024-01-27Move time services to new IPC.Kelebek1
Add some fixes/improvements to usage with the new IPC
2024-01-25Address review comments and fix compilation problemsFearlessTobi
2024-01-25fs: Add path classFearlessTobi
2024-01-25Merge pull request #12499 from Kelebek1/timeliamwhite
Rework time services
2024-01-24Rework time service to fix time passing offline.Kelebek1
2024-01-22Merge pull request #12579 from FernandoS27/smmuliamwhite
Core: Implement Device Mapping & GPU SMMU
2024-01-20fs/file: Explicitly convert std::u8string to std::filesystem::pathMerry