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


C++ VA函数代码示例

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


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

示例1: cs89x0_send_packet

static int cs89x0_send_packet(struct net_device *ndev, struct sock_buff *skb)
{
	int i;
	__u16 isq_stat;
	const __u16 *buff;
	__UNUSED__ __u32 psr;

	lock_irq_psr(psr);

	writew(VA(CS8900_IOBASE + CS_TxCMD), 0x00);
	writew(VA(CS8900_IOBASE + CS_TxLen), skb->size);

	while (1) {
		isq_stat = cs8900_inw(PP_BusST);
		if (isq_stat & Rdy4TxNow)
			break;

		printf("BusST = 0x%04x\n", isq_stat);
	}

	buff = (const __u16 *)skb->data;

	for (i = 0; i < skb->size; i += 2) {
		writew(VA(CS8900_IOBASE + CS_DATA0), *buff);
		buff++;
	}

	ndev->stat.tx_packets++;

	unlock_irq_psr(psr);

	return 0;
}
开发者ID:longli,项目名称:s5pv210_test,代码行数:33,代码来源:cs8900.c

示例2: cs89x0_isr

static int cs89x0_isr(__u32 irq, void *dev)
{
	int i;
	__u16 isq_stat;
	__u16 rx_stat, rx_size;
	__u16 *buff;
	struct sock_buff *skb;
	// struct net_device *ndev = dev;

	while ((isq_stat = readw(VA(CS8900_IOBASE + CS_ISQ)))) {
		int regn = isq_stat & 0x3F;

		if (regn == 4) {
			rx_stat = readw(VA(CS8900_IOBASE + 0x00));
			rx_size = readw(VA(CS8900_IOBASE + 0x00));

			DPRINT("isq_stat = 0x%04x, size = 0x%04x (%d)\n",
				rx_stat, rx_size, rx_size);

			skb = skb_alloc(0, rx_size);
			// if NULL
			buff = (__u16 *)skb->data;

			for (i = 0; i < rx_size; i += 2) {
				*buff = readw(VA(CS8900_IOBASE + 0x00));
				buff++;
			}

			netif_rx(skb);
		}
	}

	return 0;
}
开发者ID:longli,项目名称:s5pv210_test,代码行数:34,代码来源:cs8900.c

示例3: omapfb_reset

static int omapfb_reset(struct fb_info *fb)
{
#define OMAP_TIMEOUT 0x100
	int to;
	__u32 val;
	struct omapfb_info *omapfb = fb->par;

	// enable clock
	writel(VA(CM_FCLKEN_DSS), 7);
	writel(VA(CM_ICLKEN_DSS), 1);
	writel(VA(CM_CLKEN_PLL), 0x7 << 16);

	// reset
	dss_writel(DISPC_SYSCONFIG, 0x02);
	for (to = 0; to < OMAP_TIMEOUT; to++) {
		val = dss_readl(DISPC_SYSCONFIG);
		if (!(val & 0x2)) // fixme
			break;

		udelay(0x100);
	}

	if (OMAP_TIMEOUT == to)
		return -ETIMEDOUT;

	// configure clock
	dss_writel(DSS_CONTROL, 1);

	dss_writel(DISPC_SYSCONFIG, 1);
	dss_writel(DISPC_CONFIG, 1 << 9 | 1 << 1);

	dss_writel(DISPC_GFX_BA0, fb->fix.smem_start);

	return 0;
}
开发者ID:joy-chen,项目名称:g-bios,代码行数:35,代码来源:omap3fb.c

示例4: dss_pad_config

static inline void dss_pad_config(void)
{
	void *mux_reg;

	for (mux_reg = VA(0x480020d4); mux_reg <= VA(0x48002108); mux_reg += 2)
		writew(mux_reg, 0x0);
}
开发者ID:astwish,项目名称:witrom,代码行数:7,代码来源:omap3_disp.c

示例5: cs89x0_poll

