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

C++ set_intr_gate函数代码示例

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

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



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

示例1: ttyinit

void ttyinit(int dev)
{
  int baseport, ret;                        /* initialize baseport and return val variable for queue operations*/
  struct tty *tty;		                      /* ptr to tty software params/data block */
  baseport = devtab[dev].dvbaseport;        /* pick up hardware addr */
  tty = (struct tty *)devtab[dev].dvdata;   /* and software params struct */
  cli();
  if (baseport == COM1_BASE) 
  {
                                            /* arm interrupts by installing interrupt vector address */
    set_intr_gate(COM1_IRQ+IRQ_TO_INT_N_SHIFT, &irq4inthand);
    pic_enable_irq(COM1_IRQ);
  } 
  else if (baseport == COM2_BASE) 
  {
                                            /* arm interrupts by installing interrupt vector address */
    set_intr_gate(COM2_IRQ+IRQ_TO_INT_N_SHIFT, &irq3inthand);
    pic_enable_irq(COM2_IRQ);
  } 
  else 
  {
    kprintf("Bad TTY device table entry, dev %d\n", dev);
    return;			                            /* give up */
  }
  tty->echoflag = 1;	                                   /* default to echoing */
  ret = init_queue((tty->rqu), MAXQ);                    /* init RX queue */
  ret = init_queue((tty->tqu), MAXQ);                    /* init  TX queue */
                                                         
  outpt(baseport+UART_IER, UART_IER_RDI|UART_IER_THRI);  /* enable interrupts on receiver and transmitter */
}
开发者ID:AnoopaChandrasekharan,项目名称:sapc,代码行数:30,代码来源:tty.c


示例2: init_irq

void init_irq(void)
{
	int	i;

	init_pic();
	
	for( i = 0; i < MAX_IRQ; i++ )
		irqhandler[i]	= _ignore_irq;

	set_intr_gate(IRQ_VECTOR+0, _irq_0);
	set_intr_gate(IRQ_VECTOR+1, _irq_1);
	// IRQ2~15 is implemented later
	/*set_intr_gate(IRQ_VECTOR+2, _irq_2);
	set_intr_gate(IRQ_VECTOR+3, _irq_3);
	set_intr_gate(IRQ_VECTOR+4, _irq_4);
	set_intr_gate(IRQ_VECTOR+5, _irq_5);
	set_intr_gate(IRQ_VECTOR+6, _irq_6);
	set_intr_gate(IRQ_VECTOR+7, _irq_7);
	set_intr_gate(IRQ_VECTOR+8, _irq_8);
	set_intr_gate(IRQ_VECTOR+9, _irq_9);
	set_intr_gate(IRQ_VECTOR+10, _irq_10);
	set_intr_gate(IRQ_VECTOR+11, _irq_11);
	set_intr_gate(IRQ_VECTOR+12, _irq_12);
	set_intr_gate(IRQ_VECTOR+13, _irq_13);
	set_intr_gate(IRQ_VECTOR+14, _irq_14);
	set_intr_gate(IRQ_VECTOR+15, _irq_15);*/

}
开发者ID:gurugio,项目名称:gurugio,代码行数:28,代码来源:init_irq.c


示例3: irqaction

/* 注册中断 */
int irqaction(unsigned int irq, struct sigaction * new_sa)
{
	struct sigaction * sa;
	unsigned long flags;

	if (irq > 15)
		return -EINVAL;
	sa = irq + irq_sigaction;
	if (sa->sa_mask)
		return -EBUSY;
	if (!new_sa->sa_handler)
		return -EINVAL;
	save_flags(flags);
	cli();
	*sa = *new_sa;
	sa->sa_mask = 1;
	if (sa->sa_flags & SA_INTERRUPT)
		set_intr_gate(0x20+irq,fast_interrupt[irq]);
	else
		set_intr_gate(0x20+irq,interrupt[irq]);
	if (irq < 8) {
		cache_21 &= ~(1<<irq);
		outb(cache_21,0x21);
	} else {
		cache_21 &= ~(1<<2);
		cache_A1 &= ~(1<<(irq-8));
		outb(cache_21,0x21);
		outb(cache_A1,0xA1);
	}
	restore_flags(flags);
	return 0;
}
开发者ID:wanggx,项目名称:Linux1.0,代码行数:33,代码来源:irq.c


