OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [gdb-5.0/] [gdb/] [rdi-share/] [hsys.h] - Diff between revs 107 and 1765

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 107 Rev 1765
/*
/*
 * Copyright (C) 1995 Advanced RISC Machines Limited. All rights reserved.
 * Copyright (C) 1995 Advanced RISC Machines Limited. All rights reserved.
 *
 *
 * This software may be freely used, copied, modified, and distributed
 * This software may be freely used, copied, modified, and distributed
 * provided that the above copyright notice is preserved in all copies of the
 * provided that the above copyright notice is preserved in all copies of the
 * software.
 * software.
 */
 */
 
 
/*
/*
 * Host C library support header file.
 * Host C library support header file.
 *
 *
 * $Revision: 1.1.1.1 $
 * $Revision: 1.1.1.1 $
 *     $Date: 2001-05-18 11:16:45 $
 *     $Date: 2001-05-18 11:16:45 $
 *
 *
 */
 */
 
 
#ifndef angsd_hsys_h
#ifndef angsd_hsys_h
#define angsd_hsys_h
#define angsd_hsys_h
 
 
#define HSYS_FOPEN_MAX 256
#define HSYS_FOPEN_MAX 256
#define NONHANDLE -1
#define NONHANDLE -1
#define UNIQUETEMPS 256
#define UNIQUETEMPS 256
 
 
#include "dbg_hif.h"
#include "dbg_hif.h"
#include "hostchan.h"
#include "hostchan.h"
 
 
typedef struct {
typedef struct {
  FILE *FileTable[HSYS_FOPEN_MAX] ;
  FILE *FileTable[HSYS_FOPEN_MAX] ;
  char FileFlags[HSYS_FOPEN_MAX] ;
  char FileFlags[HSYS_FOPEN_MAX] ;
  char *TempNames[UNIQUETEMPS];
  char *TempNames[UNIQUETEMPS];
} OSblock;
} OSblock;
 
 
#define NOOP 0
#define NOOP 0
#define BINARY 1
#define BINARY 1
#define READOP 2
#define READOP 2
#define WRITEOP 4
#define WRITEOP 4
 
 
typedef struct {
typedef struct {
  const struct Dbg_HostosInterface *hostif;  /* Interface to debug toolkit. */
  const struct Dbg_HostosInterface *hostif;  /* Interface to debug toolkit. */
  int last_errno;                              /* Number of the last error. */
  int last_errno;                              /* Number of the last error. */
  OSblock *OSptr;
  OSblock *OSptr;
  char **CommandLine ;           /* Ptr to cmd line d`string held by ardi.c */
  char **CommandLine ;           /* Ptr to cmd line d`string held by ardi.c */
} hsys_state;
} hsys_state;
 
 
/*
/*
 *  Function: HostSysInit
 *  Function: HostSysInit
 *   Purpose: Set up the state block, filetable and register the and C lib
 *   Purpose: Set up the state block, filetable and register the and C lib
 *            callback fn
 *            callback fn
 *
 *
 *    Params:
 *    Params:
 *       Input: hostif, the host interface from the debug toolbox
 *       Input: hostif, the host interface from the debug toolbox
 *              cmdline, the command line used to call the image
 *              cmdline, the command line used to call the image
 *              state, the status block for the C lib
 *              state, the status block for the C lib
 *
 *
 *   Returns:
 *   Returns:
 *          OK: an RDIError_* valuee
 *          OK: an RDIError_* valuee
 */
 */
extern int HostSysInit(
extern int HostSysInit(
  const struct Dbg_HostosInterface *hostif, char **cmdline, hsys_state **state
  const struct Dbg_HostosInterface *hostif, char **cmdline, hsys_state **state
);
);
 
 
/*
/*
 *  Function: HostSysExit
 *  Function: HostSysExit
 *   Purpose: Close down the host side C library support
 *   Purpose: Close down the host side C library support
 *
 *
 *    Params:
 *    Params:
 *       Input: hstate, the status block for the C lib
 *       Input: hstate, the status block for the C lib
 *
 *
 *    Returns:  an RDIError_* valuee
 *    Returns:  an RDIError_* valuee
 */
 */
extern int HostSysExit(hsys_state *hstate);
extern int HostSysExit(hsys_state *hstate);
 
 
/*
/*
 *  Function: HandleSysMessage
 *  Function: HandleSysMessage
 *   Purpose: Handle an incoming C library message as a callback
 *   Purpose: Handle an incoming C library message as a callback
 *
 *
 *    Params:
 *    Params:
 *       Input: packet is the incoming data packet as described in devsw.h
 *       Input: packet is the incoming data packet as described in devsw.h
 *       hstate, the status block for the C lib
 *       hstate, the status block for the C lib
 *
 *
 *    Returns:  an RDIError_* valuee
 *    Returns:  an RDIError_* valuee
 */
 */
extern int HandleSysMessage(Packet *packet, hsys_state* stateptr);
extern int HandleSysMessage(Packet *packet, hsys_state* stateptr);
 
 
/*
/*
 *  Function: panic
 *  Function: panic
 *   Purpose: Print a fatal error message
 *   Purpose: Print a fatal error message
 *
 *
 *    Params:
 *    Params:
 *       Input: format  printf() style message describing the problem
 *       Input: format  printf() style message describing the problem
 *              ...     extra arguments for printf().
 *              ...     extra arguments for printf().
 *
 *
 *   Returns: This routine does not return
 *   Returns: This routine does not return
 *
 *
 * Post-conditions: Will have called exit(1);
 * Post-conditions: Will have called exit(1);
 */
 */
extern void panic(const char *format, ...);
extern void panic(const char *format, ...);
 
 
#endif /* ndef angsd_hsys_h */
#endif /* ndef angsd_hsys_h */
 
 
/* EOF hsys.h */
/* EOF hsys.h */
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.