[Kernel] Rename NotifyListener to XNotifyListener to bring it in line with the naming scheme of kernel objects.
This commit is contained in:
parent
e38be4c294
commit
0d6bfc1a6b
|
@ -19,13 +19,13 @@
|
|||
#include "xenia/base/string.h"
|
||||
#include "xenia/cpu/processor.h"
|
||||
#include "xenia/emulator.h"
|
||||
#include "xenia/kernel/notify_listener.h"
|
||||
#include "xenia/kernel/user_module.h"
|
||||
#include "xenia/kernel/util/shim_utils.h"
|
||||
#include "xenia/kernel/xam/xam_module.h"
|
||||
#include "xenia/kernel/xboxkrnl/xboxkrnl_module.h"
|
||||
#include "xenia/kernel/xevent.h"
|
||||
#include "xenia/kernel/xmodule.h"
|
||||
#include "xenia/kernel/xnotifylistener.h"
|
||||
#include "xenia/kernel/xobject.h"
|
||||
#include "xenia/kernel/xthread.h"
|
||||
|
||||
|
@ -573,7 +573,7 @@ object_ref<XThread> KernelState::GetThreadByID(uint32_t thread_id) {
|
|||
return retain_object(thread);
|
||||
}
|
||||
|
||||
void KernelState::RegisterNotifyListener(NotifyListener* listener) {
|
||||
void KernelState::RegisterNotifyListener(XNotifyListener* listener) {
|
||||
auto global_lock = global_critical_region_.Acquire();
|
||||
notify_listeners_.push_back(retain_object(listener));
|
||||
|
||||
|
@ -597,7 +597,7 @@ void KernelState::RegisterNotifyListener(NotifyListener* listener) {
|
|||
}
|
||||
}
|
||||
|
||||
void KernelState::UnregisterNotifyListener(NotifyListener* listener) {
|
||||
void KernelState::UnregisterNotifyListener(XNotifyListener* listener) {
|
||||
auto global_lock = global_critical_region_.Acquire();
|
||||
for (auto it = notify_listeners_.begin(); it != notify_listeners_.end();
|
||||
++it) {
|
||||
|
|
|
@ -48,7 +48,7 @@ class Dispatcher;
|
|||
class XHostThread;
|
||||
class KernelModule;
|
||||
class XModule;
|
||||
class NotifyListener;
|
||||
class XNotifyListener;
|
||||
class XThread;
|
||||
class UserModule;
|
||||
|
||||
|
@ -158,8 +158,8 @@ class KernelState {
|
|||
void OnThreadExit(XThread* thread);
|
||||
object_ref<XThread> GetThreadByID(uint32_t thread_id);
|
||||
|
||||
void RegisterNotifyListener(NotifyListener* listener);
|
||||
void UnregisterNotifyListener(NotifyListener* listener);
|
||||
void RegisterNotifyListener(XNotifyListener* listener);
|
||||
void UnregisterNotifyListener(XNotifyListener* listener);
|
||||
void BroadcastNotification(XNotificationID id, uint32_t data);
|
||||
|
||||
util::NativeList* dpc_list() { return &dpc_list_; }
|
||||
|
@ -196,7 +196,7 @@ class KernelState {
|
|||
// Must be guarded by the global critical region.
|
||||
util::ObjectTable object_table_;
|
||||
std::unordered_map<uint32_t, XThread*> threads_by_id_;
|
||||
std::vector<object_ref<NotifyListener>> notify_listeners_;
|
||||
std::vector<object_ref<XNotifyListener>> notify_listeners_;
|
||||
bool has_notified_startup_ = false;
|
||||
|
||||
uint32_t process_type_ = X_PROCTYPE_USER;
|
||||
|
|
|
@ -9,9 +9,9 @@
|
|||
|
||||
#include "xenia/base/logging.h"
|
||||
#include "xenia/kernel/kernel_state.h"
|
||||
#include "xenia/kernel/notify_listener.h"
|
||||
#include "xenia/kernel/util/shim_utils.h"
|
||||
#include "xenia/kernel/xam/xam_private.h"
|
||||
#include "xenia/kernel/xnotifylistener.h"
|
||||
#include "xenia/xbox.h"
|
||||
|
||||
namespace xe {
|
||||
|
@ -23,7 +23,7 @@ dword_result_t XamNotifyCreateListenerInternal(qword_t mask, dword_t unk,
|
|||
// r4=1 may indicate user process?
|
||||
|
||||
auto listener =
|
||||
object_ref<NotifyListener>(new NotifyListener(kernel_state()));
|
||||
object_ref<XNotifyListener>(new XNotifyListener(kernel_state()));
|
||||
listener->Initialize(mask);
|
||||
|
||||
// Handle ref is incremented, so return that.
|
||||
|
@ -48,7 +48,7 @@ dword_result_t XNotifyGetNext(dword_t handle, dword_t match_id,
|
|||
|
||||
// Grab listener.
|
||||
auto listener =
|
||||
kernel_state()->object_table()->LookupObject<NotifyListener>(handle);
|
||||
kernel_state()->object_table()->LookupObject<XNotifyListener>(handle);
|
||||
if (!listener) {
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
******************************************************************************
|
||||
*/
|
||||
|
||||
#include "xenia/kernel/notify_listener.h"
|
||||
#include "xenia/kernel/xnotifylistener.h"
|
||||
|
||||
#include "xenia/base/byte_stream.h"
|
||||
#include "xenia/kernel/kernel_state.h"
|
||||
|
@ -15,12 +15,12 @@
|
|||
namespace xe {
|
||||
namespace kernel {
|
||||
|
||||
NotifyListener::NotifyListener(KernelState* kernel_state)
|
||||
XNotifyListener::XNotifyListener(KernelState* kernel_state)
|
||||
: XObject(kernel_state, kTypeNotifyListener) {}
|
||||
|
||||
NotifyListener::~NotifyListener() {}
|
||||
XNotifyListener::~XNotifyListener() {}
|
||||
|
||||
void NotifyListener::Initialize(uint64_t mask) {
|
||||
void XNotifyListener::Initialize(uint64_t mask) {
|
||||
assert_false(wait_handle_);
|
||||
|
||||
wait_handle_ = xe::threading::Event::CreateManualResetEvent(false);
|
||||
|
@ -29,7 +29,7 @@ void NotifyListener::Initialize(uint64_t mask) {
|
|||
kernel_state_->RegisterNotifyListener(this);
|
||||
}
|
||||
|
||||
void NotifyListener::EnqueueNotification(XNotificationID id, uint32_t data) {
|
||||
void XNotifyListener::EnqueueNotification(XNotificationID id, uint32_t data) {
|
||||
// Ignore if the notification doesn't match our mask.
|
||||
if ((mask_ & uint64_t(1ULL << (id >> 25))) == 0) {
|
||||
return;
|
||||
|
@ -47,8 +47,8 @@ void NotifyListener::EnqueueNotification(XNotificationID id, uint32_t data) {
|
|||
wait_handle_->Set();
|
||||
}
|
||||
|
||||
bool NotifyListener::DequeueNotification(XNotificationID* out_id,
|
||||
uint32_t* out_data) {
|
||||
bool XNotifyListener::DequeueNotification(XNotificationID* out_id,
|
||||
uint32_t* out_data) {
|
||||
auto global_lock = global_critical_region_.Acquire();
|
||||
bool dequeued = false;
|
||||
if (notification_count_) {
|
||||
|
@ -65,8 +65,8 @@ bool NotifyListener::DequeueNotification(XNotificationID* out_id,
|
|||
return dequeued;
|
||||
}
|
||||
|
||||
bool NotifyListener::DequeueNotification(XNotificationID id,
|
||||
uint32_t* out_data) {
|
||||
bool XNotifyListener::DequeueNotification(XNotificationID id,
|
||||
uint32_t* out_data) {
|
||||
auto global_lock = global_critical_region_.Acquire();
|
||||
bool dequeued = false;
|
||||
if (notification_count_) {
|
||||
|
@ -84,7 +84,7 @@ bool NotifyListener::DequeueNotification(XNotificationID id,
|
|||
return dequeued;
|
||||
}
|
||||
|
||||
bool NotifyListener::Save(ByteStream* stream) {
|
||||
bool XNotifyListener::Save(ByteStream* stream) {
|
||||
SaveObject(stream);
|
||||
|
||||
stream->Write(mask_);
|
||||
|
@ -99,9 +99,9 @@ bool NotifyListener::Save(ByteStream* stream) {
|
|||
return true;
|
||||
}
|
||||
|
||||
object_ref<NotifyListener> NotifyListener::Restore(KernelState* kernel_state,
|
||||
ByteStream* stream) {
|
||||
auto notify = new NotifyListener(nullptr);
|
||||
object_ref<XNotifyListener> XNotifyListener::Restore(KernelState* kernel_state,
|
||||
ByteStream* stream) {
|
||||
auto notify = new XNotifyListener(nullptr);
|
||||
notify->kernel_state_ = kernel_state;
|
||||
|
||||
notify->RestoreObject(stream);
|
||||
|
@ -115,7 +115,7 @@ object_ref<NotifyListener> NotifyListener::Restore(KernelState* kernel_state,
|
|||
notify->notifications_.insert(pair);
|
||||
}
|
||||
|
||||
return object_ref<NotifyListener>(notify);
|
||||
return object_ref<XNotifyListener>(notify);
|
||||
}
|
||||
|
||||
} // namespace kernel
|
|
@ -7,8 +7,8 @@
|
|||
******************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef XENIA_KERNEL_NOTIFY_LISTENER_H_
|
||||
#define XENIA_KERNEL_NOTIFY_LISTENER_H_
|
||||
#ifndef XENIA_KERNEL_XNOTIFYLISTENER_H_
|
||||
#define XENIA_KERNEL_XNOTIFYLISTENER_H_
|
||||
|
||||
#include <memory>
|
||||
#include <unordered_map>
|
||||
|
@ -21,12 +21,12 @@
|
|||
namespace xe {
|
||||
namespace kernel {
|
||||
|
||||
class NotifyListener : public XObject {
|
||||
class XNotifyListener : public XObject {
|
||||
public:
|
||||
static const Type kType = kTypeNotifyListener;
|
||||
|
||||
explicit NotifyListener(KernelState* kernel_state);
|
||||
~NotifyListener() override;
|
||||
explicit XNotifyListener(KernelState* kernel_state);
|
||||
~XNotifyListener() override;
|
||||
|
||||
uint64_t mask() const { return mask_; }
|
||||
|
||||
|
@ -37,8 +37,8 @@ class NotifyListener : public XObject {
|
|||
bool DequeueNotification(XNotificationID id, uint32_t* out_data);
|
||||
|
||||
bool Save(ByteStream* stream) override;
|
||||
static object_ref<NotifyListener> Restore(KernelState* kernel_state,
|
||||
ByteStream* stream);
|
||||
static object_ref<XNotifyListener> Restore(KernelState* kernel_state,
|
||||
ByteStream* stream);
|
||||
|
||||
protected:
|
||||
xe::threading::WaitHandle* GetWaitHandle() override {
|
||||
|
@ -56,4 +56,4 @@ class NotifyListener : public XObject {
|
|||
} // namespace kernel
|
||||
} // namespace xe
|
||||
|
||||
#endif // XENIA_KERNEL_NOTIFY_LISTENER_H_
|
||||
#endif // XENIA_KERNEL_XNOTIFYLISTENER_H_
|
|
@ -14,13 +14,13 @@
|
|||
#include "xenia/base/byte_stream.h"
|
||||
#include "xenia/base/clock.h"
|
||||
#include "xenia/kernel/kernel_state.h"
|
||||
#include "xenia/kernel/notify_listener.h"
|
||||
#include "xenia/kernel/xboxkrnl/xboxkrnl_private.h"
|
||||
#include "xenia/kernel/xenumerator.h"
|
||||
#include "xenia/kernel/xevent.h"
|
||||
#include "xenia/kernel/xfile.h"
|
||||
#include "xenia/kernel/xmodule.h"
|
||||
#include "xenia/kernel/xmutant.h"
|
||||
#include "xenia/kernel/xnotifylistener.h"
|
||||
#include "xenia/kernel/xsemaphore.h"
|
||||
#include "xenia/kernel/xthread.h"
|
||||
|
||||
|
@ -139,7 +139,7 @@ object_ref<XObject> XObject::Restore(KernelState* kernel_state, Type type,
|
|||
case kTypeMutant:
|
||||
return XMutant::Restore(kernel_state, stream);
|
||||
case kTypeNotifyListener:
|
||||
return NotifyListener::Restore(kernel_state, stream);
|
||||
return XNotifyListener::Restore(kernel_state, stream);
|
||||
case kTypeSemaphore:
|
||||
return XSemaphore::Restore(kernel_state, stream);
|
||||
case kTypeSession:
|
||||
|
|
Loading…
Reference in New Issue