Weiyi Wang
a753b9c6cc
Merge pull request #4228 from NarcolepticK/lle-mapped-buffer
...
LLE Mapped Buffer: Add unmapping of write buffer, zero-size, and multiple page handling
2018-10-30 19:18:11 -04:00
Weiyi Wang
445538c2cf
Merge pull request #4371 from wwylele/kernel-global-3
...
Kernel: eliminate global state for threads and timers
2018-10-30 00:36:10 -04:00
NarcolepticK
c97146226a
LLE Mapped Buffer: Addressed comments.
2018-10-29 18:35:34 -04:00
Weiyi Wang
f63098ccdf
Kernel/CodeSet: change struct to class
...
Fix a warning where class definition and forward declaration mismatch. CodeSet is a kernel object and have ctor/dtor/private members like others, so in convention it should be a class
2018-10-28 10:35:40 -04:00
Weiyi Wang
e5b93741d3
kernel/timer: add TimerManager for timer system states
2018-10-26 16:07:45 -04:00
Weiyi Wang
20ae37ba4f
kernel/Thread: move thread list into the manager
2018-10-26 16:07:45 -04:00
Weiyi Wang
7fc61920cc
kernel/Thread: move thread wake up table and callback handle into the manager
2018-10-26 16:07:45 -04:00
Weiyi Wang
0478bc3dee
Kernel/Thread: move thread queue, current thread, and scheduling related function into the manager
...
As we touched it, remove IPC::GetCommandBuffer
2018-10-26 16:07:11 -04:00
Weiyi Wang
876729ab52
kernel/thread: move next_thread_id into manager
2018-10-26 16:07:11 -04:00
Weiyi Wang
34f1fe088c
kernel/thread: add ThreadManager
2018-10-26 16:07:11 -04:00
Weiyi Wang
8ad6cbfde2
kernel/thread: change owner_process parameter to reference
...
To enforce a valid process object
2018-10-26 09:37:46 -04:00
Weiyi Wang
e5c5d1ecce
Kernel: change owner_process in Thread/SharedMemory to raw pointer
...
Otherwise circular ownership would form in Process->handle_table->thread->owner_process
2018-10-25 19:54:06 -04:00
Weiyi Wang
8d32843d68
thread/kernel: remove unused callback_id
...
we use the thread id for the same purpose now
2018-10-23 10:06:32 -04:00
Weiyi Wang
eb285c33fd
kernel: make handle table per-process
2018-10-22 21:32:34 -04:00
Weiyi Wang
fda2a5cf54
kernel/thread: use std::unordered_map for callback record
2018-10-22 21:32:34 -04:00
Weiyi Wang
5b45a3e1b5
Kernel/Timer: use unordered_map for callback recording
2018-10-22 21:32:34 -04:00
Weiyi Wang
8fb3d8ff38
kernel/process: move current process to kernel instance
...
Two functional change:
QueryProcessMemory uses the process passed from handle instead current_process
Thread::Stop() uses TLS from owner_process instead of current_process
2018-10-22 21:32:34 -04:00
Weiyi Wang
d9342622b0
kennel/process: move process list to kernel instance
2018-10-22 21:32:34 -04:00
Weiyi Wang
4238754d8c
kernel/process: move next_process_id to kernel instance
2018-10-22 09:30:48 -04:00
Lioncash
930abb4b5e
svc: Correct vma_map boundary check within QueryProcessMemory
...
This should be using the process instance retrieved within the function,
and not g_current_process, otherwise this is potentially comparing
iterators from unrelated vma_map instances (which is undefined
behavior).
2018-10-21 22:00:12 -04:00
Weiyi Wang
751ebe55e9
Kernel: pass ref down to Object and wrap ID counter into kernel state
2018-10-18 21:41:36 -04:00
Weiyi Wang
87426b29ff
kernel: pass ref to shared memory
2018-10-18 21:41:36 -04:00
Weiyi Wang
2a411bb501
Kernel: wrap resource limit state into kernel state; pass ref to resource limit
2018-10-18 21:41:36 -04:00
Weiyi Wang
13c26b4371
Kernel: pass ref to session pair
2018-10-18 21:41:36 -04:00
Weiyi Wang
1213a298df
Kernel: pass ref to port
2018-10-18 21:41:36 -04:00
Weiyi Wang
c141657d83
Kernel: pass ref to timer
2018-10-18 21:41:36 -04:00
Weiyi Wang
247249d5d3
Kernel: pass ref to sempahore
2018-10-18 21:41:36 -04:00
Weiyi Wang
d940293d32
Kernel: pass ref to thread
2018-10-18 21:41:36 -04:00
Weiyi Wang
9565091fc2
kernel: pass ref in Process
2018-10-18 21:41:36 -04:00
Weiyi Wang
213b259cf1
kernel: pass ref in CodeSet
2018-10-18 21:41:36 -04:00
Weiyi Wang
7449ba85a6
Kernel: pass ref in Mutex
2018-10-18 21:41:36 -04:00
Weiyi Wang
eec11a94cb
Kernel: pass Kernel ref in Event
2018-10-18 21:41:36 -04:00
Weiyi Wang
734be98966
Kernel: pass Kernel reference into AddressArbiter
2018-10-18 21:41:00 -04:00
Weiyi Wang
f446fd1fe5
Kernel: add KernelSystem class
2018-10-18 21:41:00 -04:00
B3n30
2306af3600
Handle cases when std::optional does not contain a value
2018-10-05 16:51:33 +02:00
B3n30
d37a2270d6
Replace boost::optional with std::optional where possible
2018-10-05 13:51:09 +02:00
B3n30
544eb25c99
fixup! Give frontend access to the hle service interfaces
2018-10-03 20:08:01 +02:00
B3n30
d3694a930e
Give frontend access to the hle service interfaces
2018-10-03 19:44:23 +02:00
NarcolepticK
32aecd42a2
LLE Mapped Buffer: Corrected behavior
2018-10-01 21:07:25 -04:00
NarcolepticK
51d53a6281
LLE Mapped Buffer: addressed comments
2018-09-30 23:23:21 -04:00
NarcolepticK
19291ba465
LLE Mapped Buffer: Add unmapping, zero-size, and multiple page handling
2018-09-30 22:34:13 -04:00
Lioncash
d64094a0d2
kernel/object: Remove unnecessary std::move from DynamicObjectCast()
...
boost::static_pointer_cast for boost::intrusive_ptr (what SharedPtr is),
takes its parameter by const reference. Given that, it means that this
std::move doesn't actually do anything other than obscure what the
function's actual behavior is, so we can remove this. To clarify, this
would only do something if the parameter was either taking its argument
by value, by non-const ref, or by rvalue-reference.
2018-09-29 23:14:10 +02:00
Weiyi Wang
f05740a5fd
Merge pull request #4224 from FearlessTobi/port-1310
...
Port #734 and #1310 from yuzu: Changes to Thread-related enums
2018-09-25 23:07:43 -04:00
fearlessTobi
3ee9f669c1
Address review comments
2018-09-21 16:39:10 +02:00
Lioncash
5ddd382a9b
kernel/svc: Do nothing if svcOutputDebugString's length is <= 0
...
While likely very uncommon, this sanitizes the input and does nothing in
the event of the length being equal to or less than zero, avoiding
constructing a std::string when there's no need to. It also avoids an
out-of-memory scenario, as a negative value would wrap around to its
equivalent unsigned representation in std::string's constructor.
e.g. If someone was silly and a length of -1 was specified, this would
make a string with a length of 0xFFFFFFFFFFFFFFFF on a 64-bit platform,
which will obviously eventually fail due to the allocation being way too
large.
2018-09-17 19:52:53 -04:00
Lioncash
ca3d9d659e
kernel/thread: Include thread-related enums within the kernel namespace
...
Previously, these were sitting outside of the Kernel namespace, which
doesn't really make sense, given they're related to the Thread class
which is within the Kernel namespace.
2018-09-15 17:16:20 +02:00
Lioncash
5dfa7b74b5
thread: Convert ThreadStatus into an enum class
...
Makes the thread status strongly typed, so implicit conversions can't
happen. It also makes it easier to catch mistakes at compile time.
2018-09-15 17:02:44 +02:00
Valentin Vanelslande
5c4da2d218
svc: change unknown to thread in CreateThread
2018-09-08 07:40:24 -05:00
Weiyi Wang
7d8f115185
Prefix all size_t with std::
...
done automatically by executing regex replace `([^:0-9a-zA-Z_])size_t([^0-9a-zA-Z_])` -> `$1std::size_t$2`
2018-09-06 16:03:28 -04:00
fearlessTobi
cf8b1726df
Address review comments
2018-09-06 00:00:21 +02:00