當前位置: 首頁>>代碼示例>>C++>>正文


C++ CPU_REG函數代碼示例

本文整理匯總了C++中CPU_REG函數的典型用法代碼示例。如果您正苦於以下問題:C++ CPU_REG函數的具體用法?C++ CPU_REG怎麽用?C++ CPU_REG使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了CPU_REG函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: ack_gpio_irq

/*
 * ack GPIO irq's
 * Ack only for edge triggered int's valid
 */
static void inline ack_gpio_irq(u32 irq)
{
	u32 reg_base = GPIO_VIRT(IRQ_TO_REGNO(irq));
	u32 bit = IRQ_TO_BIT(irq);
	if ( (CPU_REG (reg_base, GPIO_EDGE) & bit))
		CPU_REG (reg_base, GPIO_CLR) = bit;
}
開發者ID:ForayJones,項目名稱:iods,代碼行數:11,代碼來源:common.c

示例2: ack_gpio_irq

/*
 * ack GPIO irq's
 * Ack only for edge triggered int's valid
 */
static void inline ack_gpio_irq(struct irq_data *d)
{
	u32 reg_base = GPIO_VIRT(IRQ_TO_REGNO(d->irq));
	u32 bit = IRQ_TO_BIT(d->irq);
	if ( (CPU_REG (reg_base, GPIO_EDGE) & bit))
		CPU_REG (reg_base, GPIO_CLR) = bit;
}
開發者ID:Jackeagle,項目名稱:android_kernel_sony_c2305,代碼行數:11,代碼來源:common.c

示例3: init_eval_h7202

/*
 * Hardware init. This is called early in initcalls
 * Place pin inits here. So you avoid adding ugly
 * #ifdef stuff to common drivers.
 * Use this only, if your bootloader is not able
 * to initialize the pins proper.
 */
static void __init init_eval_h7202(void)
{
	init_hw_h7202();
	(void) platform_add_devices(devices, ARRAY_SIZE(devices));

	/* Enable interrupt on portb bit 8 (ethernet) */
	CPU_REG (GPIO_B_VIRT, GPIO_POL) &= ~(1 << 8);
	CPU_REG (GPIO_B_VIRT, GPIO_EN) |= (1 << 8);
}
開發者ID:8497165,項目名稱:JetKernel,代碼行數:16,代碼來源:h7202-eval.c

示例4: init_eval_h7202

static void __init init_eval_h7202(void)
{
	init_hw_h7202();
	(void) platform_add_devices(devices, ARRAY_SIZE(devices));

	/*                                            */
	CPU_REG (GPIO_B_VIRT, GPIO_POL) &= ~(1 << 8);
	CPU_REG (GPIO_B_VIRT, GPIO_EN) |= (1 << 8);
}
開發者ID:curbthepain,項目名稱:android_kernel_us990_rev,代碼行數:9,代碼來源:h7202-eval.c

示例5: h720x__idle

static void h720x__idle(void)
{
	CPU_REG (PMU_BASE, PMU_MODE) = PMU_MODE_IDLE;
	nop();
	nop();
	CPU_REG (PMU_BASE, PMU_MODE) = PMU_MODE_RUN;
	nop();
	nop();
}
開發者ID:Jackeagle,項目名稱:android_kernel_sony_c2305,代碼行數:9,代碼來源:common.c

示例6: h7202_init_time

/*
 * Setup TIMER0 as system timer
 */
void __init h7202_init_time(void)
{
	CPU_REG (TIMER_VIRT, TM0_PERIOD) = LATCH;
	CPU_REG (TIMER_VIRT, TM0_CTRL) = TM_RESET;
	CPU_REG (TIMER_VIRT, TM0_CTRL) = TM_REPEAT | TM_START;
	CPU_REG (TIMER_VIRT, TIMER_TOPCTRL) = ENABLE_TM0_INTR | TIMER_ENABLE_BIT;

	setup_irq(IRQ_TIMER0, &h7202_timer_irq);
}
開發者ID:1x23,項目名稱:unifi-gpl,代碼行數:12,代碼來源:cpu-h7202.c

