diff options
author | Nikunj A Dadhania <nikunj@linux.vnet.ibm.com> | 2013-09-24 15:09:29 +0530 |
---|---|---|
committer | Nikunj A Dadhania <nikunj@linux.vnet.ibm.com> | 2013-10-04 12:01:20 +0530 |
commit | 7f5d67ca5f9a50d1c2169e5b2417e60b1b7d3967 (patch) | |
tree | 92aef4d0b73ae743c2dc59912fc0de6bc88b9420 /slof/ppc64.code | |
parent | 7e0d5387128228d407ee1cafd2ce6fa9ac6252b9 (diff) | |
download | SLOF-7f5d67ca5f9a50d1c2169e5b2417e60b1b7d3967.zip SLOF-7f5d67ca5f9a50d1c2169e5b2417e60b1b7d3967.tar.gz SLOF-7f5d67ca5f9a50d1c2169e5b2417e60b1b7d3967.tar.bz2 |
Implement range allocator
Use the allocator with dma-map-in so it does not create duplicate TCE
entries.
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Diffstat (limited to 'slof/ppc64.code')
-rw-r--r-- | slof/ppc64.code | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/slof/ppc64.code b/slof/ppc64.code index 9553ee8..94069a2 100644 --- a/slof/ppc64.code +++ b/slof/ppc64.code @@ -252,3 +252,23 @@ PRIM(DEC_X40) PUSH; asm volatile("mfdec %0" : "=r"(TOS)); MIRP + +PRIM(BM_X2d_ALLOCATOR_X2d_INIT) + unsigned long blocksize = TOS.u; POP; + unsigned long size = TOS.u; POP; + unsigned long start = TOS.u; + TOS.u = SLOF_bm_allocator_init(start, size, blocksize); +MIRP + +PRIM(BM_X2d_ALLOC) + unsigned long size = TOS.u; POP; + unsigned long handle = TOS.u; + TOS.u = SLOF_bm_alloc(handle, size); +MIRP + +PRIM(BM_X2d_FREE) + unsigned long size = TOS.u; POP; + unsigned long addr = TOS.u; POP; + unsigned long handle = TOS.u; POP; + SLOF_bm_free(handle, addr, size); +MIRP
\ No newline at end of file |