projects
/
mesa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge commit 'origin/master' into gallium-0.2
[mesa.git]
/
src
/
gallium
/
auxiliary
/
rtasm
/
rtasm_execmem.c
diff --git
a/src/gallium/auxiliary/rtasm/rtasm_execmem.c
b/src/gallium/auxiliary/rtasm/rtasm_execmem.c
index 19087589a873695fc65e130b34bd3be1d26abdd9..be7433baf87c6a96ca87eaceca45ab00e571ab9b 100644
(file)
--- a/
src/gallium/auxiliary/rtasm/rtasm_execmem.c
+++ b/
src/gallium/auxiliary/rtasm/rtasm_execmem.c
@@
-38,12
+38,13
@@
#include "rtasm_execmem.h"
#include "rtasm_execmem.h"
-#if defined(__linux__)
+#if defined(PIPE_OS_LINUX)
+
/*
* Allocate a large block of memory which can hold code then dole it out
* in pieces by means of the generic memory manager code.
/*
* Allocate a large block of memory which can hold code then dole it out
* in pieces by means of the generic memory manager code.
-*/
+
*/
#include <unistd.h>
#include <sys/mman.h>
#include <unistd.h>
#include <sys/mman.h>
@@
-62,7
+63,7
@@
static void
init_heap(void)
{
if (!exec_heap)
init_heap(void)
{
if (!exec_heap)
- exec_heap = mmInit( 0, EXEC_HEAP_SIZE );
+ exec_heap =
u_
mmInit( 0, EXEC_HEAP_SIZE );
if (!exec_mem)
exec_mem = (unsigned char *) mmap(0, EXEC_HEAP_SIZE,
if (!exec_mem)
exec_mem = (unsigned char *) mmap(0, EXEC_HEAP_SIZE,
@@
-82,8
+83,8
@@
rtasm_exec_malloc(size_t size)
init_heap();
if (exec_heap) {
init_heap();
if (exec_heap) {
- size = (size + 31) & ~31;
- block =
mmAllocMem( exec_heap, size, 32, 0 );
+ size = (size + 31) & ~31;
/* next multiple of 32 bytes */
+ block =
u_mmAllocMem( exec_heap, size, 5, 0 ); /* 5 -> 32-byte alignment */
}
if (block)
}
if (block)
@@
-103,17
+104,17
@@
rtasm_exec_free(void *addr)
pipe_mutex_lock(exec_mutex);
if (exec_heap) {
pipe_mutex_lock(exec_mutex);
if (exec_heap) {
- struct mem_block *block = mmFindBlock(exec_heap, (unsigned char *)addr - exec_mem);
+ struct mem_block *block =
u_
mmFindBlock(exec_heap, (unsigned char *)addr - exec_mem);
if (block)
if (block)
- mmFreeMem(block);
+
u_
mmFreeMem(block);
}
pipe_mutex_unlock(exec_mutex);
}
}
pipe_mutex_unlock(exec_mutex);
}
-#else
+#else
/* PIPE_OS_LINUX */
/*
* Just use regular memory.
/*
* Just use regular memory.
@@
-133,4
+134,4
@@
rtasm_exec_free(void *addr)
}
}
-#endif
+#endif
/* PIPE_OS_LINUX */