Annotation of uae/src/md-ppc-gcc/support.c, revision 1.1.1.1

1.1       root        1:  /* 
                      2:   * UAE - The Un*x Amiga Emulator
                      3:   * 
                      4:   * Miscellaneous machine dependent support functions and definitions
                      5:   *
                      6:   * Copyright 1996 Bernd Schmidt
                      7:   */
                      8: 
                      9: #include "sysconfig.h"
                     10: #include "sysdeps.h"
                     11: 
                     12: #include "config.h"
                     13: #include "options.h"
                     14: #include "events.h"
                     15: #include "machdep/m68k.h"
                     16: 
                     17: struct flag_struct regflags;
                     18: 
                     19: int fast_memcmp(const void *foo, const void *bar, int len)
                     20: {
                     21:        return memcmp(foo, bar, len);
                     22: }
                     23: 
                     24: int memcmpy(void *foo, const void *bar, int len)
                     25: {
                     26:        while ((len -= 4) >= 0)
                     27:                if(*((long*)foo)++ != *((long*)bar)++)
                     28:                        goto diff4;
                     29:        len += 4;
                     30:     
                     31:        while (len--)
                     32:                if (*((char*)foo)++ != *((char*)bar)++) {
                     33:                        ((char*)foo)[-1] = ((char*)bar)[-1];
                     34:                        goto diff1;
                     35:                }
                     36:        return 0;
                     37: 
                     38: diff4:
                     39:        ((long*)foo)[-1] = ((long*)bar)[-1];
                     40:        while ((len -= 4) >= 0)
                     41:                *((long*)foo)++ = *((long*)bar)++;
                     42:        len += 4;
                     43: 
                     44: diff1:
                     45:        while (len--)
                     46:                *((char*)foo)++ = *((char*)bar)++;
                     47:        return 1;
                     48: }
                     49: 
                     50: static volatile frame_time_t last_time, best_time;
                     51: static volatile int loops_to_go;
                     52: 
                     53: void machdep_init (void)
                     54: {
                     55:     rpt_available = 1;
                     56:     fprintf(stderr, "Calibrating delay loop.. ");
                     57:     fflush(stderr);
                     58:     loops_to_go = 5;
                     59: 
                     60:     sync();
                     61:     last_time = read_processor_time();
                     62:     usleep(loops_to_go * 1000000);
                     63:     best_time = read_processor_time()-last_time;
                     64:     sync();
                     65: 
                     66:     vsynctime = best_time / (50*loops_to_go);
                     67:     fprintf(stderr,"ok - %d\n",best_time/loops_to_go);
                     68:     last_time = read_processor_time();
                     69:     best_time = read_processor_time()-last_time;
                     70: }
                     71: 
                     72: 

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.