⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 syscon_api.h

📁 MIPS YAMON, a famous monitor inc. source, make file and PDF manuals.
💻 H
📖 第 1 页 / 共 3 页
字号:
/************************************************************************ * *      syscon_api.h * *      The 'syscon' module implements a generic api, which is available *      on all MIPS designed boards and which establishes an adaptation *      to the specific system resources per board. The 'syscon' api  *      must be used in drivers, protocols, applications etc. to access *      any required system data to allow modules being portable across *      all MIPS designed boards. * * ###################################################################### * * mips_start_of_legal_notice *  * Copyright (c) 2004 MIPS Technologies, Inc. All rights reserved. * * * Unpublished rights (if any) reserved under the copyright laws of the * United States of America and other countries. * * This code is proprietary to MIPS Technologies, Inc. ("MIPS * Technologies"). Any copying, reproducing, modifying or use of this code * (in whole or in part) that is not expressly permitted in writing by MIPS * Technologies or an authorized third party is strictly prohibited. At a * minimum, this code is protected under unfair competition and copyright * laws. Violations thereof may result in criminal penalties and fines. * * MIPS Technologies reserves the right to change this code to improve * function, design or otherwise. MIPS Technologies does not assume any * liability arising out of the application or use of this code, or of any * error or omission in such code. Any warranties, whether express, * statutory, implied or otherwise, including but not limited to the implied * warranties of merchantability or fitness for a particular purpose, are * excluded. Except as expressly provided in any written license agreement * from MIPS Technologies or an authorized third party, the furnishing of * this code does not give recipient any license to any intellectual * property rights, including any patent rights, that cover this code. * * This code shall not be exported, reexported, transferred, or released, * directly or indirectly, in violation of the law of any country or * international law, regulation, treaty, Executive Order, statute, * amendments or supplements thereto. Should a conflict arise regarding the * export, reexport, transfer, or release of this code, the laws of the * United States of America shall be the governing law. * * This code constitutes one or more of the following: commercial computer * software, commercial computer software documentation or other commercial * items. If the user of this code, or any related documentation of any * kind, including related technical data or manuals, is an agency, * department, or other entity of the United States government * ("Government"), the use, duplication, reproduction, release, * modification, disclosure, or transfer of this code, or any related * documentation of any kind, is restricted in accordance with Federal * Acquisition Regulation 12.212 for civilian agencies and Defense Federal * Acquisition Regulation Supplement 227.7202 for military agencies. The use * of this code by the Government is further restricted in accordance with * the terms of the license agreement(s) and/or applicable contract terms * and conditions covering this code from MIPS Technologies or an authorized * third party. * * * *  * mips_end_of_legal_notice *  * ************************************************************************/#ifndef SYSCON_API_H#define SYSCON_API_H/************************************************************************ *    Include files ************************************************************************/#include <sysdefs.h>#include <sys_api.h>#include <syserror.h>/************************************************************************ *  Macro Definitions*************************************************************************//************************************************************************ *   SYSCON, ERROR completion codes*************************************************************************/#define ERROR_SYSCON              0x00008000 /* for compile time check       */#define ERROR_SYSCON_OUT_OF_MEMORY    0x8000 /* No more dynamic memory       */#define ERROR_SYSCON_UNKNOWN_PARAM    0x8001 /* Parameter is not supported   */#define ERROR_SYSCON_IP_UNKNOWN       0x8002 /* IP address unknown           */#define ERROR_SYSCON_SUBNET_UNKNOWN   0x8003 /* Subnetmask unknown           */#define ERROR_SYSCON_GATEWAY_UNKNOWN  0x8004 /* Default gateway unknown      */#define ERROR_SYSCON_READ_ONLY_ID     0x8005 /* This parameter is read-only  */#define ERROR_SYSCON_WRITE_ONLY_ID    0x8006 /* This parameter is write-only */#define ERROR_SYSCON_ENV_VAR_TOO_BIG  0x8007 /* environment var size too big */#define ERROR_SYSCON_INVALID_CHAR_POS 0x8008 /* Alphanumeric display does not*/                                             /* support this position id     */#define ERROR_SYSCON_SIZE_MISMATCH    0x8009 /* parameter size check failed  *//************************************************************************ *  System Definitions*************************************************************************//* Memory allocation */#define SYS_MALLOC_DYNAMIC_MEMORY_SIZE  (4+90+1)*2048+4096typedef struct sys_malloc{    UINT32 size;        /* size (bytes) of memory block to be allocated */    UINT32 boundary;    /* address boundary alignment unit              */    void   **memory;    /* pointer to allocated memory block            */} t_sys_malloc;/* String or one-character output for Alphanumeric display. */typedef struct sys_alphanumeric{    UINT32 posid;     /* position to start the string or char display;                          position '0' is leftmost                       */    UINT8  *string;   /* nul-terminated string or pointer ref for char  */} t_sys_alphanumeric;/* System error to string conversion. */typedef struct sys_error_string{    UINT32 syserror;   /* system error code to be converted             */    UINT32 count;      /* number of string-pointers returned            */    UINT8  **strings;  /* pointer to array of string-pointers           */} t_sys_error_string;#define SYSCON_ERRORMSG_IDX 0 /* String index for error message         */#define SYSCON_DIAGMSG_IDX  1 /* String index for diagnose message      */#define SYSCON_HINTMSG_IDX  2 /* String index for hint message          *//* Prototype of system error lookup function: */typedef INT32 (*t_sys_error_lookup)(          t_sys_error_string *p_param );  /* INOUT: code to string(s)   *//* System error lookup registration */typedef struct sys_error_lookup_registration{    UINT32             prefix;  /* syserror prefix,                                    allocated in syserror.h              */    t_sys_error_lookup lookup;  /* lookup function                      */} t_sys_error_lookup_registration;/* System batch file descriptor:     Used to read or write a file via TFTP.     The file content is conveyed in one     operation between the 'buffer' and     the host.                                */typedef struct sys_batch_file_descriptor{    UINT32 mode ;         /* the IP-address of the TFTP server host     */    UINT32 host_ip ;      /* the IP-address of the TFTP server host     */    UINT8  *file_name ;   /* nul-terminated ASCII string                */    UINT8  *buffer ;      /* Pointer for caller allocated buffer        */    UINT32 buffer_size ;  /* Before the file operation (read or write),                               this parameter contains the size of                               the caller supplied buffer,                             After the file operation has been completed,                               this parameter contains the actual                               number of bytes, which have been read or                               written.                                 */} t_sys_batch_file_descriptor ;#define SYSCON_FILE_READ_MODE  0 /* File buffer is to be 'read'         */#define SYSCON_FILE_WRITE_MODE 1 /* File buffer is to be 'written'      *//* EEPROM definition */typedef struct{    UINT32 minor;    char   *name;    char   *descr;}t_syscon_eeprom_def;/************************************************************************ *  SYSCON enumeration definitions * *  Note that in order to maintain backward compatibility with *  earlier YAMON revisions, new IDs must be added at the end of this *  enumerated type. ************************************************************************/typedef enum syscon_ids{    /* REVISION register */    SYSCON_BOARD_REVISION_ID = 0,                    /* UINT32        */    SYSCON_BOARD_PRODUCTID_ID = 1,                   /* UINT32        */    SYSCON_BOARD_PRODUCTNAME_ID = 2,                 /* char *        */    SYSCON_BOARD_PRODUCTREV_ID = 3,                  /* UINT32        */    SYSCON_BOARD_CORECARDID_ID = 4,                  /* UINT32        */    SYSCON_BOARD_CORECARD_NAME_ID = 5,               /* char *        */    SYSCON_BOARD_CORECARDREV_ID = 6,                 /* UINT32        */    SYSCON_BOARD_FPGAREV_ID = 7,                     /* UINT32        */    SYSCON_BOARD_RTL_ID = 8,                         /* UINT32        */    SYSCON_BOARD_RTLREV_MAJOR_ID = 9,                /* UINT32        */    SYSCON_BOARD_RTLREV_MINOR_ID = 10,               /* UINT32        */    SYSCON_BOARD_RTL_NAME_ID = 11,                   /* char *        */    /* Serial number */    SYSCON_BOARD_SN_ID = 12,                         /* t_sn_ascii    */    /* NMI */    SYSCON_BOARD_NMI_STATUS_ID = 13,                 /* bool          */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -