亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? host-linux.c

?? bochs : one pc simulator.
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* *  plex86: run multiple x86 operating systems concurrently *  Copyright (C) 1999-2003 Kevin P. Lawton * *  host-linux.c: Linux specific VM host driver functionality * *  This library is free software; you can redistribute it and/or *  modify it under the terms of the GNU Lesser General Public *  License as published by the Free Software Foundation; either *  version 2 of the License, or (at your option) any later version. * *  This library is distributed in the hope that it will be useful, *  but WITHOUT ANY WARRANTY; without even the implied warranty of *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU *  Lesser General Public License for more details. * *  You should have received a copy of the GNU Lesser General Public *  License along with this library; if not, write to the Free Software *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA */#include "plex86.h"#define IN_HOST_SPACE#include "monitor.h"#include <linux/config.h>#include <linux/module.h>#include <linux/types.h>#include <linux/kernel.h>#include <linux/fs.h>#include <linux/mm.h>#include <linux/proc_fs.h>#include <linux/wrapper.h>#include <linux/version.h>#include <asm/irq.h>#include <asm/atomic.h>#ifndef VERSION_CODE#  define VERSION_CODE(vers,rel,seq) ( ((vers)<<16) | ((rel)<<8) | (seq) )#endif#if LINUX_VERSION_CODE < VERSION_CODE(2,4,20)/* I use get_user_pages() to find and pin physical pages of memory * underlying the guest physical memory malloc()'d from user space. * This became an exported symbol available for kernel modules * as of 2.4.20.  You will have to recode some functions for * lesser kernels. */#  error "Currently, you need Linux kernel 2.4.20 or above."#endif#if LINUX_VERSION_CODE >= VERSION_CODE(2,1,0)#  include <asm/uaccess.h>#endif#include <asm/io.h>/************************************************************************//* Compatibility macros & convenience functions for older kernels       *//************************************************************************/#ifndef EXPORT_NO_SYMBOLS#  define EXPORT_NO_SYMBOLS register_symtab(NULL)#endif#if LINUX_VERSION_CODE >= VERSION_CODE(2,1,29)#  define proc_register_dynamic proc_register#endif#if LINUX_VERSION_CODE < VERSION_CODE(2,2,0)#define NEED_RESCHED need_resched#else#define NEED_RESCHED current->need_resched#endif/* Instrumentation of how many hardware interrupts were redirected * to the host, while the VM monitor/guest was running.  This can be * written to by multiple contexts, so it needs SMP protection. */static atomic_t interruptRedirCount[256];#if LINUX_VERSION_CODE < VERSION_CODE(2,1,0)  static inline unsigned longcopy_from_user(void *to, const void *from, unsigned long n){  int i;  if ( (i = verify_area(VERIFY_READ, from, n)) != 0 )    return i;  memcpy_fromfs(to, from, n);  return 0;}  static inline unsigned longcopy_to_user(void *to, const void *from, unsigned long n){  int i;  if ( (i = verify_area(VERIFY_WRITE, to, n)) != 0 )    return i;  memcpy_tofs(to, from, n);  return 0;}#endif#if LINUX_VERSION_CODE >= VERSION_CODE(2,1,18) && !defined(THIS_MODULE)/* Starting with version 2.1.18, the __this_module symbol is present, * but the THIS_MODULE #define was introduced much later ... */#define THIS_MODULE (&__this_module)#endif/************************************************************************//* Declarations                                                         *//************************************************************************//* Use dynamic major number allocation. (Set non-zero for static allocation) */#define PLEX86_MAJOR 0static int plex_major = PLEX86_MAJOR;#if LINUX_VERSION_CODE >= VERSION_CODE(2,1,18)MODULE_PARM(plex_major, "i");MODULE_PARM_DESC(plex_major, "major number (default " __MODULE_STRING(PLEX86_MAJOR) ")");#endif/* The kernel segment base. */#if LINUX_VERSION_CODE < VERSION_CODE(2,1,0)#  define KERNEL_OFFSET 0xc0000000#else#  define KERNEL_OFFSET 0x00000000#endif/* File operations. */static int plex86_ioctl(struct inode *, struct file *, unsigned int,                        unsigned long);static int plex86_open(struct inode *, struct file *);#if LINUX_VERSION_CODE >= VERSION_CODE(2,1,31)static int plex86_release(struct inode *, struct file *);#elsestatic void plex86_release(struct inode *, struct file *);#endif#if LINUX_VERSION_CODE >= VERSION_CODE(2,1,0)static int plex86_mmap(struct file * file, struct vm_area_struct * vma);#elsestatic int plex86_mmap(struct inode * inode, struct file * file,                       struct vm_area_struct * vma);#endif#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,9)/* New License scheme. */#ifdef MODULE_LICENSEMODULE_LICENSE("GPL"); /* Close enough.  Keeps kernel from complaining. */#endif#endif/************************************************************************//* Structures / Variables                                               *//************************************************************************/static int      retrieveKernelModulePages(void);static unsigned retrievePhyPages(Bit32u *page, int max_pages, void *addr,                                 unsigned size);static struct file_operations plex86_fops = {#if LINUX_VERSION_CODE >= VERSION_CODE(2,4,0)  owner:    THIS_MODULE,#endif  mmap:     plex86_mmap,  ioctl:    plex86_ioctl,  open:     plex86_open,  release:  plex86_release,  };#ifdef CONFIG_DEVFS_FS#include <linux/devfs_fs_kernel.h>devfs_handle_t my_devfs_entry;#endif/* For the /proc/driver/plex86 entry. */#if LINUX_VERSION_CODE >= VERSION_CODE(2,4,0) /* XXX - How far back? */int plex86_read_procmem(char *, char **, off_t, int);#elseint plex86_read_procmem(char *, char **, off_t, int, int);#endif#if LINUX_VERSION_CODE < VERSION_CODE(2,3,25)static struct proc_dir_entry plex86_proc_entry = {  0,                  /* dynamic inode */  6, "driver/plex86",     /* len, name */  S_IFREG | S_IRUGO,  /* mode */  1, 0, 0,  0,  NULL,  &plex86_read_procmem,  /* read function */  };#endif#if CONFIG_X86_PAE#  error "CONFIG_X86_PAE defined for this kernel, but unhandled in plex86"#endif/************************************************************************//* Main kernel module code                                              *//************************************************************************/  intinit_module(void){  int err;  /* Initialize structures which are not specific to each VM.  These   * are things which are set only once upon kernel module initialization.   */  memset(&kernelModulePages, 0, sizeof(kernelModulePages));  memset(&interruptRedirCount, 0, sizeof(interruptRedirCount));  /* Register the device with the kernel. */  err = register_chrdev(plex_major, "plex86", &plex86_fops);  if (err < 0) {    printk(KERN_WARNING "plex86: can't get major %d\n", plex_major);    return(err);    }  /* If this was a dynamic allocation, save the major for   * the release code   */  if(!plex_major)    plex_major = err;  /* Register the /proc entry. */#ifdef CONFIG_PROC_FS#if LINUX_VERSION_CODE >= VERSION_CODE(2,3,25)  if (!create_proc_info_entry("driver/plex86", 0, NULL, plex86_read_procmem))    printk(KERN_ERR "plex86: registering /proc/driver/plex86 failed\n");#else  proc_register_dynamic(&proc_root, &plex86_proc_entry);#endif#endif  /* Register /dev/misc/plex86 with devfs. */#ifdef CONFIG_DEVFS_FS  my_devfs_entry = devfs_register(NULL, "misc/plex86",                                   DEVFS_FL_DEFAULT,                                   plex_major, 0 /* minor mode*/,                                   S_IFCHR | 0666, &plex86_fops,                                  NULL /* "info" */);  if (!my_devfs_entry)    printk(KERN_ERR "plex86: registering misc/plex86 devfs entry failed\n");#endif  /* Retrieve the monitor physical pages. */  if ( !retrieveKernelModulePages() ) {    printk(KERN_ERR "plex86: retrieveKernelModulePages returned error\n");    err = -EINVAL;    goto fail_retrieve_pages;    }  /* Kernel independent code to be run when kernel module is loaded. */  if ( !hostModuleInit() ) {    printk(KERN_ERR "plex86: genericModuleInit returned error\n");    err = -EINVAL;    goto fail_cpu_capabilities;    }  /* Success. */  EXPORT_NO_SYMBOLS;  return(0);fail_cpu_capabilities:fail_retrieve_pages:  /* Unregister /proc entry. */#ifdef CONFIG_PROC_FS#if LINUX_VERSION_CODE >= VERSION_CODE(2,3,25)  remove_proc_entry("driver/plex86", NULL);#else  proc_unregister(&proc_root, plex86_proc_entry.low_ino);#endif#endif  /* Unregister device. */  unregister_chrdev(plex_major, "plex86");  return err;}  voidcleanup_module(void){  /* Unregister device. */  unregister_chrdev(plex_major, "plex86");  /* Unregister /proc entry. */#ifdef CONFIG_PROC_FS#if LINUX_VERSION_CODE >= VERSION_CODE(2,3,25)  remove_proc_entry("driver/plex86", NULL);#else  proc_unregister(&proc_root, plex86_proc_entry.low_ino);#endif#endif#ifdef CONFIG_DEVFS_FS  devfs_unregister(my_devfs_entry);#endif}/************************************************************************//* Open / Release a VM                                                  *//************************************************************************/  intplex86_open(struct inode *inode, struct file *filp){  vm_t *vm;#if LINUX_VERSION_CODE < VERSION_CODE(2,4,0)  MOD_INC_USE_COUNT;#endif  /* Allocate a VM structure. */  if ( (vm = hostOSAllocZeroedMem(sizeof(vm_t))) == NULL )    return -ENOMEM;  filp->private_data = vm;    /* Kernel independent device open code. */  hostDeviceOpen(vm);  return(0);}#if LINUX_VERSION_CODE >= VERSION_CODE(2,1,31)  int#else  void#endifplex86_release(struct inode *inode, struct file *filp){  vm_t *vm = (vm_t *)filp->private_data;  filp->private_data = NULL;  /* Free the virtual memory. */  hostUnallocVmPages( vm );  /* Free the VM structure. */  memset( vm, 0, sizeof(*vm) );  vfree( vm );#if LINUX_VERSION_CODE < VERSION_CODE(2,4,0)  MOD_DEC_USE_COUNT;#endif#if LINUX_VERSION_CODE >= VERSION_CODE(2,1,31)  return(0);#endif}  intplex86_ioctl(struct inode *inode, struct file *filp,             unsigned int cmd, unsigned long arg){  vm_t *vm = (vm_t *)filp->private_data;  int ret;  /* Call non host-specific ioctl() code which calls back to this   * module only when it needs host-specific features.   */  ret = hostIoctlGeneric(vm, inode, filp, cmd, arg);  /* Convert from plex86 errno codes to host-specific errno codes.  Not   * very exciting.   */  if ( ret < 0 )    ret = - hostOSConvertPlex86Errno(- ret);  return( ret );}  int#if LINUX_VERSION_CODE >= VERSION_CODE(2,1,0)plex86_mmap(struct file * file, struct vm_area_struct * vma)#elseplex86_mmap(struct inode * inode, struct file * file, struct vm_area_struct * vma)#endif{  vm_t *vm = (vm_t *)file->private_data;  UNUSED(vm);  return -EINVAL;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久99久久精品欧美| 日韩一区二区三区免费看 | 97久久精品人人做人人爽 | 91精品国产福利在线观看 | 亚洲香蕉伊在人在线观| 欧美成人女星排行榜| av电影在线不卡| 青青草伊人久久| 欧美国产日韩一二三区| 欧美亚洲一区二区在线观看| 国产美女精品人人做人人爽| 日韩国产成人精品| 亚洲人成亚洲人成在线观看图片| 欧美一区二区三区男人的天堂| 国产凹凸在线观看一区二区| 日韩精品一二区| 亚洲另类色综合网站| 欧美精品一区二区三区四区| 欧美色综合网站| 99热精品国产| 国产在线国偷精品产拍免费yy| 免费人成在线不卡| 亚洲一区二区三区自拍| 亚洲国产精品精华液ab| 久久影院视频免费| 91精品国产综合久久久久久久| 成人h版在线观看| 国产·精品毛片| 久久99久久久欧美国产| 一区二区三区高清在线| 中文字幕乱码日本亚洲一区二区| 日韩欧美国产不卡| 波多野结衣在线一区| 国产在线一区二区| 日本va欧美va欧美va精品| 一区二区三区精品| 亚洲色图视频网站| 国产蜜臀97一区二区三区 | 欧美草草影院在线视频| 色天使久久综合网天天| 成人一区二区三区视频在线观看 | 亚洲狠狠丁香婷婷综合久久久| 久久精品视频网| 精品国产人成亚洲区| 欧美人xxxx| 欧美三级视频在线播放| 91视频免费看| 99re成人在线| 色狠狠综合天天综合综合| 国产91精品精华液一区二区三区 | 91精品福利在线一区二区三区 | 亚洲精品少妇30p| 国产欧美日韩精品一区| 久久久久久久综合日本| 欧美精品一区二区三区久久久| 欧美一级高清片在线观看| 色8久久人人97超碰香蕉987| 99精品热视频| 97se亚洲国产综合自在线| 成人黄页毛片网站| 91色porny| 欧美日韩一区二区在线观看视频| 欧美少妇一区二区| 欧美日韩精品三区| 69堂精品视频| 精品少妇一区二区三区免费观看| 精品福利一二区| 亚洲精品一区二区三区在线观看 | 99国产一区二区三精品乱码| 91片黄在线观看| 亚洲精品在线电影| 国产精品卡一卡二| 亚洲色图制服诱惑| 理论电影国产精品| 国产成人精品免费| 色婷婷av久久久久久久| 欧美一区二区三区四区在线观看| 久久久久久夜精品精品免费| 中文字幕一区二区在线观看| 国产精品天天摸av网| 亚洲综合丝袜美腿| 久久国产人妖系列| 丰满放荡岳乱妇91ww| 欧美精品久久久久久久多人混战| www国产亚洲精品久久麻豆| 欧美国产欧美综合| 亚洲女与黑人做爰| 免费欧美在线视频| 懂色av一区二区夜夜嗨| 色综合天天狠狠| 日韩欧美一级二级三级| 欧美激情一区二区三区全黄| 一区二区三区四区在线免费观看| 日韩精品电影一区亚洲| 国产精品99精品久久免费| 色婷婷av一区二区| 精品粉嫩超白一线天av| 亚洲柠檬福利资源导航| 美国三级日本三级久久99| 高清国产一区二区| 91精品国产色综合久久不卡蜜臀 | 福利一区二区在线| 91精品欧美一区二区三区综合在 | 偷拍日韩校园综合在线| 成人av在线观| 久久色视频免费观看| 午夜精品福利一区二区三区av | 一区二区三区日韩精品| 国产精品99久| 欧美成人官网二区| 亚洲成人一区在线| 色婷婷综合久久久久中文一区二区 | 国产精品国产三级国产| 麻豆成人综合网| 欧美三级电影在线看| 亚洲欧洲99久久| 国产v综合v亚洲欧| 久久色.com| 激情丁香综合五月| 日韩三级在线观看| 日本中文字幕不卡| 欧美日韩成人一区二区| 一区二区三区**美女毛片| 91一区二区三区在线观看| 国产精品国产精品国产专区不片| 成人免费精品视频| 国产精品国产馆在线真实露脸| 国产91精品免费| 国产清纯白嫩初高生在线观看91 | 中文字幕一区在线观看视频| 国产高清不卡一区| 久久久久久久久免费| 久久er99热精品一区二区| 欧美一卡2卡3卡4卡| 日韩二区三区四区| 日韩午夜中文字幕| 九九在线精品视频| 欧美变态凌虐bdsm| 狠狠色丁香婷婷综合久久片| 精品国产1区二区| 国产二区国产一区在线观看| 久久精品水蜜桃av综合天堂| 风间由美一区二区三区在线观看| 欧美国产激情二区三区| caoporm超碰国产精品| 综合久久久久综合| 欧美优质美女网站| 午夜日韩在线电影| 日韩一区二区不卡| 国产电影一区二区三区| 国产精品久久久久久久久免费樱桃| 成人丝袜高跟foot| 亚洲婷婷在线视频| 欧美高清hd18日本| 蜜臀精品久久久久久蜜臀| 久久亚洲免费视频| 高清久久久久久| 亚洲综合色噜噜狠狠| 国产mv日韩mv欧美| 亚洲人吸女人奶水| 欧美精品1区2区3区| 久久99国产精品麻豆| 国产午夜久久久久| 91视频免费观看| 三级一区在线视频先锋| 久久久不卡影院| 色婷婷国产精品综合在线观看| 日韩国产精品久久久久久亚洲| 久久精品免视看| 欧美私模裸体表演在线观看| 老司机精品视频一区二区三区| 中文字幕av一区二区三区高| 在线观看成人免费视频| 激情综合五月天| 一区二区在线免费观看| 欧美一级国产精品| 91免费小视频| 久久er99热精品一区二区| 亚洲色图另类专区| 日韩视频免费直播| 91网页版在线| 精品在线视频一区| 一区二区三区成人| 精品国产乱子伦一区| 日本高清不卡一区| 国产精品性做久久久久久| 亚洲一区二区成人在线观看| 久久男人中文字幕资源站| 欧美日韩亚洲综合| 国产激情偷乱视频一区二区三区| 亚洲电影欧美电影有声小说| 欧美国产一区在线| 日韩一区二区三区免费观看| 99久久精品免费看| 激情久久久久久久久久久久久久久久| 亚洲欧美另类小说视频| 久久久国际精品| 日韩三级视频在线看| 欧美艳星brazzers| 成人av资源下载|