📄 loader_api.h
字号:
/************************************************************************
*
* loader_api.h
*
* API file for load image module
*
*
* ######################################################################
*
* Copyright (c) 1999-2000 MIPS Technologies, Inc. All rights reserved.
*
* Unpublished rights reserved under the Copyright Laws of the United States of
* America.
*
* This document contains information that is proprietary to MIPS Technologies,
* Inc. ("MIPS Technologies"). Any copying, modifying or use of this information
* (in whole or in part) which is not expressly permitted in writing by MIPS
* Technologies or a contractually-authorized third party is strictly
* prohibited. At a minimum, this information is protected under unfair
* competition laws and the expression of the information contained herein is
* protected under federal copyright laws. Violations thereof may result in
* criminal penalties and fines.
* MIPS Technologies or any contractually-authorized third party reserves the
* right to change the information contained in this document to improve
* function, design or otherwise. MIPS Technologies does not assume any
* liability arising out of the application or use of this information. Any
* license under patent rights or any other intellectual property rights owned
* by MIPS Technologies or third parties shall be conveyed by MIPS Technologies
* or any contractually-authorized third party in a separate license agreement
* between the parties.
* The information contained in this document constitutes one or more of the
* following: commercial computer software, commercial computer software
* documentation or other commercial items. If the user of this information, 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 information, 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 information 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 information from MIPS Technologies or any
* contractually-authorized third party.
*
************************************************************************/
#ifndef LOADER_API_H
#define LOADER_API_H
/************************************************************************
* Include files
************************************************************************/
#include <sysdefs.h>
#include <syserror.h>
/************************************************************************
* Definitions
*************************************************************************/
typedef enum load_formats
{
MOTOROLA_S3 = 0,
MICROSOFT_BIN
} t_image_format;
typedef enum LOADER_error_ids
{
ERROR_LOAD_NONE /* No error */
= ERROR_LOADER,
ERROR_LOAD_UNSUPPORTED_PORT, /* Port not supported */
ERROR_LOAD_AMBIGUOUS_TYPE, /* Load format is ambigous */
ERROR_LOAD_UNKNOWN_TYPE, /* Load format is unknown */
ERROR_LOAD_ILLEGAL_FORMAT, /* Load format not compliant */
ERROR_LOAD_CHECKSUM, /* Checksum error */
ERROR_LOAD_LINE_TOO_LONG, /* Line too long */
ERROR_LOAD_NET, /* Load error from net */
ERROR_LOAD_STORE, /* Load error by store of data */
ERROR_LOAD_BREAK, /* Load was interrupted by user */
ERROR_LOAD_NO_S7_RECORD, /* S7 termination record is lacking */
ERROR_LOAD_ILLEGAL_CHARACTER, /* Illegal character in line */
ERROR_LOAD_UART_COMM_ERROR, /* UART communication error */
/******* ADD NEW SYSENV ERROR TAGS JUST BEFORE THIS LINE ONLY *******/
} t_LOADER_error_ids;
/************************************************************************
* Public variables
************************************************************************/
/************************************************************************
* Public functions
************************************************************************/
/************************************************************************
*
* loader_init
* Description :
* -------------
*
* Init load module
*
* Return values :
* ---------------
*
* None
*
************************************************************************/
void
loader_init( void );
/************************************************************************
*
* loader_image
* Description :
* -------------
*
* Load image from serial port or Ethernet
*
* Return values :
* ---------------
*
* OK if no error, else error code
*
************************************************************************/
UINT32
loader_image(
UINT32 port, /* Port number */
UINT32 ip, /* IP addr (valid for PORT_NET) */
char *filename, /* valid for PORT_NET */
void **addr, /* Output : Start address */
t_image_format *imageformat, /* Output : Format */
UINT32 *error_pos, /* Output : Position of error */
UINT32 *raw_error ); /* Output : Raw error from
failing subsystem */
/************************************************************************
*
* loader_image
* Description :
* -------------
*
* Load image from serial port or Ethernet
*
* Return values :
* ---------------
*
* OK if no error, else error code
*
************************************************************************/
UINT32
loader_data(
UINT32 port, /* Port number */
UINT32 ip, /* IP addr (valid for PORT_NET) */
char *filename, /* valid for PORT_NET */
void **addr, /* Output : Start address */
t_image_format *imageformat, /* Output : Format */
UINT32 *error_pos, /* Output : Position of error */
UINT32 *raw_error ); /* Output : Raw error from
failing subsystem */
#endif /* #ifndef LOADER_API_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -