gonzui


Format: Advanced Search

tkernel_2/include/tm/tmonitor.hbare sourcepermlink (0.01 seconds)

Search this content:

    1: /*
    2:  *----------------------------------------------------------------------
    3:  *    T-Kernel 2.0 Software Package
    4:  *
    5:  *    Copyright 2011 by Ken Sakamura.
    6:  *    This software is distributed under the latest version of T-License 2.x.
    7:  *----------------------------------------------------------------------
    8:  *
    9:  *    Released by T-Engine Forum(http://www.t-engine.org/) at 2011/05/17.
   10:  *    Modified by T-Engine Forum at 2012/11/27.
   11:  *    Modified by T-Engine Forum at 2014/07/28.
   12:  *    Modified by TRON Forum(http://www.tron.org/) at 2015/06/01.
   13:  *
   14:  *----------------------------------------------------------------------
   15:  */
   16: 
   17: /*
   18:  *      @(#)tmonitor.h (tm)
   19:  *
   20:  *      T-Monitor
   21:  */
   22: 
   23: #ifndef __TM_TMONITOR_H__
   24: #define __TM_TMONITOR_H__
   25: 
   26: #include <basic.h>
   27: #include <stdarg.h>
   28: 
   29: #ifdef __cplusplus
   30: extern "C" {
   31: #endif
   32: 
   33: #define L_DEVNM         8      /* Device name length */
   34: 
   35: /*
   36:  * Boot information
   37:  */
   38: typedef struct BootInfo {
   39:         UB     devnm[L_DEVNM];     /* Physical device name */
   40:         INT    part;              /* Partition number
   41:                                    (-1: no partition) */
   42:         INT    start;             /* Partition first sector number
   43:                                    (0: no partition) */
   44:         INT    secsz;             /* Sector size (byte) */
   45: } BootInfo;
   46: 
   47: /*
   48:  * Extended service call function number (tm_extsvc)
   49:  */
   50: #define TMEF_PORTBPS    0x00U      /* Debug port speed (bps) */
   51: #define TMEF_RDAINFO    0x01U      /* ROM disk information */
   52: #define TMEF_PCIINFO    0x02U      /* PCI device information */
   53: #define TMEF_DIPSW      0x10U        /* DIPSW state */
   54: #define TMEF_WROM       0x20U /* Flash ROM write */
   55: 
   56: /*
   57:  *      ROM disk information
   58:  */
   59: typedef struct  {
   60:         UW     rd_type;    /* ROM disk type (1: ROM disk) */
   61:         UW     rd_blksz;   /* ROM disk block size (normally 512) */
   62:         UW     rd_saddr;   /* ROM disk start address */
   63:         UW     rd_eaddr;   /* ROM disk end address */
   64: } RdaInfo;
   65: 
   66: /*
   67:  *      PCI device information
   68:  */
   69: #define CADDR(bus, dev, func)   (((bus) << 8) | ((dev) << 3) | (func))
   70: 
   71: typedef struct  {
   72:         UH     caddr;              /* Configuration address */
   73:         UH     vendor;     /* Vendor ID */
   74:         UH     devid;              /* Device ID */
   75:         UH     devclass;   /* Device class */
   76: } PciInfo;
   77: 
   78: /*
   79:  * Monitor service function
   80:  */
   81: IMPORT void tm_monitor( void );
   82: IMPORT INT  tm_getchar( INT wait );
   83: IMPORT INT  tm_putchar( INT c );
   84: IMPORT INT  tm_getline( UB *buff );
   85: IMPORT INT  tm_putstring( const UB *buff );
   86: IMPORT INT  tm_command( const UB *buff );
   87: IMPORT INT  tm_readdisk( const UB *dev, INT sec, INT nsec, void *addr );
   88: IMPORT INT  tm_writedisk( const UB *dev, INT sec, INT nsec, void *addr );
   89: IMPORT INT  tm_infodisk( const UB *dev, INT *blksz, INT *nblks );
   90: IMPORT void tm_exit( INT mode );
   91: IMPORT INT  tm_extsvc( INT fno, INT par1, INT par2, INT par3 );
   92: 
   93: /*
   94:  * Monitor related library
   95:  */
   96: IMPORT int tm_vprintf( const char *format, va_list ap );
   97: IMPORT int tm_vsprintf( char *str, const char *format, va_list ap );
   98: IMPORT int tm_sprintf( char *str, const char *format, ... );
   99: IMPORT int tm_printf( const char *format, ... );
  100: #define bms_printf      tm_printf
  101: 
  102: #ifdef __cplusplus
  103: }
  104: #endif
  105: #endif /* __TM_TMONITOR_H__ */