|
| 1 | +#ifndef __src_common_sdk_nvidia_inc_nvos_h__ |
| 2 | +#define __src_common_sdk_nvidia_inc_nvos_h__ |
| 3 | + |
| 4 | +/* Excerpt of RM headers from https://github.com/NVIDIA/open-gpu-kernel-modules/tree/535.54.03 */ |
| 5 | + |
| 6 | +/* |
| 7 | + * SPDX-FileCopyrightText: Copyright (c) 1993-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. |
| 8 | + * SPDX-License-Identifier: MIT |
| 9 | + * |
| 10 | + * Permission is hereby granted, free of charge, to any person obtaining a |
| 11 | + * copy of this software and associated documentation files (the "Software"), |
| 12 | + * to deal in the Software without restriction, including without limitation |
| 13 | + * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| 14 | + * and/or sell copies of the Software, and to permit persons to whom the |
| 15 | + * Software is furnished to do so, subject to the following conditions: |
| 16 | + * |
| 17 | + * The above copyright notice and this permission notice shall be included in |
| 18 | + * all copies or substantial portions of the Software. |
| 19 | + * |
| 20 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 21 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 22 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
| 23 | + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 24 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
| 25 | + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
| 26 | + * DEALINGS IN THE SOFTWARE. |
| 27 | + */ |
| 28 | + |
| 29 | +#define NVOS02_FLAGS_PHYSICALITY 7:4 |
| 30 | +#define NVOS02_FLAGS_PHYSICALITY_CONTIGUOUS (0x00000000) |
| 31 | +#define NVOS02_FLAGS_PHYSICALITY_NONCONTIGUOUS (0x00000001) |
| 32 | +#define NVOS02_FLAGS_LOCATION 11:8 |
| 33 | +#define NVOS02_FLAGS_LOCATION_PCI (0x00000000) |
| 34 | +#define NVOS02_FLAGS_LOCATION_AGP (0x00000001) |
| 35 | +#define NVOS02_FLAGS_LOCATION_VIDMEM (0x00000002) |
| 36 | +#define NVOS02_FLAGS_COHERENCY 15:12 |
| 37 | +#define NVOS02_FLAGS_COHERENCY_UNCACHED (0x00000000) |
| 38 | +#define NVOS02_FLAGS_COHERENCY_CACHED (0x00000001) |
| 39 | +#define NVOS02_FLAGS_COHERENCY_WRITE_COMBINE (0x00000002) |
| 40 | +#define NVOS02_FLAGS_COHERENCY_WRITE_THROUGH (0x00000003) |
| 41 | +#define NVOS02_FLAGS_COHERENCY_WRITE_PROTECT (0x00000004) |
| 42 | +#define NVOS02_FLAGS_COHERENCY_WRITE_BACK (0x00000005) |
| 43 | +#define NVOS02_FLAGS_ALLOC 17:16 |
| 44 | +#define NVOS02_FLAGS_ALLOC_NONE (0x00000001) |
| 45 | +#define NVOS02_FLAGS_GPU_CACHEABLE 18:18 |
| 46 | +#define NVOS02_FLAGS_GPU_CACHEABLE_NO (0x00000000) |
| 47 | +#define NVOS02_FLAGS_GPU_CACHEABLE_YES (0x00000001) |
| 48 | + |
| 49 | +#define NVOS02_FLAGS_KERNEL_MAPPING 19:19 |
| 50 | +#define NVOS02_FLAGS_KERNEL_MAPPING_NO_MAP (0x00000000) |
| 51 | +#define NVOS02_FLAGS_KERNEL_MAPPING_MAP (0x00000001) |
| 52 | +#define NVOS02_FLAGS_ALLOC_NISO_DISPLAY 20:20 |
| 53 | +#define NVOS02_FLAGS_ALLOC_NISO_DISPLAY_NO (0x00000000) |
| 54 | +#define NVOS02_FLAGS_ALLOC_NISO_DISPLAY_YES (0x00000001) |
| 55 | + |
| 56 | +#define NVOS02_FLAGS_ALLOC_USER_READ_ONLY 21:21 |
| 57 | +#define NVOS02_FLAGS_ALLOC_USER_READ_ONLY_NO (0x00000000) |
| 58 | +#define NVOS02_FLAGS_ALLOC_USER_READ_ONLY_YES (0x00000001) |
| 59 | + |
| 60 | +#define NVOS02_FLAGS_ALLOC_DEVICE_READ_ONLY 22:22 |
| 61 | +#define NVOS02_FLAGS_ALLOC_DEVICE_READ_ONLY_NO (0x00000000) |
| 62 | +#define NVOS02_FLAGS_ALLOC_DEVICE_READ_ONLY_YES (0x00000001) |
| 63 | + |
| 64 | +#define NVOS02_FLAGS_PEER_MAP_OVERRIDE 23:23 |
| 65 | +#define NVOS02_FLAGS_PEER_MAP_OVERRIDE_DEFAULT (0x00000000) |
| 66 | +#define NVOS02_FLAGS_PEER_MAP_OVERRIDE_REQUIRED (0x00000001) |
| 67 | + |
| 68 | +#define NVOS02_FLAGS_ALLOC_TYPE_SYNCPOINT 24:24 |
| 69 | +#define NVOS02_FLAGS_ALLOC_TYPE_SYNCPOINT_APERTURE (0x00000001) |
| 70 | + |
| 71 | +#define NVOS02_FLAGS_MEMORY_PROTECTION 26:25 |
| 72 | +#define NVOS02_FLAGS_MEMORY_PROTECTION_DEFAULT (0x00000000) |
| 73 | +#define NVOS02_FLAGS_MEMORY_PROTECTION_PROTECTED (0x00000001) |
| 74 | +#define NVOS02_FLAGS_MEMORY_PROTECTION_UNPROTECTED (0x00000002) |
| 75 | + |
| 76 | +#define NVOS02_FLAGS_MAPPING 31:30 |
| 77 | +#define NVOS02_FLAGS_MAPPING_DEFAULT (0x00000000) |
| 78 | +#define NVOS02_FLAGS_MAPPING_NO_MAP (0x00000001) |
| 79 | +#define NVOS02_FLAGS_MAPPING_NEVER_MAP (0x00000002) |
| 80 | + |
| 81 | +typedef struct |
| 82 | +{ |
| 83 | + NvU32 index; |
| 84 | + NvV32 flags; |
| 85 | + NvU64 vaSize NV_ALIGN_BYTES(8); |
| 86 | + NvU64 vaStartInternal NV_ALIGN_BYTES(8); |
| 87 | + NvU64 vaLimitInternal NV_ALIGN_BYTES(8); |
| 88 | + NvU32 bigPageSize; |
| 89 | + NvU64 vaBase NV_ALIGN_BYTES(8); |
| 90 | +} NV_VASPACE_ALLOCATION_PARAMETERS; |
| 91 | + |
| 92 | +#define NV_VASPACE_ALLOCATION_INDEX_GPU_NEW 0x00 //<! Create new VASpace, by default |
| 93 | + |
| 94 | +#endif |
0 commit comments