pcv Set/GetClockRate changes in 8.0.0#266
Conversation
| static u64 g_refCnt; | ||
|
|
||
| Result clkrstInitialize(void) { | ||
| if(!hosversionAtLeast(8,0,0)) { |
There was a problem hiding this comment.
if (hosversionBefore(8,0,0))
|
|
||
| raw->magic = SFCI_MAGIC; | ||
| raw->cmd_id = 0; | ||
| raw->module = 0x40000001 + module; |
There was a problem hiding this comment.
This needs a few more changes. I've RE'd PCV on 8.0.0 and found this: https://switchbrew.org/wiki/PCV_services#Modules
It appears that each module now has an assigned ID which doesn't necessarily map directly into 0x40000001 + module (see I2C1 to I2C6, SPI1 to SPI4 and UARTA, UARTB, UARTC, UARTD).
My suggestion would be a new enum or even a struct describing a module that would contain the regular numerical value for it and the new ID.
There was a problem hiding this comment.
Right, while they all map for the ones currently defined in pcv.h, it'd be breaking change in the future if we were to add all of them. @yellows8 Would you like all the modules defined ? It would be an enum that would be common to clkrst and rgltr API
There was a problem hiding this comment.
Should i merge clkrst funcs in pcv.h/.c then, or what's the naming scheme you'd suggest?
There was a problem hiding this comment.
Just add the enum in pcv.h.
| raw->magic = SFCI_MAGIC; | ||
| raw->cmd_id = 0; | ||
| raw->module = 0x40000001 + module; | ||
| raw->unk = 3; |
There was a problem hiding this comment.
It might be worth considering adding this value as a parameter once its purpose is sorted out. Every module does indeed hardcode this to 3, but PCV supports values at least from 0 to 7.
There was a problem hiding this comment.
Same as previous comment = would avoid breaking changes. Also, this is already something done in capssu service API (passing an unk value as arg, default value documented in header). Waiting on maintainer feedback
There was a problem hiding this comment.
Move it to input param.
"would avoid breaking changes" clkrst is a new service in the first place...
No description provided.