The expiration time for new job artifacts in CI/CD pipelines is now 30 days (GitLab default). Previously generated artifacts in already completed jobs will not be affected by the change. The latest artifacts for all jobs in the latest successful pipelines will be kept. More information: https://gitlab.lrz.de/help/user/admin_area/settings/continuous_integration.html#default-artifacts-expiration

libconfig.plain 3.59 KB
Newer Older
1
2
3
#ifndef LIBCONFIG_H
#define LIBCONFIG_H

4
#ifdef WIN32
5
#pragma warning(disable : 4996)
6
7
#endif

8
9
/* define this if you need a local copy of mem_tetra ll */
#define MMIX_LOCAL_LL  mem_tetra *ll; /* current place in the simulated memory */
10

11
12
13
14
#define MMIX_STO(val,addr) (ll=mem_find(addr),ll->tet=(val).h,(ll+1)->tet=(val).l,true)
#define MMIX_STT(val,addr) (ll=mem_find(addr),ll->tet=(val).l,true)
#define MMIX_STW(val,addr) (ll=mem_find(addr),ll->tet=(ll->tet&(~(0xFFFF<<((1-((addr).l&0x1))<<4))))|(((val).l&0xFFFF)<<((1-((addr).l&0x1))<<4)),true)
#define MMIX_STB(val,addr) (ll=mem_find(addr),ll->tet=(ll->tet&(~(0xFF<<((3-((addr).l&0x3))<<3))))|(((val).l&0xFF)<<((3-((addr).l&0x3))<<3)),true)
15

16
17
18
19
#define MMIX_LDO(val,addr) (ll=mem_find(addr),(val).h=ll->tet,(val).l=(ll+1)->tet,true)
#define MMIX_LDT(val,addr) (ll=mem_find(addr),(val).h=0,(val).l=ll->tet,true)
#define MMIX_LDW(val,addr) (ll=mem_find(addr),(val).h=0,(val).l=(ll->tet>>(16*(1-((addr).l&1))))&0xFFFF,true)
#define MMIX_LDB(val,addr) (ll=mem_find(addr),(val).h=0,(val).l=(ll->tet>>(8*(3-((addr).l&3))))&0xFF,true)
20

21
22
#define MMIX_STO_UNCACHED(val,addr) MMIX_STO(val,addr) 
#define MMIX_LDO_UNCACHED(val,addr) MMIX_LDO(val,addr)
23

24
25

#define MMIX_FETCH(inst,loc) (ll=mem_find(loc),inst=ll->tet,true)
26
27
#define MMIX_STORE_IVTC(virt,phys)
#define MMIX_STORE_DVTC(virt,phys)
28

29
#ifdef WIN32
30
#define	MMIX_DELAY(ms,d)  (Sleep(ms), d=(ms))
31
#else
32
#define	MMIX_DELAY(ms,d)  (usleep(1000*(ms)), d=(ms))
33
#endif
34

35
/* define this to check for external asynchronous interrupts*/
36
37
38
39
40
41
42
43
#define MMIX_GET_INTERRUPT

/* this code is executed when MMIX enters the handler for Ctrl-C */
#define   MMIX_CTRL_HANDLER

/* this code defines additional options */
#define MMIX_OPTIONS  

44
45
46
47
/* if MMIX_BOOT is defined, mmis-sim will boot from addres #8000...0000
   otherwise it will resume at Main */

#undef MMIX_BOOT
48
49
50
51
52
53
54
55
56

#ifdef MMIX_PRINT
extern int mmix_printf(char *format,...);
extern int mmix_fputc(int c, FILE *f);
#define printf(...) mmix_printf(__VA_ARGS__)
#define fprintf(file,...) mmix_printf(__VA_ARGS__)
#define fputc(c,f) mmix_fputc(c,f)
#endif

57
#define MMIX_NO_FILE if (!*cur_arg) scan_option("?",true) /* exit with usage note */
58

59
60
/* define this to get the real TRAP implementation not the MMIXWARE fake TRAPS */
#undef MMIX_TRAP
61

62
63
/* this is the error display function */
#define MMIX_ERROR(f,m) fprintf(stderr,f,m)
64

65
/* define this if you need the tetra inside the mem_node */
66
#define MMIX_MEM_TET tetra tet; /* the tetrabyte of simulated memory */
67

68
/* these are the functions for the instructions not implemented in the basic mmix simulator */
69
70
71
72
73
74
75
76
77
78
79
#define MMIX_WRITE_DCACHE() 
#define MMIX_CLEAR_ICACHE() 
#define MMIX_CLEAR_DCACHE() 
#define MMIX_UPDATE_VTC(w) zero_octa 
#define MMIX_CLEAR_DVTC() 
#define MMIX_CLEAR_IVTC() 
#define MMIX_PRELOAD_DCACHE(w,xx) 
#define MMIX_PRELOAD_ICACHE(w,xx) 
#define MMIX_STORE_DCACHE(w,xx) 
#define MMIX_DELETE_DCACHE(w,xx) 
#define MMIX_DELETE_ICACHE(w,xx) 
80

81
82
83
84
85
#define MMXIAL_LINE_TRUNCATED     fprintf(stderr,"(say `-b <number>' to increase the length of my input buffer)\n");

/* MMIXAL has its own notion of file numbers as embedded in the mmo file
   we might want to convert this to a global file number */
#define MMIX_FILE_NO(file_no) (file_no)
86

87
88
/* define this to record file line and location associations while assembling */
#define MMIXAL_LINE_LOC(file_no,line_no,cur_loc)
89
90
91
/* define this to record file line and location associations while loading mmo files 
   undefine to get the default behaviour of storing file_no and line_no in the mem_tetra */
#undef MMIX_LOAD_LINE_LOC(file_no,line_no,cur_loc)
92
#endif