gio_cbck.c
上传用户:dahaojd
上传日期:2008-01-29
资源大小:14357k
文件大小:1k
- /*
- * 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_cbck.c ========
- *
- */
- #include <std.h>
- #include <gio.h>
- #include <iom.h>
- #include <que.h>
- #include <_gio.h>
- /*
- * ======== _GIO_iomCallback ========
- * This function is called by the mini-driver when I/O completes.
- */
- Void _GIO_iomCallback(Ptr cbArg, IOM_Packet *packet)
- {
- GIO_Handle gioChan = (GIO_Handle)cbArg;
- GIO_AppCallback *appCallback = (GIO_AppCallback *)packet->misc;
- Int status;
- Ptr addr;
- Uns size;
-
- if (appCallback == NULL) {
- /* this was a synchronous call -- post semaphore (or alternate sync) */
- GIO->SEMPOST(gioChan->syncObj);
- }
- else {
- status = packet->status;
- addr = packet->addr;
- size = packet->size;
-
- /* recycle packet back onto free list */
- QUE_put(&gioChan->freeList, packet);
- /* callback into application with status and size */
- (*appCallback->fxn)(appCallback->arg, status, addr, size);
- }
- }