• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ MCR函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: yam_check_uart

static enum uart yam_check_uart(unsigned int iobase)
{
	unsigned char b1, b2, b3;
	enum uart u;
	enum uart uart_tab[] =
	{c_uart_16450, c_uart_unknown, c_uart_16550, c_uart_16550A};

	b1 = inb(MCR(iobase));
	outb(b1 | 0x10, MCR(iobase));	/* loopback mode */
	b2 = inb(MSR(iobase));
	outb(0x1a, MCR(iobase));
	b3 = inb(MSR(iobase)) & 0xf0;
	outb(b1, MCR(iobase));		/* restore old values */
	outb(b2, MSR(iobase));
	if (b3 != 0x90)
		return c_uart_unknown;
	inb(RBR(iobase));
	inb(RBR(iobase));
	outb(0x01, FCR(iobase));	/* enable FIFOs */
	u = uart_tab[(inb(IIR(iobase)) >> 6) & 3];
	if (u == c_uart_16450) {
		outb(0x5a, SCR(iobase));
		b1 = inb(SCR(iobase));
		outb(0xa5, SCR(iobase));
		b2 = inb(SCR(iobase));
		if ((b1 != 0x5a) || (b2 != 0xa5))
			u = c_uart_8250;
	}
	return u;
}
开发者ID:383530895,项目名称:linux,代码行数:30,代码来源:yam.c


示例2: serial_cdev_exit

void serial_cdev_exit(void)
{
	int minors;

	minors = info[0] + info[1];

	// Eliberez toate resursele
	if (info[0])
	{
		//printk(LOG_LEVEL "cdev_del %d", 0);
		outb(0x0, MCR(COM1_BASEPORT));
		outb(0x0, IER(COM1_BASEPORT));
		free_irq(COM1_IRQ, &uart[0]);
		release_region(COM1_BASEPORT, COM_PORTS);
		cdev_del(&uart[0].cdev);
	}
	if (info[1])
	{
		//printk(LOG_LEVEL "cdev_del %d", 1);
		outb(0x0, MCR(COM2_BASEPORT));
		outb(0x0, IER(COM2_BASEPORT));
		free_irq(COM2_IRQ, &uart[1]);
		release_region(COM2_BASEPORT, COM_PORTS);
		cdev_del(&uart[1].cdev);
	}

	unregister_chrdev_region(MKDEV(major, 0), minors);
}
开发者ID:evelinad,项目名称:WorkAtUPB,代码行数:28,代码来源:uart16550.c


示例3: serial_setbrg

void serial_setbrg (void)
{
	unsigned int quot = 0;
	int uart = CONFIG_SYS_IXP425_CONSOLE;

	if ((gd->baudrate <= SERIAL_CLOCK) && (SERIAL_CLOCK % gd->baudrate == 0))
		quot = SERIAL_CLOCK / gd->baudrate;
	else
		hang ();

	IER(uart) = 0;					/* Disable for now */
	FCR(uart) = 0;					/* No fifos enabled */

	/* set baud rate */
	LCR(uart) = LCR_WLS0 | LCR_WLS1 | LCR_DLAB;
	DLL(uart) = quot & 0xff;
	DLH(uart) = quot >> 8;
	LCR(uart) = LCR_WLS0 | LCR_WLS1;
#ifdef CONFIG_SERIAL_RTS_ACTIVE
	MCR(uart) = MCR_RTS;				/* set RTS active */
#else
	MCR(uart) = 0;					/* set RTS inactive */
#endif
	IER(uart) = IER_UUE;
}
开发者ID:247a,项目名称:lenovo_b6000-8000_kernel_source,代码行数:25,代码来源:serial_ixp.c


示例4: update_theta

static void
update_theta(void)
{
	int i, j, x, y, z;

	/* Update all cell representatives */
	for (i = 0; i < n; ++i) {

		/* Look for the start of an orbit */
		if (i >= gamma[i]) continue;

		/* Find the cell rep for the two elements */
		for (x = i; x != theta[x]; x = theta[x]);
		for (y = gamma[i]; y != theta[y]; y = theta[y]);

		/* Pick the cell with the smaller representative */
		z = (x < y) ? x : y;

		/* Update the old root's cell representatives */
		theta[x] = theta[y] = z;
	}

	/* Clear out last automorphism if we've already saved max */
	if (saved == max_saved) {
		--saved;
		BWIPE(FIX(saved), n);
		BWIPE(MCR(saved), n);
	}

	/* Look for orbits in gamma and update fix and mcr */
	for (i = 0; i < n; ++i) {

		/* Find the start of an orbit, and save it as an mcr */
		if (BISSET(bit_contents, i)) continue;
		BSET(bit_contents, i);
		BSET(MCR(saved), i);

		/* If the element is fixed, save as fixed and continue */
		if (gamma[i] == i) {
			BSET(FIX(saved), i);
			continue;
		}

		/* Find all other elements in the orbit */
		for (j = gamma[i]; j != i; j = gamma[j]) {
			BSET(bit_contents, j);
		}
	}

	/* Clean up */
	BWIPE(bit_contents, n);
	++saved;
}
开发者ID:afd,项目名称:symmetrytools,代码行数:53,代码来源:saucy.c


