Skip to content
Snippets Groups Projects
  1. Oct 24, 2018
  2. Oct 23, 2018
  3. Oct 20, 2018
    • Lioncash's avatar
      kernel/process: Make the handle table per-process · 90a981a0
      Lioncash authored
      In the kernel, there isn't a singular handle table that everything gets
      tossed into or used, rather, each process gets its own handle table that
      it uses. This currently isn't an issue for us, since we only execute one
      process at the moment, but we may as well get this out of the way so
      it's not a headache later on.
      90a981a0
    • Lioncash's avatar
      svc: Fix vma boundary check in svcQueryMemory · 896c0f61
      Lioncash authored
      This should be comparing against the queried process' vma_map, not the
      current process'. The only reason this hasn't become an issue yet is we
      currently only handle one process being active at any time.
      896c0f61
  4. Oct 18, 2018
  5. Oct 15, 2018
    • Lioncash's avatar
    • Lioncash's avatar
      svc: Clarify enum values for AddressSpaceBaseAddr and AddressSpaceSize in svcGetInfo() · 90f8474f
      Lioncash authored
      So, one thing that's puzzled me is why the kernel seemed to *not* use
      the direct code address ranges in some cases for some service functions.
      For example, in svcMapMemory, the full address space width is compared
      against for validity, but for svcMapSharedMemory, it compares against
      0xFFE00000, 0xFF8000000, and 0x7FF8000000 as upper bounds, and uses
      either 0x200000 or 0x8000000 as the lower-bounds as the beginning of the
      compared range. Coincidentally, these exact same values are also used in
      svcGetInfo, and also when initializing the user address space, so this
      is actually retrieving the ASLR extents, not the extents of the address
      space in general.
      90f8474f
  6. Oct 14, 2018
    • David Marcec's avatar
      Stop all threads on svcBreak · 92fae7e1
      David Marcec authored
      This should help diagnose crashes easier and prevent many users thinking that a game is still running when in fact it's just an audio thread still running(this is typically not killed when svcBreak is hit since the game expects us to do this)
      92fae7e1
  7. Oct 13, 2018
    • Lioncash's avatar
      svc: Implement svcGetProcessInfo · 1c7a7ed7
      Lioncash authored
      A fairly basic service function, which only appears to currently support
      retrieving the process state. This also alters the ProcessStatus enum to
      contain all of the values that a kernel process seems to be able of
      reporting with regards to state.
      1c7a7ed7
  8. Oct 12, 2018
  9. Oct 11, 2018
    • Lioncash's avatar
      svc: Add missing address range sanitizing checks to MapMemory/UnmapMemory · 72e9cb52
      Lioncash authored
      This adds the missing address range checking that the service functions
      do before attempting to map or unmap memory. Given that both service
      functions perform the same set of checks in the same order, we can wrap
      these into a function and just call it from both functions, which
      deduplicates a little bit of code.
      72e9cb52
  10. Oct 10, 2018
  11. Oct 09, 2018
  12. Oct 04, 2018
    • Lioncash's avatar
      kernel/thread: Make all instance variables private · baed7e1f
      Lioncash authored
      Many of the member variables of the thread class aren't even used
      outside of the class itself, so there's no need to make those variables
      public. This change follows in the steps of the previous changes that
      made other kernel types' members private.
      
      The main motivation behind this is that the Thread class will likely
      change in the future as emulation becomes more accurate, and letting
      random bits of the emulator access data members of the Thread class
      directly makes it a pain to shuffle around and/or modify internals.
      Having all data members public like this also makes it difficult to
      reason about certain bits of behavior without first verifying what parts
      of the core actually use them.
      
      Everything being public also generally follows the tendency for changes
      to be introduced in completely different translation units that would
      otherwise be better introduced as an addition to the Thread class'
      public interface.
      baed7e1f
  13. Sep 30, 2018
    • Lioncash's avatar
      kernel/svc: Implement svcGetThreadContext() · 541c5507
      Lioncash authored
      Now that we have all of the rearranging and proper structure sizes in
      place, it's fairly trivial to implement svcGetThreadContext(). In the
      64-bit case we can more or less just write out the context as is, minus
      some minor value sanitizing. In the 32-bit case we'll need to clear out
      the registers that wouldn't normally be accessible from a 32-bit
      AArch32 exectuable (or process).
      541c5507
    • 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
  14. Sep 25, 2018
  15. Sep 24, 2018
  16. Sep 21, 2018
  17. Sep 18, 2018
    • Lioncash's avatar
      kernel/svc: Handle error cases for svcArbitrateLock() and svcArbitrateUnlock() · b6867602
      Lioncash authored
      The kernel does the equivalent of the following check before proceeding:
      
      if (address + 0x8000000000 < 0x7FFFE00000) {
          return ERR_INVALID_MEMORY_STATE;
      }
      
      which is essentially what our IsKernelVirtualAddress() function does. So
      we should also be checking for this.
      
      The kernel also checks if the given input addresses are 4-byte aligned,
      however our Mutex::TryAcquire() and Mutex::Release() functions already
      handle this, so we don't need to add code for this case.
      b6867602
  18. Sep 15, 2018
  19. Sep 14, 2018
  20. Sep 12, 2018
  21. Sep 02, 2018
Loading