home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / gdb-4.16-base.tgz / gdb-4.16-base.tar / fsf / gdb / utils / amd-udi / udi / dos386c.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-23  |  6.8 KB  |  307 lines

  1. /******************************************************************************
  2.  * Copyright 1991 Advanced Micro Devices, Inc.
  3.  *
  4.  * This software is the property of Advanced Micro Devices, Inc  (AMD)  which
  5.  * specifically  grants the user the right to modify, use and distribute this
  6.  * software provided this notice is not removed or altered.  All other rights
  7.  * are reserved by AMD.
  8.  *
  9.  * AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS
  10.  * SOFTWARE.  IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL
  11.  * DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR
  12.  * USE OF THIS SOFTWARE.
  13.  *
  14.  * Comments about this software should be directed to udi@amd.com. If access
  15.  * to electronic mail isn't available, send mail to:
  16.  *
  17.  * Advanced Micro Devices, Inc.
  18.  * 29K Support Products
  19.  * Mail Stop 573
  20.  * 5900 E. Ben White Blvd.
  21.  * Austin, TX 78741
  22.  *****************************************************************************
  23.  *       $Id: dos386c.h,v 1.1 1993/12/23 04:44:42 cassidy Exp $
  24.  *       $Id: @(#)dos386c.h    1.6, AMD
  25.  */
  26.  
  27. #ifndef _DOS386_H
  28. #define _DOS386_H
  29.  
  30. #ifdef WATC 
  31. #define NULL 0
  32. #endif /* WATC */
  33.  
  34.  
  35. #ifdef _DOS386C_C
  36. #define EXTERN 
  37. #define STATIC static
  38. #else
  39. #define EXTERN extern
  40. #define STATIC
  41. #endif
  42.  
  43. #define FAR
  44.  
  45. EXTERN char    *conventional_memory;    /* pointer to first byte of conventinal memory     */
  46.  
  47. EXTERN USHORT    our_tsr_psp;
  48. EXTERN USHORT    dos_ext_psp;
  49. /* EXTERN STATIC    struct UDIVecRec FAR * FAR * UDIVecP; */
  50. extern    REALPTR    call_prot;
  51. extern    USHORT    code_selector;
  52. extern    USHORT    data_selector;
  53. extern    USHORT    rmcode_firstbyte;
  54.  
  55.  
  56. /*
  57.  * Used to copy real mode code and data into conventional memory (udip2dos)
  58.  * and to construct real mode pointers and protected mode far (48 bit) 
  59.  * pointers.
  60.  */
  61.  
  62. EXTERN    USHORT    rmem_adr;
  63. EXTERN    REALPTR    real_base;
  64. EXTERN    FARPTR    prot_base;
  65.  
  66.  
  67. /*=============== Utilities for converting pointers from prot to real and vice versa========*/
  68.  
  69.     /* LINEARIZE converts a segment:ofst pointer into a linear addr between 0 and 1meg */
  70. #define LINEARIZE(rp) ((RP_SEG(rp)<<4) + RP_OFF(rp))
  71.  
  72.  
  73.  
  74. FARPTR REAL_TO_PROT(REALPTR rp);
  75.  
  76.  
  77. /* in DOS386, TIPName, TIPVecRec defined in dos386a.asm in rmdata */
  78. extern char TIPName[];
  79. extern struct UDIVecRec TIPVecRec;
  80.  
  81.  
  82. /* Function Prototypes */
  83.  
  84. REALPTR PROT_TO_REAL(FARPTR p);
  85. REALPTR _far * FindIntVect();
  86. FARPTR NEARPTR_TO_FARPTR(void *ptr);
  87.  
  88.  
  89.  
  90. /* Prototypes for DOS386 UDI interface functions. */
  91.  
  92.  
  93. UDIError UDIPConnect(REALPTR UDIConnectAddr, 
  94.     char *Configuration, 
  95.     UDISessionId *Session,
  96.     DOSTerm _far * TermStruct
  97.     );
  98.  
  99.  
  100.  
  101. UDIError UDIPCapabilities(
  102.     REALPTR        UDICapabilitiesAddr,
  103.     UDIUInt32    *TIPId,            /* Out */
  104.     UDIUInt32    *TargetId,        /* Out */
  105.     UDIUInt32    DFEId,            /* In  */
  106.     UDIUInt32    DFE,            /* In  */
  107.     UDIUInt32    *TIP,            /* Out */
  108.     UDIUInt32    *DFEIPCId,        /* Out */
  109.     UDIUInt32    *TIPIPCId,        /* Out */
  110.     char        *TIPString        /* Out */
  111.       );
  112.  
  113. UDIError UDIPGetErrorMsg(
  114.     REALPTR        UDIGetErrorMessageAddr,
  115.     UDIError    ErrorCode,        /* In  */
  116.     UDISizeT    MsgSize,        /* In  */
  117.     char        *Msg,            /* Out */
  118.     UDISizeT    *CountDone        /* Out */
  119.     );
  120.  
  121. UDIError UDIPSetCurrentConnection(
  122.     REALPTR        UDISetCurrentConnectionAddr,
  123.     UDISessionId    Session            /* In  */
  124.     );
  125.  
  126. UDIError UDIPDisconnect(
  127.     REALPTR        UDIDisconnectAddr,
  128.     UDISessionId    Session,        /* In  */
  129.     UDIBool        Terminate,        /* In  */
  130.     DOSTerm _far * TermStruct    /* In  */
  131.     );
  132.  
  133. UDIError UDIPGetTargetConfig(
  134.     REALPTR        UDIGetTargetConfigAddr,
  135.     UDIMemoryRange    KnownMemory[],        /* Out */
  136.     UDIInt        *NumberOfRanges,    /* In/Out */
  137.     UDIUInt32    ChipVersions[],        /* Out */
  138.     UDIInt        *NumberofChips        /* In/Out */
  139.     );
  140.  
  141. UDIError UDIPCreateProcess(
  142.     REALPTR        UDICreateProcessAddr,
  143.     UDIPId        *PId            /* Out */
  144.     );
  145.  
  146. UDIError UDIPSetCurrentProcess(
  147.     REALPTR        UDISetCurrentProcessAddr,
  148.     UDIPId        PId            /* In  */
  149.     );
  150.  
  151. UDIError UDIPInitializeProcess(
  152.     REALPTR        UDIInitializeProcessAddr,
  153.     UDIMemoryRange    ProcessMemory[],    /* In  */
  154.     UDIInt        NumberOfRanges,        /* In  */
  155.     UDIResource    EntryPoint,        /* In  */
  156.     CPUSizeT    *StackSizes,        /* In  */
  157.     UDIInt        NumberOfStacks,        /* In  */
  158.     char        *ArgString        /* In  */
  159.     );
  160.  
  161. UDIError UDIPDestroyProcess(
  162.     REALPTR        UDIDestroyProcessAddr,
  163.     UDIPId        PId            /* In  */
  164.     );
  165.  
  166. UDIError UDIPRead(
  167.     REALPTR        UDIReadAddr,
  168.     UDIResource    From,            /* In  */
  169.     UDIHostMemPtr    To,            /* Out */
  170.     UDICount    Count,            /* In  */
  171.     UDISizeT    Size,            /* In  */
  172.     UDICount    *CountDone,        /* Out */
  173.     UDIBool        HostEndian        /* In  */
  174.     );
  175.  
  176. UDIError UDIPWrite(
  177.     REALPTR        UDIWriteAddr,
  178.     UDIHostMemPtr    From,            /* In  */
  179.     UDIResource    To,            /* In  */
  180.     UDICount    Count,            /* In  */
  181.     UDISizeT    Size,            /* In  */
  182.     UDICount    *CountDone,        /* Out */
  183.     UDIBool        HostEndian        /* In  */
  184.     );
  185.  
  186. UDIError UDIPCopy(
  187.     REALPTR        UDICopyAddr,
  188.     UDIResource    From,            /* In  */
  189.     UDIResource    To,            /* In  */
  190.     UDICount    Count,            /* In  */
  191.     UDISizeT    Size,            /* In  */
  192.     UDICount    *CountDone,        /* Out */
  193.     UDIBool        Direction        /* In  */
  194.     );
  195.  
  196. UDIError UDIPExecute(
  197.     REALPTR        UDIExecuteAddr
  198.     );
  199.  
  200. UDIError UDIPStep(
  201.     REALPTR        UDIStepAddr,
  202.     UDIUInt32    Steps,            /* In  */
  203.     UDIStepType    StepType,        /* In  */
  204.     UDIRange    Range            /* In  */
  205.     );
  206.  
  207. UDIError UDIPStop(
  208.     REALPTR        UDIStopAddr
  209.     );
  210.  
  211. UDIError UDIPWait(
  212.     REALPTR        UDIWaitAddr,
  213.     UDIInt32    MaxTime,        /* In  */
  214.     UDIPId        *PId,            /* Out */
  215.     UDIUInt32    *StopReason        /* Out */
  216.     );
  217.  
  218. UDIError UDIPSetBreakpoint(
  219.     REALPTR        UDISetBreakpointAddr,
  220.     UDIResource    Addr,              /* In  */
  221.     UDIInt32    PassCount,        /* In  */
  222.     UDIBreakType    Type,            /* In  */
  223.     UDIBreakId    *BreakId        /* Out */
  224.     );
  225.  
  226. UDIError UDIPQueryBreakpoint(
  227.     REALPTR        UDIQueryBreakpointAddr,
  228.     UDIBreakId    BreakId,        /* In  */
  229.     UDIResource    *Addr,            /* Out */
  230.     UDIInt32    *PassCount,        /* Out */
  231.     UDIBreakType    *Type,            /* Out */
  232.     UDIInt32    *CurrentCount        /* Out */
  233.     );
  234.  
  235. UDIError UDIPClearBreakpoint(
  236.     REALPTR        UDIClearBreakpointAddr,
  237.     UDIBreakId    BreakId            /* In  */
  238.     );
  239.  
  240.  
  241. UDIError UDIPGetStdout(
  242.     REALPTR        UDIGetStdoutAddr,
  243.     UDIHostMemPtr    Buf,            /* Out */
  244.     UDISizeT    BufSize,        /* In  */
  245.     UDISizeT    *CountDone        /* Out */
  246.     );
  247.  
  248. UDIError UDIPGetStderr(
  249.     REALPTR        UDIGetStderrAddr,
  250.     UDIHostMemPtr    Buf,            /* Out */
  251.     UDISizeT    BufSize,        /* In  */
  252.     UDISizeT    *CountDone        /* Out */
  253.     );
  254.  
  255. UDIError UDIPPutStdin(
  256.     REALPTR        UDIPutStdinAddr,
  257.     UDIHostMemPtr    Buf,            /* In  */
  258.     UDISizeT    Count,            /* In  */
  259.     UDISizeT    *CountDone        /* Out */
  260.     );
  261.  
  262. UDIError UDIPStdinMode(
  263.     REALPTR        UDIStdinModeAddr,
  264.     UDIMode        *Mode            /* Out */
  265.     );
  266.  
  267. UDIError UDIPPutTrans(
  268.     REALPTR        UDIPutTransAddr,
  269.     UDIHostMemPtr    Buf,            /* In  */
  270.     UDISizeT    Count,            /* In  */
  271.     UDISizeT    *CountDone        /* Out */
  272.     );
  273.  
  274. UDIError UDIPGetTrans(
  275.     REALPTR        UDIGetTransAddr,
  276.     UDIHostMemPtr    Buf,            /* Out */
  277.     UDISizeT    BufSize,        /* In  */
  278.     UDISizeT    *CountDone        /* Out */
  279.     );
  280.  
  281. UDIError UDIPTransMode(
  282.     REALPTR        UDITranModesAddr,
  283.     UDIMode        *Mode            /* Out */
  284.     );
  285.  
  286.  
  287. #if __HIGHC__
  288. /* make _fmemmove work for highc */
  289.  
  290. static void _fmemmove(void _far *dst, void _far *src, int count)
  291. {
  292.   /* Metaware hc386 call */
  293.   _movedata(FP_SEL(src), /* from segment:ofs */
  294.         FP_OFF(src),
  295.         FP_SEL(dst), /* to segment:ofst */
  296.         FP_OFF(dst),
  297.         count);
  298. }
  299. #endif
  300.     
  301.  
  302.  
  303. #endif  /* _DOS386_H */
  304.  
  305.  
  306.  
  307.