Changeset 1460 in svn for trunk/processor/main.m4


Ignore:
Timestamp:
2013-11-09T03:17:15+01:00 (20 months ago)
Author:
Xuefer
Message:

relocate: fix handling hash table, TODO: fix dst/src stuff

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/processor/main.m4

    r1458 r1460  
    2626dnl }}}
    2727dnl {{{ SRCPTR_EX(1:type, 2:elm)
    28 define(`SRCPTR_EX', `IFRELOCATE(`ptradd($1 *, notnullable($2), ptrdiff)', `$2')')
     28define(`SRCPTR_EX', `DSTPTR_EX(`$1', `$2')')
     29dnl }}}
     30dnl {{{ DSTPTR_EX(1:type, 2:elm)
     31define(`DSTPTR_EX', `$2')
    2932dnl }}}
    3033dnl {{{ ALLOC(1:dst, 2:type, 3:count=1, 4:clean=false, 5:realtype=$2)
     
    137140dnl }}}
    138141dnl {{{ FIXPOINTER_EX(1:type, 2:dst)
    139 define(`FIXPOINTER_EX', `
    140     IFSTORE(`$2 = ($1 *) processor->shm->handlers->to_readonly(processor->shm, (void *)$2);')
    141     IFRELOCATE(`
    142         pushdef(`relocatee', `patsubst($2, `dst', `src')')
    143         relocatee = ($1 *) (((char *) relocatee) + relocatediff);
    144         popdef(`relocatee')
    145     ')
    146 ')
     142define(`FIXPOINTER_EX', `')
    147143dnl }}}
    148144dnl {{{ IFNOTMEMCPY
     
    243239define(`IFCALCSTORE', `IFSTORE(`$1', `IFCALC(`$1', `$2')')')
    244240define(`IFRESTORE', `ifelse(PROCESSOR_TYPE, `restore', `$1', `$2')')
    245 define(`IFRELOCATE', `ifelse(PROCESSOR_TYPE, `relocate', `$1', `$2')')
    246241define(`IFCOPY', `IFSTORE(`$1', `IFRESTORE(`$1', `$2')')')
    247242define(`IFCALCCOPY', `IFCALC(`$1', `IFCOPY(`$1', `$2')')')
     243define(`IFRELOCATE', `ifelse(PROCESSOR_TYPE, `relocate', `$1', `$2')')
     244define(`IFFIXPOINTER', `IFSTORE(`$1', `IFRELOCATE(`$1', `$2')')')
    248245define(`IFDPRINT', `ifelse(PROCESSOR_TYPE, `dprint', `$1', `$2')')
    249246define(`IFDASM', `ifelse(PROCESSOR_TYPE, `dasm', `$1', `$2')')
     
    262259
    263260REDEF(`PROCESSOR_TYPE', `calc') include(srcdir`/processor/processor.m4')
     261
     262pushdef(`FIXPOINTER_EX', `$2 = ($1 *) processor->shm->handlers->to_readonly(processor->shm, (void *)$2);')
    264263REDEF(`PROCESSOR_TYPE', `store') include(srcdir`/processor/processor.m4')
     264popdef(`FIXPOINTER_EX')
     265
    265266REDEF(`PROCESSOR_TYPE', `restore') include(srcdir`/processor/processor.m4')
     267
     268define(`DSTPTR_EX', `ptradd($1 *, notnullable($2), ptrdiff)')
     269pushdef(`FIXPOINTER_EX', `$2 = ptradd($1 *, notnullable($2), relocatediff);')
     270define(`SRC', `DST(`$1')')
    266271REDEF(`PROCESSOR_TYPE', `relocate') include(srcdir`/processor/processor.m4')
     272popdef(`SRC')
     273popdef(`FIXPOINTER_EX')
     274popdef(`DSTPTR_EX')
    267275
    268276#ifdef HAVE_XCACHE_DPRINT
Note: See TracChangeset for help on using the changeset viewer.