2014-05-10 02:11:18 +00:00
|
|
|
// Copyright 2014 Citra Emulator Project / PPSSPP Project
|
2014-12-17 05:38:14 +00:00
|
|
|
// Licensed under GPLv2 or any later version
|
2014-11-19 08:49:13 +00:00
|
|
|
// Refer to the license.txt file included.
|
2014-05-10 02:11:18 +00:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2018-10-11 19:19:45 +00:00
|
|
|
#include <string>
|
|
|
|
#include <boost/smart_ptr/intrusive_ptr.hpp>
|
2015-05-06 07:06:12 +00:00
|
|
|
#include "common/common_types.h"
|
2014-05-10 02:11:18 +00:00
|
|
|
|
2014-05-20 22:13:25 +00:00
|
|
|
namespace Kernel {
|
|
|
|
|
2018-10-11 19:19:45 +00:00
|
|
|
class AddressArbiter;
|
2018-10-11 19:48:16 +00:00
|
|
|
class Event;
|
2018-10-11 20:00:09 +00:00
|
|
|
class Mutex;
|
2018-10-12 19:21:32 +00:00
|
|
|
class CodeSet;
|
2018-10-12 19:33:36 +00:00
|
|
|
class Process;
|
2018-10-11 19:48:16 +00:00
|
|
|
|
|
|
|
enum class ResetType {
|
|
|
|
OneShot,
|
|
|
|
Sticky,
|
|
|
|
Pulse,
|
|
|
|
};
|
2018-10-11 19:19:45 +00:00
|
|
|
|
|
|
|
template <typename T>
|
|
|
|
using SharedPtr = boost::intrusive_ptr<T>;
|
|
|
|
|
2018-10-11 18:49:52 +00:00
|
|
|
class KernelSystem {
|
|
|
|
public:
|
|
|
|
explicit KernelSystem(u32 system_mode);
|
|
|
|
~KernelSystem();
|
2018-10-11 19:19:45 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates an address arbiter.
|
|
|
|
*
|
|
|
|
* @param name Optional name used for debugging.
|
|
|
|
* @returns The created AddressArbiter.
|
|
|
|
*/
|
|
|
|
SharedPtr<AddressArbiter> CreateAddressArbiter(std::string name = "Unknown");
|
2018-10-11 19:48:16 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates an event
|
|
|
|
* @param reset_type ResetType describing how to create event
|
|
|
|
* @param name Optional name of event
|
|
|
|
*/
|
|
|
|
SharedPtr<Event> CreateEvent(ResetType reset_type, std::string name = "Unknown");
|
2018-10-11 20:00:09 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates a mutex.
|
|
|
|
* @param initial_locked Specifies if the mutex should be locked initially
|
|
|
|
* @param name Optional name of mutex
|
|
|
|
* @return Pointer to new Mutex object
|
|
|
|
*/
|
|
|
|
SharedPtr<Mutex> CreateMutex(bool initial_locked, std::string name = "Unknown");
|
2018-10-12 19:21:32 +00:00
|
|
|
|
|
|
|
SharedPtr<CodeSet> CreateCodeSet(std::string name, u64 program_id);
|
2018-10-12 19:33:36 +00:00
|
|
|
|
|
|
|
SharedPtr<Process> CreateProcess(SharedPtr<CodeSet> code_set);
|
2018-10-11 18:49:52 +00:00
|
|
|
};
|
2014-06-11 02:43:50 +00:00
|
|
|
|
2017-07-21 04:52:50 +00:00
|
|
|
} // namespace Kernel
|