[gforth] / gforth / engine / main.c  

gforth: gforth/engine/main.c

Diff for /gforth/engine/main.c between version 1.16 and 1.17

version 1.16, Fri Dec 25 22:50:49 1998 UTC version 1.17, Fri Jan 1 15:20:37 1999 UTC
Line 216 
Line 216 
     fprintf(stderr,"try mmap($%lx, $%lx, ..., MAP_ANON, ...); ", (long)next_address, (long)size);      fprintf(stderr,"try mmap($%lx, $%lx, ..., MAP_ANON, ...); ", (long)next_address, (long)size);
   r=mmap(next_address, size, PROT_EXEC|PROT_READ|PROT_WRITE, MAP_ANON|MAP_PRIVATE, -1, 0);    r=mmap(next_address, size, PROT_EXEC|PROT_READ|PROT_WRITE, MAP_ANON|MAP_PRIVATE, -1, 0);
 #else /* !defined(MAP_ANON) */  #else /* !defined(MAP_ANON) */
   /* Ultrix (at least does not define MAP_FILE and MAP_PRIVATE (both are    /* Ultrix (at least) does not define MAP_FILE and MAP_PRIVATE (both are
      apparently defaults*/       apparently defaults) */
 #ifndef MAP_FILE  #ifndef MAP_FILE
 # define MAP_FILE 0  # define MAP_FILE 0
 #endif  #endif
Line 342 
Line 342 
   ImageHeader header;    ImageHeader header;
   Address image;    Address image;
   Address imp; /* image+preamble */    Address imp; /* image+preamble */
   Char magic[9];    Char magic[8];
     char magic7; /* size byte of magic number */
   Cell preamblesize=0;    Cell preamblesize=0;
   Label *symbols = engine(0,0,0,0,0);    Label *symbols = engine(0,0,0,0,0);
   Cell data_offset = offset_image ? 56*sizeof(Cell) : 0;    Cell data_offset = offset_image ? 56*sizeof(Cell) : 0;
Line 358 
Line 359 
                    (sizeof(Cell) == 2) ? 1 :                     (sizeof(Cell) == 2) ? 1 :
                    (sizeof(Cell) == 4) ? 2 : 3) + ausize;                     (sizeof(Cell) == 4) ? 2 : 3) + ausize;
   
   
 #ifndef DOUBLY_INDIRECT  #ifndef DOUBLY_INDIRECT
   check_sum = checksum(symbols);    check_sum = checksum(symbols);
 #else /* defined(DOUBLY_INDIRECT) */  #else /* defined(DOUBLY_INDIRECT) */
Line 372 
Line 374 
     }      }
     preamblesize+=8;      preamblesize+=8;
   } while(memcmp(magic,"Gforth2",7));    } while(memcmp(magic,"Gforth2",7));
     magic7 = magic[7];
   if (debug) {    if (debug) {
     magic[8]='\0';      magic[7]='\0';
     fprintf(stderr,"Magic found: %s\n", magic);      fprintf(stderr,"Magic found: %s $%x\n", magic, magic7);
   }    }
   
   if(magic[7] != (ausize << 5) + (charsize << 3) + (cellsize << 1) +    if(magic7 != (ausize << 5) + (charsize << 3) + (cellsize << 1) +
 #ifdef WORDS_BIGENDIAN  #ifdef WORDS_BIGENDIAN
        0         0
 #else  #else
Line 386 
Line 389 
        )         )
     { fprintf(stderr,"This image is %d bit cell, %d bit char, %d bit address unit %s-endian,\n"      { fprintf(stderr,"This image is %d bit cell, %d bit char, %d bit address unit %s-endian,\n"
               "whereas the machine is %d bit cell, %d bit char, %d bit address unit, %s-endian.\n",                "whereas the machine is %d bit cell, %d bit char, %d bit address unit, %s-endian.\n",
               (1<<((magic[7]>>1)&3))*8,                (1<<((magic7>>1)&3))*8,
               (1<<((magic[7]>>3)&3))*8,                (1<<((magic7>>3)&3))*8,
               (1<<((magic[7]>>5)&3))*8,                (1<<((magic7>>5)&3))*8,
               endianstring[magic[7]&1],                endianstring[magic7&1],
               (1<<cellsize)*8,                (1<<cellsize)*8,
               (1<<charsize)*8,                (1<<charsize)*8,
               (1<<ausize)*8,                (1<<ausize)*8,


Generate output suitable for use with a patch program
Legend:
Removed from v.1.16  
changed lines
  Added in v.1.17

CVS Admin

Powered by ViewCVS 1.0-dev
(Powered by ViewCVS)

ViewCVS and CVS Help