static int cs89x0_poll(struct net_device *ndev)
{
	int i;
	__u16 rx_event;
	__u16 rx_stat, rx_size;
	__u16 *buff;
	struct sock_buff *skb;

	rx_event = cs8900_inw(0x0124);
	if (!(rx_event & 0x100))
		return 0;

	// printf("rx event = 0x%04x\n", rx_event);

	rx_stat = readw(VA(CS8900_IOBASE + 0x00));
	rx_size = readw(VA(CS8900_IOBASE + 0x00));

	DPRINT("rx_event = 0x%04x, size = 0x%04x (%d)\n",
		rx_stat, rx_size, rx_size);

	skb = skb_alloc(0, rx_size);
	// if NULL
	buff = (__u16 *)skb->data;

	for (i = 0; i < rx_size; i += 2) {
		*buff = readw(VA(CS8900_IOBASE + 0x00));
		buff++;
	}

	netif_rx(skb);

	ndev->stat.rx_packets++;

	return 0;
}
开发者ID:longli,项目名称:s5pv210_test,代码行数:35,代码来源:cs8900.c

示例6: at91_gpio_conf_periB

void at91_gpio_conf_periB(__u32 nPioIdx, __u32 mask, int isPullUp)
{
	writel(VA(PIO_BASE(nPioIdx)) + PIO_PDR, mask);
	writel(VA(PIO_BASE(nPioIdx)) + PIO_BSR, mask);
	writel(VA(PIO_BASE(nPioIdx)) + PIO_IDR, mask);
	writel(VA(PIO_BASE(nPioIdx)) + (isPullUp ? PIO_PUER : PIO_PUDR), mask);
}
开发者ID:JansZeng,项目名称:g-bios,代码行数:7,代码来源:at91sam926x_gpio.c

示例7: at91_gpio_conf_output

void  at91_gpio_conf_output(__u32 nPioIdx, __u32 mask, int isPullUp)
{
	writel(VA(PIO_BASE(nPioIdx) + PIO_PER), mask);
	writel(VA(PIO_BASE(nPioIdx) + PIO_OER), mask);
	writel(VA(PIO_BASE(nPioIdx) + PIO_IDR), mask);
	writel(VA(PIO_BASE(nPioIdx) + (isPullUp ? PIO_PUER : PIO_PUDR)), mask);
}
开发者ID:JansZeng,项目名称:g-bios,代码行数:7,代码来源:at91sam926x_gpio.c

示例8: at91_nand_probe

static int __INIT__ at91_nand_probe(void)
{
	int ret;
	struct nand_ctrl *nfc;

	nfc = nand_ctrl_new();

	if (NULL == nfc)
		return -ENOMEM;

	nfc->data_reg = VA(AT91SAM926X_PA_NAND);
	nfc->cmmd_reg = VA(AT91SAM926X_PA_NAND + NAND_CMMD);
	nfc->addr_reg = VA(AT91SAM926X_PA_NAND + NAND_ADDR);

	nfc->name = "atmel_nand";

	nfc->flash_ready = at91_nand_ready;
	nfc->cmd_ctrl = at91_nand_cmd;

	at91_nand_init();

	ret = nand_ctrl_register(nfc);
	if (ret < 0) {
		ret = -ENODEV;
		goto L1;
	}

	return 0;

L1:
	free(nfc);

	return ret;
}
开发者ID:RocsanWei,项目名称:g-bios,代码行数:34,代码来源:at91_nand.c

示例9: at91_nand_ready

static int at91_nand_ready(struct nand_chip *nand)
{
#if defined(CONFIG_AT91SAM9261)
	return readl(VA(AT91SAM926X_PA_PIOC + PIO_PDSR)) & PIO_NAND_RDY;
#elif defined(CONFIG_AT91SAM9263)
	return readl(VA(AT91SAM926X_PA_PIOA + PIO_PDSR)) & PIO_NAND_RDY;
#endif
}
开发者ID:RocsanWei,项目名称:g-bios,代码行数:8,代码来源:at91_nand.c

示例10: uart_rxbuf_count

