-
Notifications
You must be signed in to change notification settings - Fork 0
/
lprime.h
92 lines (72 loc) · 2.16 KB
/
lprime.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/* Handy definitions */
#define FALSE 0
#define TRUE 1
/* This controls whether we want to pause computation if the load average */
/* becomes too great. This does not apply to OS/2. */
#if defined (__linux__) || defined (__FreeBSD__) || defined (__APPLE__)
#define MPRIME_LOADAVG
#if !defined (__APPLE__)
/* Handle the difference between the naming conventions in the two */
/* C compilers. We only need to to this for global variables that */
/* referenced by the assembly routines */
//#define CPU_FLAGS _CPU_FLAGS
#define FACHSW _FACHSW
#define FACMSW _FACMSW
#define FACLSW _FACLSW
#define FACPASS _FACPASS
#define FACTEST _FACTEST
#define SRCARG _SRCARG
#define CPUID_EAX _CPUID_EAX
#ifndef X86_64
#define setupf _setupf
#define factor64 _factor64
#define psetupf _psetupf
#define pfactor64 _pfactor64
#define erdtsc _erdtsc
#endif
#endif
#define max(x, y) ((x) > (y))? x : y
#define min(x, y) ((x) < (y))? x : y
void Sleep (long);
/* Handle differences between Windows and Linux runtime libraries */
#define stricmp(x,y) strcasecmp(x,y)
#define _commit(f) fsync(f)
#define _open open
#define _close close
#define _read read
#define _write write
#define _lseek lseek
#define _unlink unlink
#define _creat creat
#define _chdir chdir
#define _ftime ftime
#define _timeb timeb
#define IsCharAlphaNumeric(c) isalnum(c)
#define _O_APPEND O_APPEND
#define _O_RDONLY O_RDONLY
#define _O_WRONLY O_WRONLY
#define _O_RDWR O_RDWR
#define _O_CREAT O_CREAT
#define _O_TRUNC O_TRUNC
#define _O_BINARY 0
#define _O_TEXT 0
#endif
#define EXTERNC
/* The common include files */
#include <time.h>
#include <assert.h>
extern int NO_GUI;
#include "./gwnum/cpuid.h"
#include "./gwnum/giants.h"
#include "./gwnum/gwnum.h"
#include "./gwnum/gwcommon.h"
#include "./common.h"
#include <hwloc.h>
#include "Llr.h"
/* Global variables */
extern int volatile THREAD_STOP; /* TRUE if thread should stop */
extern int volatile THREAD_KILL; /* TRUE if program should terminate */
extern int MENUING; /* TRUE when main menu active */
/* Internal routines */
void main_menu ();
void linuxContinue (char *);