Add API entrypoints for IPC functionality

Implement three new APIs for IPC buffer sharing:
	-hsaKmtShareMemory()
	-hsaKmtRegisterSharedHandle()
	-hsaKmtRegisterSharedHandleToNodes()

Add new ioclts necessary for the above APIs.

Change-Id: Ia2b4d0dc91ec64bff959395d11c0536467404792
Signed-off-by: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com>


[ROCm/ROCR-Runtime commit: 559e31d6ff]
This commit is contained in:
Harish Kasiviswanathan
2016-11-22 14:35:35 -05:00
rodzic bd81b76c5a
commit 5d2336f1ca
8 zmienionych plików z 367 dodań i 11 usunięć
@@ -406,6 +406,43 @@ hsaKmtRegisterGraphicsHandleToNodes(
HSAuint32* NodeArray //IN
);
/**
Export a memory buffer for sharing with other processes
NOTE: for the current revision of the thunk spec, SizeInBytes
must match whole allocation.
*/
HSAKMT_STATUS
HSAKMTAPI
hsaKmtShareMemory(
void *MemoryAddress, // IN
HSAuint64 SizeInBytes, // IN
HsaSharedMemoryHandle *SharedMemoryHandle // OUT
);
/**
Register shared memory handle
*/
HSAKMT_STATUS
HSAKMTAPI
hsaKmtRegisterSharedHandle(
const HsaSharedMemoryHandle *SharedMemoryHandle, // IN
void **MemoryAddress, // OUT
HSAuint64 *SizeInBytes // OUT
);
/**
Register shared memory handle to specific nodes only
*/
HSAKMT_STATUS
HSAKMTAPI
hsaKmtRegisterSharedHandleToNodes(
const HsaSharedMemoryHandle *SharedMemoryHandle, // IN
void **MemoryAddress, // OUT
HSAuint64 *SizeInBytes, // OUT
HSAuint64 NumberOfNodes, // OUT
HSAuint32* NodeArray // OUT
);
/**
Unregisters with KFD a memory buffer