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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? sq.c

?? 優(yōu)龍2410linux2.6.8內(nèi)核源代碼
?? C
字號:
/* * arch/sh/kernel/cpu/sq.c * * General management API for SH-4 integrated Store Queues * * Copyright (C) 2001, 2002, 2003, 2004  Paul Mundt * Copyright (C) 2001, 2002  M. R. Brown * * Some of this code has been adopted directly from the old arch/sh/mm/sq.c * hack that was part of the LinuxDC project. For all intents and purposes, * this is a completely new interface that really doesn't have much in common * with the old zone-based approach at all. In fact, it's only listed here for * general completeness. * * This file is subject to the terms and conditions of the GNU General Public * License.  See the file "COPYING" in the main directory of this archive * for more details. */#include <linux/init.h>#include <linux/kernel.h>#include <linux/module.h>#include <linux/config.h>#include <linux/slab.h>#include <linux/list.h>#include <linux/proc_fs.h>#include <linux/miscdevice.h>#include <linux/vmalloc.h>#include <asm/io.h>#include <asm/page.h>#include <asm/mmu_context.h>#include <asm/cpu/sq.h>static LIST_HEAD(sq_mapping_list);static spinlock_t sq_mapping_lock = SPIN_LOCK_UNLOCKED;/** * sq_flush - Flush (prefetch) the store queue cache * * @addr: the store queue address to flush * * Executes a prefetch instruction on the specified store queue cache, * so that the cached data is written to physical memory. */inline void sq_flush(void *addr){	__asm__ __volatile__ ("pref @%0" : : "r" (addr) : "memory");}/** * sq_flush_range - Flush (prefetch) a specific SQ range * * @start: the store queue address to start flushing from * @len: the length to flush * * Flushes the store queue cache from @start to @start + @len in a * linear fashion. */void sq_flush_range(unsigned long start, unsigned int len){	volatile unsigned long *sq = (unsigned long *)start;	unsigned long dummy;	/* Flush the queues */	for (len >>= 5; len--; sq += 8)		sq_flush((void *)sq);	/* Wait for completion */	dummy = ctrl_inl(P4SEG_STORE_QUE);	ctrl_outl(0, P4SEG_STORE_QUE + 0);	ctrl_outl(0, P4SEG_STORE_QUE + 8);}static struct sq_mapping *__sq_alloc_mapping(unsigned long virt, unsigned long phys, unsigned long size, const char *name){	struct sq_mapping *map;	if (virt + size > SQ_ADDRMAX)		return ERR_PTR(-ENOSPC);	map = kmalloc(sizeof(struct sq_mapping), GFP_KERNEL);	if (!map)		return ERR_PTR(-ENOMEM);	INIT_LIST_HEAD(&map->list);	map->sq_addr	= virt;	map->addr	= phys;	map->size	= size + 1;	map->name	= name;	list_add(&map->list, &sq_mapping_list);	return map;}static unsigned long __sq_get_next_addr(void){	if (!list_empty(&sq_mapping_list)) {		struct list_head *pos, *tmp;				/*		 * Read one off the list head, as it will have the highest		 * mapped allocation. Set the next one up right above it.		 *		 * This is somewhat sub-optimal, as we don't look at		 * gaps between allocations or anything lower then the		 * highest-level allocation.		 *		 * However, in the interest of performance and the general		 * lack of desire to do constant list rebalancing, we don't		 * worry about it.		 */		list_for_each_safe(pos, tmp, &sq_mapping_list) {			struct sq_mapping *entry;			entry = list_entry(pos, typeof(*entry), list);			return entry->sq_addr + entry->size;		}	}	return P4SEG_STORE_QUE;}/** * __sq_remap - Perform a translation from the SQ to a phys addr * * @phys: Physical address to map store queues too. * @virt: Associated store queue address. * * Maps the store queue address @virt to the physical address @phys. */static struct sq_mapping *__sq_remap(struct sq_mapping *map){	unsigned long flags, pteh, ptel;	struct vm_struct *vma;	pgprot_t pgprot;	/*	 * Without an MMU (or with it turned off), this is much more	 * straightforward, as we can just load up each queue's QACR with	 * the physical address appropriately masked.	 */	ctrl_outl(((map->addr >> 26) << 2) & 0x1c, SQ_QACR0);	ctrl_outl(((map->addr >> 26) << 2) & 0x1c, SQ_QACR1);#ifdef CONFIG_MMU	/*	 * With an MMU on the other hand, things are slightly more involved.	 * Namely, we have to have a direct mapping between the SQ addr and	 * the associated physical address in the UTLB by way of setting up	 * a virt<->phys translation by hand. We do this by simply specifying	 * the SQ addr in UTLB.VPN and the associated physical address in	 * UTLB.PPN.	 *	 * Notably, even though this is a special case translation, and some	 * of the configuration bits are meaningless, we're still required	 * to have a valid ASID context in PTEH.	 *	 * We could also probably get by without explicitly setting PTEA, but	 * we do it here just for good measure.	 */	spin_lock_irqsave(&sq_mapping_lock, flags);	pteh = map->sq_addr;	ctrl_outl((pteh & MMU_VPN_MASK) | get_asid(), MMU_PTEH);	ptel = map->addr & PAGE_MASK;	ctrl_outl(((ptel >> 28) & 0xe) | (ptel & 0x1), MMU_PTEA);	pgprot = pgprot_noncached(PAGE_KERNEL);	ptel &= _PAGE_FLAGS_HARDWARE_MASK;	ptel |= pgprot_val(pgprot);	ctrl_outl(ptel, MMU_PTEL);	__asm__ __volatile__ ("ldtlb" : : : "memory");	spin_unlock_irqrestore(&sq_mapping_lock, flags);	/*	 * Next, we need to map ourselves in the kernel page table, so that	 * future accesses after a TLB flush will be handled when we take a	 * page fault.	 *	 * Theoretically we could just do this directly and not worry about	 * setting up the translation by hand ahead of time, but for the	 * cases where we want a one-shot SQ mapping followed by a quick	 * writeout before we hit the TLB flush, we do it anyways. This way	 * we at least save ourselves the initial page fault overhead.	 */	vma = __get_vm_area(map->size, VM_ALLOC, map->sq_addr, SQ_ADDRMAX);	if (!vma)		return ERR_PTR(-ENOMEM);	vma->phys_addr = map->addr;	if (remap_area_pages((unsigned long)vma->addr, vma->phys_addr,			     map->size, pgprot_val(pgprot))) {		vunmap(vma->addr);		return NULL;	}#endif /* CONFIG_MMU */	return map;}/** * sq_remap - Map a physical address through the Store Queues * * @phys: Physical address of mapping. * @size: Length of mapping. * @name: User invoking mapping. * * Remaps the physical address @phys through the next available store queue * address of @size length. @name is logged at boot time as well as through * the procfs interface. * * A pre-allocated and filled sq_mapping pointer is returned, and must be * cleaned up with a call to sq_unmap() when the user is done with the * mapping. */struct sq_mapping *sq_remap(unsigned long phys, unsigned int size, const char *name){	struct sq_mapping *map;	unsigned long virt, end;	unsigned int psz;	/* Don't allow wraparound or zero size */	end = phys + size - 1;	if (!size || end < phys)		return NULL;	/* Don't allow anyone to remap normal memory.. */	if (phys < virt_to_phys(high_memory))		return NULL;	phys &= PAGE_MASK;	size  = PAGE_ALIGN(end + 1) - phys;	virt  = __sq_get_next_addr();	psz   = (size + (PAGE_SIZE - 1)) / PAGE_SIZE;	map   = __sq_alloc_mapping(virt, phys, size, name);	printk("sqremap: %15s  [%4d page%s]  va 0x%08lx   pa 0x%08lx\n",	       map->name ? map->name : "???",	       psz, psz == 1 ? " " : "s",	       map->sq_addr, map->addr);	return __sq_remap(map);}/** * sq_unmap - Unmap a Store Queue allocation * * @map: Pre-allocated Store Queue mapping. * * Unmaps the store queue allocation @map that was previously created by * sq_remap(). Also frees up the pte that was previously inserted into * the kernel page table and discards the UTLB translation. */void sq_unmap(struct sq_mapping *map){	if (map->sq_addr > (unsigned long)high_memory)		vfree((void *)(map->sq_addr & PAGE_MASK));	list_del(&map->list);	kfree(map);}/** * sq_clear - Clear a store queue range * * @addr: Address to start clearing from. * @len: Length to clear. * * A quick zero-fill implementation for clearing out memory that has been * remapped through the store queues. */void sq_clear(unsigned long addr, unsigned int len){	int i;		/* Clear out both queues linearly */	for (i = 0; i < 8; i++) {		ctrl_outl(0, addr + i + 0);		ctrl_outl(0, addr + i + 8);	}	sq_flush_range(addr, len);}/** * sq_vma_unmap - Unmap a VMA range * * @area: VMA containing range. * @addr: Start of range. * @len: Length of range. * * Searches the sq_mapping_list for a mapping matching the sq addr @addr, * and subsequently frees up the entry. Further cleanup is done by generic * code. */static void sq_vma_unmap(struct vm_area_struct *area,			 unsigned long addr, size_t len){	struct list_head *pos, *tmp;	list_for_each_safe(pos, tmp, &sq_mapping_list) {		struct sq_mapping *entry;		entry = list_entry(pos, typeof(*entry), list);		if (entry->sq_addr == addr) {			/* 			 * We could probably get away without doing the tlb flush			 * here, as generic code should take care of most of this			 * when unmapping the rest of the VMA range for us. Leave			 * it in for added sanity for the time being..			 */			__flush_tlb_page(get_asid(), entry->sq_addr & PAGE_MASK);						list_del(&entry->list);			kfree(entry);			return;		}		}}/** * sq_vma_sync - Sync a VMA range * * @area: VMA containing range. * @start: Start of range. * @len: Length of range. * @flags: Additional flags. * * Synchronizes an sq mapped range by flushing the store queue cache for * the duration of the mapping. * * Used internally for user mappings, which must use msync() to prefetch * the store queue cache. */static int sq_vma_sync(struct vm_area_struct *area,		       unsigned long start, size_t len, unsigned int flags){	sq_flush_range(start, len);	return 0;}static struct vm_operations_struct sq_vma_ops = {	.unmap	= sq_vma_unmap,	.sync	= sq_vma_sync,};/** * sq_mmap - mmap() for /dev/cpu/sq * * @file: unused. * @vma: VMA to remap. * * Remap the specified vma @vma through the store queues, and setup associated * information for the new mapping. Also build up the page tables for the new * area. */static int sq_mmap(struct file *file, struct vm_area_struct *vma){	unsigned long offset = vma->vm_pgoff << PAGE_SHIFT;	unsigned long size = vma->vm_end - vma->vm_start;	struct sq_mapping *map;	/* 	 * We're not interested in any arbitrary virtual address that has	 * been stuck in the VMA, as we already know what addresses we	 * want. Save off the size, and reposition the VMA to begin at	 * the next available sq address.	 */	vma->vm_start = __sq_get_next_addr();	vma->vm_end   = vma->vm_start + size;	vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);	vma->vm_flags |= VM_IO | VM_RESERVED;	map = __sq_alloc_mapping(vma->vm_start, offset, size, "Userspace");	if (io_remap_page_range(vma, map->sq_addr, map->addr,				size, vma->vm_page_prot))		return -EAGAIN;		vma->vm_ops = &sq_vma_ops;	return 0;}#ifdef CONFIG_PROC_FSstatic int sq_mapping_read_proc(char *buf, char **start, off_t off,				int len, int *eof, void *data){	struct list_head *pos;	char *p = buf;	list_for_each_prev(pos, &sq_mapping_list) {		struct sq_mapping *entry;				entry = list_entry(pos, typeof(*entry), list);		p += sprintf(p, "%08lx-%08lx [%08lx]: %s\n", entry->sq_addr,			     entry->sq_addr + entry->size - 1, entry->addr,			     entry->name);	}	return p - buf;}#endifstatic struct file_operations sq_fops = {	.owner		= THIS_MODULE,	.mmap		= sq_mmap,};static struct miscdevice sq_dev = {	.minor		= STORE_QUEUE_MINOR,	.name		= "sq",	.devfs_name	= "cpu/sq",	.fops		= &sq_fops,};static int __init sq_api_init(void){	printk(KERN_NOTICE "sq: Registering store queue API.\n");#ifdef CONFIG_PROC_FS	create_proc_read_entry("sq_mapping", 0, 0, sq_mapping_read_proc, 0);#endif	return misc_register(&sq_dev);}static void __exit sq_api_exit(void){	misc_deregister(&sq_dev);}module_init(sq_api_init);module_exit(sq_api_exit);MODULE_AUTHOR("Paul Mundt <lethal@linux-sh.org>, M. R. Brown <mrbrown@0xd6.org>");MODULE_DESCRIPTION("Simple API for SH-4 integrated Store Queues");MODULE_LICENSE("GPL");MODULE_ALIAS_MISCDEV(STORE_QUEUE_MINOR);EXPORT_SYMBOL(sq_remap);EXPORT_SYMBOL(sq_unmap);EXPORT_SYMBOL(sq_clear);EXPORT_SYMBOL(sq_flush);EXPORT_SYMBOL(sq_flush_range);

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品伦理在线| 日韩三级视频在线看| 国产欧美日韩另类一区| 国产麻豆91精品| 久久久精品国产99久久精品芒果 | 精品国产a毛片| 日韩国产欧美三级| 日韩欧美久久久| 国产精品一区免费视频| 中文字幕字幕中文在线中不卡视频| 成人精品电影在线观看| 依依成人精品视频| 欧美军同video69gay| 麻豆精品视频在线观看免费| 久久久久国产精品厨房| 91女人视频在线观看| 亚洲成人激情自拍| 久久免费午夜影院| 91免费视频网址| 天堂va蜜桃一区二区三区漫画版| 日韩欧美国产综合在线一区二区三区| 久久成人精品无人区| 国产日韩欧美制服另类| 在线一区二区三区做爰视频网站| 日韩av高清在线观看| 中文字幕欧美区| 欧美日韩国产一二三| 国产老妇另类xxxxx| 亚洲精品乱码久久久久久久久| 正在播放亚洲一区| 成人动漫中文字幕| 五月天亚洲精品| 欧美国产一区二区在线观看| 欧美探花视频资源| 国产经典欧美精品| 日韩精品一区第一页| 中文字幕精品一区| 91精品国产免费| 91成人免费在线视频| 国产伦精品一区二区三区视频青涩 | 亚洲成人免费影院| 久久久国际精品| 欧美日韩在线三区| 国产99久久精品| 久久国产精品99久久久久久老狼| 亚洲美女免费视频| 亚洲国产成人私人影院tom| 91精品婷婷国产综合久久竹菊| 成人av在线资源网站| 久久99精品久久久久久动态图| 亚洲精品美国一| 一区视频在线播放| 国产情人综合久久777777| 日韩一区二区中文字幕| 欧美色网一区二区| 97精品国产露脸对白| 国产不卡视频在线播放| 精品一二三四区| 奇米精品一区二区三区在线观看一| 亚洲三级免费观看| 中文字幕欧美国产| 欧美极品aⅴ影院| 国产亚洲综合色| 久久嫩草精品久久久久| 欧美精品一区二区在线播放| 欧美一区二区日韩| 日韩一级在线观看| 日韩免费在线观看| 日韩一区二区三区av| 欧美视频你懂的| 欧美亚洲国产一区二区三区va| 一本一道综合狠狠老| 色综合中文字幕国产 | www.爱久久.com| 国产精品一二一区| 国产一区在线视频| 国产高清亚洲一区| 国产精品一区二区久久精品爱涩| 美女视频网站久久| 久久av资源站| 精品一区二区三区日韩| 精品在线播放免费| 麻豆91免费看| 青娱乐精品在线视频| 久久草av在线| 国产麻豆精品久久一二三| 国产九九视频一区二区三区| 国产91精品一区二区麻豆网站| 国产黄色精品网站| 波多野结衣的一区二区三区| 99久久精品国产一区| 91极品美女在线| 欧美肥妇毛茸茸| 欧美大胆一级视频| 欧美激情一区二区三区不卡| 中文字幕中文字幕一区二区| 亚洲精品中文在线影院| 亚洲成a天堂v人片| 国产综合色视频| 99国产欧美另类久久久精品| 欧美午夜精品久久久| 日韩欧美视频一区| 欧美国产精品一区二区| 一区二区三区在线免费播放| 蜜桃精品视频在线| 国产成人丝袜美腿| 在线一区二区三区| 精品入口麻豆88视频| 国产精品久久毛片av大全日韩| 亚洲男人的天堂在线观看| 日韩电影免费在线看| 丁香五精品蜜臀久久久久99网站| 不卡的av网站| 欧美一区二区三区在| 国产精品看片你懂得| 奇米影视在线99精品| av电影一区二区| 欧美一级高清大全免费观看| 亚洲精品一区二区三区99| 亚洲色图在线播放| 久久国产精品露脸对白| 99久久国产免费看| 欧美v国产在线一区二区三区| 久久久久久麻豆| 亚洲成人你懂的| 成人av电影免费观看| 欧美成人精品3d动漫h| 亚洲免费看黄网站| 国模一区二区三区白浆| 欧美日韩国产综合一区二区三区| 国产欧美一区二区精品久导航| 亚洲成av人片www| 99re热视频这里只精品| 久久综合丝袜日本网| 亚洲国产综合色| av在线播放一区二区三区| 日韩精品在线一区| 丝袜脚交一区二区| 日本伦理一区二区| 国产精品美女久久久久久2018| 狠狠色狠狠色综合系列| 欧美精品v日韩精品v韩国精品v| 亚洲日本丝袜连裤袜办公室| 国产在线麻豆精品观看| 欧美va日韩va| 日韩主播视频在线| 欧美日韩综合在线免费观看| 1区2区3区国产精品| 国产91精品在线观看| 久久久久久久国产精品影院| 日本欧美一区二区在线观看| 欧洲av在线精品| 亚洲人亚洲人成电影网站色| 成人动漫视频在线| 中文字幕在线观看不卡视频| 高清不卡一区二区| 日本一区二区免费在线观看视频| 精品一区二区三区在线视频| 欧美一区二区人人喊爽| 日本不卡一二三| 91精品国产综合久久久久久漫画| 亚洲一二三四久久| 在线视频国产一区| 亚洲综合在线第一页| 欧美伊人精品成人久久综合97 | 欧美成va人片在线观看| 日本在线观看不卡视频| 91精品国产91久久久久久最新毛片 | 91成人在线免费观看| 亚洲美女屁股眼交3| 欧美少妇bbb| 视频一区中文字幕国产| 欧美一区二区在线播放| 美女一区二区三区| 日韩一区二区三区av| 9191国产精品| 亚洲精选视频在线| 国产精品一区一区三区| 国产午夜精品一区二区三区嫩草| 免费不卡在线观看| 欧美精品精品一区| 美腿丝袜亚洲三区| 久久综合狠狠综合久久综合88| 国产精品资源在线看| 国产精品情趣视频| 色综合久久综合网欧美综合网| 亚洲精品国产无天堂网2021| 在线区一区二视频| 日韩国产高清影视| 精品国产伦理网| 高清国产一区二区三区| 最新国产の精品合集bt伙计| 欧美在线观看你懂的| 看电影不卡的网站| 中文字幕一区二区三区在线观看| 91久久精品一区二区二区| 免费在线看一区| 国产精品水嫩水嫩| 欧美二区在线观看| 成人一区二区三区视频|