gio_dele.c

来自「DSP/BIOS Driver Developer Kit 1.11 The 」· C语言 代码 · 共 54 行

C
54
字号
/*
 *  Copyright 2003 by Texas Instruments Incorporated.
 *  All rights reserved. Property of Texas Instruments Incorporated.
 *  Restricted rights to use, duplicate or disclose this code are
 *  granted through contract.
 *  
 */
/* "@(#) DDK 1.11.00.00 11-04-03 (ddk-b13)" */
/*
 *  ======== gio_dele.c ========
 *
 */

#include <std.h>
#include <mem.h>
#include <que.h>

#include <gio.h>
#include <iom.h>

#include <_gio.h>


/*
 *  ======== GIO_delete ========
 */
Int GIO_delete(GIO_Handle gioChan)
{
    IOM_Packet *packet;

    /* flush and delete low-level device ... */
    if (gioChan->fxns != NULL && gioChan->mdChan != NULL) {
        GIO_flush(gioChan);
        gioChan->fxns->mdDeleteChan(gioChan->mdChan);
    }

    /* delete semaphore or alternate sync object ... */
    if (gioChan->syncObj != NULL) {
        GIO->SEMDELETE(gioChan->syncObj);
    }

    /* free frames ... */
    packet = QUE_get(&gioChan->freeList);
    while (packet != (IOM_Packet *)(&gioChan->freeList)) {
        _GIO_rmPacket(packet);
        packet = QUE_get(&gioChan->freeList);
    }

    /* free GIO object. */
    (Void)MEM_free(0, gioChan, sizeof(GIO_Obj));

    return (IOM_COMPLETED);
}

⌨️ 快捷键说明

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