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

📄 oskit_video.c

📁 基于组件方式开发操作系统的OSKIT源代码
💻 C
字号:
/* * Copyright (c) 1997-1999 University of Utah and the Flux Group. * All rights reserved. *  * This file is part of the Flux OSKit.  The OSKit is free software, also known * as "open source;" you can redistribute it and/or modify it under the terms * of the GNU General Public License (GPL), version 2, as published by the Free * Software Foundation (FSF).  To explore alternate licensing terms, contact * the University of Utah at csl-dist@cs.utah.edu or +1-801-585-3271. *  * The OSKit 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 GPL for more details.  You should have * received a copy of the GPL along with the OSKit; see the file COPYING.  If * not, write to the FSF, 59 Temple Place #330, Boston, MA 02111-1307, USA. */#include "X.h"#ifndef OSKIT#include "input.h"#endif#include "scrnintstr.h"#include "xf86.h"#include "xf86Priv.h"#include "xf86_OSlib.h"#include "xf86_Config.h"#include "osenv.h"#include <sys/mman.h>#ifndef OSKITtypedef char * caddr_t;#endif/***************************************************************************//* Video Memory Mapping section                                            *//***************************************************************************/#if 0static struct xf86memMap {  int offset;  int memSize;} xf86memMaps[MAXSCREENS];#endifstatic Bool linearmem = FALSE;pointer xf86MapVidMem(ScreenNum, Region, Base, Size)int ScreenNum;int Region;pointer Base;unsigned long Size;{	pointer base;	int rc;	if ((rc = osenv_mem_map_phys(Base, Size, &base, 0)))		return  -1;#if 0	xf86memMaps[ScreenNum].offset = (int) Base;	xf86memMaps[ScreenNum].memSize = Size;#endif	linearmem = TRUE;	return base;}#if 0void xf86GetVidMemData(ScreenNum, Base, Size)int ScreenNum;int *Base;int *Size;      {                 *Base = xf86memMaps[ScreenNum].offset;   *Size = xf86memMaps[ScreenNum].memSize;}#endif                             void xf86UnMapVidMem(ScreenNum, Region, Base, Size)int ScreenNum;int Region;pointer Base;unsigned long Size;{#ifdef NOTYET	osenv_mem_unmap_phys((caddr_t)Base, Size);#endif}Bool xf86LinearVidMem(){	return(TRUE);	/* XXX for now we assume that we'll be able to map			 * physical memory.			 */}/***************************************************************************//* I/O Permissions section                                                 *//***************************************************************************/static Bool ScreenEnabled[MAXSCREENS];static Bool InitDone = FALSE;voidxf86ClearIOPortList(ScreenNum)int ScreenNum;{	if (!InitDone)	{		int i;		for (i = 0; i < MAXSCREENS; i++)			ScreenEnabled[i] = FALSE;		InitDone = TRUE;	}	return;}voidxf86AddIOPorts(ScreenNum, NumPorts, Ports)int ScreenNum;int NumPorts;unsigned *Ports;{	return;}voidxf86EnableIOPorts(ScreenNum)int ScreenNum;{	ScreenEnabled[ScreenNum] = TRUE;	return;}	voidxf86DisableIOPorts(ScreenNum)int ScreenNum;{	ScreenEnabled[ScreenNum] = FALSE;	return;}void xf86DisableIOPrivs(){	return;}/***************************************************************************//* Interrupt Handling section                                              *//***************************************************************************/Bool xf86DisableInterrupts(){	osenv_intr_disable();	return(TRUE);}void xf86EnableInterrupts(){	osenv_intr_enable();}

⌨️ 快捷键说明

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