示例7: init_hw_h7202

void __init init_hw_h7202(void)
{
	/* Enable clocks */
	CPU_REG (PMU_BASE, PMU_PLL_CTRL) |= PLL_2_EN | PLL_1_EN | PLL_3_MUTE;

	CPU_REG (SERIAL0_VIRT, SERIAL_ENABLE) = SERIAL_ENABLE_EN;
	CPU_REG (SERIAL1_VIRT, SERIAL_ENABLE) = SERIAL_ENABLE_EN;
#ifdef CONFIG_H7202_SERIAL23
	CPU_REG (SERIAL2_VIRT, SERIAL_ENABLE) = SERIAL_ENABLE_EN;
	CPU_REG (SERIAL3_VIRT, SERIAL_ENABLE) = SERIAL_ENABLE_EN;
	CPU_IO (GPIO_AMULSEL) = AMULSEL_USIN2 | AMULSEL_USOUT2 |
	                        AMULSEL_USIN3 | AMULSEL_USOUT3;
#endif
	(void) platform_add_devices(devices, ARRAY_SIZE(devices));
}
開發者ID:8563,項目名稱:millennium-sources,代碼行數:15,代碼來源:cpu-h7202.c

示例8: h7202_timerx_demux_handler

/* Although we have two interrupt lines for the timers, we only have one
 * status register which clears all pending timer interrupts on reading. So
 * we have to handle all timer interrupts in one place.
 */
static void
h7202_timerx_demux_handler(unsigned int irq_unused, struct irqdesc *desc,
			struct pt_regs *regs)
{
	unsigned int mask, irq;

	mask = CPU_REG (TIMER_VIRT, TIMER_TOPSTAT);

	if ( mask & TSTAT_T0INT ) {
		timer_tick(regs);
		if( mask == TSTAT_T0INT )
			return;
	}

	mask >>= 1;
	irq = IRQ_TIMER1;
	desc = irq_desc + irq;
	while (mask) {
		if (mask & 1)
			desc->handle(irq, desc, regs);
		irq++;
		desc++;
		mask >>= 1;
	}
}
開發者ID:BackupTheBerlios,項目名稱:tuxap,代碼行數:29,代碼來源:cpu-h7202.c

示例9: h7201_timer_interrupt

/*
 * Timer interrupt handler
 */
static irqreturn_t
h7201_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{
	CPU_REG (TIMER_VIRT, TIMER_TOPSTAT);
	timer_tick(regs);
	return IRQ_HANDLED;
}
開發者ID:BackupTheBerlios,項目名稱:tuxap,代碼行數:10,代碼來源:cpu-h7201.c

示例10: init_hw_h7202

void __init init_hw_h7202(void)
{
	/* Enable clocks */
	CPU_REG (PMU_BASE, PMU_PLL_CTRL) |= PLL_2_EN | PLL_1_EN | PLL_3_MUTE;

	(void) platform_add_devices(devices, ARRAY_SIZE(devices));
}
開發者ID:BackupTheBerlios,項目名稱:tuxap,代碼行數:7,代碼來源:cpu-h7202.c

示例11: h720x_gpiob_demux_handler

static void
h720x_gpiob_demux_handler(unsigned int irq_unused, struct irq_desc *desc)
{
	unsigned int mask, irq;
	mask = CPU_REG(GPIO_B_VIRT,GPIO_STAT);
	irq = IRQ_CHAINED_GPIOB(0);
	IRQDBG("%s mask: 0x%08x irq: %d\n", __func__, mask,irq);
	h720x_gpio_handler(mask, irq, desc);
}
開發者ID:Jackeagle,項目名稱:android_kernel_sony_c2305,代碼行數:9,代碼來源:common.c

示例12: h7201_timer_interrupt

/*
 * Timer interrupt handler
 */
static irqreturn_t
h7201_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{
	write_seqlock(&xtime_lock);

	CPU_REG (TIMER_VIRT, TIMER_TOPSTAT);
	timer_tick(regs);

	write_sequnlock(&xtime_lock);

	return IRQ_HANDLED;
}
開發者ID:Broadcom,項目名稱:stblinux-2.6.18,代碼行數:15,代碼來源:cpu-h7201.c

