Add execution property in register memory for gfx801.
Signed-off-by: Xihan Zhang <xihan.zhang@amd.com>
[ROCm/ROCR-Runtime commit: 5ed05c99b3]
This commit is contained in:
@@ -364,7 +364,8 @@ HSAKMT_STATUS
|
||||
HSAKMTAPI
|
||||
hsaKmtRegisterMemory(
|
||||
void* MemoryAddress, //IN (page-aligned)
|
||||
HSAuint64 MemorySizeInBytes //IN (page-aligned)
|
||||
HSAuint64 MemorySizeInBytes, //IN (page-aligned)
|
||||
int ExecuteAccess
|
||||
);
|
||||
|
||||
|
||||
|
||||
@@ -170,11 +170,23 @@ HSAKMT_STATUS
|
||||
HSAKMTAPI
|
||||
hsaKmtRegisterMemory(
|
||||
void *MemoryAddress, /* IN (page-aligned) */
|
||||
HSAuint64 MemorySizeInBytes /* IN (page-aligned) */
|
||||
HSAuint64 MemorySizeInBytes, /* IN (page-aligned) */
|
||||
int ExecuteAccess
|
||||
)
|
||||
{
|
||||
CHECK_KFD_OPEN();
|
||||
|
||||
int err;
|
||||
/* for CZ ib execution */
|
||||
if (ExecuteAccess) {
|
||||
err = mprotect(MemoryAddress, MemorySizeInBytes,
|
||||
PROT_READ | PROT_WRITE | PROT_EXEC);
|
||||
|
||||
if (err != 0) {
|
||||
free(MemoryAddress);
|
||||
return err;
|
||||
}
|
||||
}
|
||||
return HSAKMT_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
Verwijs in nieuw issue
Block a user