__u32 uart_rxbuf_count(void)
{
#ifdef CONFIG_UART_ENABLE_FIFO
	return readl(VA(CURR_UART_BASE + UFSTAT)) & RX_COUNT;
#else
	return readl(VA(CURR_UART_BASE + UTRSTAT)) & 0x1;
#endif
}
开发者ID:astwish,项目名称:witrom,代码行数:8,代码来源:s3c24x_uart.c

示例11: s3c6410_reset

static void s3c6410_reset(void)
{
	__u32 val;

	val = readl(VA(RST_BASE + RST_STAT));
	val |= 0x1;
	writel(VA(RST_BASE + RST_STAT), val);
}
开发者ID:RocsanWei,项目名称:g-bios,代码行数:8,代码来源:s3c6410_plat.c

示例12: userinit

void
userinit(void)
{
	Proc *p;
	Segment *s;
	KMap *k;
	char **av;
	Page *pg;

	p = newproc();
	p->pgrp = newpgrp();
	p->egrp = smalloc(sizeof(Egrp));
	p->egrp->ref = 1;
	p->fgrp = dupfgrp(nil);
	p->rgrp = newrgrp();
	p->procmode = 0640;

	kstrdup(&eve, "");
	kstrdup(&p->text, "*init*");
	kstrdup(&p->user, eve);

	procsetup(p);

	/*
	 * Kernel Stack
	 */
	p->sched.pc = (ulong)init0;
	p->sched.sp = (ulong)p->kstack+KSTACK-MAXSYSARG*BY2WD;
	/*
	 * User Stack, pass input arguments to boot process
	 */
	s = newseg(SG_STACK, USTKTOP-USTKSIZE, USTKSIZE/BY2PG);
	p->seg[SSEG] = s;
	pg = newpage(1, 0, USTKTOP-BY2PG);
	segpage(s, pg);
	k = kmap(pg);
	for(av = (char**)argbuf; *av; av++)
		*av += (USTKTOP - sizeof(argbuf)) - (ulong)argbuf;

	memmove((uchar*)VA(k) + BY2PG - sizeof(argbuf), argbuf, sizeof argbuf);
	kunmap(k);

	/*
	 * Text
	 */
	s = newseg(SG_TEXT, UTZERO, 1);
	s->flushme++;
	p->seg[TSEG] = s;
	pg = newpage(1, 0, UTZERO);
	pg->txtflush = ~0;
	segpage(s, pg);
	k = kmap(s->map[0]->pages[0]);
	memmove((uchar*)VA(k), initcode, sizeof initcode);
	kunmap(k);

	ready(p);
}
开发者ID:Nurb432,项目名称:plan9front,代码行数:57,代码来源:main.c

示例13: s3c24x0_uart_send_byte

static void s3c24x0_uart_send_byte(__u8 ch)
{
#ifdef CONFIG_UART_ENABLE_FIFO
	while (readl(VA(CURR_UART_BASE + UFSTAT)) & FIFO_FULL);
#else
	while (!(readl(VA(CURR_UART_BASE + UTRSTAT)) & 0x2));
#endif

	writeb(VA(CURR_UART_BASE + UTX), ch);
}
开发者ID:astwish,项目名称:witrom,代码行数:10,代码来源:s3c24x_uart.c

示例14: s3c24x0_uart_recv_byte

static __u8 s3c24x0_uart_recv_byte()
{
#ifdef CONFIG_UART_ENABLE_FIFO
	while (!(readl(VA(CURR_UART_BASE + UFSTAT)) & RX_COUNT));
#else
	while (!(readl(VA(CURR_UART_BASE + UTRSTAT)) & 0x1));
#endif

	return readb(VA(CURR_UART_BASE + URX));
}
开发者ID:astwish,项目名称:witrom,代码行数:10,代码来源:s3c24x_uart.c

示例15: s3c24x_reset

static void s3c24x_reset(void)
{
	__u32 val;

	val = readl(VA(WATCHDOG_BASE + WTCON));
	val = val | (1 << 5) | 1;
	writel(VA(WATCHDOG_BASE + WTCON), val);

	while(1);
}
开发者ID:JansZeng,项目名称:g-bios,代码行数:10,代码来源:s3c24x0.c


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