Пример #1
0
//--------------------------------------------------------------------------
static int notify(processor_t::idp_notify msgid, ...) { // Various messages:
  va_list va;
  va_start(va, msgid);
  int code = invoke_callbacks(HT_IDP, msgid, va);
  if ( code ) return code;
  switch ( msgid ) {
    case processor_t::newfile:
    case processor_t::oldfile:
      tnode.create("$ tms node");
    default:
      break;

    case processor_t::move_segm:// A segment is moved
                                // Fix processor dependent address sensitive information
                                // args: ea_t from - old segment address
                                //       segment_t - moved segment
      {
        ea_t from    = va_arg(va, ea_t);
        segment_t *s = va_arg(va, segment_t *);
        asize_t size = s->size();
        tnode.altshift(from, s->startEA, size);
        tnode.altadjust(from, s->startEA, size, skip_12);
      }
      break;

  }
  return(1);
}
Пример #2
0
//----------------------------------------------------------------------
static int notify(processor_t::idp_notify msgid, ...) { // Various messages:
  va_list va;
  va_start(va, msgid);

// A well behaving processor module should call invoke_callbacks()
// in his notify() function. If this function returns 0, then
// the processor module should process the notification itself
// Otherwise the code should be returned to the caller:

  int code = invoke_callbacks(HT_IDP, msgid, va);
  if ( code ) return code;

  int retcode = 1;
  segment_t *sptr;
  static uchar first = 0;

  switch(msgid) {
    case processor_t::newseg:
      sptr = va_arg(va, segment_t *);
      sptr->defsr[rVds-ph.regFirstSreg] = find_selector(inf.start_cs); //sptr->sel;
      break;

    case processor_t::init:
      ovrtrans.create(ovrtrans_name);   // it makes no harm to create it again
    default:
      break;

    case processor_t::oldfile:
      m.asect_top = (ushort)ovrtrans.altval(n_asect);
      m.ovrcallbeg = (ushort)ovrtrans.altval(n_ovrbeg);
      m.ovrcallend = (ushort)ovrtrans.altval(n_ovrend);
      if(ovrtrans.altval(n_asciiX))
         ash.XlatAsciiOutput = macro11.XlatAsciiOutput = NULL;
      m.ovrtbl_base = (uint32)ovrtrans.altval(n_ovrbas);
    case processor_t::newfile:
      first = 1;
      break;

    case processor_t::loader:
      {
        pdp_ml_t **ml = va_arg(va, pdp_ml_t **);
        netnode  **mn  = va_arg(va, netnode **);
        if(ml && mn) {
          *ml = &m;
          *mn = &ovrtrans;
          retcode = 0;
        }
      }
      break;

    case processor_t::move_segm:
                                // A segment is moved
                                // Fix processor dependent address sensitive information
                                // args: ea_t from - old segment address
                                //       segment_t - moved segment
      {
        ea_t from    = va_arg(va, ea_t);
        segment_t *s = va_arg(va, segment_t *);
        ovrtrans.altshift(from, s->startEA, s->size()); // i'm not sure about this
      }
      break;
  }
  va_end(va);

  return(retcode);
}