Commit Graph

397 Commits

Author SHA1 Message Date
emoose
2d9326e02d [Kernel] Implement XeCryptBnQwNeRsaPubCrypt via BCrypt (win32 only) 2021-01-03 14:38:01 -06:00
Triang3l
86ba17847b [Base] Hopefully fix Clang template inheritance error 2020-12-31 16:46:25 +03:00
Triang3l
ea9ee0d4ba [Kernel] Make HDTV gamma the default 2020-12-31 16:14:26 +03:00
Triang3l
37013ee352 [Config] CVar defauls versioning 2020-12-31 16:04:50 +03:00
Triang3l
36a0bcec8b [GPU] XXH3 hash instead of XXH64 2020-12-08 22:31:09 +03:00
gibbed
319699130a [XAM] Improvement rollup. Content, enumerators...
- [Kernel] Create guest object for XEnumerator.
- [XAM] Split content data into host/guest variants.
- [XAM] Correct message return type from RESULT to HRESULT.
- [XAM] Add a new dummy content device for ODD.
- [XAM] Implement XamContentAggregateCreateEnumerator.
- [XAM] Implement XamGetPrivateEnumStructureFromHandle.
- [XAM] Implement XMsgCompleteIORequest (sketchy).
- [XAM] Implement XamGetOverlappedResult (sketchy).
- [XAM] Implement XamTaskSchedule (sketchy).
2020-11-27 14:19:30 -06:00
gibbed
f8e6ac4108 Defer XAM UI functions & other improvements.
- [Kernel] Fix global locking in kernel dispatch thread.
- [Kernel] Improve CompleteOverlappedDeferred/CompleteOverlappedDeferredEx.
- [XAM] Identify unknowns in XamNotifyCreateListener/XNotifyListener.
- [XAM] Defer XamShowMessageBoxUI.
- [XAM] Defer XamShowKeyboardUI.
- [XAM] Fix cancel handling in XamShowKeyboardUI.
- [XAM] Defer XamShowDeviceSelectorUI.
- [XAM] Defer XamShowDirtyDiscErrorUI.
2020-11-27 05:15:17 -06:00
Triang3l
d353cade76 [Base] mapped_memory_win: more explicit invalid handle values 2020-11-24 22:49:56 +03:00
Triang3l
a73592c2ef [Memory/CPU] UWP: Support separate code execution and write memory, FromApp functions + other Windows memory fixes 2020-11-24 22:18:50 +03:00
Triang3l
2cb7d26d62 [Android] Add a comment about pthreads dynamic loading 2020-11-23 00:42:58 +03:00
Triang3l
63ff758049 [Threading] Android thread naming and other cleanup 2020-11-22 20:03:45 +03:00
Triang3l
aca23c08cf [Memory] Fix kFileMappingHandleInvalid typos in tests 2020-11-22 18:49:47 +03:00
Triang3l
a39266b71e [Threading] Android thread termination signal 2020-11-22 18:48:55 +03:00
Triang3l
0ebf073385 [Base] Affinity and yield to sched on Android 2020-11-22 16:56:04 +03:00
Triang3l
9ef7fb62d3 [Memory] Android memory mapping 2020-11-22 16:32:46 +03:00
Triang3l
ec507dc2f6 [Memory] Fix forgotten kFileMappingHandleInvalid 2020-11-22 14:34:09 +03:00
Triang3l
86ae42919d [Memory] Close shared memory FD and properly handle its invalid value 2020-11-22 14:17:37 +03:00
Sandy Carter
49e194009b [memory linux] Properly unlink shared memory
shm_unlink(name) is the proper way to close a shared memory in linux.
Prior to this, xenia was creating and not cleaning up shared memory handle
which would accumulate in /dev/shm. shm_unlink is the proper way of doing
this.
Add filename to CloseFileMappingHandle signature.
Add simple test to open and close.
2020-11-22 13:54:00 +03:00
Sandy Carter
2c7009ca80 [memory] Move "Local\\" prefix to win impl
CreateFileMappingHandle now takes shared memory name without a prefix.
The doc of shm_open recommends not using slashes and prefixing with "/".
The prefixing has been moved to the os implementation layer.
Invocations of CreateFileMappingHandle were all using "Local\\" so these
prefixes were removed.
2020-11-22 13:54:00 +03:00
Sandy Carter
22ef265057 [memory] Add Memory mapping view tests
Add test for mapping and for mapping with access.
2020-11-22 13:54:00 +03:00
uytvbn
962b90f699 [Linux] Implement virtual memory allocation 2020-11-22 13:54:00 +03:00
Sandy Carter
5fa59fc4a9 threading_posix: don't delete thread_local thread object
Disabling on exit thread delete as it causes an assert fail.
There isn't a leak here because current_thread_ is a thread_local static.
2020-11-21 22:30:43 -06:00
Sandy Carter
aa332dcc8e threading_posix: Increase stack size in test
16 KB is not enough for the linux thread to be spawned so bump up to 16MB
2020-11-21 22:30:43 -06:00
Triang3l
9f45a1f338 [Base] Use bswap_16/32/64 from byteswap.h on Linux 2020-11-21 23:54:20 +03:00
Triang3l
48c97dd3b4 [Base] Android and Arm platform defines 2020-11-21 16:26:26 +03:00
Satori
52230fd4e8 [Base] Fix FileLogSink not writing to log file 2020-11-16 14:04:17 -06:00
Satori
b74eac36c7 [Base] Log to stdout by default 2020-11-16 01:52:27 -06:00
Satori
446837edb1 [Base/Win] Add cvars to enable a console window to be shown with xenia 2020-11-16 01:52:27 -06:00
Satori
42b10209fe [Base] Add support for multiple log sinks in Logger 2020-11-16 01:52:27 -06:00
Sandy
36466231d0 threading test: zero initialize counter
The high performance test atomic counters need to be set to zero to have reliable results.
2020-11-16 00:13:14 -06:00
gibbed
362251df0b [Base] Fix dangling pointer in LaunchWebBrowser.
[Base] Fix dangling pointer in LaunchWebBrowser. Fixes #1614.
2020-11-15 14:36:13 -06:00
Triang3l
91d5ba444a [Base/Kernel] Add and use truncating null-terminating string copying 2020-11-15 11:27:59 -06:00
Joel Linn
68cf47e245 [threading] Fix Fence for multiple waiting threads 2020-11-15 11:12:05 -06:00
Sandy Carter
d7094fae52 [threading linux] Implement native_handle
Move wait implementation to not use native_handle.
Implement native_handle for each primitive using posix natives.
2020-11-15 11:12:05 -06:00
Sandy Carter
e945a13957 [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.
2020-11-15 11:12:05 -06:00
Sandy Carter
382dd8860f [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.
2020-11-15 11:12:05 -06:00
Sandy Carter
a503b6222f [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.
2020-11-15 11:12:05 -06:00
Sandy Carter
e11fa0372d [threading linux] Implement Signal and Wait
Add Signal abstract function to handles.
Test SignalAndWait.
2020-11-15 11:12:05 -06:00
Sandy Carter
cb905fb195 [threading] Add complex wait on multiple test 2020-11-15 11:12:05 -06:00
Sandy Carter
e9e269622b [threading linux] Implement TLS
Implement TLSHandle with pthread_key_t.

Test Alloc, Free, Get and Set.
2020-11-15 11:12:05 -06:00
Sandy Carter
634f87f63b [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.
2020-11-15 11:12:05 -06:00
Sandy Carter
4397f25325 [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.
2020-11-15 11:12:05 -06:00
Sandy Carter
b2912e7891 [threading linux] Wait for thread start 2020-11-15 11:12:05 -06:00
Sandy Carter
b91203a0b5 [threading linux] Implement basic Thread function
Add Basic Tests on Threads
2020-11-15 11:12:05 -06:00
Sandy Carter
c2de074d5c [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.
2020-11-15 11:12:05 -06:00
Sandy Carter
331bb0ea9a [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.
2020-11-15 11:12:05 -06:00
Sandy Carter
5d0efedaf4 [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.
2020-11-15 11:12:05 -06:00
Sandy Carter
75d54e2fa2 [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.
2020-11-15 11:12:05 -06:00
Sandy Carter
6e13a38cad [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
2020-11-15 11:12:05 -06:00
Sandy Carter
4ce9eddfb9 [threading] Test WaitAll and WaitAny with Events 2020-11-15 11:12:05 -06:00