📄 sgdmac.h
字号:
/*============================================================================
____________________________________________________________________________
______________________________________________
SSSS M M CCCC Standard Microsystems Corporation
S MM MM SSSS C Austin Design Center
SSS M M M S C 11000 N. Mopac Expressway
S M M SSS C Stonelake Bldg. 6, Suite 500
SSSS M M S CCCC Austin, Texas 78759
SSSS ______________________________________________
____________________________________________________________________________
Copyright(C) 1999, Standard Microsystems Corporation
All Rights Reserved.
This program code listing is proprietary to SMSC and may not be copied,
distributed, or used without a license to do so. Such license may have
Limited or Restricted Rights. Please refer to the license for further
clarification.
____________________________________________________________________________
Notice: The program contained in this listing is a proprietary trade
secret of SMSC, Hauppauge, New York, and is copyrighted
under the United States Copyright Act of 1976 as an unpublished work,
pursuant to Section 104 and Section 408 of Title XVII of the United
States code. Unauthorized copying, adaption, distribution, use, or
display is prohibited by this law.
____________________________________________________________________________
Use, duplication, or disclosure by the Government is subject to
restrictions as set forth in subparagraph(c)(1)(ii) of the Rights
in Technical Data and Computer Software clause at DFARS 52.227-7013.
Contractor/Manufacturer is Standard Microsystems Corporation,
80 Arkay Drive, Hauppauge, New York, 1178-8847.
____________________________________________________________________________
____________________________________________________________________________
<module name> - <module description>
____________________________________________________________________________
comments tbd
____________________________________________________________________________
Revision History
Date Who Comment
________ ___ _____________________________________________________________
05/31/01 tbh -initial version
07/27/01 tbh -assimilated sgdmac_initiate_pkt2isa_transfer,
sgdmac_initiate_isa2pkt_transfer, and sgdmac_initiate_io_transfer
from the udp interface manager for the u2dp project.
============================================================================*/
//------------------------------------------------------------------------------
// IMPORTANT NOTE:
// The macro versions of the functions are faster, but trickier to use properly.
// they exist only to improve the performance of the kernel. If you personally
// choose to use the macro versions (to squeeze out every ounce of performance)
// then you should make sure you understand any differences between the macros
// and the functions, and how that can affect your implementation.
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// Name:
// _sgdmac_initiate_transfer
//
// Declaration:
// void _sgdmac_initiate_transfer(uint8 pchan, uint16 isaaddr,
// uint16 length, uint8 cmd, uint8 mode);
//
// Purpose:
// Initiates the proper transfer type based on the cmd and mode.
//
// Arguments:
// pchan - the physical dma channel. ignored for mem2mem transfers.
// isaaddr - the source or target isa address (memory or io).
// length - number of bytes to transfer.
// cmd - the value for the 8237a dmac's command register.
// mode - the value for the 8237a dmac's mode register.
//
// Return:
// None.
//
// Notes:
// This is a macro to try and speed up the udp interface manager for u2dp.
// That is the only reason this isn't a function.
//
// This is the macro version of sgdmac_initiate_transfer().
// It is faster than the function. Use where performance is critical.
//
// Since:
// MinimOS-2.1
//------------------------------------------------------------------------------
#define _sgdmac_initiate_transfer(__pchan, __isaaddr, __length, __cmd, __mode) \
{ \
trace0(0, sgdmac, 0, "_sgdmac_initiate_transfer()"); \
if ((__cmd) & kbm_dma_mem2mem) \
if ((__mode) & kbm_dma_read_xfer) \
sgdmac_initiate_pkt2isa_transfer((__isaaddr)); \
else \
sgdmac_initiate_isa2pkt_transfer((__isaaddr), (__length)); \
else \
sgdmac_initiate_io_transfer((__pchan), (__isaaddr), (__cmd), (__mode)); \
}
//------------------------------------------------------------------------------
// prototypes
void sgdmac_disable_channel(uint8 chan) reentrant;
void sgdmac_enable_channel(uint8 chan, uint8 options) reentrant;
void sgdmac_load_channel_io(uint8 chan, uint8 ahi, uint8 alo, uint8 chi, uint8 clo, uint8 cmd, uint8 mode) reentrant;
void sgdmac_load_channel_mem_pkt2isa(uint8 dahi, uint8 dalo) reentrant;
void sgdmac_load_channel_mem_isa2pkt(uint8 sahi, uint8 salo, uint8 chi, uint8 clo) reentrant;
void sgdmac_push(uint8 chan, uint8 pnr) reentrant;
uint8 sgdmac_pop(uint8 chan) reentrant;
t_bool sgdmac_channel_is_empty(uint8 chan) reentrant;
t_bool sgdmac_dma_in_prog(uint8 chan) reentrant;
t_bool sgdmac_start_fifo_is_empty(uint8 chan) reentrant;
t_bool sgdmac_done_fifo_is_empty(uint8 chan) reentrant;
void sgdmac_purge(uint8 chan) reentrant;
void sgdmac_initiate_pkt2isa_transfer(uint16 memaddr) reentrant;
void sgdmac_initiate_isa2pkt_transfer(uint16 memaddr, uint16 length) reentrant;
void sgdmac_initiate_io_transfer(uint8 pchan, uint16 ioaddr, uint8 cmd, uint8 mode) reentrant;
//---eof------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -