Skip to content

Commit

Permalink
Removed outdated stuff including MAC OS port (no longer supported). A…
Browse files Browse the repository at this point in the history
…dded preliminary OGR-NG implementation
  • Loading branch information
Didier Levet committed Feb 10, 2008
1 parent 4676892 commit 899e160
Show file tree
Hide file tree
Showing 50 changed files with 444 additions and 2,923 deletions.
10 changes: 1 addition & 9 deletions common/baseincs.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Any other distribution or use of this source violates copyright.
*/
#ifndef __BASEINCS_H__
#define __BASEINCS_H__ "@(#)$Id: baseincs.h,v 1.89 2007/10/22 16:48:23 jlawson Exp $"
#define __BASEINCS_H__ "@(#)$Id: baseincs.h,v 1.90 2008/02/10 00:24:30 kakace Exp $"

#include "cputypes.h"

Expand Down Expand Up @@ -224,14 +224,6 @@
#elif defined(__ELF__) && !defined(_LINUX_SCHED_H)
#include <sched.h>
#endif
#elif (CLIENT_OS == OS_MACOS)
#include "client_defs.h"
#include <Gestalt.h>
#define CLOCK_MONOTONIC 3
extern "C" void tzset(void);
extern "C" int clock_gettime(int clktype, struct timespec *tsp);
#include <unistd.h>
#define fileno(f) ((f)->handle)
#elif (CLIENT_OS == OS_MACOSX)
#include <sys/time.h>
#include <sys/vmparam.h> //USRSTACK
Expand Down
20 changes: 5 additions & 15 deletions common/bench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Any other distribution or use of this source violates copyright.
*/
const char *bench_cpp(void) {
return "@(#)$Id: bench.cpp,v 1.59 2007/10/22 16:48:23 jlawson Exp $"; }
return "@(#)$Id: bench.cpp,v 1.60 2008/02/10 00:24:29 kakace Exp $"; }

//#define TRACE

Expand All @@ -24,10 +24,10 @@ return "@(#)$Id: bench.cpp,v 1.59 2007/10/22 16:48:23 jlawson Exp $"; }

#define TBENCHMARK_CALIBRATION 0x80

#if (CONTEST_COUNT != 7)
#error PROJECT_NOT_HANDLED("static initializer expects CONTEST_COUNT == 7")
#if (CONTEST_COUNT != 3)
#error PROJECT_NOT_HANDLED("static initializer expects CONTEST_COUNT == 3")
#endif
unsigned long bestrate_tab[CONTEST_COUNT] = {0,0,0,0,0,0,0};
unsigned long bestrate_tab[CONTEST_COUNT] = {0,0,0};

/* -------------------------------------------------------------------- */

Expand Down Expand Up @@ -107,14 +107,6 @@ long TBenchmark( unsigned int contestid, unsigned int numsecs, int flags )
non_preemptive_os.yps = 1000/10; /* 10 ms minimum yield rate */
tslice = 0; /* zero means 'use calibrated value' */
}
#elif (CLIENT_OS == OS_MACOS)
if ( ( flags & TBENCHMARK_CALIBRATION ) != 0 ) // 2 seconds without yield
numsecs = ((numsecs > 2) ? (2) : (numsecs)); // ... is acceptable
else
{
non_preemptive_os.yps = 1000/20; /* 20 ms minimum yield rate */
tslice = 0; /* zero means 'use calibrated value' */
}
#elif (CLIENT_OS == OS_WIN16) || (CLIENT_OS == OS_WIN32) || (CLIENT_OS == OS_WIN64) /* or win32s */
if ( ( flags & TBENCHMARK_CALIBRATION ) != 0 ) // 2 seconds without yield
numsecs = ((numsecs > 2) ? (2) : (numsecs)); // ... is acceptable
Expand Down Expand Up @@ -229,8 +221,6 @@ long TBenchmark( unsigned int contestid, unsigned int numsecs, int flags )
}
#if (CLIENT_OS == OS_WIN16) || (CLIENT_OS == OS_WIN32) || (CLIENT_OS == OS_WIN64) /* or win32s */
w32Yield(); /* pump waiting messages */
#elif (CLIENT_OS == OS_MACOS)
macosSmartYield(6);
#elif (CLIENT_OS == OS_RISCOS)
riscos_upcall_6();
#elif (CLIENT_OS == OS_NETWARE)
Expand Down Expand Up @@ -266,7 +256,7 @@ long TBenchmark( unsigned int contestid, unsigned int numsecs, int flags )
}
if (ratehi)
ratelo = 0x0fffffff;
if (ratelo > tslice || contestid == OGR || contestid == OGR_P2)
if (ratelo > tslice || contestid == OGR_NG || contestid == OGR_P2)
tslice = thisprob->pub_data.tslice = ratelo;
}
run = ProblemRun(thisprob);
Expand Down
9 changes: 5 additions & 4 deletions common/buffpub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/

