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:
Xihan Zhang
2015-04-10 22:26:44 +08:00
bovenliggende 7fd679ab27
commit abf7770d46
2 gewijzigde bestanden met toevoegingen van 15 en 2 verwijderingen
@@ -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
);
+13 -1
Bestand weergeven
@@ -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;
}