rcce_shmalloc

This commit is contained in:
Carl-Benedikt Krüger 2011-06-28 07:31:23 +02:00
parent fed0130cd8
commit 312b19c35f
3 changed files with 16 additions and 4 deletions

View file

@ -26,6 +26,7 @@
//
#include <metalsvm/stddef.h>
#include <asm/page.h>
#ifdef CONFIG_ROCKCREEK
@ -335,13 +336,13 @@ int RCCE_init(
RCCE_malloc_init(RCCE_comm_buffer[RCCE_IAM],RCCE_BUFF_SIZE);
#ifdef SHMADD
RCCE_shmalloc_init(RC_SHM_BUFFER_START()+RCCE_SHM_BUFFER_offset ,RCCE_SHM_SIZE_MAX);
RCCE_shmalloc_init(map_region(NULL, RC_SHM_BUFFER_START()+RCCE_SHM_BUFFER_offset, RCCE_SHM_SIZE_MAX/PAGE_SIZE, MAP_KERNEL_SPACE|MAP_NO_CACHE), RCCE_SHM_SIZE_MAX);
#ifdef SHMDBG
kprintf("\n%d:%s:%d: RCCE_SHM_BUFFER_offset, RCCE_SHM_SIZE_MAX: %x %x\n", RCCE_IAM,
__FILE__,__LINE__,RCCE_SHM_BUFFER_offset ,RCCE_SHM_SIZE_MAX);
#endif
#else
RCCE_shmalloc_init(RC_SHM_BUFFER_START(),RCCE_SHM_SIZE_MAX);
RCCE_shmalloc_init(map_region(NULL, RC_SHM_BUFFER_START(), RCCE_SHM_SIZE_MAX/PAGE_SIZE, MAP_KERNEL_SPACE|MAP_NO_CACHE), RCCE_SHM_SIZE_MAX);
#endif
// initialize the (global) flag bookkeeping data structure

View file

@ -142,6 +142,17 @@ int icc_init(void)
kprintf("failed! (0x%x)\n", msg);
#endif
#if 0
char* str = RCCE_shmalloc(128);
if (my_ue == 1) {
memset(str, 0x00, 128);
strcpy(str, "Hello RCCE_shmalloc\n");
}
RCCE_barrier(&RCCE_COMM_WORLD);
kprintf("RCCE_shmalloc test: %s\n", str);
RCCE_shfree(str);
#endif
// reset INTR/LINT0 flag
z = Z_PID(RC_COREID[my_ue]);
tmp=ReadConfigReg(CRB_OWN + (z==0 ? GLCFG0 : GLCFG1));

View file

@ -492,11 +492,11 @@ __inline void* mmnif_shmalloc()
* until i know how to properly allocate shared memory
*/
// RCCE_shmalloc_init(0x80000000,48*8192);
//mpb_start_address = RCCE_shmalloc(mpb_size*MMNIF_CORES);
mpb_start_address = RCCE_shmalloc(mpb_size*MMNIF_CORES);
//mpb_start_address = 0x8000000+ mpb_size * (own_ip_address - router_ip_address);
//SHMalloc(&mpb_start_address);
//mpb_start_address = kmalloc(mpb_size*MMNIF_CORES);
mpb_start_address = 0xC0000000;
// mpb_start_address = 0xC0000000;
return mpb_start_address + (mpb_size) * (own_ip_address - router_ip_address);
#endif
}