const char *buffpub_cpp(void) {
return "@(#)$Id: buffpub.cpp,v 1.9 2007/10/22 16:48:23 jlawson Exp $"; }
return "@(#)$Id: buffpub.cpp,v 1.10 2008/02/10 00:24:29 kakace Exp $"; }

#include "cputypes.h"
#include "client.h" //client class
Expand Down Expand Up @@ -74,7 +74,7 @@ static FILE *BufferOpenFile( const char *filename,
{
/* OSs that require "b" for fopen() */
#if ((CLIENT_OS == OS_BEOS) || (CLIENT_OS == OS_NEXTSTEP) || \
(CLIENT_OS == OS_RISCOS) || (CLIENT_OS == OS_MACOS) || \
(CLIENT_OS == OS_RISCOS) \
(CLIENT_OS == OS_DOS) || (CLIENT_OS == OS_WIN32) || \
(CLIENT_OS == OS_NETWARE) || (CLIENT_OS == OS_OS2) || \
(CLIENT_OS == OS_WIN16) || (CLIENT_OS == OS_WIN64))
Expand Down Expand Up @@ -233,11 +233,12 @@ static void __switch_byte_order( WorkRecord *dest, const WorkRecord *source,
}
#endif
#if defined(HAVE_OGR_CORES)
case OGR:
case OGR_NG:
{
dest->work.ogr.workstub.stub.marks = (u16)ntohs(dest->work.ogr.workstub.stub.marks);
dest->work.ogr.workstub.stub.length = (u16)ntohs(dest->work.ogr.workstub.stub.length);
dest->work.ogr.iterations = 0;
dest->work.ogr.maxlen = (u32)ntohl(dest->work.ogr.maxlen);
dest->work.ogr.stopdepth = (u32)ntohl(dest->work.ogr_p2.stopdepth);
for (int i = 0; i < STUB_MAX; i++)
dest->work.ogr.workstub.stub.diffs[i] = (u16)ntohs(dest->work.ogr.workstub.stub.diffs[i]);
dest->work.ogr.workstub.worklength = (u32)ntohl(dest->work.ogr.workstub.worklength);
Expand Down
12 changes: 4 additions & 8 deletions common/clicdata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* ----------------------------------------------------------------------
*/
const char *clicdata_cpp(void) {
return "@(#)$Id: clicdata.cpp,v 1.38 2007/10/22 16:48:24 jlawson Exp $"; }
return "@(#)$Id: clicdata.cpp,v 1.39 2008/02/10 00:24:29 kakace Exp $"; }

//#define TRACE

Expand Down Expand Up @@ -43,17 +43,13 @@ static struct contestInfo
unsigned int UnitsDone;
unsigned int BestTime; /* in seconds */
int BestTimeWasForced;
} conStats[] = { { /*"RC5", "keys", */ RC5, 1, 0, {0,0}, {0,0}, {0,0}, 0, 0, 0 },
{ /*"DES", "keys", */ DES, 2, 0, {0,0}, {0,0}, {0,0}, 0, 0, 0 },
{ /*"OGR", "nodes",*/ OGR, 1, 0, {0,0}, {0,0}, {0,0}, 0, 0, 0 },
{ /*"CSC", "keys", */ CSC, 1, 0, {0,0}, {0,0}, {0,0}, 0, 0, 0 },
{ /*"OGR_NG", "nodes",*/ OGR_NEXTGEN_SOMEDAY, 1, 0, {0,0}, {0,0}, {0,0}, 0, 0, 0 },
} conStats[] = { { /*"OGR_NG", "nodes",*/ OGR_NG, 1, 0, {0,0}, {0,0}, {0,0}, 0, 0, 0 },
{ /*"RC5-72", "keys", */ RC5_72, 1, 0, {0,0}, {0,0}, {0,0}, 0, 0, 0 },
{ /*"OGR-P2", "nodes",*/ OGR_P2, 1, 0, {0,0}, {0,0}, {0,0}, 0, 0, 0 },
{ /* NULL, NULL, */ -1, 0, 0, {0,0}, {0,0}, {0,0}, 0, 0, 0 } };
// obsolete projects may be omitted
#if (CONTEST_COUNT != 7)
#error PROJECT_NOT_HANDLED("conStats[]: static initializer expects CONTEST_COUNT == 7")
#if (CONTEST_COUNT != 3)
#error PROJECT_NOT_HANDLED("conStats[]: static initializer expects CONTEST_COUNT == 3")
#endif

/* ----------------------------------------------------------------------- */
Expand Down
66 changes: 2 additions & 64 deletions common/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Any other distribution or use of this source violates copyright.
*/
const char *client_cpp(void) {
return "@(#)$Id: client.cpp,v 1.255 2008/02/07 10:24:03 kakace Exp $"; }
return "@(#)$Id: client.cpp,v 1.256 2008/02/10 00:24:29 kakace Exp $"; }

/* ------------------------------------------------------------------------ */

Expand Down Expand Up @@ -93,24 +93,6 @@ static const char *GetBuildOrEnvDescription(void)
speshul = " (SFT III MSE)";
sprintf(buffer, "NetWare%s %u.%u%c", speshul, major, minor, revision );
return buffer;
#elif (CLIENT_OS == OS_MACOS)
const char *osname = "Mac OS";
long osversion;
if ( Gestalt( gestaltAUXVersion, &osversion ) != noErr)
osversion = 0;
if (osversion != 0)
osname = "A/UX";
else if ( Gestalt( gestaltSystemVersion, &osversion ) != noErr)
osversion = 0;
if ((osversion & 0xffff) != 0)
{
static char buffer[40];
sprintf( buffer, "%s %d.%d%c%d", osname,
(int)((osversion&0xff00)>>8), (int)((osversion&0x00f0)>>4),
(((osversion & 0x000f) == 0)?(0):('.')), (int)((osversion&0x000f)) );
return buffer;
}
return "";
#elif (CLIENT_OS == OS_AMIGAOS)
static char buffer[40];
#ifdef __OS3PPC__
Expand Down Expand Up @@ -243,24 +225,6 @@ static void PrintBanner(const char *dnet_id,int level,int restarted,int logscree
{
LogScreenRaw( "\ndistributed.net client for " CLIENT_OS_NAME " "
"Copyright 1997-2007, distributed.net\n");
#if defined HAVE_RC5_64_CORES
#if (CLIENT_CPU == CPU_68K)
LogScreenRaw( "RC5 68K assembly by John Girvin\n");
#endif
#if (CLIENT_CPU == CPU_POWERPC)
LogScreenRaw( "RC5 PowerPC and AltiVec assembly by Dan Oetting\n"
"Enhancements for 604e CPUs by Roberto Ragusa\n");
#endif
#if (CLIENT_CPU == CPU_ALPHA) && (CLIENT_OS == OS_WIN32)
LogScreenRaw( "RC5 Alpha assembly by Mike Marcelais\n");
#endif
#if (CLIENT_CPU == CPU_ARM)
LogScreenRaw( "RC5 ARM assembly by Steve Lee\n");
#if (CLIENT_OS == OS_RISCOS) && defined(HAVE_X86_CARD_SUPPORT)
LogScreenRaw( "RISCOS/PC Card support by Dominic Plunkett\n");
#endif
#endif
#endif
#if defined HAVE_RC5_72_CORES
#if (CLIENT_CPU == CPU_ARM)
#if defined(HAVE_OGR_CORES) || defined(HAVE_OGR_PASS2)
Expand Down Expand Up @@ -298,29 +262,13 @@ static void PrintBanner(const char *dnet_id,int level,int restarted,int logscree
LogScreenRaw( "OGR ARM assembly by Peter Teichmann\n");
#endif
#endif
#endif
#if defined(HAVE_DES_CORES)
#if defined(KWAN) && defined(MEGGS)
LogScreenRaw( "DES bitslice driver Copyright 1997-1998, Andrew Meggs\n"
"DES sboxes routines Copyright 1997-1998, Matthew Kwan\n" );
#elif defined(KWAN) && defined(DWORZ)
LogScreenRaw( "DES bitslice driver Copyright 1999, Christoph Dworzak\n"
"DES sboxes routines Copyright 1997-1998, Matthew Kwan\n" );
#elif defined(KWAN)
LogScreenRaw( "DES search routines Copyright 1997-1998, Matthew Kwan\n" );
#endif
#if (CLIENT_CPU == CPU_X86)
LogScreenRaw( "DES search routines Copyright 1997-1998, Svend Olaf Mikkelsen\n");
#endif
#endif
#if (CLIENT_OS == OS_DOS)
LogScreenRaw( "PMODE DOS extender Copyright 1994-1998, Charles Scheffold and Thomas Pytel\n");
#endif

LogScreenRaw( "Please visit http://www.distributed.net/ for up-to-date contest information.\n");
#if (!CLIENT_OS == OS_MACOS)
LogScreenRaw( "Start the client with '-help' for a list of valid command line options.\n" );
#endif
LogScreenRaw( "\n" );
}
else if ( level == 1 || level == 2 )
Expand Down Expand Up @@ -541,17 +489,7 @@ static int ClientMain( int argc, char *argv[] )

/* ---------------------------------------------------------------------- */

#if (CLIENT_OS == OS_MACOS)
int main( void )
{
char *argv[2];
((const char **)argv)[0] = utilGetAppName();
argv[1] = (char *)0;
macosInitialize();
ClientMain(1,argv);
return 0;
}
#elif (CLIENT_OS == OS_WIN16) || (CLIENT_OS == OS_WIN32) || (CLIENT_OS == OS_WIN64)
#if (CLIENT_OS == OS_WIN16) || (CLIENT_OS == OS_WIN32) || (CLIENT_OS == OS_WIN64)
//if you get compile or link errors it is probably because you compiled with
//STRICT, which is a no-no when using cpp (think 'overloaded')
#define WIN32_LEAN_AND_MEAN
Expand Down
9 changes: 2 additions & 7 deletions common/client.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Any other distribution or use of this source violates copyright.
*/
#ifndef __CLIENT_H__
#define __CLIENT_H__ "@(#)$Id: client.h,v 1.152 2007/10/22 16:48:24 jlawson Exp $"
#define __CLIENT_H__ "@(#)$Id: client.h,v 1.153 2008/02/10 00:24:29 kakace Exp $"

#include "projdata.h" /* PROJECT_COUNT */
#include "problem.h" /* WorkRecord, CONTEST_COUNT */
Expand All @@ -14,9 +14,6 @@
#define __TEXTIFY(x) #x
#define _TEXTIFY(x) __TEXTIFY(x)

#define PREFERREDBLOCKSIZE_DEFAULT 31 /* was 30, now 31 */
#define PREFERREDBLOCKSIZE_MIN 28
#define PREFERREDBLOCKSIZE_MAX 33
#define BUFFER_DEFAULT_IN_BASENAME "buff-in"
#define BUFFER_DEFAULT_OUT_BASENAME "buff-out"
#define MINCLIENTOPTSTRLEN 64 /* no asciiz var is smaller than this */
Expand All @@ -29,7 +26,6 @@ typedef struct
{
/* non-user-configurable */
int nonewblocks;
int rc564closed;
int stopiniio;
u32 scheduledupdatetime;
char inifilename[MINCLIENTOPTSTRLEN*2];
Expand All @@ -38,7 +34,7 @@ typedef struct
int buffupd_retry_delay;
int net_update_status;
int remote_update_status;
int project_state[PROJECT_COUNT]; /* do NOT save states received from proxy to disk! */
int project_state[PROJECT_COUNT]; /* do NOT save states received from proxy to disk! */

/* -- general -- */
char id[MINCLIENTOPTSTRLEN];
Expand Down Expand Up @@ -76,7 +72,6 @@ typedef struct
#if (!defined(NO_OUTBUFFER_THRESHOLDS))
int outthreshold[CONTEST_COUNT];
#endif
int preferred_blocksize[CONTEST_COUNT];
int project_order_map[PROJECT_COUNT];

/* -- perf -- */
Expand Down
5 changes: 1 addition & 4 deletions common/cliident.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* ----------------------------------------------------------------------
*/
const char *cliident_cpp(void) {
return "@(#)$Id: cliident.cpp,v 1.29 2007/10/22 16:48:24 jlawson Exp $"; }
return "@(#)$Id: cliident.cpp,v 1.30 2008/02/10 00:24:29 kakace Exp $"; }

#include "cputypes.h"
#include "baseincs.h"
Expand All @@ -42,7 +42,6 @@ return "@(#)$Id: cliident.cpp,v 1.29 2007/10/22 16:48:24 jlawson Exp $"; }
#include "confopt.h"
#include "confrwv.h"
#include "console.h"
#include "convdes.h"
#include "cpucheck.h"
#include "disphelp.h"
#include "iniread.h"
Expand Down Expand Up @@ -104,7 +103,6 @@ static const char *h_ident_table[] =
(const char *)__CONFOPT_H__,
(const char *)__CONFRWV_H__,
(const char *)__CONSOLE_H__,
//(const char *)__CONVDES_H__,
(const char *)__CPUCHECK_H__,
(const char *)__CPUTYPES_H__,
(const char *)__DISPHELP_H__,
Expand Down Expand Up @@ -223,7 +221,6 @@ static const char * (*ident_table[])(void) =
confopt_cpp,
confrwv_cpp,
console_cpp,
//convdes_cpp,
cpucheck_cpp,
disphelp_cpp,
iniread_cpp,
Expand Down
Loading

0 comments on commit 899e160

Please sign in to comment.