Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
dvma.c
Package: linux-2.4.20.tar.gz [view]
Upload User: jlfgdled
Upload Date: 2013-04-10
Package Size: 33168k
Code Size: 1k
Category:
Linux-Unix program
Development Platform:
Unix_Linux
- /* dvma support routines */
- #include <linux/kernel.h>
- #include <linux/mm.h>
- #include <linux/bootmem.h>
- #include <linux/list.h>
- #include <asm/page.h>
- #include <asm/pgtable.h>
- #include <asm/sun3mmu.h>
- #include <asm/dvma.h>
- static unsigned long ptelist[120];
- inline unsigned long dvma_page(unsigned long kaddr, unsigned long vaddr)
- {
- unsigned long pte;
- unsigned long j;
- pte_t ptep;
- j = *(volatile unsigned long *)kaddr;
- *(volatile unsigned long *)kaddr = j;
- ptep = __mk_pte(kaddr, PAGE_KERNEL);
- pte = pte_val(ptep);
- // printk("dvma_remap: addr %lx -> %lx pte %08lx len %xn",
- // kaddr, vaddr, pte, len);
- if(ptelist[(vaddr & 0xff000) >> PAGE_SHIFT] != pte) {
- sun3_put_pte(vaddr, pte);
- ptelist[(vaddr & 0xff000) >> PAGE_SHIFT] = pte;
- }
- return (vaddr + (kaddr & ~PAGE_MASK));
- }
- int dvma_map_iommu(unsigned long kaddr, unsigned long baddr,
- int len)
- {
- unsigned long end;
- unsigned long vaddr;
- vaddr = dvma_btov(baddr);
- end = vaddr + len;
- while(vaddr < end) {
- dvma_page(kaddr, vaddr);
- kaddr += PAGE_SIZE;
- vaddr += PAGE_SIZE;
- }
- return 0;
- }
- void sun3_dvma_init(void)
- {
- memset(ptelist, 0, sizeof(ptelist));
- }