Changeset 1015
- Timestamp:
- 01/02/11 10:05:19 (2 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 8 edited
-
buildconf.inc (modified) (1 diff)
-
core/Makefile (modified) (1 diff)
-
core/main.c (modified) (1 diff)
-
core/suba.c (added)
-
include/lolevel.h (modified) (1 diff)
-
include/platform.h (modified) (1 diff)
-
makefile.inc (modified) (1 diff)
-
platform/d10/sub/100a/stubs_entry_2.S (modified) (1 diff)
-
platform/generic/wrappers.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/buildconf.inc
r1000 r1015 12 12 OPT_EDGEOVERLAY=1 13 13 OPT_LUA_STRLIB=1 14 14 # experimental - allocate memory from alternate heap. Default 2MB from EXMEM_RAMDISK 15 # See exmem_malloc_init in generic/wrappers.c 16 #OPT_EXMEM_MALLOC=1 15 17 # experimental PTP/USB interface 16 18 #OPT_PTP=1 -
trunk/core/Makefile
r1000 r1015 61 61 OPT_OBJS+=ptp.o 62 62 endif 63 ifdef OPT_EXMEM_MALLOC 64 #CFLAGS+=-DOPT_EXMEM_MALLOC 65 OPT_OBJS+=suba.o 66 endif 63 67 64 68 OBJS=entry.o nothumb.o main.o gui_draw.o gui_menu.o gui_palette.o gui_mbox.o \ -
trunk/core/main.c
r992 r1015 70 70 spytask_can_start=0; 71 71 72 #ifdef OPT_EXMEM_MALLOC 73 exmem_malloc_init(); 74 #endif 75 72 76 #ifdef CAM_CHDK_PTP 73 77 init_chdk_ptp_task(); -
trunk/include/lolevel.h
r994 r1015 289 289 #endif 290 290 291 #endif 291 #ifdef OPT_EXMEM_MALLOC 292 extern void *_exmem_alloc(int pool_id,int size,int unk); 293 #endif 294 295 #endif -
trunk/include/platform.h
r1007 r1015 548 548 void ExitTask(); 549 549 550 #endif 550 #ifdef OPT_EXMEM_MALLOC 551 void exmem_malloc_init(void); 552 #endif 553 554 #endif -
trunk/makefile.inc
r1008 r1015 405 405 endif 406 406 407 ifdef OPT_EXMEM_MALLOC 408 CFLAGS+=-DOPT_EXMEM_MALLOC 409 endif 410 407 411 ifdef OPT_WARNINGS 408 412 ifeq ($(GCC_VERSION_MAJOR),3) -
trunk/platform/d10/sub/100a/stubs_entry_2.S
r938 r1015 43 43 // useful for debugging with uart redirect or crash log 44 44 NHSTUB(LogPrintf,0xFF86EF38) 45 // allocate from given EXMEM pool 46 NHSTUB(exmem_alloc, 0xFF86C810) 47 // not needed yet 48 //NHSTUB(exmem_free, 0xFF86C7B0) -
trunk/platform/generic/wrappers.c
r1010 r1015 484 484 } 485 485 486 #ifdef OPT_EXMEM_MALLOC 487 // I set this up to 16 mb and it still booted... 488 #define EXMEM_HEAP_SIZE (1024*1024*2) 489 // these aren't currently needed elsewhere 490 /* 491 void * exmem_alloc(unsigned pool_id, unsigned size) 492 { 493 return _exmem_alloc(pool_id,size,0); 494 } 495 496 void exmem_free(unsigned pool_id) 497 { 498 _exmem_free(pool_id); 499 } 500 */ 501 502 static void *exmem_heap; 503 504 void *suba_init(void *heap, unsigned size, unsigned rst, unsigned mincell); 505 void *suba_alloc(void *heap, unsigned size, unsigned zero); 506 int suba_free(void *heap, void *p); 507 508 void exmem_malloc_init() { 509 // pool zero is EXMEM_RAMDISK on d10 510 void *mem = _exmem_alloc(0,EXMEM_HEAP_SIZE,0); 511 if(mem) { 512 exmem_heap = suba_init(mem,EXMEM_HEAP_SIZE,1,1024); 513 } 514 } 515 516 void *malloc(unsigned size) { 517 if(exmem_heap) 518 return suba_alloc(exmem_heap,size,0); 519 else 520 return _malloc(size); 521 } 522 void free(void *p) { 523 if(exmem_heap) 524 suba_free(exmem_heap,p); 525 else 526 free(p); 527 } 528 // regular malloc 529 #else 486 530 void *malloc(long size) { 487 531 return _malloc(size); … … 491 535 return _free(p); 492 536 } 537 #endif 493 538 494 539 void *memcpy(void *dest, const void *src, long n) { … … 1017 1062 } 1018 1063 */ 1064
Note: See TracChangeset
for help on using the changeset viewer.