示例5: data_cache_clean

void data_cache_clean()
{
    mem_dsb();
    mem_dmb();

    MCR(15, 0, 7, 10, 0, 0);
}
开发者ID:MyEyes,项目名称:Nos-ARM,代码行数:7,代码来源:cache.c


示例6: Ap15CorePerfMonStart

static void Ap15CorePerfMonStart(NvU32* pEventList, NvU32* pEventListSize)
{
    NvU32 RegValue, Event0, Event1;

    // Just return maximum monitored events if no input list, otherwise
    // get both events ready (set the same if only one specified)
    if (*pEventListSize == 0)
    {
        *pEventListSize = NVRM_AP15_MONITORED_EVENTS_MAX;
        return;
    }
    Event0 = Event1 = pEventList[0];
    if (*pEventListSize >= NVRM_AP15_MONITORED_EVENTS_MAX)
    {
        Event1 = pEventList[1];
        *pEventListSize = NVRM_AP15_MONITORED_EVENTS_MAX;
    }

    // Reset, clear overflow flags and enable 3 performance counters:
    // total cycle counter and 2 event counters
    RegValue =
        NV_DRF_NUM(AP15_CP15, PMNC, ENABLE, 1) |
        NV_DRF_NUM(AP15_CP15, PMNC, EVENT_CNTS_RESET, 1) |
        NV_DRF_NUM(AP15_CP15, PMNC, CYCLE_CNT_RESET, 1) |
        NV_DRF_NUM(AP15_CP15, PMNC, CYCLE_CNT_OV, 1) |
        NV_DRF_NUM(AP15_CP15, PMNC, EVENT0_CNT_OV, 1) |
        NV_DRF_NUM(AP15_CP15, PMNC, EVENT1_CNT_OV, 1) |
        NV_DRF_NUM(AP15_CP15, PMNC, EVENT0, Event0) |
        NV_DRF_NUM(AP15_CP15, PMNC, EVENT1, Event1);
    MCR(p15, 0, RegValue, c15, c12, 0);
}
开发者ID:0x0f,项目名称:adam-kernel,代码行数:31,代码来源:ap15rm_memctrl.c


示例7: uart_init_line

static void uart_init_line(int port, unsigned long baud)
{
	int i, baudconst;

	switch (baud) {
	case 115200:
		baudconst = 1;
		break;
	case 57600:
		baudconst = 2;
		break;
	case 38400:
		baudconst = 3;
		break;
	case 19200:
		baudconst = 6;
		break;
	case 9600:
	default:
		baudconst = 12;
		break;
	}

	outb(0x87, LCR(port));
	outb(0x00, DLM(port));
	outb(baudconst, DLL(port));
	outb(0x07, LCR(port));
	outb(0x0f, MCR(port));

	for (i = 10; i > 0; i--) {
		if (inb(LSR(port)) == (unsigned int) 0)
			break;
		inb(RBR(port));
	}
}
开发者ID:Kokoro666,项目名称:Evangelion-BIOS,代码行数:35,代码来源:pc_serial.c


示例8: check_export_pmu

static void
check_export_pmu(void)
{
#ifdef CONFIG_EXPORT_PMU_USER
    /* Export performance counters */
    uint32_t v;
    v = PMUSERENR_ENABLE;
    MCR(PMUSERENR, v);

    /* enable user-level pmu event counter if we're in secure mode */
    if (!(readDscrCp() & DBGDSCR_SECURE_MODE_DISABLED)) {
        MRC(DBGSDER, v);
        v |= DBGSDER_ENABLE_SECURE_USER_NON_INVASIVE_DEBUG;
        MCR(DBGSDER, v);
    }
#endif
}
开发者ID:alex-ab,项目名称:seL4,代码行数:17,代码来源:user_access.c


示例9: fpga_reset

