📄 tmnxcompid.h
字号:
/* -------------------------------------------------------------------------- *//* (C) Copyright 2000-2005 Koninklijke Philips Electronics N.V., *//* All rights reserved *//* *//* This source code and any compilation or derivative thereof is the *//* proprietary information of Konlinklijke Philips Electronics N.V. and is *//* Confidential in nature. *//* Under no circumstances is this software to be exposed to or placed under an*//* Open Source License of any type without the expressed written permission of*//* Koninklijke Philips Electronics N.V. *//* -------------------------------------------------------------------------- *//* *//* MoReUse - 2005-10-24 Version 118 *//* *//* Added: *//* CID_AACPENC *//* *//* *//* Changed: *//* *//* *//* *//* Removed: *//* *//* *//* *//* General Error Codes Added *//* *//* -------------------------------------------------------------------------- *//* FILE NAME: tmNxCompId.h *//* *//* DESCRIPTION: This header file identifies the standard component *//* identifiers (CIDs) and interface identifiers (IID) for *//* Nexperia platforms. *//* The objective of these identifiers is to enable unique *//* identification of software components and interfaces. *//* In addition, standard status values are also defined to make *//* determination of typical error cases much easier. *//* *//* Functional errors are not real errors in the sense of *//* unexpected behaviour but are part of the normal communication*//* between a client an a server component. They are linked to *//* an interface, rather than to a component. All implementations*//* of an interface must have the same behaviour with respect to *//* functional errors. Functional erros are all positive *//* One global functional error is defined: TM_OK 0x00000000 *//* *//* Non-functional errors (all negative numbers) indicate *//* unexpected behaviour. They are linked to concrete component *//* implementations *//* *//* NOTE: The current implementation is different from the prev. *//* component identifier implementation, based on classes, *//* types and layers. However, the new system is backward *//* compatitible with the old implementation. *//* *//* tmNxCompId.h defines a number of general error codes that can*//* be used by all components. These error codes are concatenated*//* to the CID or IID value in the local component headerfile of *//* the component that wants to (re-)use this general error code *//* General error codes can be used for both functional and *//* non-functional errors. They should only be used if they *//* semantically fully match (if not, defined a new component or *//* interface specific error code. *//* *//* General Rules: *//* A return value has a length of 32 bits. At the binary level, *//* 1 bit indicates the component or interface flag; 16 bits are *//* used for the actual component id (CID) or interface id (IID) *//* and 12 bits for the return status. *//* The component/interface flag is bit 31. *//* Bits 30--28 are all 0. *//* The component/interface id occupies bits 27--12. *//* The return status occupies bits 11--0. *//* *//* +--------+-----+-------+-----------+ *//* | flag:1 | 0:3 | id:16 | status:12 | *//* +--------+-----+-------+-----------+ *//* *//* Format of interface ids: *//* *//* +-----+-----+--------+-----------+ *//* | 0:1 | 0:3 | iid:16 | status:12 | *//* +-----+-----+--------+-----------+ *//* *//* Format of component ids: *//* *//* +-----+-----+--------+-----------+ *//* | 1:1 | 0:3 | cid:16 | status:12 | *//* +-----+-----+--------+-----------+ *//* *//* At the macro level, we use the prefix "CID_" for component *//* ids (previous version "CID_COMP_") and "IID_" for interface *//* ids. *//* *//* Each component id will be used by only one component; each *//* component will have its own component id. *//* Each interface id will be used by only one interface; each *//* interface will have its own interface id. *//* *//* In order to avoid problems when promoting a UNIQUE interface *//* to a SEPARATE interface, the ranges for CIDs and IIDS must *//* not overlap. *//* *//* Component names and component ids have to be registered *//* together; the same applies for interface names and ids. *//* *//* NOTE about Compatibility *//* In the previous implementation the first four bits were *//* reserved for class, and there were separate fields for *//* type and tag, like this: *//* *//* +---------+--------+-------+---------+-----------+ *//* | class:4 | type:4 | tag:8 | layer:4 | status:12 | *//* +---------+--------+-------+---------+-----------+ *//* *//* The values 0 or 8 are not valid classes, and this fact *//* can be used to distinguish a new-style IID (class == 0), *//* a new-style CID (class == 8), and an old-style CID *//* (otherwise). *//* *//* NOTE about error codes *//* The general error codes use the range 0x001 to 0x7FF. *//* The component specific error codes are defined in the *//* local component header file and can use 0x800 to 0xFFF. *//* TM_OK has the value 0x00000000. *//* The proposed error code ranges (general and specific) are *//* the same for functional and non-functional errors. *//* *//* The previously defined ranges for external customers, *//* assert errors and fatal errors have been dropped. *//* The previously defined range for general errors started *//* at 0x000 instead of 0x001 *//* *//* DOCUMENT REF: Nexperia/MoReUse Naming Conventions *//* *//* -------------------------------------------------------------------------- */#ifndef TMNXCOMPID_H#define TMNXCOMPID_H/* -------------------------------------------------------------------------- *//* *//* Standard include files: *//* *//* -------------------------------------------------------------------------- */#include "tmNxTypes.h"#ifdef __cplusplusextern "C"{#endif/* -------------------------------------------------------------------------- *//* *//* Types and defines: *//* *//* -------------------------------------------------------------------------- *//* -------------------------------------------------------------------------- *//* *//* TM_OK is the 32 bit global status value used by all Nexperia components *//* to indicate successful function/operation status. If a non-zero value is*//* returned as status, it should use the component ID formats defined. *//* *//* -------------------------------------------------------------------------- */#define TM_OK 0U /* Global success return status *//* -------------------------------------------------------------------------- *//* *//* General Defines *//* *//* -------------------------------------------------------------------------- */#define CID_IID_FLAG_BITSHIFT 31#define CID_ID_BITSHIFT 12#define IID_ID_BITSHIFT 12#define CID_FLAG (0x1U << CID_IID_FLAG_BITSHIFT)#define IID_FLAG (0x0U << CID_IID_FLAG_BITSHIFT)#define CID_ID(number) ((number) << CID_ID_BITSHIFT)#define CID_ID_BITMASK (0x7FFFFU << CID_ID_BITSHIFT)#define IID_ID(number) ((number) << IID_ID_BITSHIFT)#define IID_ID_BITMASK (0x7FFFFU << IID_ID_BITSHIFT)/* -------------------------------------------------------------------------- *//* *//* Definition of the interface IDs *//* *//* -------------------------------------------------------------------------- */#define IID_IENUMUNKNOWN (IID_ID(0x001U) | IID_FLAG)#define IID_IBIND (IID_ID(0x002U) | IID_FLAG)#define IID_IBINDINFO (IID_ID(0x003U) | IID_FLAG)#define IID_IMEM (IID_ID(0x004U) | IID_FLAG)#define IID_IUNKNOWN (IID_ID(0x005U) | IID_FLAG)#define IID_IIC (IID_ID(0x006U) | IID_FLAG)#define IID_ACHAN (IID_ID(0x007U) | IID_FLAG)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -