Commit Graph
45 Commits
Author SHA1 Message Date
Stefanos Kornilios Mitsis Poiitidis 66a0293cdb Merge pull request #201 from Sonicadvance1/fix_file_flags
Fixes FD flags mismatch between x86 and ARM64
2020-05-26 12:52:26 +03:00
Ryan Houdek 7c8f7c732f Fixes some missing includes 2020-05-25 20:04:17 -07:00
Ryan Houdek 160da69c21 Fixes FD flags mismatch between x86 and ARM64
AArch64 redefines these four flags so they don't match between
architectures.
This is what was actually causing ls to fail, the x86 side was passing
in O_DIRECTORY which the AArch64 side was interpreting at O_DIRECT.
This made it return EINVAL
2020-05-26 02:44:11 +01:00
Stefanos Kornilios Mitsis Poiitidis f5d69722d7 Merge pull request #195 from Sonicadvance1/implement_get_rusage
Implements get_rusage syscall
2020-05-25 18:11:36 +03:00
Ryan Houdek 136a2e4291 Implements get_rusage syscall 2020-05-24 00:22:40 -07:00
Ryan Houdek a95d43fa37 Changes getcwd to use the syscall directly.
The glibc implementation and syscall implementation differ quite
significantly.
Just use the kernel interface one for now.
2020-05-24 00:21:51 -07:00
Ryan Houdek 10087f7757 Implements initial 32bit syscall support
This adds the initial 32bit syscalls for testing. No where near complete
2020-05-15 03:23:15 -07:00
Ryan Houdek d2cf07a4fd Passes the running mode through from FEX to FEXCore 2020-05-14 00:56:31 -07:00
Stefanos Kornilios Mitsis Poiitidis d58961ef1e Propagate guest exit code 2020-05-02 02:34:50 +03:00
Ryan Houdek 0d83454366 Merge pull request #170 from dmiller423/procfs_auxv
Added dup3 syscall, EmulatedFiles : /proc/{self,$PID}/auxv, modified …
2020-04-29 16:06:30 -07:00
David Miller 09f119a3ce removed front end header / class from EmulatedFiles.cpp 2020-04-29 16:39:40 -04:00
David Miller f916294772 Include unistd.h in EmulatedFiles.cpp as CI doesn't build 2020-04-29 16:04:39 -04:00
David Miller 306cca33d7 Added dup3 syscall, EmulatedFiles : /proc/{self,$PID}/auxv, modified OpenAt() to normalize path to canonical if possible or lexically_normal. Note: canonical will change symlinks, ensure the map keys take this into account. 2020-04-29 16:00:59 -04:00
Ryan Houdek 523562cc6d Merge pull request #153 from Sonicadvance1/more_syscalls3
Implements 9 new syscalls
2020-04-29 12:26:59 -07:00
Ryan Houdek fb88100a7e Merge pull request #152 from Sonicadvance1/implement_open_syscall
Implements the open syscall
2020-04-29 12:26:46 -07:00
Ryan Houdek a7e2198586 Merge pull request #151 from Sonicadvance1/fix_epoll_create
Fixes epoll_create syscall
2020-04-29 12:26:32 -07:00
Ryan Houdek 2f56c475e2 Fixes memory leak on shutdown for syscall handlers
Switches it over to a unique_ptr to ensure it doesn't happen again.
2020-04-26 18:15:52 -07:00
Ryan Houdek 52396227b7 Implements 9 new syscalls
Found these while running games and having upgraded from glibc 2.30 to
2.31
2020-04-24 19:40:10 -07:00
Ryan Houdek 726057c873 Implements the open syscall
Was only stubbed before, easy enough to pass it through
2020-04-24 19:11:14 -07:00
Ryan Houdek 3101e92bb4 Fixes epoll_create syscall
Accidently made it behave like epoll_create1. This caused some games to
throw asserts in terminal.
2020-04-24 19:08:29 -07:00
Ryan Houdek f6bdcbbdcf Merge pull request #129 from Sonicadvance1/more_syscalls2
Implements two more syscalls
2020-04-24 09:10:01 -07:00
Ryan Houdek 56759faff0 Merge pull request #122 from Sonicadvance1/fix_futexes
Fixes some bugs with threads and futexes
2020-04-18 12:35:56 -07:00
Ryan Houdek a901c3cb07 Implements two more syscalls 2020-04-18 11:55:32 -07:00
Ryan Houdek 2cac41ee1c Adds a bunch more syscalls
Some of these are just there to get us farther in some cases. They can
result in behaviour the app isn't expecting like when signals are setup
but not handled correctly.
Is fine for the cases that the app doesn't actually use them.
2020-04-17 15:19:09 -07:00
Ryan Houdek 902cae7ebc Fixes some bugs with threads and futexes
Fixing some bugs in threading required fixing how the futexes operate.
Instead of the terrible condition variables and atomic values just use
the kernel futex facility directly.
This required fixing some of the threading management since otherwise
there was a issue around the weird mixture of our threads using our
"Futex" class and the kernel expecting real futexes on the values.
Just switch everything over and it ends up being cleaner