static void fpga_reset(int iobase)
{
	outb(0, IER(iobase));
	outb(LCR_DLAB | LCR_BIT5, LCR(iobase));
	outb(1, DLL(iobase));
	outb(0, DLM(iobase));

	outb(LCR_BIT5, LCR(iobase));
	inb(LSR(iobase));
	inb(MSR(iobase));
	/* turn off FPGA supply voltage */
	outb(MCR_OUT1 | MCR_OUT2, MCR(iobase));
	delay(100);
	/* turn on FPGA supply voltage again */
	outb(MCR_DTR | MCR_RTS | MCR_OUT1 | MCR_OUT2, MCR(iobase));
	delay(100);
}
开发者ID:383530895,项目名称:linux,代码行数:17,代码来源:yam.c


示例10: check_export_pmu

static void
check_export_pmu(void)
{
#ifdef CONFIG_EXPORT_PMU_USER
    /* Export performance counters */
    uint32_t v;
    v = PMUSERENR_ENABLE;
    MCR(PMUSERENR, v);
#endif
}
开发者ID:KGG814,项目名称:AOS,代码行数:10,代码来源:user_access.c


示例11: check_export_arch_timer

static void
check_export_arch_timer(void)
{
    uint32_t v;
    MRC(CNTKCTL, v);
#ifdef CONFIG_EXPORT_PCNT_USER
    v |= CNTKCTL_PL0PCTEN;
#endif
#ifdef CONFIG_EXPORT_VCNT_USER
    v |= CNTKCTL_PL0VCTEN;
#endif
    MCR(CNTKCTL, v);
}
开发者ID:KGG814,项目名称:AOS,代码行数:13,代码来源:user_access.c


示例12: ser12_tx

static inline void ser12_tx(struct net_device *dev, struct baycom_state *bc)
{
	/* one interrupt per channel bit */
	ser12_set_divisor(dev, 12);
	/*
	 * first output the last bit (!) then call HDLC transmitter,
	 * since this may take quite long
	 */
	outb(0x0e | (!!bc->modem.ser12.tx_bit), MCR(dev->base_addr));
	if (bc->modem.shreg <= 1)
		bc->modem.shreg = 0x10000 | hdlcdrv_getbits(&bc->hdrv);
	bc->modem.ser12.tx_bit = !(bc->modem.ser12.tx_bit ^
				   (bc->modem.shreg & 1));
	bc->modem.shreg >>= 1;
}
开发者ID:ena30,项目名称:snake-os,代码行数:15,代码来源:baycom_ser_hdx.c


示例13: orbit_prune

static void
orbit_prune(void)
{
	int i, j, good;

	/* Start with a completely set bit vector */
	for (j = 0; j < BSIZE(n); ++j) {
		bit_contents[j] = ~0;
	}

	/* Find the mcr's of permutations that fix this node */
	for (i = 0; i < saved; ++i) {

		/* Make sure we're a superset */
		for (j = 0, good = 1; good && j < BSIZE(n); ++j) {
			if (bit_fixed[j] & ~FIX(i)[j]) good = 0;
		}
		if (!good) continue;

		/* The automorphism fixes this node, so update mcr */
		for (j = 0; j < BSIZE(n); ++j) {
			bit_contents[j] &= MCR(i)[j];
		}
	}

	/* Point to the start of the target cell */
	target = i = start[lev];
	target_min = n+1;

	/* Do some orbit pruning */
	do {
		++i;

		/* If we have a new candidate for minimum... */
		if ((lab[i] > fixed[lev]) && (lab[i] < target_min)) {

			/* Make it minimum if it is an mcr */
			if (BISSET(bit_contents, lab[i])) {
				target = i; target_min = lab[i];
			}
		}
	/* Keep going until the end of the cell */
	} while (ptn[i] > lev);

	/* Clear the bit vector */
	BWIPE(bit_contents, n);
}
开发者ID:afd,项目名称:symmetrytools,代码行数:47,代码来源:saucy.c


示例14: fpga_write

static int fpga_write(int iobase, unsigned char wrd)
{
	unsigned char bit;
	int k;
	unsigned long timeout = jiffies + HZ / 10;

	for (k = 0; k < 8; k++) {
		bit = (wrd & 0x80) ? (MCR_RTS | MCR_DTR) : MCR_DTR;
		outb(bit | MCR_OUT1 | MCR_OUT2, MCR(iobase));
		wrd <<= 1;
		outb(0xfc, THR(iobase));
		while ((inb(LSR(iobase)) & LSR_TSRE) == 0)
			if (time_after(jiffies, timeout))
				return -1;
	}

	return 0;
}
开发者ID:383530895,项目名称:linux,代码行数:18,代码来源:yam.c


示例15: do_requests

