public NvIoctlNotImplementedException(ServiceCtx context, NvDeviceFile deviceFile, NvIoctl command, string message)
     : base(message)
 {
     Context    = context;
     DeviceFile = deviceFile;
     Command    = command;
 }
Пример #2
0
        public override NvInternalResult Ioctl(NvIoctl command, Span <byte> arguments)
        {
            NvInternalResult result = NvInternalResult.NotImplemented;

            if (command.Type == NvIoctl.NvHostCustomMagic)
            {
                switch (command.Number)
                {
                case 0x14:
                    result = CallIoctlMethod <NvFence>(SyncptRead, arguments);
                    break;

                case 0x15:
                    result = CallIoctlMethod <uint>(SyncptIncr, arguments);
                    break;

                case 0x16:
                    result = CallIoctlMethod <SyncptWaitArguments>(SyncptWait, arguments);
                    break;

                case 0x19:
                    result = CallIoctlMethod <SyncptWaitExArguments>(SyncptWaitEx, arguments);
                    break;

                case 0x1a:
                    result = CallIoctlMethod <NvFence>(SyncptReadMax, arguments);
                    break;

                case 0x1b:
                    // As Marshal cannot handle unaligned arrays, we do everything by hand here.
                    GetConfigurationArguments configArgument = GetConfigurationArguments.FromSpan(arguments);
                    result = GetConfig(configArgument);

                    if (result == NvInternalResult.Success)
                    {
                        configArgument.CopyTo(arguments);
                    }
                    break;

                case 0x1d:
                    result = CallIoctlMethod <EventWaitArguments>(EventWait, arguments);
                    break;

                case 0x1e:
                    result = CallIoctlMethod <EventWaitArguments>(EventWaitAsync, arguments);
                    break;

                case 0x1f:
                    result = CallIoctlMethod <uint>(EventRegister, arguments);
                    break;
                }
            }

            return(result);
        }
Пример #3
0
        public override NvInternalResult Ioctl(NvIoctl command, Span <byte> arguments)
        {
            NvInternalResult result = NvInternalResult.NotImplemented;

            if (command.Type == NvIoctl.NvMapCustomMagic)
            {
                switch (command.Number)
                {
                case 0x01:
                    result = CallIoctlMethod <NvMapCreate>(Create, arguments);
                    break;

                case 0x03:
                    result = CallIoctlMethod <NvMapFromId>(FromId, arguments);
                    break;

                case 0x04:
                    result = CallIoctlMethod <NvMapAlloc>(Alloc, arguments);
                    break;

                case 0x05:
                    result = CallIoctlMethod <NvMapFree>(Free, arguments);
                    break;

                case 0x09:
                    result = CallIoctlMethod <NvMapParam>(Param, arguments);
                    break;

                case 0x0e:
                    result = CallIoctlMethod <NvMapGetId>(GetId, arguments);
                    break;

                case 0x02:
                case 0x06:
                case 0x07:
                case 0x08:
                case 0x0a:
                case 0x0c:
                case 0x0d:
                case 0x0f:
                case 0x10:
                case 0x11:
                    result = NvInternalResult.NotSupported;
                    break;
                }
            }

            return(result);
        }
Пример #4
0
        public override NvInternalResult Ioctl2(NvIoctl command, Span <byte> arguments, Span <byte> inlineInBuffer)
        {
            NvInternalResult result = NvInternalResult.NotImplemented;

            if (command.Type == NvIoctl.NvHostMagic)
            {
                switch (command.Number)
                {
                case 0x1b:
                    result = CallIoctlMethod <SubmitGpfifoArguments, ulong>(SubmitGpfifoEx, arguments, inlineInBuffer);
                    break;
                }
            }

            return(result);
        }
Пример #5
0
        public override NvInternalResult Ioctl3(NvIoctl command, Span <byte> arguments, Span <byte> inlineOutBuffer)
        {
            NvInternalResult result = NvInternalResult.NotImplemented;

            if (command.Type == NvIoctl.NvGpuAsMagic)
            {
                switch (command.Number)
                {
                case 0x08:
                    // This is the same as the one in ioctl as inlineOutBuffer is empty.
                    result = CallIoctlMethod <GetVaRegionsArguments>(GetVaRegions, arguments);
                    break;
                }
            }

            return(result);
        }
Пример #6
0
        public override NvInternalResult Ioctl(NvIoctl command, Span <byte> arguments)
        {
            NvInternalResult result = NvInternalResult.NotImplemented;

            if (command.Type == NvIoctl.NvGpuAsMagic)
            {
                switch (command.Number)
                {
                case 0x01:
                    result = CallIoctlMethod <BindChannelArguments>(BindChannel, arguments);
                    break;

                case 0x02:
                    result = CallIoctlMethod <AllocSpaceArguments>(AllocSpace, arguments);
                    break;

                case 0x03:
                    result = CallIoctlMethod <FreeSpaceArguments>(FreeSpace, arguments);
                    break;

                case 0x05:
                    result = CallIoctlMethod <UnmapBufferArguments>(UnmapBuffer, arguments);
                    break;

                case 0x06:
                    result = CallIoctlMethod <MapBufferExArguments>(MapBufferEx, arguments);
                    break;

                case 0x08:
                    result = CallIoctlMethod <GetVaRegionsArguments>(GetVaRegions, arguments);
                    break;

                case 0x09:
                    result = CallIoctlMethod <InitializeExArguments>(InitializeEx, arguments);
                    break;

                case 0x14:
                    result = CallIoctlMethod <RemapArguments>(Remap, arguments);
                    break;
                }
            }

            return(result);
        }