Fixes random mutex failures that were happening in various applications
2020-04-15 11:58:26 -07:00
Ryan Houdek 46692d72c0 Adds new syscalls to the jump tables 2020-04-15 11:18:37 -07:00
Ryan Houdek 6471b6e833 Adds two new thread syscall functions
Adds getppid and kill

kill signals sent to emulator local threads may or may not behave as
expected until signals are implemented here
2020-04-15 11:16:14 -07:00
Ryan Houdek 565b8a6b54 Adds new FD syscall functions
flock, fsync, fdatasync, and fchmod
2020-04-15 11:14:23 -07:00
Ryan Houdek 12e8e63be7 Adds epoll_create syscall function 2020-04-15 11:13:36 -07:00
Stefanos Kornilios Mitsis Poiitidis 25d30597b5 Merge pull request #110 from Sonicadvance1/fix_clone_fork
Fixes clone syscall when VFORK flag is used
2020-04-13 09:51:48 +03:00
Stefanos Kornilios Mitsis Poiitidis 40c7da0b53 Merge pull request #109 from Sonicadvance1/fix_affinity_syscall
Fixes the getaffinity syscall
2020-04-13 09:50:46 +03:00
Stefanos Kornilios Mitsis Poiitidis 374e6f397c Merge pull request #108 from Sonicadvance1/mlock_syscall
Implements the mlock syscalls
2020-04-13 09:49:54 +03:00
Ryan Houdek 9233589ccc Fixes clone syscall when VFORK flag is used
The VFORK flag lets clone behaviour similarly to a fork.
The parent will be suspended until the resulting thread is exited
The mutex is removed because everything that touches state is already
wrapped by mutexes. So we don't need this one
2020-04-12 17:29:46 -07:00
Ryan Houdek 94b0ea4be3 Fixes the getaffinity syscall
This was implemented with the glibc API originally which was incorrect.
The syscall API is just a simple bitmask of for the affinity of the
number of CPU cores and a size check that the resulting structure is
large enough to store the number of bits.
2020-04-12 12:44:37 -07:00
Ryan Houdek 6f7573d726 Implements the mlock syscalls
Saw this when running Dolphin
2020-04-12 12:38:37 -07:00
Ryan Houdek 2ec41070da Ensure that anything opened with openat is tracked in our FD map
Missing this was an accident, this was how it was supposed to be.
It's very helpful to map FDs to filenames when tracking mmap mappings
2020-04-12 12:36:20 -07:00
Stefanos Kornilios Mitsis Poiitidis fec93ea573 Merge pull request #95 from FEX-Emu/skmp/block-cache-hotfix
BlockCache: Remove MemoryBase logic, check full address for match
2020-04-10 13:58:04 +03:00
Stefanos Kornilios Mitsis Poiitidis 937dbd811c BlockCache: Remove MemoryBase logic, check full address on aliased lookup 2020-04-10 13:50:09 +03:00
Ryan Houdek 044d7289b1 Implements personality syscall
Was seen in Reicast doing it for legacy reasons. Might as well as
support it.
2020-04-09 13:54:32 -07:00
Ryan Houdek 8c2beba584 Cleans up x86-64 syscall implementation
Splits out to a jump table approach and loosely classifies and groups
the syscalls.

Also defines syscalls by number of arguments so it can be optimized
2020-04-05 14:00:13 -07:00
Ryan Houdek b948be7ad8 Implements more syscalls that I found while running applications
Futex needs to be looked at seriously soon to see if we can just pass it
directly
2020-03-21 21:12:15 -07:00
Stefanos Kornilios Mitsis Poiitidis 8a1a3c222b Merge pull request #57 from Sonicadvance1/fix_futex
Fixes a couple bugs in the futex syscall
2020-03-21 09:30:51 +02:00
Ryan Houdek ca36fd4523 Fixes a couple bugs in the futex syscall
futex command 9 is actually WAIT_BITSET, not WAKE_BITSET
Implements futexes with timeouts as well, necessary for anything using
std::condition_variable and wait_for/wait_until
2020-03-20 17:32:37 -07:00
Ryan Houdek ea167cf7d9 Adds a few new syscalls that I saw in app testing
madvise, dup, bind, syslog, getresuid, get_mempolicy, newfstatat, execve

execve specifically returned error. We don't support it yet.
2020-03-20 12:30:08 -07:00
Stefanos Kornilios Mitsis Poiitidis e9ea4cbb76 FEXCore: Move to Externals/FEXCore 2020-03-06 09:07:37 +02:00