示例4: rs_init

void rs_init(void) {
    set_intr_gate(0x24,rs1_interrupt);  // set up serial port 1 interruption
    set_intr_gate(0x23,rs2_interrupt);  // serial port 2 interruption
    init(tty_table[1].read_q.data);     // initialize serial port 1
    init(tty_table[2].read_q.data);     // initialize serial port 2
    outb(inb_p(0x21)&0xE7,0x21);        // Allow IRQ3 and IRQ4
}
开发者ID:litao91,项目名称:linux0.11,代码行数:7,代码来源:serial.c


示例5: idt_init

/* Initialize the IDT table */
void idt_init()
{
	/* Initialize Exception Gates */
	set_trap_gate(0, &divide_error_wrapper);
	set_trap_gate(1, &debug);
	set_trap_gate(2, &nmi);
	set_system_gate(3, &int3);
	set_system_gate(4, &overflow);
	set_system_gate(5, &bounds);
	set_trap_gate(6, &invalid_op);
	set_trap_gate(7, &device_not_available);
	set_trap_gate(8, &double_fault);
	set_trap_gate(9, &coprocessor_segment_overrun);
	set_trap_gate(10, &invalid_TSS);
	set_trap_gate(11, &segment_not_present);
	set_trap_gate(12, &stack_segment);
	set_trap_gate(13, &general_protection);
	set_trap_gate(14, &page_fault_wrapper);
	set_trap_gate(16, &coprocessor_error);
	set_trap_gate(17, &alignment_check);


	
	/* Initialize Interrupt Gates */
	// refer to student-notes.pdf P29
	set_intr_gate(0x20, &PIT_wrapper);
	set_intr_gate(0x21, &keyboard_wrapper);			// Initialize keyboard entry
	set_intr_gate(0x28, &rtc_wrapper);				// Initialize the RTC entry


	
	
	/* Initialize system call gates*/
	set_system_gate(0x80, &syscall_linkage);
}
开发者ID:tielong,项目名称:ece391,代码行数:36,代码来源:idt.c


示例6: rs_init

void rs_init(void)
{
	set_intr_gate(0x24,rs1_interrupt);
	set_intr_gate(0x23,rs2_interrupt);
	init(tty_table[1].read_q.data); /* data = 0x3f8, rs1 */
	init(tty_table[2].read_q.data); /* data = 0x2f8, rs2 */
	outb(inb_p(0x21)&0xE7,0x21);
}
开发者ID:CarterTsai,项目名称:linux-kernel-0.12-study-version,代码行数:8,代码来源:serial.c


示例7: rs_init

//// 初始化串行中断程序和串行接口。
void
rs_init (void)
{
	set_intr_gate (0x24, rs1_interrupt);	// 设置串行口1 的中断门向量(硬件IRQ4 信号)。
	set_intr_gate (0x23, rs2_interrupt);	// 设置串行口2 的中断门向量(硬件IRQ3 信号)。
	init (tty_table[1].read_q.data);	// 初始化串行口1(.data 是端口号)。
	init (tty_table[2].read_q.data);	// 初始化串行口2。
	outb (inb_p (0x21) & 0xE7, 0x21);	// 允许主8259A 芯片的IRQ3,IRQ4 中断信号请求。
}
开发者ID:TakiJoe,项目名称:kernel-0.11,代码行数:10,代码来源:serial.c


示例8: setup_idt

static void setup_idt(void)
{
	for (int i = 0; i < EXCEPTION_GATES; i ++)
		set_intr_gate(i, &idt_exception_stubs[i]);

	set_intr_gate(HALT_CPU_IPI_VECTOR, halt_cpu_ipi_handler);

	load_idt(&idtdesc);
}
开发者ID:a-darwish,项目名称:cuteOS,代码行数:9,代码来源:main.c


示例9: traps_init

void traps_init(void)
{
	int i;

	for (i = 0; i < VALID_ISR+2; ++i)
		set_intr_gate(i, (unsigned int)isr_table[(i << 1) + 1]);
	for (; i < 256; ++i)
		set_intr_gate(i, (unsigned int)isr_table[(i << 1) + 1]);
}
开发者ID:blessed,项目名称:blessOS,代码行数:9,代码来源:exceptions.c


