⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 interrupt.c

📁 一个Windows下的Linux专用虚拟机
💻 C
字号:
/* * This source code is a part of coLinux source package. * * Dan Aloni <da-x@colinux.org>, 2003 (c) * * The code is licensed under the GPL. See the COPYING file at * the root directory. */#include <colinux/arch/interrupt.h>static void call_intr(void *func){	asm("    call 1f"                            "\n" 	    "1:  popl %%eax"                         "\n" 	    "    addl $2f-1b,%%eax"                  "\n" 	    "    pushfl"             /* flags */     "\n" 	    "    pushl %%cs"         /* cs */        "\n" 	    "    pushl %%eax"        /* eip (2:) */  "\n" 	    "    jmp *%0"            /* jmp func */  "\n" 	    "2:  sti"                                "\n" 	    : : "m"(func): "eax", "esp");}void co_monitor_arch_real_hardware_interrupt(co_monitor_t *cmon){	struct {		unsigned long a, b;	} *host;	void *func;		host = (typeof(host))(cmon->passage_page->host_state.idt.table);	host = &host[co_passage_page->params[0]];	func = (void *)((host->b & 0xffff0000) | (host->a & 0x0000ffff));		call_intr(func);}void co_monitor_arch_enable_interrupts(void){	asm("sti\n");}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -