Support passing additional constructor arguments to nvdrv devices

Needed for host1x channels which use the same class for multiple types.
This commit is contained in:
Billy Laws 2021-10-24 16:01:20 +01:00 committed by PixelyIon
parent eb6f052873
commit b0a5dab0f7

View File

@ -23,11 +23,11 @@ namespace skyline::service::nvdrv {
break; \
}
#define DEVICE_CASE(path, object) \
#define DEVICE_CASE(path, object, ...) \
case util::Hash(path): \
{ \
std::unique_lock lock(deviceMutex); \
devices.emplace(fd, std::make_unique<device::object>(state, *this, core, ctx)); \
devices.emplace(fd, std::make_unique<device::object>(state, *this, core, ctx, ##__VA_ARGS__)); \
return NvResult::Success; \
}