示例10: native_init_IRQ

void __init native_init_IRQ(void)
{
	int i;

	/* Execute any quirks before the call gates are initialised: */
	/* 这里又是执行x86_init结构中的初始化函数,pre_vector_init()指向 init_ISA_irqs  */
	x86_init.irqs.pre_vector_init();

	/* 初始化中断描述符表中的中断控制器中特定的一些中断门初始化 */
	apic_intr_init();

	/*
	 * Cover the whole vector space, no vector can escape
	 * us. (some of these will be overridden and become
	 * 'special' SMP interrupts)
	 */
	/* 第一个外部中断,默认是32 */
	i = FIRST_EXTERNAL_VECTOR;
	/* 在used_vectors变量中找出所有没有置位的中断向量,我们知道,在trap_init()中对所有异常和陷阱和系统调用中断都置位了used_vectors,没有置位的都为中断
	 * 这里就是对所有中断设置门描述符
	 */
	for_each_clear_bit_from(i, used_vectors, NR_VECTORS) {
		/* IA32_SYSCALL_VECTOR could be used in trap_init already. */
		/* interrupt[]数组保存的是外部中断的中断门信息
		 * 这里就是将空闲的中断设置为外部中断,interrupt是一个函数指针数组,其将31~255数组元素指向common_interrupt函数
		 */
		set_intr_gate(i, interrupt[i - FIRST_EXTERNAL_VECTOR]);
	}
开发者ID:tolimit,项目名称:linux-comment-cn,代码行数:28,代码来源:irqinit.c


示例11: free_irq

void free_irq(unsigned int irq)
{
	struct irqaction * action = irq + irq_action;
	unsigned long flags;

	if (irq > 15) {
		printk("Trying to free IRQ%d\n",irq);
		return;
	}
	if (!action->handler) {
		printk("Trying to free free IRQ%d\n",irq);
		return;
	}
	save_flags(flags);
	cli();
	if (irq < 8) {
		cache_21 |= 1 << irq;
		outb(cache_21,0x21);
	} else {
		cache_A1 |= 1 << (irq-8);
		outb(cache_A1,0xA1);
	}
	set_intr_gate(0x20+irq,bad_interrupt[irq]);
	action->handler = NULL;
	action->flags = 0;
	action->mask = 0;
	action->name = NULL;
	restore_flags(flags);
}
开发者ID:TaoAndHua,项目名称:linux-1.2.13,代码行数:29,代码来源:irq.c


示例12: free_irq

void free_irq(unsigned int irq)
{
	struct sigaction * sa = irq + irq_sigaction;
	unsigned long flags;

	if (irq > 15) {
		printk("Trying to free IRQ%d\n",irq);
		return;
	}
	if (!sa->sa_mask) {
		printk("Trying to free free IRQ%d\n",irq);
		return;
	}
	save_flags(flags);
	cli();
	if (irq < 8) {
		cache_21 |= 1 << irq;
		outb(cache_21,0x21);
	} else {
		cache_A1 |= 1 << (irq-8);
		outb(cache_A1,0xA1);
	}
	set_intr_gate(0x20+irq,bad_interrupt[irq]);
	sa->sa_handler = NULL;
	sa->sa_flags = 0;
	sa->sa_mask = 0;
	sa->sa_restorer = NULL;
	restore_flags(flags);
}
开发者ID:wanggx,项目名称:Linux1.0,代码行数:29,代码来源:irq.c


示例13: smp_intr_init

static void __init smp_intr_init(void)
{
#ifdef CONFIG_SMP
	/*
	 * The reschedule interrupt is a CPU-to-CPU reschedule-helper
	 * IPI, driven by wakeup.
	 */
	alloc_intr_gate(RESCHEDULE_VECTOR, reschedule_interrupt);

	/* IPIs for invalidation */
	alloc_intr_gate(INVALIDATE_TLB_VECTOR_START+0, invalidate_interrupt0);
	alloc_intr_gate(INVALIDATE_TLB_VECTOR_START+1, invalidate_interrupt1);
	alloc_intr_gate(INVALIDATE_TLB_VECTOR_START+2, invalidate_interrupt2);
	alloc_intr_gate(INVALIDATE_TLB_VECTOR_START+3, invalidate_interrupt3);
	alloc_intr_gate(INVALIDATE_TLB_VECTOR_START+4, invalidate_interrupt4);
	alloc_intr_gate(INVALIDATE_TLB_VECTOR_START+5, invalidate_interrupt5);
	alloc_intr_gate(INVALIDATE_TLB_VECTOR_START+6, invalidate_interrupt6);
	alloc_intr_gate(INVALIDATE_TLB_VECTOR_START+7, invalidate_interrupt7);

	/* IPI for generic function call */
	alloc_intr_gate(CALL_FUNCTION_VECTOR, call_function_interrupt);

	/* IPI for generic single function call */
	alloc_intr_gate(CALL_FUNCTION_SINGLE_VECTOR,
			call_function_single_interrupt);

	/* Low priority IPI to cleanup after moving an irq */
	set_intr_gate(IRQ_MOVE_CLEANUP_VECTOR, irq_move_cleanup_interrupt);
	set_bit(IRQ_MOVE_CLEANUP_VECTOR, used_vectors);
#endif
}
开发者ID:10x-Amin,项目名称:x10_Th_kernel,代码行数:31,代码来源:irqinit_64.c


示例14: x86_64_start_kernel

void __init x86_64_start_kernel(char * real_mode_data)
{
	int i;

	/* clear bss before set_intr_gate with early_idt_handler */
	clear_bss();

	/* Make NULL pointers segfault */
	zap_identity_mappings();

	for (i = 0; i < IDT_ENTRIES; i++)
		set_intr_gate(i, early_idt_handler);
	load_idt((const struct desc_ptr *)&idt_descr);

	early_printk("Kernel alive\n");

 	for (i = 0; i < NR_CPUS; i++)
 		cpu_pda(i) = &boot_cpu_pda[i];

	pda_init(0);
	copy_bootdata(__va(real_mode_data));
#ifdef CONFIG_SMP
	cpu_set(0, cpu_online_map);
#endif
	start_kernel();
}
开发者ID:AmesianX,项目名称:winkvm,代码行数:26,代码来源:head64.c


示例15: native_init_IRQ

void __init native_init_IRQ(void)
{
	int i;

	/* Execute any quirks before the call gates are initialised: */
	x86_init.irqs.pre_vector_init();

	apic_intr_init();

	/*
	 * Cover the whole vector space, no vector can escape
	 * us. (some of these will be overridden and become
	 * 'special' SMP interrupts)
	 */
	for (i = FIRST_EXTERNAL_VECTOR; i < NR_VECTORS; i++) {
		/* IA32_SYSCALL_VECTOR could be used in trap_init already. */
		if (!test_bit(i, used_vectors))
			set_intr_gate(i, interrupt[i-FIRST_EXTERNAL_VECTOR]);
	}

	if (!acpi_ioapic && !of_ioapic)
		setup_irq(2, &irq2);

#ifdef CONFIG_X86_32
	/*
	 * External FPU? Set up irq13 if so, for
	 * original braindamaged IBM FERR coupling.
	 */
	if (boot_cpu_data.hard_math && !cpu_has_fpu)
		setup_irq(FPU_IRQ, &fpu_irq);

	irq_ctx_init(smp_processor_id());
#endif
}
开发者ID:WhiteBearSolutions,项目名称:WBSAirback,代码行数:34,代码来源:irqinit.c


示例16: hd_init

void hd_init(void)
{
	blk_dev[MAJOR_NR].request_fn = DEVICE_REQUEST;
	set_intr_gate(0x2E,&hd_interrupt);
	outb_p(inb_p(0x21)&0xfb,0x21);
	outb(inb_p(0xA1)&0xbf,0xA1);
}
开发者ID:xh4n3,项目名称:study_kernel,代码行数:7,代码来源:hd.c


示例17: smp_intr_init

static void __init smp_intr_init(void)
{
#ifdef CONFIG_SMP
#if defined(CONFIG_X86_64) || defined(CONFIG_X86_LOCAL_APIC)
	/*
	 * The reschedule interrupt is a CPU-to-CPU reschedule-helper
	 * IPI, driven by wakeup.
	 */
	alloc_intr_gate(RESCHEDULE_VECTOR, reschedule_interrupt);

	/* IPI for generic function call */
	alloc_intr_gate(CALL_FUNCTION_VECTOR, call_function_interrupt);

	/* IPI for generic single function call */
	alloc_intr_gate(CALL_FUNCTION_SINGLE_VECTOR,
			call_function_single_interrupt);

	/* Low priority IPI to cleanup after moving an irq */
	set_intr_gate(IRQ_MOVE_CLEANUP_VECTOR, irq_move_cleanup_interrupt);
	set_bit(IRQ_MOVE_CLEANUP_VECTOR, used_vectors);

	/* IPI used for rebooting/stopping */
	alloc_intr_gate(REBOOT_VECTOR, reboot_interrupt);
#endif
#endif /* CONFIG_SMP */
}
开发者ID:ARMWorks,项目名称:FA_2451_Linux_Kernel,代码行数:26,代码来源:irqinit.c


示例18: apic_intr_init

void __init apic_intr_init(void)
{
#ifdef CONFIG_SMP
	smp_intr_init();
#endif
	/* self generated IPI for local APIC timer */
	set_intr_gate(LOCAL_TIMER_VECTOR, apic_timer_interrupt);

	/* IPI vectors for APIC spurious and error interrupts */
	set_intr_gate(SPURIOUS_APIC_VECTOR, spurious_interrupt);
	set_intr_gate(ERROR_APIC_VECTOR, error_interrupt);

	/* thermal monitor LVT interrupt */
#ifdef CONFIG_X86_MCE_P4THERMAL
	set_intr_gate(THERMAL_APIC_VECTOR, thermal_interrupt);
#endif
}
开发者ID:BackupTheBerlios,项目名称:tuxap,代码行数:17,代码来源:apic.c


示例19: get_new_vector

static int get_new_vector(void)
{
	int vector = assign_msi_vector();

	if (vector > 0)
		set_intr_gate(vector, interrupt[vector]);

	return vector;
}
开发者ID:xf739645524,项目名称:kernel-rhel5,代码行数:9,代码来源:msi.c


示例20: x86_64_start_kernel

void __init x86_64_start_kernel(char * real_mode_data)
{
	int i;

	/*
	 * Build-time sanity checks on the kernel image and module
	 * area mappings. (these are purely build-time and produce no code)
	 */
	BUILD_BUG_ON(MODULES_VADDR < KERNEL_IMAGE_START);
	BUILD_BUG_ON(MODULES_VADDR-KERNEL_IMAGE_START < KERNEL_IMAGE_SIZE);
	BUILD_BUG_ON(MODULES_LEN + KERNEL_IMAGE_SIZE > 2*PUD_SIZE);
	BUILD_BUG_ON((KERNEL_IMAGE_START & ~PMD_MASK) != 0);
	BUILD_BUG_ON((MODULES_VADDR & ~PMD_MASK) != 0);
	BUILD_BUG_ON(!(MODULES_VADDR > __START_KERNEL));
	BUILD_BUG_ON(!(((MODULES_END - 1) & PGDIR_MASK) ==
				(__START_KERNEL & PGDIR_MASK)));
	BUILD_BUG_ON(__fix_to_virt(__end_of_fixed_addresses) <= MODULES_END);

	/* clear bss before set_intr_gate with early_idt_handler */
	clear_bss();

	/* Make NULL pointers segfault */
	zap_identity_mappings();

	/* Cleanup the over mapped high alias */
	cleanup_highmap();

	for (i = 0; i < NUM_EXCEPTION_VECTORS; i++) {
#ifdef CONFIG_EARLY_PRINTK
		set_intr_gate(i, &early_idt_handlers[i]);
#else
		set_intr_gate(i, early_idt_handler);
#endif
	}
	load_idt((const struct desc_ptr *)&idt_descr);

	early_printk("Kernel alive\n");

	x86_64_init_pda();

	early_printk("Kernel really alive\n");

	x86_64_start_reservations(real_mode_data);
}
开发者ID:deepikateriar,项目名称:Onlive-Source-Backup,代码行数:44,代码来源:head64.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ set_irq_chained_handler函数代码示例发布时间:2022-05-30
下一篇:
C++ set_intersection函数代码示例发布时间: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