示例13: h7202_init_irq

void __init h7202_init_irq (void)
{
	int 	irq;

	CPU_REG (GPIO_E_VIRT, GPIO_MASK) = 0x0;

	for (irq = IRQ_TIMER1;
	                  irq < IRQ_CHAINED_TIMERX(NR_TIMERX_IRQS); irq++) {
		mask_timerx_irq(irq);
		set_irq_chip(irq, &h7202_timerx_chip);
		set_irq_handler(irq, do_edge_IRQ);
		set_irq_flags(irq, IRQF_VALID );
	}
	set_irq_chained_handler(IRQ_TIMERX, h7202_timerx_demux_handler);

	h720x_init_irq();
}
開發者ID:BackupTheBerlios,項目名稱:tuxap,代碼行數:17,代碼來源:cpu-h7202.c

示例14: h7202_timerx_demux_handler

/* Although we have two interrupt lines for the timers, we only have one
 * status register which clears all pending timer interrupts on reading. So
 * we have to handle all timer interrupts in one place.
 */
static void
h7202_timerx_demux_handler(unsigned int irq_unused, struct irq_desc *desc)
{
	unsigned int mask, irq;

	mask = CPU_REG (TIMER_VIRT, TIMER_TOPSTAT);

	if ( mask & TSTAT_T0INT ) {
		timer_tick();
		if( mask == TSTAT_T0INT )
			return;
	}

	mask >>= 1;
	irq = IRQ_TIMER1;
	while (mask) {
		if (mask & 1)
			generic_handle_irq(irq);
		irq++;
		mask >>= 1;
	}
}
開發者ID:8563,項目名稱:millennium-sources,代碼行數:26,代碼來源:cpu-h7202.c

示例15: h720x_init_irq

void __init h720x_init_irq (void)
{
	int 	irq;

	
	CPU_REG (IRQC_VIRT, IRQC_IER) = 0x0;

	
	CPU_REG (GPIO_A_VIRT, GPIO_MASK) = 0x0;
	CPU_REG (GPIO_B_VIRT, GPIO_MASK) = 0x0;
	CPU_REG (GPIO_C_VIRT, GPIO_MASK) = 0x0;
	CPU_REG (GPIO_D_VIRT, GPIO_MASK) = 0x0;

	
	for (irq = 0; irq < NR_GLBL_IRQS; irq++) {
		irq_set_chip_and_handler(irq, &h720x_global_chip,
					 handle_level_irq);
		set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
	}

	
	for (irq = IRQ_CHAINED_GPIOA(0) ; irq <= IRQ_CHAINED_GPIOD(31); irq++) {
		irq_set_chip_and_handler(irq, &h720x_gpio_chip,
					 handle_edge_irq);
		set_irq_flags(irq, IRQF_VALID );
	}
	irq_set_chained_handler(IRQ_GPIOA, h720x_gpioa_demux_handler);
	irq_set_chained_handler(IRQ_GPIOB, h720x_gpiob_demux_handler);
	irq_set_chained_handler(IRQ_GPIOC, h720x_gpioc_demux_handler);
	irq_set_chained_handler(IRQ_GPIOD, h720x_gpiod_demux_handler);

#ifdef CONFIG_CPU_H7202
	for (irq = IRQ_CHAINED_GPIOE(0) ; irq <= IRQ_CHAINED_GPIOE(31); irq++) {
		irq_set_chip_and_handler(irq, &h720x_gpio_chip,
					 handle_edge_irq);
		set_irq_flags(irq, IRQF_VALID );
	}
	irq_set_chained_handler(IRQ_GPIOE, h720x_gpioe_demux_handler);
#endif

	
	CPU_REG (IRQC_VIRT, IRQC_IER) = IRQ_ENA_MUX;
}
開發者ID:Blackburn29,項目名稱:PsycoKernel,代碼行數:43,代碼來源:common.c


注:本文中的CPU_REG函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。