Commit Graph

5673 Commits

Author SHA1 Message Date
gibbed 75a78c45c4 More xb.bat fixes.
- Properly check if candidate path exists.
- Quote python path when invoking.
2019-08-18 09:35:11 -05:00
Triang3l 56b168216d
Merge pull request #1441 from Triang3l/dcb-instructions
[CPU] Data cache control instructions
2019-08-18 16:43:46 +03:00
Triang3l bc4b68db45 [CPU] Data cache control instructions 2019-08-18 16:22:32 +03:00
gibbed c19dc9c7d6 Prefer vsdevcmd over vcvarsall. 2019-08-17 08:32:20 -05:00
gibbed 1ebc13df94 Oops. Call set after vsdevcmd. 2019-08-17 08:32:20 -05:00
gibbed 7b0367da5f Overhaul finding Python in xb.bat.
- Checks hardcoded paths first, then checks for results of 'where python3' and
  'where python'.
- Checks if these files and have a size larger than 0 (fixes Windows 10 issue).
2019-08-17 08:07:02 -05:00
gibbed 745d5609e6 Add hardcoded path for Python 3.7 to xb.bat Python check. 2019-08-17 08:07:02 -05:00
gibbed c3c77187bb Fix an issue in git-clang-format that exists with Python 3.4. Issue resolved on its own by Python 3.7 (unknown when it's actually resolved) but still good to have this fix. 2019-08-17 08:05:03 -05:00
Triang3l b25c50164f [APU] Physical address in XE_XMA_REG_CONTEXT_ARRAY_ADDRESS 2019-08-16 21:20:10 +03:00
Triang3l e35c609224 Revert "[APU] Temp XMA context allocation region workaround"
This reverts commit 968c337d22.
2019-08-16 21:11:55 +03:00
Triang3l 968c337d22 [APU] Temp XMA context allocation region workaround 2019-08-16 09:47:28 +03:00
Triang3l 0faafd738a [Docs] Update 0xE0000000 range info 2019-08-16 09:26:34 +03:00
Triang3l 126978d960 [Memory] Fix memory watch addresses 2019-08-16 08:49:48 +03:00
Triang3l 834ced0d63 [Memory] 0xE0000000: Fix a typo, re-enable and cleanup 2019-08-15 23:55:33 +03:00
Doug Johnson d8eb24f495 base: clock_posix: Fix implementation to match windows semantics 2019-08-15 08:33:36 -04:00
Sandy Carter ac78acbea1 [debugging linux] Implement functions
Check TracerPid in /proc/self/status for attached debugger.
Add SIGTRAP handler to prevent signal from halting app while not running
in a debugger.
Log DebugPrint in clog (stderr).
2019-08-15 08:30:38 -04:00
Triang3l e862169156 [Memory] BaseHeap::TranslateRelative including host address offset 2019-08-15 00:31:21 +03:00
Triang3l 0451153760 [Memory] Temporarily disable allocation in 0xE0000000 2019-08-15 00:06:27 +03:00
gibbed 6ab7720951 [Kernel] Fix stray whitespace in license_mask definition. 2019-08-14 14:15:56 -05:00
Triang3l 003c02c640 [CPU, Memory] 0xE0000000 adjustment by @elad335 and mapping 2019-08-14 21:37:52 +03:00
illusion98 c021c7741d [Kernel] Add license mask as a config variable 2019-08-14 10:25:24 -05:00
Sandy Carter 3c3709dbe7 [CPU] Use c++ style cast 2019-08-14 06:42:30 -05:00
Doug Johnson 959ad9f0cc base: main_posix: Print build version and date, like the windows main 2019-08-14 07:07:35 -04:00
Doug Johnson e092c8c187 base: logging: Add Linux support, add stderr output support 2019-08-14 07:07:35 -04:00
Sandy Carter 2970b84bc1 [string] Remove reuse of va_list in AppendVarargs
va_list are not guarenteed to maintain their values after being used.
With clang on Linux, args is undefined after fetching length and will print
"(null)".
Copy args into another va_list before getting length to prevent this.
Add tests.
2019-08-14 07:07:35 -04:00
Sandy Carter 6cde4f9e12 [logging] Fix log folder creation from same directory
Expand find_base_path to support unix-style and local files.
Remove trailing path separators from find_base_path output.
Fix cases of local files such as `find_base_path("local_file")`
Fix logger creating directories such as xenia.log/ when run from a local
directory such as with ./build/bin/xenia under linux creating a directory
called xenia.log/ and then being unable to create a log of the same name.

Add tests to validate find_base_path.
2019-08-14 07:07:35 -04:00
Sandy Carter 738eb65643 [string] Combine string and wstring in template
Merge kPathSeparator and kWPathSeparator to template variable.
Generalize /, and \ in kAllPathSeparators.
2019-08-14 07:07:35 -04:00
Sandy Carter 221c9739cb [string] Add base string tests 2019-08-14 07:07:35 -04:00
Triang3l 2507f1a819 [Memory] TranslateVirtual in shim and strings 2019-08-14 10:31:11 +03:00
Triang3l 0067f5561d [Kernel] More TranslateVirtual/HostToGuestVirtual usage 2019-08-14 08:28:30 +03:00
Triang3l 2152c79965 [Memory] 0xE… adjustment in TranslateVirtual 2019-08-14 00:07:27 +03:00
Sandy Carter 02c17f086e [threading linux] Implement native_handle
Move wait implementation to not use native_handle.
Implement native_handle for each primitive using posix natives.
2019-08-13 16:50:28 -04:00
Sandy Carter 24d210f07f [threading linux] Implement suspend count
Add suspend count to thread implementation.
Increment suspend count on suspend and decrement on resume.
Wait on suspend count to be decremented to 0.
Return suspend count on suspend and on resume before incr/decr.
Fix naming of resume suspend count to make clear that suspend count is
before incr/decr.
Add test.
2019-08-13 16:50:28 -04:00
Sandy Carter 49f8a519af [threading] Change thread names to suit pthread
Shorten names to 16.
Rename Win32 to Windowing.
Shorten GraphicsSystem thread names due to 16 length limit of pthread.
Without this change, both show up as GraphicsSystem.
Remove redundant "Worker" and "Thread" from names.
Remove redundant thread handle from thread name.
2019-08-13 16:50:28 -04:00
Sandy Carter 5575bd9b6f [threads linux] Free and signal suspended threads
Give other threads access to initially suspended threads by signalling
conditional variable before waiting for state to be changed again.
2019-08-13 16:50:28 -04:00
Sandy Carter d1b3c858e9 [threading linux] Implement Signal and Wait
Add Signal abstract function to handles.
Test SignalAndWait.
2019-08-13 16:50:28 -04:00
Sandy Carter 1ac9ac7cab [threading] Add complex wait on multiple test 2019-08-13 16:50:28 -04:00
Sandy Carter e2bf48ac1d [threading linux] Implement TLS
Implement TLSHandle with pthread_key_t.

Test Alloc, Free, Get and Set.
2019-08-13 16:50:28 -04:00
Sandy Carter 41ba1eb1c1 [threading linux] Implement Callback Queuing
Add thread local bool for alertable state.
Use real-time event interrupt to run callback.
Fix sleep duration from miliseconds (microseconds / 1000) to seconds in sleep
command.
Add note for future implementation.

Ignore real-time event 37 in .gdbinit which is used to signal callback.

Test AlertableSleep
Test Thread QueueUserCallback.
TODO: Test alerted wait result when using IO functions.
2019-08-13 16:50:28 -04:00
Sandy Carter 00f223e737 [threading linux] Implement suspendable pthreads
Use real-time event interrupt to communicate suspend in timely manner.
Use conditional_variable to implement suspend wait and resume trigger.

Ignore real-time event 36 in .gdbinit which is used to signal suspend.

Test suspending threads.
2019-08-13 16:50:28 -04:00
Sandy Carter c02f0e9219 [threading linux] Wait for thread start 2019-08-13 16:50:28 -04:00
Sandy Carter 82cbb11ff2 [threading linux] Implement basic Thread function
Add Basic Tests on Threads
2019-08-13 16:50:28 -04:00
Sandy Carter fb3533ec45 [threading linux] Implement Timer
Test Manual Reset and Synchronization timers single threaded.
Test Cancelling timers.
Test WaitMultiple.
Ignore real-time event 35 in .gdbinit which is used to signal timer.

Callbacks don't seem to be called so testing them is difficult.
2019-08-13 16:50:28 -04:00
Sandy Carter 996d629538 [threading linux] Implement Mutant
Keep track of recursive locks with owner and count of locks.
Only allow recursive locks from same thread and increment count.
Only allow first locks from when count is zero.

Test acquiring and releasing mutant on same and on different threads.
Test Release return values.
Test WaitAll and WaitAny.
2019-08-13 16:50:28 -04:00
Sandy Carter 01f1ca283f [threading linux] Implement Semaphore
Test acquiring and releasing semaphores on same and on different threads.
Test previous_count values.
Test WaitAll and WaitAny.

Add tests for invalid semaphore creation parameters but disactivated as
they do not pass on any platform. These should be enabled and the
implementations fixed to match documentation.
2019-08-13 16:50:28 -04:00
Sandy Carter 4289349654 [threading linux] Make PosixCondition base class
Add PosixConditionBase as base class for Waitables to use common
primitives mutex and conditional variable
Add abstract signaled() and post_execution() to use single WaitMultiple
implementation.
2019-08-13 16:50:28 -04:00
Sandy Carter fb505eaed1 [threading linux] Implement WaitMultiple
Make conditional_variable and mutex static and create generalisation of
Wait for vector of handles.
Use std::any for waitany and std::all for waitall
2019-08-13 16:50:28 -04:00
Sandy Carter 0f7b48618e [threading] Test WaitAll and WaitAny with Events 2019-08-13 16:50:26 -04:00
Triang3l 741b5ae2ec [Memory] Add HostToGuestVirtual and use it in a couple of places 2019-08-13 23:49:49 +03:00
Sandy Carter dedf7cb184 [threading linux] Implement Events
Remove file-descriptor specific wait implementation to PosixFdHandle class
which breaks on waits of non-fd handles.
Replace with PosixConditionHandle and extend to support auto reset and
initial values.
Simplify mutex and conditional variable use with stdlib versions which
wrap these primitives but provide better C++ interface.
Test Event and Reset
2019-08-13 16:49:48 -04:00