static int do_requests(int baseport, int irq, int index, int minor)
{
	int err;

	atomic_set(&uart[index].read_ready, 0);
	atomic_set(&uart[index].write_ready, 0);
	uart[index].read = 0;
	uart[index].write = 0;
	uart[index].base_port = baseport;
	cdev_init(&uart[index].cdev, &serial_fops);
	init_waitqueue_head(&uart[index].wq_reads);
	init_waitqueue_head(&uart[index].wq_writes);

	if ((err = cdev_add(&uart[index].cdev, MKDEV(major, minor), 1)))
	{
		//printk(LOG_LEVEL "cdev_init %d failed", minor);
		return err;
	}

	if (request_region(baseport, COM_PORTS, MODULE_NAME) == NULL)
	{
		//printk(LOG_LEVEL "request_region failed for COM1");
		return -EINVAL;
	}

	err = request_irq(irq, serial_interrupt_handle, IRQF_SHARED, MODULE_NAME,
			&uart[index]);
	if (err)
	{
		//printk(LOG_LEVEL "ERROR: %s: error %d\n", "request_irq", err);
		return err;
	}

	// Enable FIFO cu 14 octeti
	outb(0xc7, FCR(baseport));

	// Enable interrupts
	outb(0x08, MCR(baseport));
	outb(0x01, IER(baseport));

	//printk(LOG_LEVEL "index %d, baseport %d, irq %d, minor %d", index, baseport, irq, minor);

	return 0;
}
开发者ID:evelinad,项目名称:WorkAtUPB,代码行数:44,代码来源:uart16550.c


示例16: yam_set_uart

static void yam_set_uart(struct net_device *dev)
{
	struct yam_port *yp = netdev_priv(dev);
	int divisor = 115200 / yp->baudrate;

	outb(0, IER(dev->base_addr));
	outb(LCR_DLAB | LCR_BIT8, LCR(dev->base_addr));
	outb(divisor, DLL(dev->base_addr));
	outb(0, DLM(dev->base_addr));
	outb(LCR_BIT8, LCR(dev->base_addr));
	outb(PTT_OFF, MCR(dev->base_addr));
	outb(0x00, FCR(dev->base_addr));

	/* Flush pending irq */

	inb(RBR(dev->base_addr));
	inb(MSR(dev->base_addr));

	/* Enable rx irq */

	outb(ENABLE_RTXINT, IER(dev->base_addr));
}
开发者ID:383530895,项目名称:linux,代码行数:22,代码来源:yam.c


示例17: yam_close

static int yam_close(struct net_device *dev)
{
	struct sk_buff *skb;
	struct yam_port *yp = (struct yam_port *) dev->priv;

	if (!dev || !yp)
		return -EINVAL;
	/*
	 * disable interrupts
	 */
	outb(0, IER(dev->base_addr));
	outb(1, MCR(dev->base_addr));
	/* Remove IRQ handler if last */
	free_irq(dev->irq,dev);
	release_region(dev->base_addr, YAM_EXTENT);
	netif_stop_queue(dev);
	while ((skb = skb_dequeue(&yp->send_queue)))
		dev_kfree_skb(skb);

	printk(KERN_INFO "%s: close yam at iobase 0x%lx irq %u\n",
		   yam_drvname, dev->base_addr, dev->irq);
	return 0;
}
开发者ID:Antonio-Zhou,项目名称:Linux-2.6.11,代码行数:23,代码来源:yam.c


示例18: ptt_off

static void ptt_off(struct net_device *dev)
{
	outb(PTT_OFF, MCR(dev->base_addr));
}
开发者ID:383530895,项目名称:linux,代码行数:4,代码来源:yam.c


示例19: Ap15CorePerfMonDisable

static void Ap15CorePerfMonDisable(void)
{
    // Disable all performance counters
    NvU32 RegValue = NV_DRF_NUM(AP15_CP15, PMNC, ENABLE, 0);
    MCR(p15, 0, RegValue, c15, c12, 0);
}
开发者ID:0x0f,项目名称:adam-kernel,代码行数:6,代码来源:ap15rm_memctrl.c


示例20: resetTimer

/**
   DONT_TRANSLATE
 */
void
resetTimer(void)
{
    MCR(CNTV_TVAL, TIMER_RELOAD_VAL);
    MCR(CNTV_CTL, (1 << 0));
}
开发者ID:aoom,项目名称:seL4,代码行数:9,代码来源:hardware.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ MCSDL_GPIO_SCL_SET_HIGH函数代码示例发布时间:2022-05-30
下一篇:
C++ MCOperand_getReg函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap