mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 09:11:26 +03:00
Modify nvscic2c-pcie files to use updated licenses as per nvidia-oot. Bug 3739487 Jira C2C-826 Change-Id: I819b459fdb0743d37bc08b4c9b92097d87e62884 Signed-off-by: dbadgaiyan <dbadgaiyan@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2830686 Reviewed-by: svcacv <svcacv@nvidia.com> Reviewed-by: Arihant Jejani <ajejani@nvidia.com> Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com> GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
62 lines
1.5 KiB
C
62 lines
1.5 KiB
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/* Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. */
|
|
|
|
#ifndef __IOVA_MNGR_H__
|
|
#define __IOVA_MNGR_H__
|
|
|
|
#include <linux/types.h>
|
|
|
|
/*
|
|
* iova_mngr_block_reserve
|
|
*
|
|
* Reserves a block from the free IOVA regions. Once reserved, the block
|
|
* is marked reserved and appended in the reserved list. Use
|
|
* iova_mngr_block_get_address to fetch the address of the block reserved.
|
|
*/
|
|
int
|
|
iova_mngr_block_reserve(void *mngr_handle, size_t size,
|
|
u64 *address, size_t *offset,
|
|
void **block_handle);
|
|
|
|
/*
|
|
* iova_mngr_block_release
|
|
*
|
|
* Release an already reserved IOVA block/chunk by the caller back to
|
|
* free list.
|
|
*/
|
|
int
|
|
iova_mngr_block_release(void *mngr_handle, void **block_handle);
|
|
|
|
/*
|
|
* iova_mngr_print
|
|
*
|
|
* DEBUG only.
|
|
*
|
|
* Helper function to print all the reserved and free blocks with
|
|
* their names, size and start address.
|
|
*/
|
|
void iova_mngr_print(void *handle);
|
|
|
|
/*
|
|
* iova_mngr_init
|
|
*
|
|
* Initialises the IOVA space manager with the base address + size
|
|
* provided. IOVA manager would use two lists for book-keeping reserved
|
|
* memory blocks and free memory blocks.
|
|
*
|
|
* When initialised all of the IOVA region: base_address + size is free.
|
|
*/
|
|
int
|
|
iova_mngr_init(char *name, u64 base_address, size_t size, void **mngr_handle);
|
|
|
|
/*
|
|
* iova_mngr_deinit
|
|
*
|
|
* deinitialize the IOVA space manager. Any blocks unreturned from the client
|
|
* (caller) shall become dangling.
|
|
*/
|
|
void
|
|
iova_mngr_deinit(void **handle);
|
|
|
|
#endif //__IOVA_MNGR_H__
|