-
-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #182 from wheremyfoodat/services
Pain and suffering
- Loading branch information
Showing
5 changed files
with
54 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,33 @@ | ||
#pragma once | ||
#include <array> | ||
#include <optional> | ||
|
||
#include "helpers.hpp" | ||
#include "kernel_types.hpp" | ||
#include "logger.hpp" | ||
#include "memory.hpp" | ||
#include "result/result.hpp" | ||
|
||
// Yay, circular dependencies! | ||
class Kernel; | ||
|
||
class CAMService { | ||
Handle handle = KernelHandles::CAM; | ||
Memory& mem; | ||
Kernel& kernel; | ||
MAKE_LOG_FUNCTION(log, camLogger) | ||
|
||
using Event = std::optional<Handle>; | ||
static constexpr size_t portCount = 4; // PORT_NONE, PORT_CAM1, PORT_CAM2, PORT_BOTH | ||
std::array<Event, portCount> bufferErrorInterruptEvents; | ||
|
||
// Service commands | ||
void driverInitialize(u32 messagePointer); | ||
void getMaxLines(u32 messagePointer); | ||
void getBufferErrorInterruptEvent(u32 messagePointer); | ||
|
||
public: | ||
CAMService(Memory& mem) : mem(mem) {} | ||
public: | ||
CAMService(Memory& mem, Kernel& kernel) : mem(mem), kernel(kernel) {} | ||
void reset(); | ||
void handleSyncRequest(u32 messagePointer); | ||
}; |
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