Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hiddbg: modify hiddbgAttachHdlsWorkBuffer to accept a user-supplied buffer and size #601

Merged
merged 3 commits into from
Feb 1, 2023

Conversation

ndeadly
Copy link
Contributor

@ndeadly ndeadly commented Feb 1, 2023

The current version of hiddbgAttachHdlsWorkBuffer is incompatible with sysmodules using libstratosphere due to the libnx memory allocations in tmemCreate. This modifies the existing function to create a transfer memory from an optional user-supplied buffer using tmemCreateFromMemory instead.

I wasn't sure whether breaking the existing API by adding the additional parameters was a good idea, but this seems like the most straightforward solution.

@fincs
Copy link
Contributor

fincs commented Feb 1, 2023

Given that this command makes most sense to use in sysmodules (and I believe you are the only user), I think you can remove the old tmemCreate handling; leaving explicit memory management as the only option.

@ndeadly
Copy link
Contributor Author

ndeadly commented Feb 1, 2023

There are definitely a few others using it who may be affected (sys-con and sys-botbase come to mind). I have no problem with removing the old handling though. Up to you guys.

@@ -402,8 +402,10 @@ Result hiddbgUnsetAllAutoPilotVirtualPadState(void);
* @brief Initialize Hdls.
* @note Only available with [7.0.0+].
* @param[out] session_id [13.0.0+] \ref HiddbgHdlsSessionId
* @param[in] buffer An existing buffer to be used as transfer memory. If null a new transfer memory will be created.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If null ... <- no longer applies

@fincs fincs merged commit dcebe96 into switchbrew:master Feb 1, 2023
@ndeadly ndeadly deleted the hdls-user-buffer branch February 1, 2023 23:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants