Kernel/IPC: Implement StaticBuffer translation for HLE services that use the HLERequestContext architecture.
The real kernel requires services to set up their static buffer targets ahead of time. This implementation does not require that and will simply create the storage for the buffers as they are processed in the incoming IPC request. Static buffers are kept in an unordered_map keyed by their buffer id, and are written into the already-setup area of the request thread when responding an IPC request. This fixes a regression (crash) introduced in #2992. This PR introduces more warnings due to the [[deprecated]] attribute being added to void PushStaticBuffer(VAddr buffer_vaddr, size_t size, u8 buffer_id); and VAddr PopStaticBuffer(size_t* data_size);
This commit is contained in:
parent
4fc0448093
commit
c9c1ba0952
10 changed files with 113 additions and 40 deletions
|
@ -40,13 +40,16 @@ static const int kStaticBuffersOffset = 0x100;
|
|||
inline u32* GetStaticBuffers(const int offset = 0) {
|
||||
return GetCommandBuffer(kStaticBuffersOffset + offset);
|
||||
}
|
||||
}
|
||||
} // namespace Kernel
|
||||
|
||||
namespace IPC {
|
||||
|
||||
/// Size of the command buffer area, in 32-bit words.
|
||||
constexpr size_t COMMAND_BUFFER_LENGTH = 0x100 / sizeof(u32);
|
||||
|
||||
// Maximum number of static buffers per thread.
|
||||
constexpr size_t MAX_STATIC_BUFFERS = 16;
|
||||
|
||||
// These errors are commonly returned by invalid IPC translations, so alias them here for
|
||||
// convenience.
|
||||
// TODO(yuriks): These will probably go away once translation is implemented inside the kernel.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue