当前位置: 首页>>代码示例>>C++>>正文


C++ PORT2ADDR函数代码示例

本文整理汇总了C++中PORT2ADDR函数的典型用法代码示例。如果您正苦于以下问题:C++ PORT2ADDR函数的具体用法?C++ PORT2ADDR怎么用?C++ PORT2ADDR使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了PORT2ADDR函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: microdev_inl

unsigned int microdev_inl(unsigned long port)
{
#ifdef CONFIG_PCI
	if (port >= PCIBIOS_MIN_IO)
		return microdev_pci_inl(port);
#endif
	return *(volatile unsigned int*)PORT2ADDR(port);
}
开发者ID:FatSunHYS,项目名称:OSCourseDesign,代码行数:8,代码来源:io.c

示例2: microdev_outl

void microdev_outl(unsigned int b, unsigned long port)
{
#ifdef CONFIG_PCI
	if (port >= PCIBIOS_MIN_IO) {
		microdev_pci_outl(b, port);
		return;
	}
#endif
	*(volatile unsigned int*)PORT2ADDR(port) = b;
}
开发者ID:FatSunHYS,项目名称:OSCourseDesign,代码行数:10,代码来源:io.c

示例3: microdev_outsl

void microdev_outsl(unsigned long port, const void *buffer, unsigned long count)
{
	volatile unsigned long *port_addr;
	const unsigned int *buf = buffer;

	port_addr = (volatile unsigned long *)PORT2ADDR(port);

	while (count--)
		*port_addr = *buf++;
}
开发者ID:FatSunHYS,项目名称:OSCourseDesign,代码行数:10,代码来源:io.c

示例4: microdev_insl

void microdev_insl(unsigned long port, void *buffer, unsigned long count)
{
	volatile unsigned long *port_addr;
	unsigned int *buf = buffer;

	port_addr = (volatile unsigned long *)PORT2ADDR(port);

	while (count--)
		*buf++ = *port_addr;
}
开发者ID:FatSunHYS,项目名称:OSCourseDesign,代码行数:10,代码来源:io.c

示例5: hd64461_outsl

void hd64461_outsl(unsigned long port, const void *buffer, unsigned long count)
{
	volatile unsigned long* addr=(volatile unsigned long*)PORT2ADDR(port);
	const unsigned long *buf=buffer;
	while(count--) *addr=*buf++;
}
开发者ID:BackupTheBerlios,项目名称:tew632-brp-svn,代码行数:6,代码来源:io.c

示例6: microdev_outb

void microdev_outb(unsigned char b, unsigned long port)
{
#ifdef CONFIG_PCI
	if (port >= PCIBIOS_MIN_IO) {
		microdev_pci_outb(b, port);
		return;
	}
#endif

	/*
	 *	There is a board feature with the current SH4-202 MicroDev in
	 *	that the 2 byte enables (nBE0 and nBE1) are tied together (and
	 *	to the Chip Select Line (Ethernet_CS)). Due to this conectivity,
	 *	it is not possible to safely perform 8-bit writes to the
	 *	Ethernet registers, as 16-bits will be consumed from the Data
	 *	lines (corrupting the other byte).  Hence, this function is
	 *	written to impliment 16-bit read/modify/write for all byte-wide
	 *	acceses.
	 *
	 *	Note: there is no problem with byte READS (even or odd).
	 *
	 *			Sean McGoogan - 16th June 2003.
	 */
	if ((port >= IO_LAN91C111_BASE) &&
	    (port <  IO_LAN91C111_BASE + IO_LAN91C111_EXTENT)) {
			/*
			 * Then are trying to perform a byte-write to the
			 * LAN91C111.  This needs special care.
			 */
		if (port % 2 == 1) {	/* is the port odd ? */
			/* unset bit-0, i.e. make even */
			const unsigned long evenPort = port-1;
			unsigned short word;

			/*
			 * do a 16-bit read/write to write to 'port',
			 * preserving even byte.
			 *
			 *	Even addresses are bits 0-7
			 *	Odd  addresses are bits 8-15
			 */
			word = microdev_inw(evenPort);
			word = (word & 0xffu) | (b << 8);
			microdev_outw(word, evenPort);
		} else {
			/* else, we are trying to do an even byte write */
			unsigned short word;

			/*
			 * do a 16-bit read/write to write to 'port',
			 * preserving odd byte.
			 *
			 *	Even addresses are bits 0-7
			 *	Odd  addresses are bits 8-15
			 */
			word = microdev_inw(port);
			word = (word & 0xff00u) | (b);
			microdev_outw(word, port);
		}
	} else {
		*(volatile unsigned char*)PORT2ADDR(port) = b;
	}
}
开发者ID:FatSunHYS,项目名称:OSCourseDesign,代码行数:63,代码来源:io.c

示例7: hd64461_insl

void hd64461_insl(unsigned long port, void *buffer, unsigned long count)
{
	volatile unsigned long* addr=(volatile unsigned long*)PORT2ADDR(port);
	unsigned long *buf=buffer;
	while(count--) *buf++=*addr;
}
开发者ID:BackupTheBerlios,项目名称:tew632-brp-svn,代码行数:6,代码来源:io.c


注:本文中的PORT2ADDR函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。