亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? sysmotvpdutil.c

?? vxworks的bsp開發(fā)包(基于POWERPC的PRPMC800)
?? C
字號:
/* sysMotVpdUtil.c - Vital Product Data Routines. *//* Copyright 1999-2001 Motorola, Inc., All Rights Reserved *//*modification history--------------------01d,08oct00,dmw  Fixed range read functions to use dual byte addresses.01c,08sep00,dmw  Added dual-address I2C EEPROM accesses.01b,07sep00,dmw  Updated I2C access names.01a,31aug00,dmw  Written (from version 01a of ppmc750/vpdUtil.c) and                 add Harrier calls.*//*DESCRIPTIONThis file contains the Vital Product Data utility routines. These routines areused to read the contents of the VPD serial EEPROM and provide access to thevarious VPD data packets. These routines operate using caller-supplied buffers.This permits their use in environments where multiple VPD EEPROMS are supported.CAVEATSThis code executes very early in the startup sequence (called from romInit.s),before the image has been copied to RAM (assuming a non-ROM image). As such,this file must be added to the BOOT_EXTRA list in the Makefile to prevent itfrom being compressed during keernel generation. Additionally, extreme cautionmust be exercised when modifying these routines to prevent the use of absolutememory addresses which reference locations in the RAM-relocated image. Theselocations are invalid and references to them will cause unpredictable behavior.Absolute memory addresses are generated by the compiler when referencing tables,static data structures and global variables. All of these must be avoided. Insome places in the code, nested if-else constructs are used to avoid the jumptable created when a simple switch contruct is used. The jump table address wasloaded using an absolute address and the code broke because the execution imagehad not been copied to the RAM address produced by the compiler.*/#include "vxWorks.h"#include "config.h"#include "prpmc800.h"#include "sysMotVpd.h"/* defines */#define ENET_INSTANCE_SIZE  7   /* size of an extended ethernet packet */#ifndef I2C_BYTE_READIMPORT STATUS sysMotI2cRead(UCHAR, UCHAR, UCHAR *, UCHAR);#define I2C_BYTE_READ(device, offset, bfr, num) \    sysMotI2cRead(device, offset, bfr, num)#endif#ifndef I2C_BYTE_WRITEIMPORT STATUS sysMotI2cWrite(UCHAR, UCHAR, UCHAR *, UCHAR);#define I2C_BYTE_WRITE(device, offset, bfr, num) \    sysMotI2cWrite(device, offset, bfr, num)#endif#ifndef I2C_BYTE_RANGE_READIMPORT STATUS sysMotI2cRangeRead(UCHAR, USHORT, UINT16, UCHAR *, UCHAR);#define I2C_BYTE_RANGE_READ(device, offset, count, bfr, num) \    sysMotI2cRangeRead(device, offset, count, bfr, num)#endif#ifndef I2C_BYTE_RANGE_WRITEIMPORT STATUS sysI2cSromRangeWrite(UCHAR, USHORT, UINT16, UCHAR *);#define I2C_BYTE_RANGE_WRITE(device, offset, count, bfr) \    sysI2cSromRangeWrite(device, offset, count, bfr)#endif/********************************************************************************* sysI2cSromRangeRead - reads a range of bytes from an I2C serial eeprom (SROM)** This routine simply calls the I2C byte read routine for each requested byte.* The I2C byte read call is written using a macro to accommodate alternate* read routines.** RETURNS: OK, or ERROR if the I2C byte read fails.** SEE ALSO: sysI2cSromRangeWrite**/STATUS sysI2cSromRangeRead     (    UCHAR    devAdrs,    /* i2c address of the serial eeprom */    USHORT   devOffset,  /* starting offset within the serial eeprom to read */    UINT16   byteCount,  /* number of bytes to read (one-based) */    UCHAR *  pBfr        /* destination buffer */    )    {    for ( ; byteCount != 0; ++devOffset, ++pBfr, --byteCount)        {        if (I2C_BYTE_READ(devAdrs, devOffset, pBfr, I2C_ADDRESS_BYTES) != OK)            return (ERROR);        }    return (OK);    }/********************************************************************************* sysI2cSromRangeWrite - writes a range of bytes to an I2C serial eeprom (SROM)** This routine simply calls the I2C byte write routine for each requested byte.* The I2C byte write call is written using a macro to accommodate alternate* I2C byte write routines.** RETURNS: OK, or ERROR if the I2C byte write fails.** SEE ALSO: sysI2cSromRangeRead**/STATUS sysI2cSromRangeWrite     (    UCHAR    devAdrs,    /* i2c address of the serial eeprom */    USHORT   devOffset,  /* starting offset within the serial eeprom to write */    UINT16   byteCount,  /* number of bytes to write (one-based) */    UCHAR *  pBfr        /* source buffer */    )    {    for ( ; byteCount != 0; ++devOffset, ++pBfr, --byteCount)        {        if (I2C_BYTE_WRITE(devAdrs, devOffset, pBfr, I2C_ADDRESS_BYTES) != OK)            return (ERROR);        }    return (OK);    }/********************************************************************************* sysVpdHdrVld - validate a vital product data header** This routine validates the header of a vital product data structure. The* validation is performed by checking the contents of the "eyecatcher" and size* fields.** RETURNS: OK, or ERROR if vpd header contents are invalid.**/STATUS sysVpdHdrVld     (    VPD * pVpd   /* pointer to vpd structure */    )    {    UINT32 * pEyecatcher;    /*     * verify that the contents of the eyecatcher are correct. this must be     * done numerically because the string addresses generated by the     * compiler reference the program data area which is not valid until after     * the code has been copied to ram.     */    pEyecatcher = (UINT32 *)&pVpd->header.eyeCatcher[0];    if ((*pEyecatcher != 0x4d4f544f) ||     /* MOTO */        (*(pEyecatcher+1) != 0x524f4c41))   /* ROLA */            return (ERROR);    /*     * make sure the eeprom contents will fit into our vpd structure     * and that the eeprom size is at least large enough to hold the header and     * a termination packet.     */    if ( (pVpd->header.size > sizeof(VPD)) ||         (pVpd->header.size < (sizeof(VPD_HEADER) + 1)) )        return (ERROR);    return (OK);    }/********************************************************************************* sysVpdPktParse - parse the vital product data packets** This routine parses a raw VPD data array into an array of VPD packet pointers.* The parser walks through the data area of the vital product data structure and* saves the starting address of each packet it finds into an array of packet* pointers. When a desired packet is needed at a later time, the packet pointer* array can be scanned without having to re-parse the packets for each search.** RETURNS: OK, or ERROR and NULLs the first pointer in the array if an error*          is encountered while parsing or the size of the pointer array is*          exceeded. ** SEE ALSO: sysVpdPktGet()*/STATUS sysVpdPktParse    (    VPD *         pVpd,        /* pointer to vpd structure */    VPD_PACKET ** pVpdPtr,     /* packet ptr array */    UINT32        vpdPktLimit  /* number of pointers in the array */    )    {    VPD_PACKET ** p;           /* address of first array element */    UCHAR type;                /* type of current packet */    UINT32 limit;              /* end of valid packet data */    UINT32 index = 0;          /* current position in packet data */    UINT32 pkt = 0;            /* number of packets found */    /* verify that the header is correct */    if (sysVpdHdrVld (pVpd) != OK)        {        *pVpdPtr = NULL;        return (ERROR);        }    /* save the address of the first element in the pointer array */    p = pVpdPtr;    /* calculate the size of the data array */    limit = (UINT32)pVpd->header.size - sizeof(VPD_HEADER);    /* walk through the vpd data area parsing each packet */    do        {        /* save the packet type */        type =  pVpd->packets[index];        /*         * save the address of the current packet in the packet pointer array         * and advance the packet pointer to the next array entry.         */        *pVpdPtr++ = (VPD_PACKET *)&pVpd->packets[index++];        /* increment the packet count and advance to the next packet */        ++pkt;        index += pVpd->packets[index] + 1;        /*         * check the packet type and bail out of the loop if: 1) the termination         * packet has been found, 2) the packet type is illegal, or 3) if we've         * reached or exceeded the end of the data array or the packet pointer         * array.         */        if ( (type == VPD_PID_TERM) ||             (type == VPD_PID_GI)   ||             (index >= limit)       ||             (pkt >= vpdPktLimit) )            break;        /* continue until termination packet is found */        } while (type != VPD_PID_TERM);     /*     * if we didn't stop due to finding a termination packet, invalidate the     * first entry in the pointer array and return an error indication.     */    if (type != VPD_PID_TERM)        {        *p = NULL;        return (ERROR);        }    else        return (OK);    }/********************************************************************************* sysVpdPktGet - search the vital product data for a specific packet** This routine searches the a caller-supplied array of vpd packet pointers* looking for the specified instance of a specific packet type. Instances are* numbered starting at 0.** NOTE: There are two types of ethernet address packets defined: The base type* has 6 data bytes and no trailing instance number. The alternate type contains* 6 bytes of ethernet address plus a trailing instance byte. Instances are* numbered starting at zero. This routine will handle both packet types. It will* also handle multiple instances of the other packet types (except only one* termination packet is allowed).** RETURNS: A pointer to the desired packet and OK if the packet was found,*          otherwise it returns ERROR.** SEE ALSO: sysVpdPktParse()*/STATUS sysVpdPktGet    (    UCHAR         vpdType,     /* target packet type */    UINT32        vpdInstance, /* instance number of desired packet (0-based) */    VPD_PACKET ** pVpdPtr,     /* address of the array of packet pointers */    VPD_PACKET ** pVpdPacket   /* address of the return variable */    )    {    UCHAR        type;         /* current packet type */    VPD_PACKET * p;            /* pointer to current packet */    /* if the first pointer in the array is NULL, return an error indication. */    if (*pVpdPtr == NULL)        return (ERROR);    do        {        /* get the current packet pointer */        p = *pVpdPtr;        /* if the packet type matches the caller's requested type */        if ( (type = p->type) == vpdType )            {            /*             * see if the type is an ethernet address and has a trailing             * instance value. if it does, see of the instance number matches             * the caller's requested instance.             */            if ( (vpdType == VPD_PID_EA) &&                 (p->size == ENET_INSTANCE_SIZE) &&                 (vpdInstance == p->data[ENET_INSTANCE_SIZE-1]) )                {                *pVpdPacket = p;                return (OK);                }            else                {                /*                 * see if this is the instance the caller requested, if not                 * decrement the instance count and go around again.                 */                if (vpdInstance-- == 0)                    {                    *pVpdPacket = p;                    return (OK);                    }                }             }        /* advance to the next packet. */        pVpdPtr++;        /* terminate on reaching the term packet. */        } while ( type != VPD_PID_TERM);    return (ERROR);    }/********************************************************************************* sysVpdPktInit - initialize a vital product data structure.** This routine reads the vital product data header from a serial eeprom and* validates it. If the header is valid, the remainder of the vpd data* is read from the serial eeprom and parsed into vpd packets for general* purpose use.** RETURNS: OK, if successful or ERROR if unsuccessful.** SEE ALSO: sysVpdPktParse(), sysVpdPktGet() */STATUS sysVpdPktInit    (    UCHAR         devAdrs,   /* i2c address of the serial eeprom */    UCHAR         devOffset, /* offset to vpd within the serial eeprom */    VPD *         pVpd,      /* address of vpd structure */    VPD_PACKET ** pVpdPtr,   /* address of packet ptr array */    UINT32        PktLimit   /* number of entries in the packet ptr array */    )    {    /* mark vpd packet pointer contents invalid. */    *pVpdPtr = NULL;    /* read just the header from serial eeprom. */    if (I2C_BYTE_RANGE_READ (devAdrs, devOffset, sizeof(VPD_HEADER),                        (UCHAR *)pVpd, I2C_ADDRESS_BYTES) != OK)        return (ERROR);    /* check for a valid header */    if (sysVpdHdrVld (pVpd) != OK)        return (ERROR);    /* read the rest of the vpd from the serial eeprom. */    if (I2C_BYTE_RANGE_READ (devAdrs, devOffset + sizeof(VPD_HEADER),                        pVpd->header.size - sizeof(VPD_HEADER),                        (UCHAR *)&pVpd->packets, I2C_ADDRESS_BYTES) != OK)        return (ERROR);    /* parse the raw vpd data into vpd packets. */    return (sysVpdPktParse (pVpd, pVpdPtr, PktLimit) );    }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
蜜臀av一区二区在线免费观看| 成人黄色小视频在线观看| 国产一区二区精品久久| 91伊人久久大香线蕉| 日韩欧美在线影院| 夜夜操天天操亚洲| 成人美女在线视频| 精品日韩在线观看| 午夜电影久久久| 色播五月激情综合网| 国产亚洲精品免费| 久久国产免费看| 欧美日韩国产高清一区二区| 亚洲精品乱码久久久久久 | 日韩毛片视频在线看| 久久狠狠亚洲综合| 欧美挠脚心视频网站| 又紧又大又爽精品一区二区| 成人国产精品免费观看视频| 久久青草国产手机看片福利盒子 | 国产成人精品网址| 亚洲精品一线二线三线| 香蕉影视欧美成人| 欧美最新大片在线看| 一区在线播放视频| 蜜臀va亚洲va欧美va天堂| 欧美绝品在线观看成人午夜影视| 亚洲在线观看免费| 欧美在线啊v一区| 亚洲一二三四区不卡| 91在线免费看| 亚洲精品国产一区二区精华液 | 国产盗摄女厕一区二区三区| 欧美成人女星排名| 麻豆精品在线视频| 精品国精品国产| 国产一区二区三区av电影| 久久综合中文字幕| 国产精品99久| 中文字幕一区二区三区四区不卡 | 国产成人免费在线观看| 中文字幕国产一区二区| 成人黄色免费短视频| 国产精品久久久久一区二区三区 | 国产盗摄女厕一区二区三区| 国产欧美一区二区精品久导航| 国产伦精品一区二区三区视频青涩 | 欧美日韩高清一区二区三区| 日韩一区精品视频| 日韩欧美久久久| 国产裸体歌舞团一区二区| 国产精品久久久久桃色tv| 99麻豆久久久国产精品免费| 尤物av一区二区| 3d动漫精品啪啪1区2区免费| 激情都市一区二区| 成人欧美一区二区三区白人 | 美女一区二区在线观看| 日本一区二区三区视频视频| 91在线观看高清| 爽好久久久欧美精品| 久久奇米777| 色呦呦一区二区三区| 蜜臀av在线播放一区二区三区| 中文字幕av一区二区三区免费看| 色香色香欲天天天影视综合网| 日本aⅴ免费视频一区二区三区| 久久久久久久综合| 91成人网在线| 国产老妇另类xxxxx| 亚洲视频免费在线| 精品欧美乱码久久久久久1区2区| 99久久精品国产导航| 亚洲va国产天堂va久久en| 久久久久久久精| 欧美色偷偷大香| 不卡一区在线观看| 另类中文字幕网| 亚洲综合区在线| 国产欧美日韩不卡| 日韩亚洲国产中文字幕欧美| av在线这里只有精品| 久久国产生活片100| 一区二区高清在线| 国产精品丝袜在线| 日韩美女在线视频| 欧美日韩国产首页| 一本到三区不卡视频| 国产精品一区一区| 美女脱光内衣内裤视频久久影院| 亚洲人成亚洲人成在线观看图片 | 亚洲综合色视频| 亚洲国产精品t66y| 日韩三级精品电影久久久| 91久久精品一区二区| 成人福利视频网站| 国产高清成人在线| 韩国v欧美v亚洲v日本v| 三级欧美韩日大片在线看| 亚洲精品视频在线观看网站| 国产丝袜在线精品| 久久久久久久久久久久久久久99| 宅男噜噜噜66一区二区66| 欧美午夜一区二区| 欧美中文字幕亚洲一区二区va在线| 高清不卡在线观看av| 国产综合色在线| 国产乱妇无码大片在线观看| 国产综合久久久久久久久久久久| 蜜臀av亚洲一区中文字幕| 日韩精品91亚洲二区在线观看| 亚洲第一av色| 亚洲国产日产av| 亚洲成人av一区二区三区| 亚洲激情自拍偷拍| 一区二区三区精品在线| 亚洲乱码中文字幕| 亚洲最大成人综合| 亚洲第一狼人社区| 亚洲永久精品大片| 亚洲成人自拍一区| 日本伊人色综合网| 蜜桃视频第一区免费观看| 国产一区视频导航| 成人午夜碰碰视频| 一本色道久久综合亚洲91| 在线观看亚洲a| 91麻豆精品国产91久久久久久 | 日韩天堂在线观看| 精品国产123| 国产日韩欧美不卡在线| 国产精品国产三级国产普通话蜜臀 | 久久国产精品99精品国产| 极品销魂美女一区二区三区| 国产九色sp调教91| 99久久久久久| 欧美乱熟臀69xxxxxx| 精品免费国产一区二区三区四区| 亚洲国产激情av| 一区二区免费视频| 日本视频在线一区| 成人网男人的天堂| 欧美午夜片在线看| 国产日韩欧美a| 一区二区三区在线视频观看| 日韩二区三区四区| thepron国产精品| 51午夜精品国产| 国产精品免费视频网站| 亚洲成av人**亚洲成av**| 国产一区二区不卡| 91福利视频在线| 久久久久97国产精华液好用吗| 亚洲视频一区二区在线观看| 免费观看30秒视频久久| 成人av电影在线播放| 这里只有精品99re| 亚洲色图另类专区| 免费成人av资源网| 色偷偷成人一区二区三区91 | 麻豆精品视频在线观看免费 | 日韩欧美aaaaaa| 一区二区三区免费网站| 国产一区二区三区蝌蚪| 欧美性猛交xxxxxx富婆| 国产网站一区二区| 免费人成在线不卡| 欧美亚男人的天堂| 国产欧美日韩三区| 精品在线观看视频| 欧美无人高清视频在线观看| 中文字幕欧美激情| 国产999精品久久| 欧美日韩国产另类一区| 中文字幕佐山爱一区二区免费| 精品无人码麻豆乱码1区2区| 欧美天天综合网| 亚洲视频1区2区| 风间由美一区二区av101 | 国产成人在线观看免费网站| 欧美电影一区二区| 一区二区三区成人| 成人99免费视频| 国产欧美一区视频| 韩国理伦片一区二区三区在线播放 | 亚洲成人免费观看| fc2成人免费人成在线观看播放 | 精品国产污污免费网站入口| 亚洲一区二区精品3399| 91一区二区在线| 亚洲欧洲一区二区三区| 国产91精品在线观看| 欧美精品一区二区高清在线观看| 日本一道高清亚洲日美韩| 7878成人国产在线观看| 三级影片在线观看欧美日韩一区二区| 色av一区二区| 亚洲五码中文字幕| 在线亚洲欧美专区二区| 亚洲一区中文在线|