Skip to content

Commit

Permalink
Detect PPC e5500/e6500 + Minor AmigaOS 4.x housekeeping
Browse files Browse the repository at this point in the history
  • Loading branch information
Futaura committed Feb 13, 2016
1 parent 18b9a92 commit 4c74c3b
Show file tree
Hide file tree
Showing 13 changed files with 178 additions and 17 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ dnetc.1
dnetc*.tar.gz
dnetc*.zip
dnetc*.lha
dnetc*.library

dnetc.ini
buff-in.*
Expand Down
12 changes: 9 additions & 3 deletions common/cpucheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,8 @@ static long __GetRawProcessorID(const char **cpuname)
{ 0x8020, "e500" },
{ 0x8021, "e500v2" },
{ 0x8023, "e500mc" },
{ 0x8024, "e5500" },
{ 0x8040, "e6500" },
{ 0x8081, "5200 (G2)" },
{ 0x8082, "5200 (G2-LE)" },
// { 0x810x, "e200z5" }, // last digit of rid???
Expand Down Expand Up @@ -831,6 +833,8 @@ static long __GetRawProcessorID(const char **cpuname)
{ "e500", 0x8020 },
{ "e500v2", 0x8021 },
{ "e500mc", 0x8023 },
{ "e5500", 0x8024 },
{ "e6500", 0x8040 },
// { "e200z5", 0x810x },
// { "e200z6", 0x811x },
// Must find true rid's for these
Expand Down Expand Up @@ -900,7 +904,7 @@ static long __GetRawProcessorID(const char **cpuname)
#if defined(__amigaos4__)
/* AmigaOS 4.x */
ULONG cpu;
IExec->GetCPUInfoTags(GCIT_Model, &cpu, TAG_DONE);
GetCPUInfoTags(GCIT_Model, &cpu, TAG_DONE);
switch (cpu)
{
case CPUTYPE_PPC603E: detectedtype = 0x0006; break;
Expand All @@ -921,6 +925,8 @@ static long __GetRawProcessorID(const char **cpuname)
case CPUTYPE_PPC440SP: detectedtype = 0x5322; break;
case CPUTYPE_PA6T_1682M: detectedtype = 0x0090; break;
case CPUTYPE_PPC460EX: detectedtype = 0x1302; break;
case CPUTYPE_PPC5121E: detectedtype = 0x0086; break;
case CPUTYPE_P50XX: detectedtype = 0x8024; break;
default: // some PPC processor that we don't know about
// set the tag (so that the user can tell us), but return 0
sprintf(namebuf, "OS4:%ld", cpu );
Expand Down Expand Up @@ -2526,7 +2532,7 @@ unsigned int GetProcessorFrequency(int device)
#elif (CLIENT_OS == OS_AMIGAOS) && (CLIENT_CPU == CPU_POWERPC)
#if defined(__amigaos4__)
uint64 freqhz;
IExec->GetCPUInfoTags(GCIT_ProcessorSpeed, &freqhz, TAG_DONE);
GetCPUInfoTags(GCIT_ProcessorSpeed, &freqhz, TAG_DONE);
if (freqhz != 0)
freq = (freqhz + 500000) / 1000000;
#elif !defined(__POWERUP__)
Expand Down Expand Up @@ -2713,7 +2719,7 @@ unsigned long GetProcessorFeatureFlags(int device)
/* AmigaOS 4.x */
ULONG vec;
char *extensions;
IExec->GetCPUInfoTags(GCIT_VectorUnit, &vec, GCIT_Extensions, &extensions, TAG_DONE);
GetCPUInfoTags(GCIT_VectorUnit, &vec, GCIT_Extensions, &extensions, TAG_DONE);

if ((vec == VECTORTYPE_ALTIVEC) &&
(extensions && strstr(extensions,"altivec")) &&
Expand Down
1 change: 1 addition & 0 deletions docs/CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ Version change log: $Id: CHANGES.txt,v 1.133 2016/02/01 16:09:10 ertyu Exp $
imp: gpu: better handling of small blocks on fast GPUs
imp: x86/amd64: Intel Xeon E5/E7 v3 (#4626,#4627)
fix: threading on FreeBSD >= 10
imp: ppc: recognize e5500 and e6500 processors

2.9111.520 imp: all: support for benchmarks > 2Gkeys/sec
chg: all: increase max threads to 512
Expand Down
6 changes: 3 additions & 3 deletions plat/amigaos/amMemory.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright distributed.net 1997-2002 - All Rights Reserved
* Copyright distributed.net 1997-2016 - All Rights Reserved
* For use in distributed.net projects only.
* Any other distribution or use of this source violates copyright.
*
Expand Down Expand Up @@ -43,7 +43,7 @@ BOOL MemInit(VOID)
{
if (!MemPool) {
#ifdef __amigaos4__
MemPool = CreatePool(MEMF_SHARED,8192,4096); /* OS4 */
MemPool = AllocSysObjectTags(ASOT_MEMPOOL,ASOPOOL_MFlags,MEMF_SHARED,ASOPOOL_Puddle,8192,ASOPOOL_Threshold,4096,ASOPOOL_Name,"dnetc",TAG_END); /* OS4 */
#elif !defined(__PPC__)
MemPool = LibCreatePool(MEMF_PUBLIC,8192,4096); /* 68K */
InitSemaphore(&MemPoolLock);
Expand Down Expand Up @@ -138,7 +138,7 @@ VOID MemDeinit(VOID)
if (MemPool) {
#if defined(__amigaos4__)
ObtainSemaphore(&MemPoolLock);
DeletePool(MemPool); /* OS4 */
FreeSysObject(ASOT_MEMPOOL,MemPool); /* OS4 */
ReleaseSemaphore(&MemPoolLock);
#elif !defined(__PPC__)
ObtainSemaphore(&MemPoolLock);
Expand Down
21 changes: 20 additions & 1 deletion plat/amigaos/amiga.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright distributed.net 1997-2003 - All Rights Reserved
* Copyright distributed.net 1997-2016 - All Rights Reserved
* For use in distributed.net projects only.
* Any other distribution or use of this source violates copyright.
*
Expand Down Expand Up @@ -109,6 +109,25 @@ extern "C" {
#endif
#endif

#ifdef __amigaos4__
#ifdef CreateMsgPort
#undef CreateMsgPort
#endif
#define CreateMsgPort() (struct MsgPort *)AllocSysObject(ASOT_PORT,NULL)
#ifdef DeleteMsgPort
#undef DeleteMsgPort
#endif
#define DeleteMsgPort(msgPort) FreeSysObject(ASOT_PORT,msgPort)
#ifdef CreateIORequest
#undef CreateIORequest
#endif
#define CreateIORequest(ioReplyPort,size) AllocSysObjectTags(ASOT_IOREQUEST,ASOIOR_ReplyPort,ioReplyPort,ASOIOR_Size,size,TAG_DONE)
#ifdef DeleteIORequest
#undef DeleteIORequest
#endif
#define DeleteIORequest(ioReq) FreeSysObject(ASOT_IOREQUEST,ioReq)
#endif

#define DNETC_MSG_RESTART 0x01
#define DNETC_MSG_SHUTDOWN 0x02
#define DNETC_MSG_PAUSE 0x04
Expand Down
2 changes: 2 additions & 0 deletions plat/amigaos/guilib/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dnetcgui_rev.i
dnetcgui_rev.s
11 changes: 10 additions & 1 deletion plat/amigaos/guilib/common.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright distributed.net 1997-2002 - All Rights Reserved
* Copyright distributed.net 1997-2016 - All Rights Reserved
* For use in distributed.net projects only.
* Any other distribution or use of this source violates copyright.
*
Expand Down Expand Up @@ -125,6 +125,15 @@ VOID CloseLibraryIFace( struct Library *lib, APTR iface );
#define DoMethod IDoMethod
#define NewObject IIntuition->NewObject

#ifdef CreateMsgPort
#undef CreateMsgPort
#endif
#define CreateMsgPort() AllocSysObject(ASOT_PORT,NULL)
#ifdef DeleteMsgPort
#undef DeleteMsgPort
#endif
#define DeleteMsgPort(msgPort) FreeSysObject(ASOT_PORT,msgPort)

LIBFUNC ULONG dnetcguiOpen(struct Interface *self, ULONG cpu, UBYTE *programname, struct WBArg *iconname, const char *vstring);
LIBFUNC BOOL dnetcguiClose(struct Interface *self, struct ClientGUIParams *params);
LIBFUNC VOID dnetcguiConsoleOut(struct Interface *self, ULONG cpu, UBYTE *output, BOOL overwrite);
Expand Down
122 changes: 122 additions & 0 deletions plat/amigaos/guilib/dnetcgui_68k.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
/*
** This file was automatically generated by fdtrans 52.1.
** Do not edit it by hand. Instead, edit the sfd file
** that was used to generate this file
*/

#ifdef __USE_INLINE__
#undef __USE_INLINE__
#endif
#ifndef __NOGLOBALIFACE__
#define __NOGLOBALIFACE__
#endif

#include <exec/interfaces.h>
#include <exec/libraries.h>
#include <exec/emulation.h>
#include <interfaces/exec.h>
#include <interfaces/dnetcgui.h>
#include <proto/dnetcgui.h>


static inline int8 convert_int8 (uint32 x) { return x; }
static inline int16 convert_int16(uint32 x) { return x; }


STATIC struct Library * stub_OpenPPC(ULONG *regarray)
{
struct Library *Base = (struct Library *) regarray[REG68K_A6/4];
struct ExtendedLibrary *ExtLib = (struct ExtendedLibrary *) ((ULONG)Base + Base->lib_PosSize);
struct LibraryManagerInterface *Self = (struct LibraryManagerInterface *) ExtLib->ILibrary;

return Self->Open(0);
}
STATIC CONST struct EmuTrap stub_Open = { TRAPINST, TRAPTYPE, (ULONG (*)(ULONG *))stub_OpenPPC };

STATIC APTR stub_ClosePPC(ULONG *regarray)
{
struct Library *Base = (struct Library *) regarray[REG68K_A6/4];
struct ExtendedLibrary *ExtLib = (struct ExtendedLibrary *) ((ULONG)Base + Base->lib_PosSize);
struct LibraryManagerInterface *Self = (struct LibraryManagerInterface *) ExtLib->ILibrary;

return Self->Close();
}
STATIC CONST struct EmuTrap stub_Close = { TRAPINST, TRAPTYPE, (ULONG (*)(ULONG *))stub_ClosePPC };

STATIC APTR stub_ExpungePPC(ULONG *regarray __attribute__((unused)))
{
return NULL;
}
STATIC CONST struct EmuTrap stub_Expunge = { TRAPINST, TRAPTYPE, (ULONG (*)(ULONG *))stub_ExpungePPC };

STATIC ULONG stub_ReservedPPC(ULONG *regarray __attribute__((unused)))
{
return 0UL;
}
STATIC CONST struct EmuTrap stub_Reserved = { TRAPINST, TRAPTYPE, stub_ReservedPPC };

static ULONG stub_dnetcguiOpenPPC(uint32 *regarray)
{
struct Library *Base = (struct Library *) regarray[REG68K_A6/4];
struct ExtendedLibrary *ExtLib = (struct ExtendedLibrary *) ((uint32)Base + Base->lib_PosSize);
struct DnetcIFace *Self = (struct DnetcIFace *) ExtLib->MainIFace;

return Self->dnetcguiOpen(
(ULONG)regarray[0],
(UBYTE *)regarray[8],
(struct WBArg *)regarray[9],
(const char *)regarray[10]
);
}
STATIC CONST struct EmuTrap stub_dnetcguiOpen = { TRAPINST, TRAPTYPE, (uint32 (*)(uint32 *))stub_dnetcguiOpenPPC };

static BOOL stub_dnetcguiClosePPC(uint32 *regarray)
{
struct Library *Base = (struct Library *) regarray[REG68K_A6/4];
struct ExtendedLibrary *ExtLib = (struct ExtendedLibrary *) ((uint32)Base + Base->lib_PosSize);
struct DnetcIFace *Self = (struct DnetcIFace *) ExtLib->MainIFace;

return Self->dnetcguiClose(
(struct ClientGUIParams *)regarray[8]
);
}
STATIC CONST struct EmuTrap stub_dnetcguiClose = { TRAPINST, TRAPTYPE, (uint32 (*)(uint32 *))stub_dnetcguiClosePPC };

static ULONG stub_dnetcguiHandleMsgsPPC(uint32 *regarray)
{
struct Library *Base = (struct Library *) regarray[REG68K_A6/4];
struct ExtendedLibrary *ExtLib = (struct ExtendedLibrary *) ((uint32)Base + Base->lib_PosSize);
struct DnetcIFace *Self = (struct DnetcIFace *) ExtLib->MainIFace;

return Self->dnetcguiHandleMsgs(
(ULONG)regarray[0]
);
}
STATIC CONST struct EmuTrap stub_dnetcguiHandleMsgs = { TRAPINST, TRAPTYPE, (uint32 (*)(uint32 *))stub_dnetcguiHandleMsgsPPC };

static VOID stub_dnetcguiConsoleOutPPC(uint32 *regarray)
{
struct Library *Base = (struct Library *) regarray[REG68K_A6/4];
struct ExtendedLibrary *ExtLib = (struct ExtendedLibrary *) ((uint32)Base + Base->lib_PosSize);
struct DnetcIFace *Self = (struct DnetcIFace *) ExtLib->MainIFace;

Self->dnetcguiConsoleOut(
(ULONG)regarray[0],
(UBYTE *)regarray[8],
(BOOL)convert_int16(regarray[1])
);
}
STATIC CONST struct EmuTrap stub_dnetcguiConsoleOut = { TRAPINST, TRAPTYPENR, (uint32 (*)(uint32 *))stub_dnetcguiConsoleOutPPC };

CONST CONST_APTR VecTable68K[] =
{
&stub_Open,
&stub_Close,
&stub_Expunge,
&stub_Reserved,
&stub_dnetcguiOpen,
&stub_dnetcguiClose,
&stub_dnetcguiHandleMsgs,
&stub_dnetcguiConsoleOut,
(CONST_APTR)-1
};
10 changes: 5 additions & 5 deletions plat/amigaos/guilib/dnetcgui_rev.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#define VERSION 1
#define REVISION 13
#define DATE "17.12.2010"
#define VERS "dnetcgui 1.13"
#define VSTRING "dnetcgui 1.13 (17.12.2010)\r\n"
#define VERSTAG "\0$VER: dnetcgui 1.13 (17.12.2010)"
#define REVISION 14
#define DATE "13.2.2016"
#define VERS "dnetcgui 1.14"
#define VSTRING "dnetcgui 1.14 (13.2.2016)\r\n"
#define VERSTAG "\0$VER: dnetcgui 1.14 (13.2.2016)"
1 change: 1 addition & 0 deletions plat/amigaos/guilib/dnetcgui_rev.rev
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
14
4 changes: 2 additions & 2 deletions plat/amigaos/guilib/libbase.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright distributed.net 1997-2002 - All Rights Reserved
* Copyright distributed.net 1997-2016 - All Rights Reserved
* For use in distributed.net projects only.
* Any other distribution or use of this source violates copyright.
*
Expand All @@ -21,7 +21,7 @@ LONG _start(VOID)
}

const char ExLibName[] = "dnetcgui.library";
#define ExLibID (VSTRING "\0Copyright © 2001-2005 Oliver Roberts. All rights reserved.")
#define ExLibID (VSTRING "\0Copyright © 2001-2016 Oliver Roberts. All rights reserved.")

struct ExecBase *SysBase = NULL;
struct DosLibrary *DOSBase = NULL;
Expand Down
4 changes: 2 additions & 2 deletions plat/amigaos/guilib/main.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright distributed.net 1997-2011 - All Rights Reserved
* Copyright distributed.net 1997-2016 - All Rights Reserved
* For use in distributed.net projects only.
* Any other distribution or use of this source violates copyright.
*
Expand Down Expand Up @@ -159,7 +159,7 @@ struct NewMenu ClientMenus[] = {

const char AboutText[] =
"distributed.net client - a product of distributed.net\n"
"%s\nCopyright (C) 1997-2010 distributed.net\n\n"
"%s\nCopyright (C) 1997-2016 distributed.net\n\n"
#ifndef __amigaos4__
"\33cAmigaOS clients maintained by\n"
#else
Expand Down
Empty file modified plat/amigaos/tools/amigadate
100644 → 100755
Empty file.

0 comments on commit 4c74c3b

Please sign in to comment.