forked from strato-emu/strato
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
62 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
#pragma once | ||
|
||
#include <cstdint> | ||
#include "switch/common.h" | ||
|
||
namespace lightSwitch::os::ipc { | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,32 @@ | ||
#pragma once | ||
|
||
#include <cstdint> | ||
#include <err.h> | ||
#include "switch/common.h" | ||
#include <unordered_map> | ||
#include "../common.h" | ||
#include "ipc.h" | ||
#include "kernel.h" | ||
#include "svc.h" | ||
|
||
namespace lightSwitch::os { | ||
class KObject { | ||
private: | ||
uint32_t handle; | ||
public: | ||
KObject(uint32_t handle) : handle(handle) {} | ||
|
||
uint32_t Handle() { return handle; } | ||
}; | ||
|
||
typedef std::shared_ptr<KObject> KObjectPtr; | ||
|
||
class OS { | ||
private: | ||
device_state state; | ||
uint32_t handle_index = constant::base_handle_index; | ||
std::unordered_map<uint32_t, KObjectPtr> handles; | ||
public: | ||
OS(device_state state_); | ||
|
||
static void SvcHandler(uint16_t svc, void *vstate); | ||
void SvcHandler(uint16_t svc, void *vstate); | ||
|
||
void HandleSvc(uint16_t svc); | ||
uint32_t NewHandle(KObjectPtr obj); | ||
}; | ||
} |