📄 dm_errors.h
字号:
/******************************************************************************
**
** COPYRIGHT (C) 2000, 2001 Intel Corporation.
**
** This software as well as the software described in it is furnished under
** license and may only be used or copied in accordance with the terms of the
** license. The information in this file is furnished for informational use
** only, is subject to change without notice, and should not be construed as
** a commitment by Intel Corporation. Intel Corporation assumes no
** responsibility or liability for any errors or inaccuracies that may appear
** in this document or any software that may be provided in association with
** this document.
** Except as permitted by such license, no part of this document may be
** reproduced, stored in a retrieval system, or transmitted in any form or by
** any means without the express written consent of Intel Corporation.
**
** FILENAME: dm_errors.h
**
** PURPOSE: This file contains the global #defines for all of the error
** codes in the diagnostic manager. Errors are stored as
** encoded 32-bit integers. In little-endian fashion, the
** most significant 8 bits are reserved for the location of
** the error. The next 12 bits are to be used as a sub-location
** of the error, and the last 12 bits are used for the error
** type encoding.
**
** These errors are intended to provide a means to track errors
** from device driver modules. The reasoning is that when an
** error occurs from a device driver module it may imply that
** there is a hardware failure. However, there is ample
** tracking and reporting for other software related errors too.
**
** LAST MODIFIED: $Modtime: 3/29/04 11:05a $
******************************************************************************/
#ifndef _DM_ERRORS_H
#define _DM_ERRORS_H
/*
*******************************************************************************
* HEADER FILES
*******************************************************************************
*/
#include "xllp_defs.h"
/*
*******************************************************************************
Definitions
*******************************************************************************
*/
typedef XLLP_UINT32_T ErrorT;
#define ERRORCODE(l,s,t) (((l)<<ERR_L_SHIFT) | ((s)<<ERR_S_SHIFT) | (t))
#define ERRORCODEX(l,s,s2,t) (((l)<<ERR_L_SHIFT) | ((s)<<ERR_S_SHIFT) | ((s2)<<ERR_S2_SHIFT) | (t))
#define ERR_L(e) (((e)&ERR_L_MASK)>>ERR_L_SHIFT)
#define ERR_S(e) (((e)&ERR_S_MASK)>>ERR_S_SHIFT)
#define ERR_S2(e) (((e)&ERR_S2_MASK)>>ERR_S2_SHIFT)
#define ERR_T(e) ((e)&ERR_T_MASK)
/*
*******************************************************************************
Special 32-bit codes
*******************************************************************************
*/
// Use this value to initialize the context structure error return value
#define ERR_PASS_CODE 0x50415353u // PASS in ASCII
// Use the following value for non-zero failing return value if there is no
// other value more suitable such as the error code itself.
#define ERR_FAIL_CODE 0x4641494Cu // FAIL in ASCII
// "No Error" return code
#define ERR_NONE ERRORCODEX(ERR_L_NONE, ERR_S_NONE, ERR_S2_NONE, ERR_T_NONE)
// "Unspecified Error" return code
#define ERR_UNSPECIFIED ERRORCODEX(ERR_L_NONE, ERR_S_NONE, ERR_S2_NONE, ERR_T_UNSPECIFIED)
/*
*******************************************************************************
(Software) Location codes - 8 bits max - 256 possible codes
- Used to identify the module that detects an error which affects its own
processing.
Location codes are prefixed with ERR_L_.
Force these constants to unsigned because they shift to the high end of the
unsigned storage variable.
*******************************************************************************
*/
#define ERR_L_SHIFT 24 // the bit shift for the location code
// Mask to isolate location code
#define ERR_L_MASK (0xFFu << ERR_L_SHIFT)
#define ERR_L_NONE 0x00u // Unspecified location/device/module
#define ERR_L_XSIC 0x01u // Main processor Interrupt Controller SW
#define ERR_L_XSDMA 0x02u // Main processor DMA Controller module
#define ERR_L_FLASH 0x03u // Flash memory device
#define ERR_L_XSGPIO 0x04u // Main processor GPIO module
#define ERR_L_LAN91C111 0x05u // LAN91C111 Ethernet Controller
#define ERR_L_XSFFUART 0x06u // FFUart device
#define ERR_L_XSBTUART 0x07u // BTUart device
#define ERR_L_XSSTUART 0x08u // STUart device
#define ERR_L_XSRTC 0x09u // Main Processor Real Time Clock
#define ERR_L_XSOST 0x0Au // Main processor Operating System Timer
#define ERR_L_XSAC97CTRL 0x0Bu // Main processor AC '97 Controller Unit
#define ERR_L_XSCLKMGR 0x0Cu // Main processor clock manager
#define ERR_L_AC97 0x0Du // AC'97 Audio and Modem Codec driver
#define ERR_L_PERIPH_BDCTRL 0x0Eu // Peripheral board's Control module
#define ERR_L_I2SCODEC 0x0Fu // I2S Audio Codec driver
#define ERR_L_MEMSTICK 0x10u // Memory Stick driver
#define ERR_L_CPU 0x11u // General CPU failures
#define ERR_L_MEMORY 0x12u // General Memory failures
#define ERR_L_SRAM 0x13u // SRAM device
#define ERR_L_SDRAM 0x14u // SDRAM device
#define ERR_L_XSUDC 0x15u // USB device controller
#define ERR_L_USB 0x16u // USB Host
#define ERR_L_XSSSP1 0x17u // SSP1 device
#define ERR_L_XSICP 0x18u // ICP device
#define ERR_L_LCD 0x19u // LCD device
#define ERR_L_TS 0x1Au // AC97 Touchscreen device
#define ERR_L_SSPTOUCH 0x1Bu // SSP Touchscreen dvice
#define ERR_L_MMC 0x1Cu // MMC device
#define ERR_L_USIM 0x1Du // USIM device
#define ERR_L_PCMCIA 0x1Eu // PCMCIA device
#define ERR_L_MSL 0x1Fu // MSL Controller
#define ERR_L_KEYPAD 0x20u // Keypad Controller
#define ERR_L_HEXLEDS 0x21u // HEX LEDs
#define ERR_L_DISCLEDS 0x22u // Discrete LEDs
#define ERR_L_HEXSW 0x23u // HEX Switches
#define ERR_L_USERSW 0x24u // User switches
#define ERR_L_PREMEM 0x25u // PreMemInit, this must remain 0x25 !
#define ERR_L_I2C 0x26u // I2C bus error
#define ERR_L_HEAP 0x27u // Heap manager
#define ERR_L_ROS 0x28u // ROS
#define ERR_L_XSSSP2 0x29u // SSP2 device
#define ERR_L_XSSSP3 0x2Au // SSP3 device
#define ERR_L_DP8390 0x2Au // DP8390 Ethernet Controller
#define ERR_L_DVM 0x2Bu // DVM error
#define ERR_L_USBOTG 0x2Cu // USB OTG Tranceiver
#define ERR_L_RSVD_FAIL 0xFEu
#define ERR_L_UNKNOWN 0xFFu
/*
*******************************************************************************
Primary sub-location codes - 8 bits max - 256 possible primary sub-location
codes. These are normally used to indicate the particular function we are in.
The programmer must define his own static sub-location codes within the device
driver and test code.
Codes from 0x00-0x7f are reserved for device driver code. It is recommended
that sublocation device driver code symbols be prefixed with ERR_S_.
Codes from 0x80-0xff are reserved for test code. It is recommended that
sublocation test code symbols be prefixed with ERR_TS_.
*******************************************************************************
*/
#define ERR_S_SHIFT 16 // the sub-location bit shift
// Mask to isolate sub-location code
#define ERR_S_MASK (0xFF << ERR_S_SHIFT)
#define ERR_S_NONE 0x0 // Unspecified sub-location
/*
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -