Zap more a29k stragglers.
This commit is contained in:
parent
cbb09e6a75
commit
de888f764c
14 changed files with 5 additions and 3255 deletions
|
@ -1,9 +0,0 @@
|
|||
The files in this directory are shared with other debuggers and
|
||||
debug interfaces that use Advanced Micro Devices' UDI (universal debug
|
||||
interface) protocol. The protocol provides a common interface among
|
||||
debuggers, logic analyzers, emulators, and embedded systems that use
|
||||
AMD 29000 family processors.
|
||||
|
||||
Do not change these files without coordinating with Advanced Micro
|
||||
Devices, Embedded Processor Division, 5204 E. Ben White Blvd, Austin, TX 78741.
|
||||
Maybe postmaster@cayman.amd.com can direct you to the current maintainers.
|
|
@ -1,607 +0,0 @@
|
|||
/*
|
||||
|
||||
Interface from UDI calls in 32-bit mode to go32 in 16-bit mode.
|
||||
Communication is done through a single interrupt vector, which passes
|
||||
data through two linear buffers.
|
||||
|
||||
Call:
|
||||
AH = 0xfe
|
||||
AL = UDI function number
|
||||
ECX = IN length
|
||||
ESI = pointer to IN buffer
|
||||
EDI = pointer to OUT buffer
|
||||
|
||||
Return:
|
||||
EAX = return value of UDI function
|
||||
|
||||
Vector:
|
||||
0x21
|
||||
|
||||
*/
|
||||
#ifdef __GO32__
|
||||
|
||||
#include <stdlib.h>
|
||||
#include "udiproc.h"
|
||||
#include "udisoc.h"
|
||||
|
||||
char dfe_errmsg[500];
|
||||
|
||||
static char in_buffer[4096];
|
||||
static char out_buffer[4096];
|
||||
static char *in_ptr;
|
||||
static char *out_ptr;
|
||||
|
||||
#define IN_INIT() in_ptr = in_buffer
|
||||
#define IN_VAL(t,v) *((t *)in_ptr)++ = v
|
||||
#define IN_DATA(ptr, cnt) memcpy(in_ptr, ptr, cnt), in_ptr += cnt
|
||||
|
||||
#define OUT_INIT() out_ptr = out_buffer
|
||||
#define OUT_VAL(t) (*((t *)out_ptr)++)
|
||||
#define OUT_DATA(ptr, cnt) memcpy(ptr, out_ptr, cnt), out_ptr += cnt
|
||||
|
||||
static int DO_CALL(int function)
|
||||
{
|
||||
asm("pushl %esi");
|
||||
asm("pushl %edi");
|
||||
asm("movb %0, %%al" : : "g" (function));
|
||||
asm("movl _in_ptr, %ecx");
|
||||
asm("movl $_in_buffer, %esi");
|
||||
asm("subl %esi, %ecx");
|
||||
asm("movl $_out_buffer, %edi");
|
||||
asm("movb $0xfe, %ah");
|
||||
asm("int $0x21");
|
||||
asm("popl %edi");
|
||||
asm("popl %esi");
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
#ifdef TEST_UDI
|
||||
int main()
|
||||
{
|
||||
int r;
|
||||
long p2;
|
||||
short p1;
|
||||
IN_INIT();
|
||||
IN_VAL(long, 11111111);
|
||||
IN_VAL(short, 2222);
|
||||
IN_DATA("Hello, world\n", 17);
|
||||
|
||||
r = DO_CALL(42);
|
||||
|
||||
OUT_INIT();
|
||||
p1 = OUT_VAL(short);
|
||||
p2 = OUT_VAL(long);
|
||||
printf("main: p1=%d p2=%d rv=%d\n", p1, p2, r);
|
||||
return r;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
unsupported(char *s)
|
||||
{
|
||||
printf("unsupported UDI host call %s\n", s);
|
||||
abort();
|
||||
}
|
||||
|
||||
UDIError UDIConnect (
|
||||
char *Configuration, /* In */
|
||||
UDISessionId *Session /* Out */
|
||||
)
|
||||
{
|
||||
int r;
|
||||
out_buffer[0] = 0; /* DJ - test */
|
||||
IN_INIT();
|
||||
IN_DATA(Configuration, strlen(Configuration)+1);
|
||||
|
||||
r = DO_CALL(UDIConnect_c);
|
||||
|
||||
OUT_INIT();
|
||||
*Session = OUT_VAL(UDISessionId);
|
||||
return r;
|
||||
}
|
||||
|
||||
UDIError UDIDisconnect (
|
||||
UDISessionId Session, /* In */
|
||||
UDIBool Terminate /* In */
|
||||
)
|
||||
{
|
||||
int r;
|
||||
IN_INIT();
|
||||
IN_VAL(UDISessionId, Session);
|
||||
IN_VAL(UDIBool, Terminate);
|
||||
|
||||
return DO_CALL(UDIDisconnect_c);
|
||||
}
|
||||
|
||||
UDIError UDISetCurrentConnection (
|
||||
UDISessionId Session /* In */
|
||||
)
|
||||
{
|
||||
IN_INIT();
|
||||
IN_VAL(UDISessionId, Session);
|
||||
|
||||
return DO_CALL(UDISetCurrentConnection_c);
|
||||
}
|
||||
|
||||
UDIError UDICapabilities (
|
||||
UDIUInt32 *TIPId, /* Out */
|
||||
UDIUInt32 *TargetId, /* Out */
|
||||
UDIUInt32 DFEId, /* In */
|
||||
UDIUInt32 DFE, /* In */
|
||||
UDIUInt32 *TIP, /* Out */
|
||||
UDIUInt32 *DFEIPCId, /* Out */
|
||||
UDIUInt32 *TIPIPCId, /* Out */
|
||||
char *TIPString /* Out */
|
||||
)
|
||||
{
|
||||
int r;
|
||||
IN_INIT();
|
||||
IN_VAL(UDIUInt32, DFEId);
|
||||
IN_VAL(UDIUInt32, DFE);
|
||||
r = DO_CALL(UDICapabilities_c);
|
||||
OUT_INIT();
|
||||
*TIPId = OUT_VAL(UDIUInt32);
|
||||
*TargetId = OUT_VAL(UDIUInt32);
|
||||
*TIP = OUT_VAL(UDIUInt32);
|
||||
*DFEIPCId = OUT_VAL(UDIUInt32);
|
||||
*TIPIPCId = OUT_VAL(UDIUInt32);
|
||||
strcpy(TIPString, out_ptr);
|
||||
return r;
|
||||
}
|
||||
|
||||
UDIError UDIEnumerateTIPs (
|
||||
UDIInt (*UDIETCallback) /* In */
|
||||
( char *Configuration ) /* In to callback() */
|
||||
)
|
||||
{
|
||||
UDIETCallback("montip.exe");
|
||||
}
|
||||
|
||||
UDIError UDIGetErrorMsg (
|
||||
UDIError ErrorCode, /* In */
|
||||
UDISizeT MsgSize, /* In */
|
||||
char *Msg, /* Out */
|
||||
UDISizeT *CountDone /* Out */
|
||||
)
|
||||
{
|
||||
int r;
|
||||
if (MsgSize > 4000)
|
||||
MsgSize = 4000;
|
||||
IN_INIT();
|
||||
IN_VAL(UDIError, ErrorCode);
|
||||
IN_VAL(UDISizeT, MsgSize);
|
||||
|
||||
r = DO_CALL(UDIGetErrorMsg_c);
|
||||
|
||||
OUT_INIT();
|
||||
*CountDone = OUT_VAL(UDISizeT);
|
||||
OUT_DATA(Msg, *CountDone);
|
||||
return r;
|
||||
}
|
||||
|
||||
UDIError UDIGetTargetConfig (
|
||||
UDIMemoryRange KnownMemory[], /* Out */
|
||||
UDIInt *NumberOfRanges, /* In/Out */
|
||||
UDIUInt32 ChipVersions[], /* Out */
|
||||
UDIInt *NumberOfChips /* In/Out */
|
||||
)
|
||||
{
|
||||
int r, i;
|
||||
int nr = *NumberOfRanges;
|
||||
int nc = *NumberOfChips;
|
||||
IN_INIT();
|
||||
IN_VAL(UDIInt, *NumberOfRanges);
|
||||
IN_VAL(UDIInt, *NumberOfChips);
|
||||
r = DO_CALL(UDIGetTargetConfig_c);
|
||||
if (r == UDIErrorIncomplete)
|
||||
return r;
|
||||
OUT_INIT();
|
||||
*NumberOfRanges = OUT_VAL(UDIInt);
|
||||
*NumberOfChips = OUT_VAL(UDIInt);
|
||||
for (i=0; i<nr; i++)
|
||||
{
|
||||
KnownMemory[i].Space = OUT_VAL(short);
|
||||
KnownMemory[i].Offset = OUT_VAL(CPUOffset);
|
||||
KnownMemory[i].Size = OUT_VAL(CPUSizeT);
|
||||
}
|
||||
for (i=0; i<nc; i++)
|
||||
{
|
||||
ChipVersions[i] = OUT_VAL(UDIUInt32);
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
UDIError UDICreateProcess (
|
||||
UDIPId *PId /* Out */
|
||||
)
|
||||
{
|
||||
int r = DO_CALL(UDICreateProcess_c);
|
||||
|
||||
OUT_INIT();
|
||||
*PId = OUT_VAL(UDIPId);
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
UDIError UDISetCurrentProcess (
|
||||
UDIPId PId /* In */
|
||||
)
|
||||
{
|
||||
IN_INIT();
|
||||
IN_VAL(UDIPId, PId);
|
||||
|
||||
return DO_CALL(UDISetCurrentProcess_c);
|
||||
}
|
||||
|
||||
UDIError UDIDestroyProcess (
|
||||
UDIPId PId /* In */
|
||||
)
|
||||
{
|
||||
IN_INIT();
|
||||
IN_VAL(UDIPId, PId);
|
||||
|
||||
return DO_CALL(UDIDestroyProcess_c);
|
||||
}
|
||||
|
||||
UDIError UDIInitializeProcess (
|
||||
UDIMemoryRange ProcessMemory[], /* In */
|
||||
UDIInt NumberOfRanges, /* In */
|
||||
UDIResource EntryPoint, /* In */
|
||||
CPUSizeT StackSizes[], /* In */
|
||||
UDIInt NumberOfStacks, /* In */
|
||||
char *ArgString /* In */
|
||||
)
|
||||
{
|
||||
int i, r;
|
||||
IN_INIT();
|
||||
IN_VAL(UDIInt, NumberOfRanges);
|
||||
for (i=0; i<NumberOfRanges; i++)
|
||||
{
|
||||
IN_VAL(short, ProcessMemory[i].Space);
|
||||
IN_VAL(CPUOffset, ProcessMemory[i].Offset);
|
||||
IN_VAL(CPUSizeT, ProcessMemory[i].Size);
|
||||
}
|
||||
IN_VAL(short, EntryPoint.Space);
|
||||
IN_VAL(CPUOffset, EntryPoint.Offset);
|
||||
IN_VAL(UDIInt, NumberOfStacks);
|
||||
for (i=0; i<NumberOfStacks; i++)
|
||||
IN_VAL(CPUSizeT, StackSizes[i]);
|
||||
IN_DATA(ArgString, strlen(ArgString)+1);
|
||||
|
||||
return DO_CALL(UDIInitializeProcess_c);
|
||||
}
|
||||
|
||||
UDIError UDIRead (
|
||||
UDIResource From, /* In */
|
||||
UDIHostMemPtr To, /* Out */
|
||||
UDICount Count, /* In */
|
||||
UDISizeT Size, /* In */
|
||||
UDICount *CountDone, /* Out */
|
||||
UDIBool HostEndian /* In */
|
||||
)
|
||||
{
|
||||
int cleft = Count, cthis, dthis;
|
||||
int cdone = 0, r, bsize=2048/Size;
|
||||
|
||||
while (cleft)
|
||||
{
|
||||
cthis = (cleft<bsize) ? cleft : bsize;
|
||||
IN_INIT();
|
||||
IN_VAL(short, From.Space);
|
||||
IN_VAL(CPUOffset, From.Offset);
|
||||
IN_VAL(UDICount, cthis);
|
||||
IN_VAL(UDISizeT, Size);
|
||||
IN_VAL(UDIBool, HostEndian);
|
||||
|
||||
r = DO_CALL(UDIRead_c);
|
||||
|
||||
OUT_INIT();
|
||||
dthis = OUT_VAL(UDICount);
|
||||
OUT_DATA(To, dthis*Size);
|
||||
cdone += dthis;
|
||||
To += dthis*Size;
|
||||
|
||||
if (r != UDINoError)
|
||||
{
|
||||
*CountDone = cdone;
|
||||
return r;
|
||||
}
|
||||
cleft -= cthis;
|
||||
}
|
||||
*CountDone = cdone;
|
||||
return UDINoError;
|
||||
}
|
||||
|
||||
UDIError UDIWrite (
|
||||
UDIHostMemPtr From, /* In */
|
||||
UDIResource To, /* In */
|
||||
UDICount Count, /* In */
|
||||
UDISizeT Size, /* In */
|
||||
UDICount *CountDone, /* Out */
|
||||
UDIBool HostEndian /* In */
|
||||
)
|
||||
{
|
||||
int cleft = Count, cthis, dthis;
|
||||
int cdone = 0, r, bsize=2048/Size;
|
||||
|
||||
while (cleft)
|
||||
{
|
||||
cthis = (cleft<bsize) ? cleft : bsize;
|
||||
IN_INIT();
|
||||
IN_VAL(short, To.Space);
|
||||
IN_VAL(CPUOffset, To.Offset);
|
||||
IN_VAL(UDICount, cthis);
|
||||
IN_VAL(UDISizeT, Size);
|
||||
IN_VAL(UDIBool, HostEndian);
|
||||
IN_DATA(From, cthis*Size);
|
||||
From += cthis*Size;
|
||||
|
||||
r = DO_CALL(UDIWrite_c);
|
||||
|
||||
OUT_INIT();
|
||||
cdone += OUT_VAL(UDICount);
|
||||
|
||||
if (r != UDINoError)
|
||||
{
|
||||
*CountDone = cdone;
|
||||
return r;
|
||||
}
|
||||
cleft -= cthis;
|
||||
}
|
||||
*CountDone = cdone;
|
||||
return UDINoError;
|
||||
}
|
||||
|
||||
UDIError UDICopy (
|
||||
UDIResource From, /* In */
|
||||
UDIResource To, /* In */
|
||||
UDICount Count, /* In */
|
||||
UDISizeT Size, /* In */
|
||||
UDICount *CountDone, /* Out */
|
||||
UDIBool Direction /* In */
|
||||
)
|
||||
{
|
||||
int r;
|
||||
IN_INIT();
|
||||
IN_VAL(short, From.Space);
|
||||
IN_VAL(CPUOffset, From.Offset);
|
||||
IN_VAL(short, To.Space);
|
||||
IN_VAL(CPUOffset, To.Offset);
|
||||
IN_VAL(UDICount, Count);
|
||||
IN_VAL(UDISizeT, Size);
|
||||
IN_VAL(UDIBool, Direction);
|
||||
|
||||
r = DO_CALL(UDICopy_c);
|
||||
|
||||
OUT_INIT();
|
||||
*CountDone = OUT_VAL(UDICount);
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
UDIError UDIExecute (
|
||||
void
|
||||
)
|
||||
{
|
||||
return DO_CALL(UDIExecute_c);
|
||||
}
|
||||
|
||||
UDIError UDIStep (
|
||||
UDIUInt32 Steps, /* In */
|
||||
UDIStepType StepType, /* In */
|
||||
UDIRange Range /* In */
|
||||
)
|
||||
{
|
||||
IN_INIT();
|
||||
IN_VAL(UDIUInt32, Steps);
|
||||
IN_VAL(UDIStepType, StepType);
|
||||
IN_VAL(UDIRange, Range);
|
||||
|
||||
return DO_CALL(UDIStep_c);
|
||||
}
|
||||
|
||||
UDIVoid UDIStop (
|
||||
void
|
||||
)
|
||||
{
|
||||
DO_CALL(UDIStop_c);
|
||||
}
|
||||
|
||||
UDIError UDIWait (
|
||||
UDIInt32 MaxTime, /* In */
|
||||
UDIPId *PId, /* Out */
|
||||
UDIUInt32 *StopReason /* Out */
|
||||
)
|
||||
{
|
||||
int r;
|
||||
IN_INIT();
|
||||
IN_VAL(UDIInt32, MaxTime);
|
||||
r = DO_CALL(UDIWait_c);
|
||||
OUT_INIT();
|
||||
*PId = OUT_VAL(UDIPId);
|
||||
*StopReason = OUT_VAL(UDIUInt32);
|
||||
return r;
|
||||
}
|
||||
|
||||
UDIError UDISetBreakpoint (
|
||||
UDIResource Addr, /* In */
|
||||
UDIInt32 PassCount, /* In */
|
||||
UDIBreakType Type, /* In */
|
||||
UDIBreakId *BreakId /* Out */
|
||||
)
|
||||
{
|
||||
int r;
|
||||
IN_INIT();
|
||||
IN_VAL(short, Addr.Space);
|
||||
IN_VAL(CPUOffset, Addr.Offset);
|
||||
IN_VAL(UDIInt32, PassCount);
|
||||
IN_VAL(UDIBreakType, Type);
|
||||
|
||||
r = DO_CALL(UDISetBreakpoint_c);
|
||||
|
||||
OUT_INIT();
|
||||
*BreakId = OUT_VAL(UDIBreakId);
|
||||
return r;
|
||||
}
|
||||
|
||||
UDIError UDIQueryBreakpoint (
|
||||
UDIBreakId BreakId, /* In */
|
||||
UDIResource *Addr, /* Out */
|
||||
UDIInt32 *PassCount, /* Out */
|
||||
UDIBreakType *Type, /* Out */
|
||||
UDIInt32 *CurrentCount /* Out */
|
||||
)
|
||||
{
|
||||
int r;
|
||||
IN_INIT();
|
||||
IN_VAL(UDIBreakId, BreakId);
|
||||
|
||||
r = DO_CALL(UDIQueryBreakpoint_c);
|
||||
|
||||
OUT_INIT();
|
||||
Addr->Space = OUT_VAL(short);
|
||||
Addr->Offset = OUT_VAL(CPUOffset);
|
||||
*PassCount = OUT_VAL(UDIInt32);
|
||||
*Type = OUT_VAL(UDIBreakType);
|
||||
*CurrentCount = OUT_VAL(UDIInt32);
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
UDIError UDIClearBreakpoint (
|
||||
UDIBreakId BreakId /* In */
|
||||
)
|
||||
{
|
||||
IN_INIT();
|
||||
IN_VAL(UDIBreakId, BreakId);
|
||||
|
||||
return DO_CALL(UDIClearBreakpoint_c);
|
||||
}
|
||||
|
||||
UDIError UDIGetStdout (
|
||||
UDIHostMemPtr Buf, /* Out */
|
||||
UDISizeT BufSize, /* In */
|
||||
UDISizeT *CountDone /* Out */
|
||||
)
|
||||
{
|
||||
int r;
|
||||
IN_INIT();
|
||||
if (BufSize > 4000)
|
||||
BufSize = 4000;
|
||||
IN_VAL(UDISizeT,BufSize);
|
||||
r = DO_CALL(UDIGetStdout_c);
|
||||
OUT_INIT();
|
||||
*CountDone = OUT_VAL(UDISizeT);
|
||||
if (*CountDone <= BufSize)
|
||||
OUT_DATA(Buf, *CountDone);
|
||||
return r;
|
||||
}
|
||||
|
||||
UDIError UDIGetStderr (
|
||||
UDIHostMemPtr Buf, /* Out */
|
||||
UDISizeT BufSize, /* In */
|
||||
UDISizeT *CountDone /* Out */
|
||||
)
|
||||
{
|
||||
int r;
|
||||
IN_INIT();
|
||||
if (BufSize > 4000)
|
||||
BufSize = 4000;
|
||||
IN_VAL(UDISizeT,BufSize);
|
||||
r = DO_CALL(UDIGetStderr_c);
|
||||
OUT_INIT();
|
||||
*CountDone = OUT_VAL(UDISizeT);
|
||||
OUT_DATA(Buf, *CountDone);
|
||||
return r;
|
||||
}
|
||||
|
||||
UDIError UDIPutStdin (
|
||||
UDIHostMemPtr Buf, /* In */
|
||||
UDISizeT Count, /* In */
|
||||
UDISizeT *CountDone /* Out */
|
||||
)
|
||||
{
|
||||
int r;
|
||||
IN_INIT();
|
||||
if (Count > 4000)
|
||||
Count = 4000;
|
||||
IN_VAL(UDISizeT,Count);
|
||||
IN_DATA(Buf, Count);
|
||||
r = DO_CALL(UDIPutStdin_c);
|
||||
OUT_INIT();
|
||||
*CountDone = OUT_VAL(UDISizeT);
|
||||
return r;
|
||||
}
|
||||
|
||||
UDIError UDIStdinMode (
|
||||
UDIMode *Mode /* Out */
|
||||
)
|
||||
{
|
||||
int r;
|
||||
IN_INIT();
|
||||
r = DO_CALL(UDIStdinMode_c);
|
||||
OUT_INIT();
|
||||
*Mode = OUT_VAL(UDIMode);
|
||||
return r;
|
||||
}
|
||||
|
||||
UDIError UDIPutTrans (
|
||||
UDIHostMemPtr Buf, /* In */
|
||||
UDISizeT Count, /* In */
|
||||
UDISizeT *CountDone /* Out */
|
||||
)
|
||||
{
|
||||
int r;
|
||||
IN_INIT();
|
||||
if (Count > 4000)
|
||||
Count = 4000;
|
||||
IN_VAL(UDISizeT,Count);
|
||||
IN_DATA(Buf, Count);
|
||||
r = DO_CALL(UDIPutTrans_c);
|
||||
OUT_INIT();
|
||||
*CountDone = OUT_VAL(UDISizeT);
|
||||
return r;
|
||||
}
|
||||
|
||||
UDIError UDIGetTrans (
|
||||
UDIHostMemPtr Buf, /* Out */
|
||||
UDISizeT BufSize, /* In */
|
||||
UDISizeT *CountDone /* Out */
|
||||
)
|
||||
{
|
||||
int r;
|
||||
IN_INIT();
|
||||
if (BufSize > 4000)
|
||||
BufSize = 4000;
|
||||
IN_VAL(UDISizeT,BufSize);
|
||||
r = DO_CALL(UDIGetTrans_c);
|
||||
OUT_INIT();
|
||||
*CountDone = OUT_VAL(UDISizeT);
|
||||
OUT_DATA(Buf, *CountDone);
|
||||
return r;
|
||||
}
|
||||
|
||||
UDIError UDITransMode (
|
||||
UDIMode *Mode /* Out */
|
||||
)
|
||||
{
|
||||
int r;
|
||||
IN_INIT();
|
||||
r = DO_CALL(UDITransMode_c);
|
||||
OUT_INIT();
|
||||
*Mode = OUT_VAL(UDIMode);
|
||||
return r;
|
||||
}
|
||||
|
||||
#define DFEIPCIdCompany 0x0001 /* Company ID AMD */
|
||||
#define DFEIPCIdProduct 0x1 /* Product ID 0 */
|
||||
#define DFEIPCIdVersion 0x125 /* 1.2.5 */
|
||||
|
||||
unsigned UDIGetDFEIPCId ()
|
||||
{
|
||||
return((((UDIUInt32)DFEIPCIdCompany) << 16) |(DFEIPCIdProduct << 12) | DFEIPCIdVersion);
|
||||
}
|
||||
|
||||
#endif /* __GO32__ */
|
|
@ -1,48 +0,0 @@
|
|||
/* This file contains the DFE and TIP IDs to be used by AMD products for
|
||||
the UDICapabilities call.
|
||||
|
||||
Copyright 1993 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GDB.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* Company Codes -- AMD assigns these */
|
||||
#define UDICompanyCode_AMD 1
|
||||
|
||||
/* Build a UDIID given a CompanyProdCode and 3 version pieces */
|
||||
#define UDIID(CompanyProdCode, v1,v2,v3) ((((CompanyProdCode) & 0xfffff)<<12)+\
|
||||
(((v1)&0xf)<<8) + (((v2)&0xf)<<4) + ((v3)&0xf))
|
||||
|
||||
|
||||
/* Extract a CompanyProdCode or a Version from a UDIID */
|
||||
#define UDIID_CompanyProdCode(id) (((id)>>12) & 0xfffff)
|
||||
#define UDIID_Version(id) ((id)&0xfff)
|
||||
|
||||
|
||||
#define UDIAMDProduct(ProdCode) ((UDICompanyCode_AMD<<4) + (ProdCode&0xf))
|
||||
|
||||
/* AMD DFE Product Codes */
|
||||
#define UDIProductCode_Mondfe UDIAMDProduct(0)
|
||||
#define UDIProductCode_XRAY UDIAMDProduct(1)
|
||||
#define UDIProductCode_TIPTester UDIAMDProduct(2)
|
||||
|
||||
/* AMD TIP Product Codes (need not be distinct from DFE Product Codes) */
|
||||
#define UDIProductCode_Montip UDIAMDProduct(0)
|
||||
#define UDIProductCode_Isstip UDIAMDProduct(1)
|
||||
|
||||
|
||||
#define UDILatestVersion 0x120 /* UDI 1.2.0, can be used in DFE and TIP desired UDI params */
|
||||
|
File diff suppressed because it is too large
Load diff
|
@ -1,44 +0,0 @@
|
|||
/* This file just picks the correct udiphxxx.h depending on the host.
|
||||
The two hosts that are now defined are UNIX and MSDOS.
|
||||
|
||||
Copyright 1993 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GDB.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
/*
|
||||
* For the moment, we will default to BSD_IPC; this might change if/when
|
||||
* another type of IPC (Mach? SysV?) is implemented.
|
||||
*/
|
||||
|
||||
#if 0
|
||||
|
||||
/* We don't seem to have a copy of udiphdos.h. Furthermore, all the
|
||||
things in udiphunix.h are pretty much generic 32-bit machine defines
|
||||
which don't have anything to do with IPC. */
|
||||
|
||||
#ifdef DOS_IPC
|
||||
#include "udiphdos.h"
|
||||
#else
|
||||
/*#ifdef BSD_IPC */
|
||||
#include "udiphunix.h"
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
#include "udiphunix.h"
|
||||
|
||||
#endif
|
|
@ -1,81 +0,0 @@
|
|||
/* Originally called "udiphsun.h", however it was not very
|
||||
Sun-specific; now it is used for generic-unix-with-bsd-ipc.
|
||||
|
||||
Copyright 1993 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GDB.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* This file is to be used to reconfigure the UDI Procedural interface
|
||||
for a given host. This file should be placed so that it will be
|
||||
included from udiproc.h. Everything in here may need to be changed
|
||||
when you change either the host CPU or its compiler. Nothing in
|
||||
here should change to support different targets. There are multiple
|
||||
versions of this file, one for each of the different host/compiler
|
||||
combinations in use.
|
||||
*/
|
||||
|
||||
#define UDIStruct struct /* _packed not needed on unix */
|
||||
/* First, we need some types */
|
||||
/* Types with at least the specified number of bits */
|
||||
typedef double UDIReal64; /* 64-bit real value */
|
||||
typedef float UDIReal32; /* 32-bit real value */
|
||||
|
||||
typedef unsigned long UDIUInt32; /* unsigned integers */
|
||||
typedef unsigned short UDIUInt16;
|
||||
typedef unsigned char UDIUInt8;
|
||||
|
||||
typedef long UDIInt32; /* 32-bit integer */
|
||||
typedef short UDIInt16; /* 16-bit integer */
|
||||
typedef char UDIInt8; /* unreliable signedness */
|
||||
|
||||
/* To aid in supporting environments where the DFE and TIP use
|
||||
different compilers or hosts (like DOS 386 on one side, 286 on the
|
||||
other, or different Unix machines connected by sockets), we define
|
||||
two abstract types - UDIInt and UDISizeT.
|
||||
UDIInt should be defined to be int except for host/compiler combinations
|
||||
that are intended to talk to existing UDI components that have a different
|
||||
sized int. Similarly for UDISizeT.
|
||||
*/
|
||||
typedef int UDIInt;
|
||||
typedef unsigned int UDIUInt;
|
||||
|
||||
typedef unsigned int UDISizeT;
|
||||
|
||||
/* Now two void types. The first is for function return types,
|
||||
the other for pointers to no particular type. Since these types
|
||||
are used solely for documentational clarity, if your host/compiler
|
||||
doesn't support either one, replace them with int and char *
|
||||
respectively.
|
||||
*/
|
||||
typedef void UDIVoid; /* void type */
|
||||
typedef void * UDIVoidPtr; /* void pointer type */
|
||||
typedef void * UDIHostMemPtr; /* Arbitrary memory pointer */
|
||||
|
||||
/* Now we want a type optimized for boolean values. Normally this
|
||||
would be int, but on some machines (Z80s, 8051s, etc) it might
|
||||
be better to map it onto a char
|
||||
*/
|
||||
typedef int UDIBool;
|
||||
|
||||
/* Now indicate whether your compiler support full ANSI style
|
||||
prototypes. If so, use #if 1. If not use #if 0.
|
||||
*/
|
||||
#if 0
|
||||
#define UDIParams(x) x
|
||||
#else
|
||||
#define UDIParams(x) ()
|
||||
#endif
|
|
@ -1,308 +0,0 @@
|
|||
/* local type decs. and macro defs.
|
||||
|
||||
Copyright 1993 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GDB.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include "udiphcfg.h" /* Get host specific configuration */
|
||||
#include "udiptcfg.h" /* Get target specific configuration */
|
||||
|
||||
/* Here are all of the CPU Families for which UDI is currently defined */
|
||||
#define Am29K 1 /* AMD's Am290xx and Am292xx parts */
|
||||
|
||||
typedef UDIInt UDIError;
|
||||
typedef UDIInt UDISessionId;
|
||||
typedef UDIInt UDIPId;
|
||||
typedef UDIInt UDIStepType;
|
||||
typedef UDIInt UDIBreakType;
|
||||
typedef UDIUInt UDIBreakId;
|
||||
typedef UDIUInt UDIMode;
|
||||
|
||||
typedef UDIStruct
|
||||
{
|
||||
CPUSpace Space;
|
||||
CPUOffset Offset;
|
||||
} UDIResource;
|
||||
|
||||
typedef UDIStruct
|
||||
{
|
||||
CPUOffset Low;
|
||||
CPUOffset High;
|
||||
} UDIRange;
|
||||
|
||||
typedef UDIStruct
|
||||
{
|
||||
CPUSpace Space;
|
||||
CPUOffset Offset;
|
||||
CPUSizeT Size;
|
||||
} UDIMemoryRange;
|
||||
|
||||
/* Values for UDIStepType parameters */
|
||||
#define UDIStepNatural 0x0000
|
||||
#define UDIStepOverTraps 0x0001
|
||||
#define UDIStepOverCalls 0x0002
|
||||
#define UDIStepInRange 0x0004
|
||||
#define UDIStepNatural 0x0000
|
||||
|
||||
/* Values for UDIBreakType parameters */
|
||||
#define UDIBreakFlagExecute 0x0001
|
||||
#define UDIBreakFlagRead 0x0002
|
||||
#define UDIBreakFlagWrite 0x0004
|
||||
#define UDIBreakFlagFetch 0x0008
|
||||
|
||||
/* Special values for UDIWait MaxTime parameter */
|
||||
#define UDIWaitForever (UDIInt32) -1 /* Infinite time delay */
|
||||
|
||||
/* Special values for PId */
|
||||
#define UDIProcessProcessor -1 /* Raw Hardware, if possible */
|
||||
|
||||
/* Values for UDIWait StopReason */
|
||||
#define UDIGrossState 0xff
|
||||
#define UDITrapped 0 /* Fine state - which trap */
|
||||
#define UDINotExecuting 1
|
||||
#define UDIRunning 2
|
||||
#define UDIStopped 3
|
||||
#define UDIWarned 4
|
||||
#define UDIStepped 5
|
||||
#define UDIWaiting 6
|
||||
#define UDIHalted 7
|
||||
#define UDIStdoutReady 8 /* fine state - size */
|
||||
#define UDIStderrReady 9 /* fine state - size */
|
||||
#define UDIStdinNeeded 10 /* fine state - size */
|
||||
#define UDIStdinModeX 11 /* fine state - mode */
|
||||
#define UDIBreak 12 /* Fine state - Breakpoint Id */
|
||||
#define UDIExited 13 /* Fine state - exit code */
|
||||
|
||||
/* Enumerate the return values from the callback function
|
||||
for UDIEnumerateTIPs.
|
||||
*/
|
||||
#define UDITerminateEnumeration 0
|
||||
#define UDIContinueEnumeration 1
|
||||
|
||||
/* Enumerate values for Terminate parameter to UDIDisconnect */
|
||||
#define UDITerminateSession 1
|
||||
#define UDIContinueSession 0
|
||||
|
||||
/* Error codes */
|
||||
#define UDINoError 0 /* No error occured */
|
||||
#define UDIErrorNoSuchConfiguration 1
|
||||
#define UDIErrorCantHappen 2
|
||||
#define UDIErrorCantConnect 3
|
||||
#define UDIErrorNoSuchConnection 4
|
||||
#define UDIErrorNoConnection 5
|
||||
#define UDIErrorCantOpenConfigFile 6
|
||||
#define UDIErrorCantStartTIP 7
|
||||
#define UDIErrorConnectionUnavailable 8
|
||||
#define UDIErrorTryAnotherTIP 9
|
||||
#define UDIErrorExecutableNotTIP 10
|
||||
#define UDIErrorInvalidTIPOption 11
|
||||
#define UDIErrorCantDisconnect 12
|
||||
#define UDIErrorUnknownError 13
|
||||
#define UDIErrorCantCreateProcess 14
|
||||
#define UDIErrorNoSuchProcess 15
|
||||
#define UDIErrorUnknownResourceSpace 16
|
||||
#define UDIErrorInvalidResource 17
|
||||
#define UDIErrorUnsupportedStepType 18
|
||||
#define UDIErrorCantSetBreakpoint 19
|
||||
#define UDIErrorTooManyBreakpoints 20
|
||||
#define UDIErrorInvalidBreakId 21
|
||||
#define UDIErrorNoMoreBreakIds 22
|
||||
#define UDIErrorUnsupportedService 23
|
||||
#define UDIErrorTryAgain 24
|
||||
#define UDIErrorIPCLimitation 25
|
||||
#define UDIErrorIncomplete 26
|
||||
#define UDIErrorAborted 27
|
||||
#define UDIErrorTransDone 28
|
||||
#define UDIErrorCantAccept 29
|
||||
#define UDIErrorTransInputNeeded 30
|
||||
#define UDIErrorTransModeX 31
|
||||
#define UDIErrorInvalidSize 32
|
||||
#define UDIErrorBadConfigFileEntry 33
|
||||
#define UDIErrorIPCInternal 34
|
||||
/* TBD */
|
||||
|
||||
/****************************************************************** PROCEDURES
|
||||
*/
|
||||
|
||||
UDIError UDIConnect UDIParams((
|
||||
char *Configuration, /* In */
|
||||
UDISessionId *Session /* Out */
|
||||
));
|
||||
|
||||
UDIError UDIDisconnect UDIParams((
|
||||
UDISessionId Session, /* In */
|
||||
UDIBool Terminate /* In */
|
||||
));
|
||||
|
||||
UDIError UDISetCurrentConnection UDIParams((
|
||||
UDISessionId Session /* In */
|
||||
));
|
||||
|
||||
UDIError UDICapabilities UDIParams((
|
||||
UDIUInt32 *TIPId, /* Out */
|
||||
UDIUInt32 *TargetId, /* Out */
|
||||
UDIUInt32 DFEId, /* In */
|
||||
UDIUInt32 DFE, /* In */
|
||||
UDIUInt32 *TIP, /* Out */
|
||||
UDIUInt32 *DFEIPCId, /* Out */
|
||||
UDIUInt32 *TIPIPCId, /* Out */
|
||||
char *TIPString /* Out */
|
||||
));
|
||||
|
||||
UDIError UDIEnumerateTIPs UDIParams((
|
||||
UDIInt (*UDIETCallback) /* In */
|
||||
UDIParams(( char *Configuration )) /* In to callback() */
|
||||
));
|
||||
|
||||
UDIError UDIGetErrorMsg UDIParams((
|
||||
UDIError ErrorCode, /* In */
|
||||
UDISizeT MsgSize, /* In */
|
||||
char *Msg, /* Out */
|
||||
UDISizeT *CountDone /* Out */
|
||||
));
|
||||
|
||||
UDIError UDIGetTargetConfig UDIParams((
|
||||
UDIMemoryRange KnownMemory[], /* Out */
|
||||
UDIInt *NumberOfRanges, /* In/Out */
|
||||
UDIUInt32 ChipVersions[], /* Out */
|
||||
UDIInt *NumberOfChips /* In/Out */
|
||||
));
|
||||
|
||||
UDIError UDICreateProcess UDIParams((
|
||||
UDIPId *PId /* Out */
|
||||
));
|
||||
|
||||
UDIError UDISetCurrentProcess UDIParams((
|
||||
UDIPId PId /* In */
|
||||
));
|
||||
|
||||
UDIError UDIDestroyProcess UDIParams((
|
||||
UDIPId PId /* In */
|
||||
));
|
||||
|
||||
UDIError UDIInitializeProcess UDIParams((
|
||||
UDIMemoryRange ProcessMemory[], /* In */
|
||||
UDIInt NumberOfRanges, /* In */
|
||||
UDIResource EntryPoint, /* In */
|
||||
CPUSizeT StackSizes[], /* In */
|
||||
UDIInt NumberOfStacks, /* In */
|
||||
char *ArgString /* In */
|
||||
));
|
||||
|
||||
UDIError UDIRead UDIParams((
|
||||
UDIResource From, /* In */
|
||||
UDIHostMemPtr To, /* Out */
|
||||
UDICount Count, /* In */
|
||||
UDISizeT Size, /* In */
|
||||
UDICount *CountDone, /* Out */
|
||||
UDIBool HostEndian /* In */
|
||||
));
|
||||
|
||||
UDIError UDIWrite UDIParams((
|
||||
UDIHostMemPtr From, /* In */
|
||||
UDIResource To, /* In */
|
||||
UDICount Count, /* In */
|
||||
UDISizeT Size, /* In */
|
||||
UDICount *CountDone, /* Out */
|
||||
UDIBool HostEndian /* In */
|
||||
));
|
||||
|
||||
UDIError UDICopy UDIParams((
|
||||
UDIResource From, /* In */
|
||||
UDIResource To, /* In */
|
||||
UDICount Count, /* In */
|
||||
UDISizeT Size, /* In */
|
||||
UDICount *CountDone, /* Out */
|
||||
UDIBool Direction /* In */
|
||||
));
|
||||
|
||||
UDIError UDIExecute UDIParams((
|
||||
void
|
||||
));
|
||||
|
||||
UDIError UDIStep UDIParams((
|
||||
UDIUInt32 Steps, /* In */
|
||||
UDIStepType StepType, /* In */
|
||||
UDIRange Range /* In */
|
||||
));
|
||||
|
||||
UDIVoid UDIStop UDIParams((
|
||||
void
|
||||
));
|
||||
|
||||
UDIError UDIWait UDIParams((
|
||||
UDIInt32 MaxTime, /* In */
|
||||
UDIPId *PId, /* Out */
|
||||
UDIUInt32 *StopReason /* Out */
|
||||
));
|
||||
|
||||
UDIError UDISetBreakpoint UDIParams((
|
||||
UDIResource Addr, /* In */
|
||||
UDIInt32 PassCount, /* In */
|
||||
UDIBreakType Type, /* In */
|
||||
UDIBreakId *BreakId /* Out */
|
||||
));
|
||||
|
||||
UDIError UDIQueryBreakpoint UDIParams((
|
||||
UDIBreakId BreakId, /* In */
|
||||
UDIResource *Addr, /* Out */
|
||||
UDIInt32 *PassCount, /* Out */
|
||||
UDIBreakType *Type, /* Out */
|
||||
UDIInt32 *CurrentCount /* Out */
|
||||
));
|
||||
|
||||
UDIError UDIClearBreakpoint UDIParams((
|
||||
UDIBreakId BreakId /* In */
|
||||
));
|
||||
|
||||
UDIError UDIGetStdout UDIParams((
|
||||
UDIHostMemPtr Buf, /* Out */
|
||||
UDISizeT BufSize, /* In */
|
||||
UDISizeT *CountDone /* Out */
|
||||
));
|
||||
|
||||
UDIError UDIGetStderr UDIParams((
|
||||
UDIHostMemPtr Buf, /* Out */
|
||||
UDISizeT BufSize, /* In */
|
||||
UDISizeT *CountDone /* Out */
|
||||
));
|
||||
|
||||
UDIError UDIPutStdin UDIParams((
|
||||
UDIHostMemPtr Buf, /* In */
|
||||
UDISizeT Count, /* In */
|
||||
UDISizeT *CountDone /* Out */
|
||||
));
|
||||
|
||||
UDIError UDIStdinMode UDIParams((
|
||||
UDIMode *Mode /* Out */
|
||||
));
|
||||
|
||||
UDIError UDIPutTrans UDIParams((
|
||||
UDIHostMemPtr Buf, /* In */
|
||||
UDISizeT Count, /* In */
|
||||
UDISizeT *CountDone /* Out */
|
||||
));
|
||||
|
||||
UDIError UDIGetTrans UDIParams((
|
||||
UDIHostMemPtr Buf, /* Out */
|
||||
UDISizeT BufSize, /* In */
|
||||
UDISizeT *CountDone /* Out */
|
||||
));
|
||||
|
||||
UDIError UDITransMode UDIParams((
|
||||
UDIMode *Mode /* Out */
|
||||
));
|
|
@ -1,87 +0,0 @@
|
|||
/* This file is to be used to reconfigure the UDI Procedural interface
|
||||
for a given target.
|
||||
|
||||
Copyright 1993 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GDB.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* This file should be placed so that it will be
|
||||
included from udiproc.h. Everything in here will probably need to
|
||||
be changed when you change the target processor. Nothing in here
|
||||
should need to change when you change hosts or compilers.
|
||||
*/
|
||||
|
||||
/* Select a target CPU Family */
|
||||
#define TargetCPUFamily Am29K
|
||||
|
||||
/* Enumerate the processor specific values for Space in a resource */
|
||||
#define UDI29KDRAMSpace 0
|
||||
#define UDI29KIOSpace 1
|
||||
#define UDI29KCPSpace0 2
|
||||
#define UDI29KCPSpace1 3
|
||||
#define UDI29KIROMSpace 4
|
||||
#define UDI29KIRAMSpace 5
|
||||
#define UDI29KLocalRegs 8
|
||||
#define UDI29KGlobalRegs 9
|
||||
#define UDI29KRealRegs 10
|
||||
#define UDI29KSpecialRegs 11
|
||||
#define UDI29KTLBRegs 12 /* Not Am29005 */
|
||||
#define UDI29KACCRegs 13 /* Am29050 only */
|
||||
#define UDI29KICacheSpace 14 /* Am2903x only */
|
||||
#define UDI29KAm29027Regs 15 /* When available */
|
||||
#define UDI29KPC 16
|
||||
#define UDI29KDCacheSpace 17 /* When available */
|
||||
|
||||
/* Enumerate the Co-processor registers */
|
||||
#define UDI29KCP_F 0
|
||||
#define UDI29KCP_Flag 8
|
||||
#define UDI29KCP_I 12
|
||||
#define UDI29KCP_ITmp 16
|
||||
#define UDI29KCP_R 20
|
||||
#define UDI29KCP_S 28
|
||||
#define UDI29KCP_RTmp 36
|
||||
#define UDI29KCP_STmp 44
|
||||
#define UDI29KCP_Stat 52
|
||||
#define UDI29KCP_Prec 56
|
||||
#define UDI29KCP_Reg0 60
|
||||
#define UDI29KCP_Reg1 68
|
||||
#define UDI29KCP_Reg2 76
|
||||
#define UDI29KCP_Reg3 84
|
||||
#define UDI29KCP_Reg4 92
|
||||
#define UDI29KCP_Reg5 100
|
||||
#define UDI29KCP_Reg6 108
|
||||
#define UDI29KCP_Reg7 116
|
||||
#define UDI29KCP_Mode 124
|
||||
|
||||
/* Enumerate the stacks in StackSizes array */
|
||||
#define UDI29KMemoryStack 0
|
||||
#define UDI29KRegisterStack 1
|
||||
|
||||
/* Enumerate the chips for ChipVersions array */
|
||||
#define UDI29K29KVersion 0
|
||||
#define UDI29K29027Version 1
|
||||
|
||||
/* Define special value for elements of ChipVersions array for
|
||||
* chips not present */
|
||||
#define UDI29KChipNotPresent -1
|
||||
|
||||
typedef UDIInt32 UDICount;
|
||||
typedef UDIUInt32 UDISize;
|
||||
|
||||
typedef UDIInt CPUSpace;
|
||||
typedef UDIUInt32 CPUOffset;
|
||||
typedef UDIUInt32 CPUSizeT;
|
|
@ -1,19 +0,0 @@
|
|||
/* Copyright 1993 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GDB.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include "udipt29k.h"
|
|
@ -1,184 +0,0 @@
|
|||
/* This module defines constants used in the UDI IPC modules.
|
||||
|
||||
Copyright 1993 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GDB.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
static char udisoc_h[]="@(#)udisoc.h 2.6 Daniel Mann";
|
||||
static char udisoc_h_AMD[]="@(#)udisoc.h 2.4, AMD";
|
||||
|
||||
#define LOCAL static
|
||||
#define company_c 1 /* AMD Company id */
|
||||
#define product_c 1 /* socket IPC id */
|
||||
|
||||
/* Enumerate the UDI procedure services
|
||||
*/
|
||||
#define UDIConnect_c 0
|
||||
#define UDIDisconnect_c 1
|
||||
#define UDISetCurrentConnection_c 2
|
||||
#define UDICapabilities_c 3
|
||||
#define UDIEnumerateTIPs_c 4
|
||||
#define UDIGetErrorMsg_c 5
|
||||
#define UDIGetTargetConfig_c 6
|
||||
#define UDICreateProcess_c 7
|
||||
#define UDISetCurrentProcess_c 8
|
||||
#define UDIDestroyProcess_c 9
|
||||
#define UDIInitializeProcess_c 10
|
||||
#define UDIRead_c 11
|
||||
#define UDIWrite_c 12
|
||||
#define UDICopy_c 13
|
||||
#define UDIExecute_c 14
|
||||
#define UDIStep_c 15
|
||||
#define UDIStop_c 16
|
||||
#define UDIWait_c 17
|
||||
#define UDISetBreakpoint_c 18
|
||||
#define UDIQueryBreakpoint_c 19
|
||||
#define UDIClearBreakpoint_c 20
|
||||
#define UDIGetStdout_c 21
|
||||
#define UDIGetStderr_c 22
|
||||
#define UDIPutStdin_c 23
|
||||
#define UDIStdinMode_c 24
|
||||
#define UDIPutTrans_c 25
|
||||
#define UDIGetTrans_c 26
|
||||
#define UDITransMode_c 27
|
||||
#define UDITest_c 28
|
||||
#define UDIKill_c 29
|
||||
|
||||
#define udr_UDIInt8(udrs, obj) udr_work(udrs, obj, 1)
|
||||
#define udr_UDIInt16(udrs, obj) udr_work(udrs, obj, 2)
|
||||
#define udr_UDIInt32(udrs, obj) udr_work(udrs, obj, 4)
|
||||
#define udr_UDIInt(udrs, obj) udr_work(udrs, obj, 4)
|
||||
|
||||
#define udr_UDIUInt8(udrs, obj) udr_work(udrs, obj, 1)
|
||||
#define udr_UDIUInt16(udrs, obj) udr_work(udrs, obj, 2)
|
||||
#define udr_UDIUInt32(udrs, obj) udr_work(udrs, obj, 4)
|
||||
#define udr_UDIUInt(udrs, obj) udr_work(udrs, obj, 4)
|
||||
|
||||
#define udr_UDIBool(udrs, obj) udr_UDIInt32(udrs, obj)
|
||||
#define udr_UDICount(udrs, obj) udr_UDIInt32(udrs, obj)
|
||||
#define udr_UDISize(udrs, obj) udr_UDIUInt32(udrs, obj)
|
||||
#define udr_CPUSpace(udrs, obj) udr_UDIInt32(udrs, obj)
|
||||
#define udr_CPUOffset(udrs, obj) udr_UDIUInt32(udrs, obj)
|
||||
#define udr_CPUSizeT(udrs, obj) udr_UDIUInt32(udrs, obj)
|
||||
#define udr_UDIBreakId(udrs,obj) udr_UDIUInt(udrs, obj)
|
||||
#define udr_UDISizeT(udrs, obj) udr_UDIUInt(udrs, obj)
|
||||
#define udr_UDIMode(udrs, obj) udr_UDIUInt(udrs, obj)
|
||||
|
||||
#define udr_UDIHostMemPtr(udrs, obj) udr_UDIUInt32(udrs, obj)
|
||||
#define udr_UDIVoidPtr(udrs, obj) udr_UDIUInt32(udrs, obj)
|
||||
#define udr_UDIPId(udrs, obj) udr_UDIUInt(udrs, obj)
|
||||
#define udr_UDISessionId(udrs, obj) udr_UDIInt32(udrs, obj)
|
||||
#define udr_UDIError(udrs, obj) udr_UDIInt32(udrs, obj)
|
||||
#define udr_UDIStepType(udrs, obj) udr_UDIInt32(udrs, obj)
|
||||
#define udr_UDIBreakType(udrs, obj) udr_UDIInt32(udrs, obj)
|
||||
|
||||
|
||||
#define UDR_ENCODE 1
|
||||
#define UDR_DECODE 2
|
||||
|
||||
typedef struct UDR_str
|
||||
{
|
||||
int udr_op; /* UDR operation */
|
||||
int previous_op;
|
||||
int sd;
|
||||
int bufsize;
|
||||
char* buff;
|
||||
char* getbytes;
|
||||
char* putbytes;
|
||||
char* putend;
|
||||
int domain;
|
||||
char* soc_name;
|
||||
} UDR;
|
||||
|
||||
/******************************************* Declare UDR suport functions */
|
||||
int udr_create UDIParams((
|
||||
UDR* udrs,
|
||||
int sd,
|
||||
int size
|
||||
));
|
||||
|
||||
int udr_free UDIParams((
|
||||
UDR* udrs,
|
||||
));
|
||||
|
||||
int udr_signal UDIParams((
|
||||
UDR* udrs,
|
||||
));
|
||||
|
||||
int udr_sendnow UDIParams((
|
||||
UDR* udrs
|
||||
));
|
||||
|
||||
int udr_work UDIParams((
|
||||
UDR* udrs,
|
||||
void* object_p,
|
||||
int size
|
||||
));
|
||||
|
||||
int udr_UDIResource UDIParams((
|
||||
UDR* udrs,
|
||||
UDIResource* object_p
|
||||
));
|
||||
|
||||
int udr_UDIRange UDIParams((
|
||||
UDR* udrs,
|
||||
UDIRange* object_p
|
||||
));
|
||||
|
||||
int udr_UDIMemoryRange UDIParams((
|
||||
UDR* udrs,
|
||||
UDIMemoryRange* object_p
|
||||
));
|
||||
|
||||
int udr_UDIMemoryRange UDIParams((
|
||||
UDR* udrs,
|
||||
UDIMemoryRange* object_p
|
||||
));
|
||||
|
||||
int udr_int UDIParams((
|
||||
UDR* udrs,
|
||||
int* int_p
|
||||
));
|
||||
|
||||
int udr_bytes UDIParams((
|
||||
UDR* udrs,
|
||||
char* ptr,
|
||||
int len
|
||||
));
|
||||
|
||||
char* udr_inline UDIParams((
|
||||
UDR* udrs,
|
||||
int size
|
||||
));
|
||||
|
||||
char* udr_getpos UDIParams((
|
||||
UDR* udrs
|
||||
));
|
||||
int udr_setpos UDIParams((
|
||||
UDR* udrs,
|
||||
char* pos
|
||||
));
|
||||
|
||||
int udr_readnow UDIParams((
|
||||
UDR* udrs,
|
||||
int size
|
||||
));
|
||||
|
||||
int udr_align UDIParams((
|
||||
UDR* udrs,
|
||||
int size,
|
||||
));
|
|
@ -1,427 +0,0 @@
|
|||
/* This module supports sending and receiving data objects over a
|
||||
socket conection.
|
||||
|
||||
Copyright 1993 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GDB.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
static char udr_c[]="@(#)udr.c 2.8 Daniel Mann";
|
||||
static char udr_c_AMD[]="@(#)udr.c 2.3, AMD";
|
||||
/*
|
||||
* All data is serialised into a character stream,
|
||||
* and de-serialised back into the approproiate objects.
|
||||
********************************************************************** HISTORY
|
||||
*/
|
||||
/* This is all unneeded on DOS machines. */
|
||||
#ifndef __GO32__
|
||||
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
/* This used to say sys/fcntl.h, but the only systems I know of that
|
||||
require that are old (pre-4.3, at least) BSD systems, which we
|
||||
probably don't need to worry about. */
|
||||
#include <fcntl.h>
|
||||
|
||||
#include <sys/socket.h>
|
||||
#include "udiproc.h"
|
||||
#include "udisoc.h"
|
||||
|
||||
extern int errno;
|
||||
extern char* malloc();
|
||||
|
||||
/* local type decs. and macro defs. not in a .h file ************* MACRO/TYPE
|
||||
*/
|
||||
|
||||
/* global dec/defs. which are not in a .h file ************* EXPORT DEC/DEFS
|
||||
*/
|
||||
int udr_errno; /* error occurs during UDR service */
|
||||
|
||||
/* local dec/defs. which are not in a .h file *************** LOCAL DEC/DEFS
|
||||
*/
|
||||
|
||||
/****************************************************************** UDR_CREATE
|
||||
* Build UDR structure for character stream processing.
|
||||
*/
|
||||
int udr_create(udrs, sd, size)
|
||||
UDR* udrs;
|
||||
int sd;
|
||||
int size;
|
||||
{
|
||||
udrs->sd = sd;
|
||||
if(!udrs->buff) udrs->buff = malloc(size);
|
||||
udrs->getbytes = udrs->buff; /* set the buffer to the start */
|
||||
udrs->putbytes = udrs->buff;
|
||||
udrs->putend = udrs->buff;
|
||||
udrs->udr_op = -1; /* don't know the direction */
|
||||
udrs->previous_op = -1; /* don't know the direction */
|
||||
udrs->bufsize = size;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/******************************************************************** UDR_FREE
|
||||
* Free USR structure and close socket.
|
||||
*/
|
||||
int udr_free(udrs)
|
||||
UDR* udrs;
|
||||
{
|
||||
close(udrs->sd);
|
||||
free(udrs->buff);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/****************************************************************** UDR_SIGNAL
|
||||
* Send a signal to the process at the other end of the socket,
|
||||
* indicating that it should expect to recieve a new message shortly.
|
||||
*/
|
||||
int udr_signal(udrs)
|
||||
UDR* udrs;
|
||||
{
|
||||
if(send(udrs->sd, "I", 1, MSG_OOB) == -1)
|
||||
{ perror("ERROR, udr_signal(), send(...MSG_OOB)");
|
||||
udr_errno = UDIErrorIPCInternal;
|
||||
return -1; /* return error code */
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/***************************************************************** UDR_SENDNOW
|
||||
* used to flush the current character stream buffer to
|
||||
* the associated socket. */
|
||||
int udr_sendnow(udrs)
|
||||
UDR* udrs;
|
||||
{
|
||||
int size = (UDIUInt32)(udrs->putend) - (UDIUInt32)(udrs->buff);
|
||||
if(udrs->previous_op == 0)
|
||||
{ udr_errno = UDIErrorIPCInternal;
|
||||
return -1;
|
||||
}
|
||||
udrs->putbytes = udrs->buff;
|
||||
udrs->putend = udrs->buff;
|
||||
if (write(udrs->sd, udrs->buff, size) == -1)
|
||||
{ perror("ERROR, udr_sendnow(), write() call: ");
|
||||
udr_errno = UDIErrorIPCInternal;
|
||||
return -1; /* return error code */
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/******************************************************************** UDR_WORK
|
||||
* Function to send or recieve data from the buffers supporting
|
||||
* socket communication. The buffer contains serialised objects
|
||||
* sent/recieved over a socket connection.
|
||||
*/
|
||||
int udr_work(udrs, object_p, size)
|
||||
UDR* udrs;
|
||||
void* object_p;
|
||||
int size;
|
||||
{
|
||||
int cnt, remain;
|
||||
|
||||
if(udrs->udr_op != udrs->previous_op)
|
||||
{ if(udrs->previous_op == 0)
|
||||
{ udr_errno = UDIErrorIPCInternal;
|
||||
return -1;
|
||||
}
|
||||
udrs->previous_op= udrs->udr_op;
|
||||
udrs->putbytes = udrs->buff;
|
||||
udrs->getbytes = udrs->buff;
|
||||
}
|
||||
|
||||
if(udrs->udr_op == UDR_ENCODE)
|
||||
{ /* write data into character stream buffer */
|
||||
if( (UDIUInt32)(udrs->putbytes) + size >
|
||||
(UDIUInt32)(udrs->buff) + (UDIUInt32)(udrs->bufsize) )
|
||||
{ udr_errno = UDIErrorIPCInternal;
|
||||
return -1;
|
||||
}
|
||||
memcpy(udrs->putbytes, (char*)object_p, size);
|
||||
udrs->putbytes += size;
|
||||
if(udrs->putbytes > udrs->putend) udrs->putend = udrs->putbytes;
|
||||
}
|
||||
else if(udrs->udr_op == UDR_DECODE)
|
||||
{
|
||||
if( (UDIUInt32)(udrs->putbytes)-(UDIUInt32)(udrs->getbytes) < size )
|
||||
{ /* need more data in character stream buffer */
|
||||
remain = (UDIUInt32)(udrs->bufsize) -
|
||||
( (UDIUInt32)(udrs->putbytes)-(UDIUInt32)(udrs->buff) );
|
||||
if( ((UDIUInt32)(udrs->bufsize) + (UDIUInt32)(udrs->buff)
|
||||
- (UDIUInt32)(udrs->getbytes)) < size)
|
||||
{ udr_errno = UDIErrorIPCInternal;
|
||||
return -1;
|
||||
}
|
||||
cnt = read(udrs->sd, (char*)udrs->putbytes, remain);
|
||||
if(cnt == -1) perror("ERROR udr_work(), read() failure: ");
|
||||
udrs->putbytes += cnt;
|
||||
if( (UDIUInt32)(udrs->putbytes)-(UDIUInt32)(udrs->getbytes) < size )
|
||||
{ udr_errno = UDIErrorIPCInternal;
|
||||
return -1; /* return error code */
|
||||
}
|
||||
} /* read data from character stream buffer */
|
||||
memcpy((char*)object_p, udrs->getbytes, size);
|
||||
udrs->getbytes += size;
|
||||
}
|
||||
else
|
||||
{ udr_errno = UDIErrorIPCInternal;
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/************************************************************* UDR_UDIResource
|
||||
*/
|
||||
int udr_UDIResource(udrs, object_p)
|
||||
UDR* udrs;
|
||||
UDIResource* object_p;
|
||||
{
|
||||
int retval;
|
||||
|
||||
retval = udr_CPUSpace(udrs, &object_p->Space);
|
||||
retval = retval | udr_CPUOffset(udrs, &object_p->Offset);
|
||||
return retval;
|
||||
}
|
||||
|
||||
/**************************************************************** UDR_UDIRange
|
||||
*/
|
||||
int udr_UDIRange(udrs, object_p)
|
||||
UDR* udrs;
|
||||
UDIRange* object_p;
|
||||
{
|
||||
int retval;
|
||||
|
||||
retval = udr_CPUOffset(udrs, &object_p->Low);
|
||||
retval = retval | udr_CPUOffset(udrs, &object_p->High);
|
||||
return retval;
|
||||
}
|
||||
|
||||
/********************************************************** UDR_UDIMemoryRange
|
||||
*/
|
||||
int udr_UDIMemoryRange(udrs, object_p)
|
||||
UDR* udrs;
|
||||
UDIMemoryRange* object_p;
|
||||
{
|
||||
int retval;
|
||||
|
||||
retval = udr_CPUSpace(udrs, &object_p->Space);
|
||||
retval = retval | udr_CPUOffset(udrs, &object_p->Offset);
|
||||
retval = retval | udr_CPUSizeT(udrs, &object_p->Size);
|
||||
return retval;
|
||||
}
|
||||
|
||||
/****************************************************************** UDR_string
|
||||
*/
|
||||
int udr_string(udrs, sp)
|
||||
UDR* udrs;
|
||||
char* sp;
|
||||
{
|
||||
int len, retval;
|
||||
|
||||
if(udrs->udr_op == UDR_ENCODE)
|
||||
{
|
||||
if(sp)
|
||||
{ len = strlen(sp) + 1;
|
||||
retval = udr_UDIInt32(udrs, &len);
|
||||
retval = retval | udr_work(udrs, sp, len);
|
||||
}
|
||||
else /* deal with NULL pointer */
|
||||
{ len = 0;
|
||||
retval = udr_UDIInt32(udrs, &len);
|
||||
}
|
||||
}
|
||||
else if(udrs->udr_op == UDR_DECODE)
|
||||
{
|
||||
retval = udr_UDIInt32(udrs, &len);
|
||||
if(len)
|
||||
retval = retval | udr_work(udrs, sp, len);
|
||||
else *sp = '\0'; /* terminate string */
|
||||
}
|
||||
else
|
||||
{ udr_errno = UDIErrorIPCInternal;
|
||||
return -1;
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
/******************************************************************* UDR_BYTES
|
||||
*/
|
||||
int udr_bytes(udrs, ptr, len)
|
||||
UDR* udrs;
|
||||
char* ptr;
|
||||
int len;
|
||||
{
|
||||
return udr_work(udrs, ptr, len);
|
||||
}
|
||||
|
||||
/********************************************************************* UDR_INT
|
||||
*/
|
||||
int udr_int(udrs, int_p)
|
||||
UDR* udrs;
|
||||
int* int_p;
|
||||
{
|
||||
int ret_val;
|
||||
UDIInt32 udr_obj; /* object of know size */
|
||||
|
||||
if(udrs->udr_op == UDR_ENCODE)
|
||||
{
|
||||
udr_obj = *int_p; /* copy into know object size */
|
||||
return udr_UDIInt32(udrs, &udr_obj);
|
||||
}
|
||||
else if(udrs->udr_op == UDR_DECODE)
|
||||
{
|
||||
ret_val = udr_UDIInt32(udrs, &udr_obj); /* get object of known size */
|
||||
*int_p = udr_obj;
|
||||
return ret_val;
|
||||
}
|
||||
else
|
||||
{ udr_errno = UDIErrorIPCInternal;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/****************************************************************** UDR_INLINE
|
||||
*/
|
||||
char* udr_inline(udrs, size)
|
||||
UDR* udrs;
|
||||
int size;
|
||||
{
|
||||
if(udrs->udr_op != udrs->previous_op)
|
||||
{ if(udrs->previous_op == 0)
|
||||
{ udr_errno = UDIErrorIPCInternal;
|
||||
return 0;
|
||||
}
|
||||
udrs->previous_op= udrs->udr_op;
|
||||
udrs->putbytes = udrs->buff;
|
||||
udrs->getbytes = udrs->buff;
|
||||
}
|
||||
if(udrs->udr_op == UDR_ENCODE)
|
||||
{
|
||||
if(udrs->putbytes + size > udrs->bufsize + udrs->buff)
|
||||
return 0;
|
||||
udrs->putbytes += size;
|
||||
return udrs->putbytes - size;
|
||||
}
|
||||
else if(udrs->udr_op == UDR_DECODE)
|
||||
{
|
||||
if(udrs->getbytes + size > udrs->bufsize + udrs->buff)
|
||||
return 0;
|
||||
udrs->getbytes += size;
|
||||
return udrs->getbytes - size;
|
||||
}
|
||||
else
|
||||
{ udr_errno = UDIErrorIPCInternal;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/****************************************************************** UDR_GETPOS
|
||||
*/
|
||||
char* udr_getpos(udrs)
|
||||
UDR* udrs;
|
||||
{
|
||||
if(udrs->udr_op == UDR_ENCODE)
|
||||
{
|
||||
return udrs->putbytes;
|
||||
}
|
||||
else if(udrs->udr_op == UDR_DECODE)
|
||||
{
|
||||
return udrs->getbytes;
|
||||
}
|
||||
else
|
||||
{ udr_errno = UDIErrorIPCInternal;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/****************************************************************** UDR_SETPOS
|
||||
*/
|
||||
int udr_setpos(udrs, pos)
|
||||
UDR* udrs;
|
||||
char* pos;
|
||||
{
|
||||
if( ((UDIUInt32)pos > (UDIUInt32)(udrs->buff) + (UDIUInt32)(udrs->bufsize))
|
||||
|| ((UDIUInt32)pos < (UDIUInt32)(udrs->buff) ) )
|
||||
{ udr_errno = UDIErrorIPCInternal;
|
||||
return 0;
|
||||
}
|
||||
if(udrs->udr_op == UDR_ENCODE)
|
||||
{
|
||||
udrs->putbytes = pos;
|
||||
return 1;
|
||||
}
|
||||
else if(udrs->udr_op == UDR_DECODE)
|
||||
{
|
||||
udrs->getbytes = pos;
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{ udr_errno = UDIErrorIPCInternal;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/***************************************************************** UDR_READNOW
|
||||
* Try and ensure "size" bytes are available in the
|
||||
* receive buffer character stream.
|
||||
*/
|
||||
int udr_readnow(udrs, size)
|
||||
UDR* udrs;
|
||||
int size;
|
||||
{
|
||||
int cnt, remain;
|
||||
|
||||
if(udrs->udr_op == UDR_ENCODE)
|
||||
{
|
||||
udr_errno = UDIErrorIPCInternal;
|
||||
return -1;
|
||||
}
|
||||
else if(udrs->udr_op == UDR_DECODE)
|
||||
{
|
||||
if( (UDIUInt32)(udrs->putbytes)-(UDIUInt32)(udrs->getbytes) < size )
|
||||
{ /* need more data in character stream buffer */
|
||||
remain = (UDIUInt32)(udrs->bufsize) -
|
||||
( (UDIUInt32)(udrs->putbytes)-(UDIUInt32)(udrs->buff) );
|
||||
cnt = read(udrs->sd, (char*)udrs->putbytes, remain);
|
||||
if(cnt == -1) perror("ERROR udr_work(), read() failure: ");
|
||||
udrs->putbytes += cnt;
|
||||
if( (UDIUInt32)(udrs->putbytes)-(UDIUInt32)(udrs->getbytes) < size )
|
||||
{ fprintf(stderr,"ERROR, udr_readnow() too few bytes in stream\n");
|
||||
return -1; /* return error code */
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{ udr_errno = UDIErrorIPCInternal;
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/******************************************************************* UDR_ALIGN
|
||||
*/
|
||||
int udr_align(udrs, size)
|
||||
UDR* udrs;
|
||||
int size;
|
||||
{
|
||||
char* align;
|
||||
int offset;
|
||||
|
||||
align = udr_getpos(udrs);
|
||||
offset = size - ((int)align & (size -1));
|
||||
offset = offset & (size -1);
|
||||
if(offset) udr_setpos(udrs, align + offset);
|
||||
}
|
||||
#endif /* __GO32__ */
|
|
@ -1,9 +0,0 @@
|
|||
# @(#)udi_soc 2.1 Daniel Mann
|
||||
# NOTE: the Session string must not start whith white-space characters.
|
||||
# Format of string is:
|
||||
# <session> <domain> <soc_name|host_name> <tip_exe> <pass to UDIconnect>
|
||||
soc2cayman AF_INET cayman /bin/udi_tip ...
|
||||
soc2tip AF_UNIX astring tip.exe ...
|
||||
cuba AF_UNIX soc_name ../bin.68020/udi_tip stuff to pass
|
||||
cayman AF_INET cayman this_entry_not_matter stuff to pass
|
||||
iss AF_UNIX * sun4/isstip -r osboot
|
|
@ -1,3 +1,8 @@
|
|||
2002-05-30 Andrew Cagney <ac131313@redhat.com>
|
||||
|
||||
* a29k-share/: Delete directory.
|
||||
* remote-vx29k.c: Delete file.
|
||||
|
||||
2002-05-30 Jason Thorpe <thorpej@wasabisystems.com>
|
||||
|
||||
* config/djgpp/fnchange.lst: Add ns32knbsd-nat.c, ns32knbsd-tdep.c,
|
||||
|
|
|
@ -1,182 +0,0 @@
|
|||
/* Am29k-dependent portions of the RPC protocol
|
||||
|
||||
Contributed by Wind River Systems.
|
||||
|
||||
This file is part of GDB.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include <stdio.h>
|
||||
#include "defs.h"
|
||||
|
||||
#include "vx-share/regPacket.h"
|
||||
#include "frame.h"
|
||||
#include "inferior.h"
|
||||
#include "target.h"
|
||||
#include "gdbcore.h"
|
||||
#include "command.h"
|
||||
#include "symtab.h"
|
||||
#include "symfile.h" /* for struct complaint */
|
||||
#include "regcache.h"
|
||||
|
||||
#include "gdb_string.h"
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
#ifdef _AIX /* IBM claims "void *malloc()" not char * */
|
||||
#define malloc bogon_malloc
|
||||
#endif
|
||||
|
||||
#include <rpc/rpc.h>
|
||||
#include <sys/time.h> /* UTek's <rpc/rpc.h> doesn't #incl this */
|
||||
#include <netdb.h>
|
||||
#include "vx-share/ptrace.h"
|
||||
#include "vx-share/xdr_ptrace.h"
|
||||
#include "vx-share/xdr_ld.h"
|
||||
#include "vx-share/xdr_rdb.h"
|
||||
#include "vx-share/dbgRpcLib.h"
|
||||
|
||||
/* get rid of value.h if possible */
|
||||
#include <value.h>
|
||||
#include <symtab.h>
|
||||
|
||||
/* Flag set if target has fpu */
|
||||
|
||||
extern int target_has_fp;
|
||||
|
||||
/* Generic register read/write routines in remote-vx.c. */
|
||||
|
||||
extern void net_read_registers ();
|
||||
extern void net_write_registers ();
|
||||
|
||||
/* Read a register or registers from the VxWorks target.
|
||||
REGNO is the register to read, or -1 for all; currently,
|
||||
it is ignored. FIXME look at regno to improve efficiency. */
|
||||
|
||||
void
|
||||
vx_read_register (int regno)
|
||||
{
|
||||
char am29k_greg_packet[AM29K_GREG_PLEN];
|
||||
char am29k_fpreg_packet[AM29K_FPREG_PLEN];
|
||||
|
||||
/* Get general-purpose registers. When copying values into
|
||||
registers [], don't assume that a location in registers []
|
||||
is properly aligned for the target data type. */
|
||||
|
||||
net_read_registers (am29k_greg_packet, AM29K_GREG_PLEN, PTRACE_GETREGS);
|
||||
|
||||
/* Now copy the register values into registers[].
|
||||
Note that this code depends on the ordering of the REGNUMs
|
||||
as defined in "tm-29k.h". */
|
||||
|
||||
bcopy (&am29k_greg_packet[AM29K_R_GR96],
|
||||
®isters[REGISTER_BYTE (GR96_REGNUM)], 160 * AM29K_GREG_SIZE);
|
||||
bcopy (&am29k_greg_packet[AM29K_R_VAB],
|
||||
®isters[REGISTER_BYTE (VAB_REGNUM)], 15 * AM29K_GREG_SIZE);
|
||||
registers[REGISTER_BYTE (INTE_REGNUM)] = am29k_greg_packet[AM29K_R_INTE];
|
||||
bcopy (&am29k_greg_packet[AM29K_R_RSP],
|
||||
®isters[REGISTER_BYTE (GR1_REGNUM)], 5 * AM29K_GREG_SIZE);
|
||||
|
||||
/* PAD For now, don't care about exop register */
|
||||
|
||||
memset (®isters[REGISTER_BYTE (EXO_REGNUM)], '\0', AM29K_GREG_SIZE);
|
||||
|
||||
/* If the target has floating point registers, fetch them.
|
||||
Otherwise, zero the floating point register values in
|
||||
registers[] for good measure, even though we might not
|
||||
need to. */
|
||||
|
||||
if (target_has_fp)
|
||||
{
|
||||
net_read_registers (am29k_fpreg_packet, AM29K_FPREG_PLEN,
|
||||
PTRACE_GETFPREGS);
|
||||
registers[REGISTER_BYTE (FPE_REGNUM)] = am29k_fpreg_packet[AM29K_R_FPE];
|
||||
registers[REGISTER_BYTE (FPS_REGNUM)] = am29k_fpreg_packet[AM29K_R_FPS];
|
||||
|
||||
/* PAD For now, don't care about registers (?) AI0 to q */
|
||||
|
||||
memset (®isters[REGISTER_BYTE (161)], '\0', 21 * AM29K_FPREG_SIZE);
|
||||
}
|
||||
else
|
||||
{
|
||||
memset (®isters[REGISTER_BYTE (FPE_REGNUM)], '\0', AM29K_FPREG_SIZE);
|
||||
memset (®isters[REGISTER_BYTE (FPS_REGNUM)], '\0', AM29K_FPREG_SIZE);
|
||||
|
||||
/* PAD For now, don't care about registers (?) AI0 to q */
|
||||
|
||||
memset (®isters[REGISTER_BYTE (161)], '\0', 21 * AM29K_FPREG_SIZE);
|
||||
}
|
||||
|
||||
/* Mark the register cache valid. */
|
||||
|
||||
registers_fetched ();
|
||||
}
|
||||
|
||||
/* Store a register or registers into the VxWorks target.
|
||||
REGNO is the register to store, or -1 for all; currently,
|
||||
it is ignored. FIXME look at regno to improve efficiency. */
|
||||
|
||||
void
|
||||
vx_write_register (int regno)
|
||||
{
|
||||
char am29k_greg_packet[AM29K_GREG_PLEN];
|
||||
char am29k_fpreg_packet[AM29K_FPREG_PLEN];
|
||||
|
||||
/* Store general purpose registers. When copying values from
|
||||
registers [], don't assume that a location in registers []
|
||||
is properly aligned for the target data type. */
|
||||
|
||||
bcopy (®isters[REGISTER_BYTE (GR96_REGNUM)],
|
||||
&am29k_greg_packet[AM29K_R_GR96], 160 * AM29K_GREG_SIZE);
|
||||
bcopy (®isters[REGISTER_BYTE (VAB_REGNUM)],
|
||||
&am29k_greg_packet[AM29K_R_VAB], 15 * AM29K_GREG_SIZE);
|
||||
am29k_greg_packet[AM29K_R_INTE] = registers[REGISTER_BYTE (INTE_REGNUM)];
|
||||
bcopy (®isters[REGISTER_BYTE (GR1_REGNUM)],
|
||||
&am29k_greg_packet[AM29K_R_RSP], 5 * AM29K_GREG_SIZE);
|
||||
|
||||
net_write_registers (am29k_greg_packet, AM29K_GREG_PLEN, PTRACE_SETREGS);
|
||||
|
||||
/* Store floating point registers if the target has them. */
|
||||
|
||||
if (target_has_fp)
|
||||
{
|
||||
am29k_fpreg_packet[AM29K_R_FPE] = registers[REGISTER_BYTE (FPE_REGNUM)];
|
||||
am29k_fpreg_packet[AM29K_R_FPS] = registers[REGISTER_BYTE (FPS_REGNUM)];
|
||||
|
||||
net_write_registers (am29k_fpreg_packet, AM29K_FPREG_PLEN,
|
||||
PTRACE_SETFPREGS);
|
||||
}
|
||||
}
|
||||
|
||||
/* VxWorks zeroes fp when the task is initialized; we use this
|
||||
to terminate the frame chain. Chain means here the nominal address of
|
||||
a frame, that is, the return address (lr0) address in the stack. To
|
||||
obtain the frame pointer (lr1) contents, we must add 4 bytes.
|
||||
Note : may be we should modify init_frame_info() to get the frame pointer
|
||||
and store it into the frame_info struct rather than reading its
|
||||
contents when FRAME_CHAIN_VALID is invoked. THISFRAME is unused. */
|
||||
|
||||
int
|
||||
vx29k_frame_chain_valid (CORE_ADDR chain, struct frame_info *thisframe)
|
||||
{
|
||||
int fp_contents;
|
||||
|
||||
read_memory ((CORE_ADDR) (chain + 4), (char *) &fp_contents, 4);
|
||||
return (fp_contents != 0);
|
||||
}
|
Loading…
Reference in a new issue