Skip to content
Snippets Groups Projects
  1. Jan 01, 2020
  2. Nov 27, 2019
  3. Oct 06, 2019
    • Lioncash's avatar
      core: Remove Core::CurrentProcess() · f1382cf0
      Lioncash authored
      This only encourages the use of the global system instance (which will
      be phased out long-term). Instead, we use the direct system function
      call directly to remove the appealing but discouraged short-hand.
      f1382cf0
  4. Sep 19, 2019
  5. Jul 06, 2019
  6. Apr 12, 2019
    • Lioncash's avatar
      core/cpu_core_manager: Create threads separately from initialization. · f2331a80
      Lioncash authored
      Our initialization process is a little wonky than one would expect when
      it comes to code flow. We initialize the CPU last, as opposed to
      hardware, where the CPU obviously needs to be first, otherwise nothing
      else would work, and we have code that adds checks to get around this.
      
      For example, in the page table setting code, we check to see if the
      system is turned on before we even notify the CPU instances of a page
      table switch. This results in dead code (at the moment), because the
      only time a page table switch will occur is when the system is *not*
      running, preventing the emulated CPU instances from being notified of a
      page table switch in a convenient manner (technically the code path
      could be taken, but we don't emulate the process creation svc handlers
      yet).
      
      This moves the threads creation into its own member function of the core
      manager and restores a little order (and predictability) to our
      initialization process.
      
      Previously, in the multi-threaded cases, we'd kick off several threads
      before even the main kernel process was created and ready to execute (gross!).
      Now the initialization process is like so:
      
      Initialization:
        1. Timers
      
        2. CPU
      
        3. Kernel
      
        4. Filesystem stuff (kind of gross, but can be amended trivially)
      
        5. Applet stuff (ditto in terms of being kind of gross)
      
        6. Main process (will be moved into the loading step in a following
                         change)
      
        7. Telemetry (this should be initialized last in the future).
      
        8. Services (4 and 5 should ideally be alongside this).
      
        9. GDB (gross. Uses namespace scope state. Needs to be refactored into a
                class or booted altogether).
      
        10. Renderer
      
        11. GPU (will also have its threads created in a separate step in a
                 following change).
      
      Which... isn't *ideal* per-se, however getting rid of the wonky
      intertwining of CPU state initialization out of this mix gets rid of
      most of the footguns when it comes to our initialization process.
      f2331a80
  7. Apr 07, 2019
  8. Mar 21, 2019
  9. Mar 17, 2019
  10. Mar 16, 2019
  11. Mar 15, 2019
  12. Mar 07, 2019
  13. Mar 02, 2019
    • Weiyi Wang's avatar
      Memory: don't lock hle mutex in memory read/write · 5159f4ee
      Weiyi Wang authored
      The comment already invalidates itself: neither MMIO nor rasterizer cache belongsHLE kernel state. This mutex has a too large scope if MMIO or cache is included, which is prone to dead lock when multiple thread acquires these resource at the same time. If necessary, each MMIO component or rasterizer should have their own lock.
      5159f4ee
  14. Feb 27, 2019
  15. Dec 19, 2018
  16. Dec 06, 2018
    • Lioncash's avatar
      memory: Convert ASSERT into a DEBUG_ASSERT within GetPointerFromVMA() · 15e3d4f3
      Lioncash authored
      Given memory should always be expected to be valid during normal
      execution, this should be a debug assertion, rather than a check in
      regular builds.
      15e3d4f3
    • Lioncash's avatar
      vm_manager: Make vma_map private · d4c1b9d3
      Lioncash authored
      This was only ever public so that code could check whether or not a
      handle was valid or not. Instead of exposing the object directly and
      allowing external code to potentially mess with the map contents, we
      just provide a member function that allows checking whether or not a
      handle is valid.
      
      This makes all member variables of the VMManager class private except
      for the page table.
      d4c1b9d3
  17. Dec 05, 2018
  18. Oct 30, 2018
  19. Sep 30, 2018
    • Lioncash's avatar
      kernel/process: Make data member variables private · cf9d6c6f
      Lioncash authored
      Makes the public interface consistent in terms of how accesses are done
      on a process object. It also makes it slightly nicer to reason about the
      logic of the process class, as we don't want to expose everything to
      external code.
      cf9d6c6f
  20. Sep 25, 2018
    • Lioncash's avatar
      memory: Dehardcode the use of fixed memory range constants · 83377113
      Lioncash authored
      The locations of these can actually vary depending on the address space
      layout, so we shouldn't be using these when determining where to map
      memory or be using them as offsets for calculations. This keeps all the
      memory ranges flexible and malleable based off of the virtual memory
      manager instance state.
      83377113
    • Lioncash's avatar
      memory: Dehardcode the use of a 36-bit address space · 7fd59863
      Lioncash authored
      Given games can also request a 32-bit or 39-bit address space, we
      shouldn't be hardcoding the address space range as 36-bit.
      7fd59863
  21. Sep 15, 2018
  22. Aug 31, 2018
  23. Aug 28, 2018
    • Lioncash's avatar
      gpu: Make memory_manager private · 45fb74d2
      Lioncash authored
      Makes the class interface consistent and provides accessors for
      obtaining a reference to the memory manager instance.
      
      Given we also return references, this makes our more flimsy uses of
      const apparent, given const doesn't propagate through pointers in the
      way one would typically expect. This makes our mutable state more
      apparent in some places.
      45fb74d2
  24. Aug 04, 2018
    • Lioncash's avatar
      renderer_base: Make Rasterizer() return the rasterizer by reference · 2665457f
      Lioncash authored
      All calling code assumes that the rasterizer will be in a valid state,
      which is a totally fine assumption. The only way the rasterizer wouldn't
      be is if initialization is done incorrectly or fails, which is checked
      against in System::Init().
      2665457f
    • Lioncash's avatar
      video_core: Eliminate the g_renderer global variable · 6030c5ce
      Lioncash authored
      We move the initialization of the renderer to the core class, while
      keeping the creation of it and any other specifics in video_core. This
      way we can ensure that the renderer is initialized and doesn't give
      unfettered access to the renderer. This also makes dependencies on types
      more explicit.
      
      For example, the GPU class doesn't need to depend on the
      existence of a renderer, it only needs to care about whether or not it
      has a rasterizer, but since it was accessing the global variable, it was
      also making the renderer a part of its dependency chain. By adjusting
      the interface, we can get rid of this dependency.
      6030c5ce
  25. Aug 03, 2018
Loading