1 /* 2 * SPDX-FileCopyrightText: Copyright (c) 2019-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 3 * SPDX-License-Identifier: MIT 4 * 5 * Permission is hereby granted, free of charge, to any person obtaining a 6 * copy of this software and associated documentation files (the "Software"), 7 * to deal in the Software without restriction, including without limitation 8 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 * and/or sell copies of the Software, and to permit persons to whom the 10 * Software is furnished to do so, subject to the following conditions: 11 * 12 * The above copyright notice and this permission notice shall be included in 13 * all copies or substantial portions of the Software. 14 * 15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 * DEALINGS IN THE SOFTWARE. 22 */ 23 /* 24 * GSP MESSAGE QUEUE 25 */ 26 27 #ifndef _MESSAGE_QUEUE_H_ 28 #define _MESSAGE_QUEUE_H_ 29 30 // Used for indexing into the MESSAGE_QUEUE_COLLECTION array. 31 #define RPC_TASK_RM_QUEUE_IDX 0 32 #define RPC_TASK_ISR_QUEUE_IDX 1 33 #define RPC_QUEUE_COUNT 2 34 35 typedef struct _message_queue_info MESSAGE_QUEUE_INFO; 36 typedef struct MESSAGE_QUEUE_COLLECTION MESSAGE_QUEUE_COLLECTION; 37 38 // CPU-side calls 39 NV_STATUS GspMsgQueuesInit(OBJGPU *pGpu, MESSAGE_QUEUE_COLLECTION **ppMQCollection); 40 void GspMsgQueuesCleanup(MESSAGE_QUEUE_COLLECTION **ppMQCollection); 41 NV_STATUS GspStatusQueueInit(OBJGPU *pGpu, MESSAGE_QUEUE_INFO **ppMQI); 42 NV_STATUS GspMsgQueueSendCommand(MESSAGE_QUEUE_INFO *pMQI, OBJGPU *pGpu); 43 NV_STATUS GspMsgQueueReceiveStatus(MESSAGE_QUEUE_INFO *pMQI); 44 45 #endif // _MESSAGE_QUEUE_H_ 46