Compare commits

...

1 Commits

Author SHA1 Message Date
VolcaEM
520243c300 nvdrv/nvmap: Add cases for "Compr" and "Base"
From Switchbrew (https://switchbrew.org/wiki/NV_services):

"Returns info about a nvmap object. Identical to Linux driver, but extended with further params.

struct {
   __in  u32 handle;
   __in  u32 param;  // 1=SIZE, 2=ALIGNMENT, 3=BASE (returns error), 4=HEAP (always 0x40000000), 5=KIND, 6=COMPR (unused)
   __out u32 result;
 }; "

Base always returns an error (not sure if it's "InvalidValue" though), while Compr is unused, so nothing should change functionality-wise, I think
2020-06-30 19:47:13 +02:00

View File

@@ -200,8 +200,13 @@ u32 nvmap::IocParam(const std::vector<u8>& input, std::vector<u8>& output) {
case ParamTypes::Kind:
params.result = object->kind;
break;
case ParamTypes::Compr:
params.result = 0;
break;
case ParamTypes::Base:
default:
UNIMPLEMENTED();
return static_cast<u32>(NvErrCodes::InvalidValue);
break;
}
std::memcpy(output.data(), &params, sizeof(params));