Пример #7
0
        public override NvInternalResult Ioctl3(NvIoctl command, Span <byte> arguments, Span <byte> inlineOutBuffer)
        {
            NvInternalResult result = NvInternalResult.NotImplemented;

            if (command.Type == NvIoctl.NvGpuMagic)
            {
                switch (command.Number)
                {
                case 0x05:
                    result = CallIoctlMethod <GetCharacteristicsArguments, GpuCharacteristics>(GetCharacteristics, arguments, inlineOutBuffer);
                    break;

                case 0x06:
                    result = CallIoctlMethod <GetTpcMasksArguments, int>(GetTpcMasks, arguments, inlineOutBuffer);
                    break;
                }
            }

            return(result);
        }
Пример #8
0
        public override NvInternalResult Ioctl(NvIoctl command, Span <byte> arguments)
        {
            NvInternalResult result = NvInternalResult.NotImplemented;

            if (command.Type == NvIoctl.NvGpuMagic)
            {
                switch (command.Number)
                {
                case 0x01:
                    result = CallIoctlMethod <ZcullGetCtxSizeArguments>(ZcullGetCtxSize, arguments);
                    break;

                case 0x02:
                    result = CallIoctlMethod <ZcullGetInfoArguments>(ZcullGetInfo, arguments);
                    break;

                case 0x03:
                    result = CallIoctlMethod <ZbcSetTableArguments>(ZbcSetTable, arguments);
                    break;

                case 0x05:
                    result = CallIoctlMethod <GetCharacteristicsArguments>(GetCharacteristics, arguments);
                    break;

                case 0x06:
                    result = CallIoctlMethod <GetTpcMasksArguments>(GetTpcMasks, arguments);
                    break;

                case 0x14:
                    result = CallIoctlMethod <GetActiveSlotMaskArguments>(GetActiveSlotMask, arguments);
                    break;

                case 0x1c:
                    result = CallIoctlMethod <GetGpuTimeArguments>(GetGpuTime, arguments);
                    break;
                }
            }

            return(result);
        }
        public override NvInternalResult Ioctl(NvIoctl command, Span <byte> arguments)
        {
            NvInternalResult result = NvInternalResult.NotImplemented;

            if (command.Type == NvIoctl.NvHostCustomMagic)
            {
                switch (command.Number)
                {
                case 0x01:
                    result = Submit(arguments);
                    break;

                case 0x02:
                    result = CallIoctlMethod <GetParameterArguments>(GetSyncpoint, arguments);
                    break;

                case 0x03:
                    result = CallIoctlMethod <GetParameterArguments>(GetWaitBase, arguments);
                    break;

                case 0x07:
                    result = CallIoctlMethod <uint>(SetSubmitTimeout, arguments);
                    break;

                case 0x09:
                    result = MapCommandBuffer(arguments);
                    break;

                case 0x0a:
                    result = UnmapCommandBuffer(arguments);
                    break;
                }
            }
            else if (command.Type == NvIoctl.NvHostMagic)
            {
                switch (command.Number)
                {
                case 0x01:
                    result = CallIoctlMethod <int>(SetNvMapFd, arguments);
                    break;

                case 0x03:
                    result = CallIoctlMethod <uint>(SetTimeout, arguments);
                    break;

                case 0x08:
                    result = SubmitGpfifo(arguments);
                    break;

                case 0x09:
                    result = CallIoctlMethod <AllocObjCtxArguments>(AllocObjCtx, arguments);
                    break;

                case 0x0b:
                    result = CallIoctlMethod <ZcullBindArguments>(ZcullBind, arguments);
                    break;

                case 0x0c:
                    result = CallIoctlMethod <SetErrorNotifierArguments>(SetErrorNotifier, arguments);
                    break;

                case 0x0d:
                    result = CallIoctlMethod <NvChannelPriority>(SetPriority, arguments);
                    break;

                case 0x18:
                    result = CallIoctlMethod <AllocGpfifoExArguments>(AllocGpfifoEx, arguments);
                    break;

                case 0x1a:
                    result = CallIoctlMethod <AllocGpfifoExArguments>(AllocGpfifoEx2, arguments);
                    break;

                case 0x1d:
                    result = CallIoctlMethod <uint>(SetTimeslice, arguments);
                    break;
                }
            }
            else if (command.Type == NvIoctl.NvGpuMagic)
            {
                switch (command.Number)
                {
                case 0x14:
                    result = CallIoctlMethod <ulong>(SetUserData, arguments);
                    break;
                }
            }

            return(result);
        }
Пример #10
0
 public virtual NvInternalResult Ioctl3(NvIoctl command, Span <byte> arguments, Span <byte> inlineOutBuffer)
 {
     return(NvInternalResult.NotImplemented);
 }
Пример #11
0
 public virtual NvInternalResult Ioctl(NvIoctl command, Span <byte> arguments)
 {
     return(NvInternalResult.NotImplemented);
 }
 public NvIoctlNotImplementedException(ServiceCtx context, NvDeviceFile deviceFile, NvIoctl command)
     : this(context, deviceFile, command, "The ioctl is not implemented.")
 {
 }