linux/drivers/char/mspec.c
<<
opti.6./spaue= .6./forme= .6.a opti.6 href="../linux+v3.7.5/drivers/char/mspec.c">opti.6.img src="../.static/gfx/right.png" alt=">>">op./spaue=op.spau class="lxr_search">optiopti.6.input typ vhidden" nam vnavtarget" > v">opti.6.input typ vtext" nam vsearch" id vsearch">opti.6.butt1 typ vsubmit">Searchopti.6Prefs= .6./a>op./spaue=ti.6 6./dive=ti.6 6.form acvalu="ajax+*" method="post" onsubmit="return false;">op.input typ vhidden" nam vajax_lookup" id vajax_lookup" > v">oti.6 6./forme=oti.6 6.div class="headingbott1m">= .div id vfile_contents"e
6 61./a>.spau class="comment">/*./spaue=6 62./a>.spau class="comment"> * Copyright (C) 2001-2006 Silic1
	Graphics, Inc.  All rights./spaue=6 63./a>.spau class="comment"> * reserved../spaue=6 64./a>.spau class="comment"> *./spaue=6 65./a>.spau class="comment"> * This program is free software; you cau redistribute it and/or modify it./spaue=6 66./a>.spau class="comment"> * under the terms of vers11
	2 of the GNU General Public License./spaue=6 67./a>.spau class="comment"> * as published by the Free Software Foundavalu../spaue=6 68./a>.spau class="comment"> */./spaue=6 69./a>o6 ptioa>.spau class="comment">/*./spaue=6 11./a>.spau class="comment"> * SN Platform Special Memory (mspec) Support./spaue=6 12./a>.spau class="comment"> *./spaue=6 13./a>.spau class="comment"> * This driver exports the SN special memory (mspec) facility to user./spaue=6 14./a>.spau class="comment"> * processes../spaue=6 15./a>.spau class="comment"> * There are three typ s of memory made available thru this driver:./spaue=6 16./a>.spau class="comment"> * fetchops, uncached and cached../spaue=6 17./a>.spau class="comment"> *./spaue=6 18./a>.spau class="comment"> * Fetchops are at1mic memory operavalus that are implemented in the./spaue=6 19./a>.spau class="comment"> * memory controller 1
	SGI SN hardware../spaue=6 2tioa>.spau class="comment"> *./spaue=6 21./a>.spau class="comment"> * Uncached are used for memory write combining feature of the iaptiospaue=6 22./a>.spau class="comment"> * cpu../spaue=6 23./a>.spau class="comment"> *./spaue=6 24./a>.spau class="comment"> * Cached are used for areas of memory that are used as cached addresses./spaue=6 25./a>.spau class="comment"> * 1
	our parti.11
	and used as uncached addresses from other parti.11
s../spaue=6 26./a>.spau class="comment"> * Due to a design constraint of the SN2 Shub, you cau not have processors./spaue=6 27./a>.spau class="comment"> * on the sam  FSB perform both a cached and uncached reference to the./spaue=6 28./a>.spau class="comment"> * sam  cache line.  These special memory cached regalus prevent the./spaue=6 29./a>.spau class="comment"> * kernel from ever dropping in a TLB entry and therefore prevent the./spaue=6 3tioa>.spau class="comment"> * processor from ever speculating a cache line from this page../spaue=6 31./a>.spau class="comment"> */./spaue=6 32./a>o6 33./a>#include <linux/typ s.h./a>>o6 34./a>#include <linux/kernel.h./a>>o6 35./a>#include <linux/module.h./a>>o6 36./a>#include <linux/init.h./a>>o6 37./a>#include <linux/errno.h./a>>o6 38./a>#include <linux/miscdevice.h./a>>o6 39./a>#include <linux/spinlock.h./a>>o6 40./a>#include <linux/mm.h./a>>o6 41./a>#include <linux/fs.h./a>>o6 42./a>#include <linux/vmalloc.h./a>>o6 43./a>#include <linux/string.h./a>>o6 44./a>#include <linux/slab.h./a>>o6 45./a>#include <linux/numa.h./a>>o6 46./a>#include <asm/page.h./a>>o6 47./a>#include <asm/pgtable.h./a>>o6 48./a>#include <linux/at1mic.h./a>>o6 49./a>#include <asm/tlbflush.h./a>>o6 50./a>#include <asm/uncached.h./a>>o6 51./a>#include <asm/sn/addrs.h./a>>o6 52./a>#include <asm/sn/arch.h./a>>o6 53./a>#include <asm/sn/mspec.h./a>>o6 54./a>#include <asm/sn/sn_cpuid.h./a>>o6 55./a>#include <asm/sn/io.h./a>>o6 56./a>#include <asm/sn/bte.h./a>>o6 57./a>#include <asm/sn/shubio.h./a>>o6 58./a>o6 59./a>o6 60./a>#define FETCHOP_ID./a>ti.6 6.spau class="string">"SGI Fetchop,"./spaue=6 61./a>#define CACHED_ID./a>ti.6 66.spau class="string">"Cached,"./spaue=6 62./a>#define UNCACHED_ID./a>ti.6 .spau class="string">"Uncached"./spaue=6 63./a>#define REVISION./a>ti.6 66 .spau class="string">"4.0"./spaue=6 64./a>#define MSPEC_BASENAME./a>ti.spau class="string">"mspec"./spaue=6 65./a>o6 66./a>.spau class="comment">/*./spaue=6 67./a>.spau class="comment"> * Page typ s allocated by the device../spaue=6 68./a>.spau class="comment"> */./spaue=6 69./a>enum mspec_page_typ ./a>t{=6 70./a>ti.6 66 .a href="+code=MSPEC_FETCHOP" class="sref">MSPEC_FETCHOP./a>t= 1,=6 71./a>ti.6 66 .a href="+code=MSPEC_CACHED" class="sref">MSPEC_CACHED./a>,=6 72./a>ti.6 66 .a href="+code=MSPEC_UNCACHED" class="sref">MSPEC_UNCACHED./a>o6 73./a>};o6 74./a>o6 75./a>#ifdef CONFIG_SGI_SN./a>o6 76./a>static int is_sn2./a>;o6 77./a>#elseo6 78./a>#define is_sn2./a>          0o6 79./a>#endif=6 80./a>o6 81./a>.spau class="comment">/*./spaue=6 82./a>.spau class="comment"> * One of these structures is allocated whe
	an mspec regalu is mmaped. The./spaue=6 83./a>.spau class="comment"> * structure is pointed to by the vma->vm_private_data field in the vma struct../spaue=6 84./a>.spau class="comment"> * This structure is used to record the addresses of the mspec pages../spaue=6 85./a>.spau class="comment"> * This structure is shared by all vma's that are split off from the./spaue=6 86./a>.spau class="comment"> * original vma whe
	split_vma()'s are done../spaue=6 87./a>.spau class="comment"> *./spaue=6 88./a>.spau class="comment"> * The refcnt is incremented at1mically because mm->mmap_sem does not./spaue=6 89./a>.spau class="comment"> * protect in fork case where multiple tasks share the vma_data../spaue=6 9tioa>.spau class="comment"> */./spaue=6 91./a>struct vma_data./a>t{=6 92./a>ti.6 66 .a href="+code=at1mic_t" class="sref">at1mic_t./a>t.a href="+code=refcnt" class="sref">refcnt./a>;ti.6 66 .spau class="comment">/* Number 1f vmas sharing the data. */./spaue=6 93./a>ti.6 66 .a href="+code=spinlock_t" class="sref">spinlock_t./a>t.a href="+code=lock" class="sref">lock./a>;ti.6 66 .spau class="comment">/* Serialize access to this structure. */./spaue=6 94./a>ti.6 66 int count./a>;ti.6 66 .6 66 .spau class="comment">/* Number 1f pages allocated. */./spaue=6 95./a>ti.6 66 enum mspec_page_typ ./a>ttyp ./a>; .spau class="comment">/* Typ  1f pages allocated. */./spaue=6 96./a>ti.6 66 int flags./a>;ti.6 66 .6 66 .spau class="comment">/* See VMD_xxx below. */./spaue=6 97./a>ti.6 66 unsigned long vm_start./a>; .spau class="comment">/* Original (unsplit) base. */./spaue=6 98./a>ti.6 66 unsigned long vm_end./a>;ti..spau class="comment">/* Original (unsplit) end. */./spaue=6 99./a>ti.6 66 unsigned long maddr./a>[0]; .spau class="comment">/* Array 1f MSPEC addresses. */./spaue=6100./a>};o6101./a>o6102./a>#define VMD_VMALLOCED./a>t0x1 .6 66 .spau class="comment">/* vmalloc'd rather than kmalloc'd */./spaue=6103./a>o6104./a>.spau class="comment">/* used lu shub2 to clear FOP cache in the HUB */./spaue=6105./a>static unsigned long scratch_page./a>[.a href="+code=MAX_NUMNODES" class="sref">MAX_NUMNODES./a>];o6106./a>#define SH2_AMO_CACHE_ENTRIES./a>ti.4o6107./a>o6108./a>static inline./a>tinto6109./a>.a href="+code=mspec_zero_block" class="sref">mspec_zero_block./a>(unsigned long addr./a>, int len./a>)=61ptioa>{=6111./a>ti.6 66 int status./a>;o6112./a>o6113./a>ti.6 66 if (is_sn2./a>)t{=6114./a>ti.6 66 ti.6 66 if (is_shub2./a>())t{=6115./a>ti.6 66 ti.6 66 ti.6 66 int nid./a>;o6116./a>ti.6 66 ti.6 66 ti.6 66 void *p./a>;o6117./a>ti.6 66 ti.6 66 ti.6 66 int i./a>;o6118./a>o6119./a>ti.6 66 ti.6 66 ti.6 66 nid./a> = nasid_to_cnodeid./a>(get_node_number./a>(__pa./a>(addr./a>)));o6120./a>ti.6 66 ti.6 66 ti.6 66 p./a> = (void *)TO_AMO./a>(scratch_page./a>[.a href="+code=nid" class="sref">nid./a>]);o6121./a>o6122./a>ti.6 66 ti.6 66 ti.6 66 for (i./a>=0; i./a> < SH2_AMO_CACHE_ENTRIES./a>; i./a>++)t{=6123./a>ti.6 66 ti.6 66 ti.6 66 ti.6 66 FETCHOP_LOAD_OP./a>(p./a>, FETCHOP_LOAD./a>);o6124./a>ti.6 66 ti.6 66 ti.6 66 ti.6 66 p./a> += FETCHOP_VAR_SIZE./a>;o6125./a>ti.6 66 ti.6 66 ti.6 66 }o6126./a>ti.6 66 ti.6 66 }o6127./a>o6128./a>ti.6 66 ti.6 66 status./a> = bte_copy./a>(0, addr./a> & ~__IA64_UNCACHED_OFFSET./a>, len./a>,=6129./a>ti.6 66 ti.6 66 ti.6 66 6 ti.6 66 BTE_WACQUIRE./a>t| BTE_ZERO_FILL./a>, NULL./a>);o6130./a>ti.6 66 } elset{=6131./a>ti.6 66 ti.6 66 memset./a>((char *) addr./a>, 0, len./a>);o6132./a>ti.6 66 ti.6 66 status./a> = 0;o6133./a>ti.6 66 }o6134./a>ti.6 66 return status./a>;o6135./a>}o6136./a>o6137./a>.spau class="comment">/*./spaue=6138./a>.spau class="comment"> * mspec_open./spaue=6139./a>.spau class="comment"> *./spaue=614tioa>.spau class="comment"> * Called whe
	a device mapping is created by a means other than mmap./spaue=6141./a>.spau class="comment"> * (via fork, munmap, etc.).  Increments the reference count on the./spaue=6142./a>.spau class="comment"> * underlying mspec data so it is not freed prematurely../spaue=6143./a>.spau class="comment"> */./spaue=6144./a>static void=6145./a>.a href="+code=mspec_open" class="sref">mspec_open./a>(struct vm_area_struct./a>t*vma./a>)=6146./a>{=6147./a>ti.6 66 struct vma_data./a>t*vdata./a>;o6148./a>o6149./a>ti.6 66 vdata./a> = vma./a>->vm_private_data./a>;o6150./a>ti.6 66 .a href="+code=at1mic_inc" class="sref">at1mic_inc./a>(&vdata./a>->refcnt./a>);o6151./a>}o6152./a>o6153./a>.spau class="comment">/*./spaue=6154./a>.spau class="comment"> * mspec_close./spaue=6155./a>.spau class="comment"> *./spaue=6156./a>.spau class="comment"> * Called whe
	unmapping a device mapping. Frees all mspec pages./spaue=6157./a>.spau class="comment"> * belonging to all the vma's sharing this vma_data structure../spaue=6158./a>.spau class="comment"> */./spaue=6159./a>static void=6160./a>.a href="+code=mspec_close" class="sref">mspec_close./a>(struct vm_area_struct./a>t*vma./a>)=6161./a>{=6162./a>ti.6 66 struct vma_data./a>t*vdata./a>;o6163./a>ti.6 66 int index./a>, last_index./a>;o6164./a>ti.6 66 unsigned long my_page./a>;o6165./a>o6166./a>ti.6 66 vdata./a> = vma./a>->vm_private_data./a>;o6167./a>o6168./a>ti.6 66 if (!.a href="+code=at1mic_dec_and_test" class="sref">at1mic_dec_and_test./a>(&vdata./a>->refcnt./a>))=6169./a>ti.6 66 ti.6 66 return;o6170./a>o6171./a>ti.6 66 .a href="+code=last_index" class="sref">last_index./a> = (vdata./a>->vm_end./a> - vdata./a>->vm_start./a>) >> PAGE_SHIFT./a>;o6172./a>ti.6 66 for (index./a> = 0; index./a> < last_index./a>; index./a>++)t{=6173./a>ti.6 66 ti.6 66 if (vdata./a>->maddr./a>[index./a>] == 0)=6174./a>ti.6 66 ti.6 66 ti.6 66 continue;o6175./a>ti.6 66 ti.6 66 .spau class="comment">/*./spaue=6176./a>.spau class="comment">                 * Clear the page before sticking it back./spaue=6177./a>.spau class="comment">                 * into the pool../spaue=6178./a>.spau class="comment">                 */./spaue=6179./a>ti.6 66 ti.6 66 my_page./a> = vdata./a>->maddr./a>[index./a>];o6180./a>ti.6 66 ti.6 66 vdata./a>->maddr./a>[index./a>] = 0;o6181./a>ti.6 66 ti.6 66 if (!.a href="+code=mspec_zero_block" class="sref">mspec_zero_block./a>(my_page./a>, PAGE_SIZE./a>))=6182./a>ti.6 66 ti.6 66 ti.6 66 uncached_free_page./a>(my_page./a>, 1);o6183./a>ti.6 66 ti.6 66 elseo6184./a>ti.6 66 ti.6 66 ti.6 66 printk./a>(KERN_WARNING./a>t.spau class="string">"mspec_close(): "./spaue=6185./a>ti.6 66 ti.6 66 ti.6 66 i.6 66 "failed to zero page %ld\n"./spaue, my_page./a>);o6186./a>ti.6 66 }o6187./a>o6188./a>ti.6 66 if (vdata./a>->flags./a> & VMD_VMALLOCED./a>)=6189./a>ti.6 66 ti.6 66 vfree./a>(vdata./a>);o6190./a>ti.6 66 elseo6191./a>ti.6 66 ti.6 66 kfree./a>(vdata./a>);o6192./a>}o6193./a>o6194./a>.spau class="comment">/*./spaue=6195./a>.spau class="comment"> * mspec_fault./spaue=6196./a>.spau class="comment"> *./spaue=6197./a>.spau class="comment"> * Creates a mspec page and maps it to user space../spaue=6198./a>.spau class="comment"> */./spaue=6199./a>static into6200./a>.a href="+code=mspec_fault" class="sref">mspec_fault./a>(struct vm_area_struct./a>t*vma./a>, struct vm_fault./a>t*vmf./a>)=6201./a>{=6202./a>ti.6 66 unsigned long paddr./a>, maddr./a>;o6203./a>ti.6 66 unsigned long pfn./a>;o6204./a>ti.6 66 pgoff_t./a>t.a href="+code=index" class="sref">index./a> = vmf./a>->pgoff./a>;o6205./a>ti.6 66 struct vma_data./a>t*vdata./a> = vma./a>->vm_private_data./a>;o6206./a>o6207./a>ti.6 66 maddr./a> = (volatile unsigned long) vdata./a>->maddr./a>[index./a>];o6208./a>ti.6 66 if (maddr./a> == 0)t{=6209./a>ti.6 66 ti.6 66 maddr./a> = uncached_alloc_page./a>(numa_node_id./a>(), 1);o6210./a>ti.6 66 ti.6 66 if (maddr./a> == 0)o6211./a>ti.6 66 ti.6 66         return VM_FAULT_OOM./a>;o6212./a>o6213./a>ti.6 66 ti.6 66 spin_lock./a>(&vdata./a>->lock./a>);o6214./a>ti.6 66 ti.6 66 if (vdata./a>->maddr./a>[index./a>] == 0)t{=6215./a>ti.6 66 ti.6 66 ti.6 66 vdata./a>->count./a>++;o6216./a>ti.6 66 ti.6 66 ti.6 66 vdata./a>->maddr./a>[index./a>] = maddr./a>;o6217./a>ti.6 66 ti.6 66 } elset{=6218./a>ti.6 66 ti.6 66 ti.6 66 uncached_free_page./a>(maddr./a>, 1);o6219./a>ti.6 66 ti.6 66 ti.6 66 maddr./a> = vdata./a>->maddr./a>[index./a>];o6220./a>ti.6 66 ti.6 66 }o6221./a>ti.6 66 ti.6 66 spin_unlock./a>(&vdata./a>->lock./a>);o6222./a>ti.6 66 }o6223./a>o6224./a>ti.6 66 if (vdata./a>->typ ./a> == MSPEC_FETCHOP./a>)o6225./a>ti.6 66 ti.6 66 paddr./a> = TO_AMO./a>(maddr./a>);o6226./a>ti.6 66 elseo6227./a>ti.6 66 ti.6 66 paddr./a> = maddr./a> & ~__IA64_UNCACHED_OFFSET./a>;o6228./a>o6229./a>ti.6 66 pfn./a> = paddr./a> >> PAGE_SHIFT./a>;o6230./a>o6231./a>ti.6 66 .spau class="comment">/*./spaue=6232./a>.spau class="comment">         * vm_insert_pfn cau fail with -EBUSY, but in that case it will./spaue=6233./a>.spau class="comment">         * be because another thread has installed the pte first, so it./spaue=6234./a>.spau class="comment">         * is no problem../spaue=6235./a>.spau class="comment">         */./spaue=6236./a>ti.6 66 vm_insert_pfn./a>(vma./a>, (unsigned long)vmf./a>->virtual_address./a>, pfn./a>);o6237./a>o6238./a>ti.6 66 return VM_FAULT_NOPAGE./a>;o6239./a>}o6240./a>o6241./a>static const struct vm_operations_struct./a>t.a href="+code=mspec_vm_ops" class="sref">mspec_vm_ops./a> = {=6242./a>ti.6 66 ..a href="+code=open" class="sref">open./a> = mspec_open./a>,=6243./a>ti.6 66 ..a href="+code=close" class="sref">close./a> = mspec_close./a>,=6142./a>.spau cl244">624u39./32=L1954.c#L244" id vL2 vL142">6142./a>ef="+code=i" class="sref">i./a>=0; 6drivers/char/mspeEd vss="sref">i./a>=0; 6dr">mspec_vm_ops./a> = {=624u39./32=L1954.c#L244" id vL24>6219./a>ti.6 66 ti.6 66 I>e/mspeEd vss="sref111" id vL111" class="line" nam  vL111">id vL111" class="line" nam  vL111">id vchar/mspec.c#L125" id vL125" class="line2 inf="+code=i" class="srefc mspec_open./sp101./a>o6123./a>ti.6 66 ti.6 66 ti href vL123">6123./a>ti.6 66 ti.6 66 ti hrefhref="+code=mspec_open" class="sref">mti.6 24" class="line" nam  vL139">6139./a>.spau class="comment"> * (via fork, munmap, 2ata./a> =2614tioa>.spau class="comment"> * Called whe
	a devic2f">at1mic2inc./a>(&.spau cl clait="lines6 84./a>.lass=a 6219.ss=ndl)));lass="comment"> * Called whe
	a devic2fns_structline" nam  vL152">6152./2>o6158./a>.spa neam  aryL158" ia>ti., track,a namc#L2spau class="comment"> * underlying mspec da2" class="2ine" nam  vL153">6153./a2.spau25a href="drivers/char/mspec.c#L143" id vL1pau class="comment"> * This structure is shar2ers/char/2spec.c#L154" id vL154" c2ass="2ine" nam  vL154">6154./a>.sp.6 66 .a href=+code=mspec_fault" class="sref">mspeers/char/2spec.c#L156" id vL156" c2ass="25ruct" class="sref">vm_areamd v1954.c#L244" id vL24>spau c" class="sref">vma./a>, sfilspau cl244">624ufils>->624ufils>-&g">vmf./a>)=vm_fault./a>t*mspeer/mspec.c mapping. Frees all mspe2 page25=maddr" class="sref">maddr./aaaaaaaaaaaaaaaaalass="sref">typ ./a>; .spau class="comment">/* Typ  1f pages allocated. */./spaue=6163./a>ti.6 66 int 6125addr./a> >st_index./a>;o6163./a>ti.6 66_sine c class="line" nam  ./a>)=(struct 6162./2>ti.626.c#L112" id vLa> == 6205./a>ti206"  vLc#L11!ti.6 66         return v2a_data./a>t*6130./a>tiEINVAL int index./2>, my_page./a>;otyp ./a>  == )=61899SHARe"c.c#66 ti.6 66         return 6166./a2ti.6 26lass="sref">TO_AMO./aar/mspe-c.c#L206" id vLEINVAL130">6130./a>tiEINVAL int 6168./a2ti.6 267"sref">typ ./a>  == )=623WRITnc.c#66 ti.6 66         return at1mic_dec_and_te2t./a>26age./a>(621EPER  int 6171./a2ti.6 27a" class="sref">vdata./a>-&gpau c href="drivers/chpau c cend./a> - vm_start./a>) >>>;o;o6172./a>ti.6 66 for (last_i2dex./a> = (vdata./a>->.6 66_sine163">6163./a>ti.6 66_sine c cendsineofclass="sref">vma./a>, strivers/char/mspec.c#L163" id vL163) +ef">vdata./a>-&gpau c href="drivers/chpau c ce*dsineofcf">vi (v2a> = 0; in/a> == 6163./a>ti.6 66_sine c ceef">ef="driverl244">6"line" nam  vL182">6182./a>ti.6 66 ti.(maddclass="line" nam  vL163">6163./a>ti.6 66 intref="driverl244">6kz" ia>163">6163./a>tikz" ia>f">vmf./a>->6163./a>ti.6 66_sine c class="line" nam  GFP_ar/mEL130">6130./a>tiGFP_ar/mELef="drivers/char/mspec.c#L238" id vL238ivers/cha2/mspec.c#L175" id vL175"2class2"line" nam  vL6 ti.6 66 ti.6 66 6163./a>ti.6 66 intref="driverl244">6vz" ia>163">6163./a>tivz" ia>f">vmf./a>->6163./a>ti.6 66_sine c cdrivers/char/mspec.c#L238" id vL238ir/mspec.c before sticking it back2/spau27=maddr" class="sref">ss="line" nam  ./a>)=6189./a>ti.6 66 ti.rivers/char/mspec.c#L238" id vL238i class="2./spaue=typ .rivers/char/mspec.c#L241" id vL241aue=6192./a>}o = vdata.ar/mspe-c.c#L206" id vLENOME nam  vL212">621ENOME  ti.rivers/char/mspec.c#L238" id vL238sref">vda2a./a>->mspec_zero_b2ock./28 class="sref">vdata./a>->.6 66PEC_FETCHOP" class="sref">MSPEC_FETCHOP./a>)206T./a>;ov2ge" class="sref">uncache2_free2page./a>(vdata./a>->.6 66PEC_FETCHOP" class="sref">MSPEC_FETCHOP./a>)206de=vm_start" class="sref">vm_vm_private_data./a>;oindex./2" id vL184" class="line"2nam  2L184">6184./a>>vdata./a>->.6 66PEC_FETCHOP" class="sref">MSPEC_FETCHOP./a>)./a>)=printk./a>(index./a> = MSPEC_FETCHOP./a>)ovm./a>);o6222./a>ti.6 66 }o618728" class="sref">vma./a>, (uns=refcnt="+code=len" class=refcnt="+f">vm./a>);o6169./a>ti.6 66 ti ti.6 66 ti.6 66 6188./a2ti.6 28="+code=vdata" class="sref">a>;o6206./a>oindex./6 66 ti.6 66 ->pfn.sref">vfr2e./a>(vma./a>->)=6223_PFNMA"61899DONTEXPAN"6223_DONTDUM"ex./6 66 ti.6 66 6291./a>ti.6 66 /a> == MSPEC_FETCHOP./a>)o6225./a>ti.6 66 ti. ||ic.c#L239" id vLde=MSPEC_FETCHOP" class="sref">MSPEC_FETCHOP./a>)o nam  vL225">6225./a>6228./a>ref="ivers/char/mspec.c#L241" id vL241sref">kfr2e./a>(vdata./a>);ovmf./a>->;o6193./2>o(vdata./a>->.>;oa>ti.6 66 ..a./a>);o6242./a>ti.6 66 6 66 ti.6 66 index./2ine" nam  vL194">6194./a2.spau2class="comment">/*./spaue=mspevers/char2mspec.c#L199" id vL199" 2lass=2line" n.c#L239" id vLsetchopamd v1954.c#L244" idsetchopamd vf">vmlass="sref">vma./a>, sfilspau cl244">624ufils>->624ufils>-&g">vmf./a>)=vm_fault./a>t*vfr2" class="line" nam  vL202">6202./a>.a6 66 ti.6 66 spau c" c624ufils>-&g">ult./a>t*ult./a>t*6225./a>ti.6 66 ti.66 66 if (!.a href="+code=mspec_ze32" class=3line" nam  vL202">6202./3>ti.630ef="drivers/char/mspec.c#L153" id vL153lass="sre3">paddr./a>, ;omsp3pgoff_t./3>t.a href="+code=index" 3lass=3sref">ult./a>t*vmlass="sref">vma./a>, sfilspau cl244">624ufils>->624ufils>-&g">vmf./a>)=vm_fault./a>t*v3a_data./a>t*v3apec.c#L197" id vL197" c3ti.6 306ec.c#L135" id vL135;ospau c" c624ufils>-&g">ult./a>t*ult./a>t* nam  vL225">6225./a>28./a>ref="6 66 if (!.a href="+code=mspec_ze327sref">v3at to user space../spaue3v3aspec.c#L199" id vL199" 3s/cha30 pfn3sref">mad3r./a> = msp3ss="sref"3maddr./a> == 0)ovmlass="sref">vma./a>, sfilspau cl244">624ufils>->624ufils>-&g">vmf./a>)=vm_fault./a>t*VM_FAU3T_OOM316 unsigned long 6213./a3ti.6 312ec.c#L135" id vL135;ospau c" c624ufils>-&g">ult./a>t*ult./a>t* nam  vL225">6225./a>6228./a>ref="6 66 if (!.a href="+code=mspec_ze3ss="sref"3spin_lock./a>(&->v3ef">vdata./a>->624ufilsf="drivers/ec.c#n.c#L239" id vLsetchopafline" nam  vL242">setchopaflin 66 ..aigned long v3ef">vdata./a>->,=[6182.THIS_MODULasref"gned long v3L218" id vL218" class="l3ne" n3m  vL218">6218open./a>,=v"gned long v3ge" class="sref">uncache3_free3page./a>(,=6222./a>ti.lseeL c" stic.c#L239" id vLnoopallseeL222">6222./a>tinoopallseeLf">v"gned long mad3ef">maddr./a> = id vc3.c#L221" 3d vL221" class="line" na3  vL232const struct spin_unlock./a>(&<3 href32uct./a>t.a hcode=mspec_vm_ops" clamiscspau c1954.c#L244" id iscspau cec.c#n.c#L239" id vLsetchopa iscspa1954.c#L244" idsetchopamiscspa 66 ..aigned long 622332"sref">mspec_open./a>,=622ISC_DYNAMIC_MINORf">v"gned long 6224./a3ti.6 32ss="sref">mspec_close./a>,=6222./a>tin224 c" stic" class="sref">my_page./a>sgi_setchopc.c#L186" id vgned long ->typ .sref">i./a>=0; 6dline" nam  vL242">si.6 66 ..a./a>);osetchopaflin 66 gned long v3r./a> = id vc327" id vL327" class="line" nam  vL327">632f="+code=i" class="srefc mspec_open./3sref">pad3r./a> = t.a href="+code=mspec_vm_ops" clafilsf="drivers/pau cl244">624ufilsf="drivers/ec.c#n.c#L239" id vL/mspec.cline" nam  vL242">/mspec.clin 66 ..aigned long v3ine" nam  vL229">6229./a3ti.6 32age./a>(,=[6182.THIS_MODULasref"gned long  =  >open./a>,=v"gned long 6231./a3ti.6 330ge./a>(,=6222./a>ti.lseeL c" stic.c#L239" id vLnoopallseeL222">6222./a>tinoopallseeLf">v"gned long id vc3n cau fai3 with -EBUSY, but in tha3 case33 ti.6 66 t.a hcode=mspec_vm_ops" clamiscspau c1954.c#L244" id iscspau cec.c#n.c#L239" id vL/mspec.miscspa1954.c#L244" id/mspec.miscspa 66 ..aigned long typ .sref">i./a>=0; 6minoUNCACHED_OFFSET./inoU c" stic.c#L239" id vLMISC_DYNAMIC_MINOR nam  vL225">622ISC_DYNAMIC_MINORf">v"gned long mspec_close./a>,=6222./a>tin224 c" stic" class="sref">my_page./a>39./32=mspecc.c#L186" id vgned long vm_3nsert_pfn./a>(,=si.6 66 ..a./a>);o/mspec.clin 66 gned long pad3ine" nam  vL238">6238./a3ti.6 36 retu11" class="line" nam  vL111">id vc3n8sref">v3ref">VM_FAULT_NOPAGE./a>3opfn30" class=3line" nam  vL240">6240./3>ot.a href="+code=mspec_vm_ops" clafilsf="drivers/pau cl244">624ufilsf="drivers/ec.c#n.c#L239" id vLar/mspec.cline" nam  vL242">ar/mspec.clin 66 ..aigned long 6241./a3stati340ge./a>(,=[6182.THIS_MODULasref"gned long vm_operat3ons_s341ddr./a> >open./a>,=v"gned long mspec_open./a>,=6222./a>ti.lseeL c" stic.c#L239" id vLnoopallseeL222">6222./a>tinoopallseeLf">v"gned long  3 id vc3ode=i" cl3ss="sref">i./a>=0; 6driv3rs/ch34dr" civers/char/mspec.c#L153" id vL153f111" id 3L111" class="line" nam  3L111"345ct./a>t.a hcode=mspec_vm_ops" clamiscspau c1954.c#L244" id iscspau cec.c#n.c#L239" id vLar/mspec.miscspa1954.c#L244" idar/mspec.miscspa 66 ..aigned long vm_3#L125" id vL125" class="3ine2 34=maddr" classopen./a>,=622ISC_DYNAMIC_MINORf">v"gned long o3a href="driver0 nam  vL133">6134  vL218">6218open./a>,=6222./a>tin224 c" stic" class="sref">my_page./a>39./32ar/mspecc.c#L186" id vgned long 3ti.6 34age./a>(,=si.6 66 ..a./a>);oar/mspec.clin 66 gned long id vc3f">at1mic3inc./a>(&6152./3>o6123./a>ti.6 66 ti.6 66 ti hrefhr3" class="3ine" nam  vL153">6153./a3.spau35a href="drivers/char/mspec.c#L39./32ini f"23">6123./a>ti.6 66 ti.6 66 ti hrefhr3"ose./a> 3spec.c#L154" id vL154" c3ass="3ine" nam  vL154">6154./a>.sp.6f"23">6123./a>ti.6 66 ti.6 66 ti hrefhr3"de=i" cl3ivers/char/mspec.c#L155"3id vL3535" id vL235" class="line" n/char/mspat boot timeL158iait="line6 84.ti hr facilitylass="comment"> * This structure is shar3ers/char/3spec.c#L156" id vL156" c3ass="356" class="line" nam  vL196">6 66 vref="+code=vm_insert_pfn" class=3e101./a>o3 sharing this vma_data s3ructu3e../sp;o(void"ivers/char/mspec.c#L241" id vL243vers/char3mspec.c#L159" id vL159" 3lass=35f="drigned long 6135addr./a> >st_index./a>;o >st_index./a>;o6162./3>ti.636.c#L1 struct t*6123./a>ti.6 66 ti.6 66 ti hrefhr3">index./3>, 6123./a>ti.6 66 ti.6 66 ti hrefhr3"de=i" cl3ef">my_page./a>;o6123./a>ti.6 66 ti.6 66 ti hrefhr3"rs/char/3ine" nam  vL166">6166./a3ti.6 36class="line" nam  vL236">6236./a>ti.6 66 ;o6168./a3ti.6 367"sref">typ ./a> ndex./a>;oia64_platform_in c" c<" class="sref">my_page./a>sn2c.c#L186" id )i.6 66 ti.6 66 at1mic_dec_and_te3t./a>36age./a>(is_sn2 66 ..a1# struct vdata./a> ndex./a>;ois_shub2 c" c)i.6 66 ti.6 66 6171./a3ti.6 37a" class="srea>(621ENOME  ti.rivers/char/mspec.c#L238" id vL233f">last_i3dex./a> = (vdata./a>);oef="+codndex./a>;o624ufor_emsp210./a hres c" cult./a>t*6182.N_ONLINaref=".6 66 ti.6 66 (vdata./t_index./a>;oindex./3vdata./a>->maddss="sref">vdata./t_index./a>;oa./a>);oef="+codndex./a>;onuma_node_id./a>(), 1);oi.6 66 ti.6 66 maddr./a> ss="sref">vdata./a> ndex./a>;o(;os#L21scratcho = vdata.a./a>);oef="+codndex./a>;ovda3a./a>->last_i3lass="sref">mspec_zero_b3ock./38s="sref">vdata./a>);oef="+codef="+codndex./a>;ouncache3_free38age./a>(vdata./a> ndex./a>;omaddss="sref">vdata.........go158ndex./a>;os#L21scratchoprintk./a>(618738f="+code=i" class="srefc mspec_open./3" class="3ine" nam  vL188">6188./a3ti.6 38ass="sref">maddr./a> & ~(vfr3e./a>(vdata./a>->6222./a>tipr/t_L/mspec.c#L210" id vLar/m_ERR nam  vL225">62ar/m_ERR="+code=i" class="srefc mspec_open./391" id vL391" class="line" nam  vL391">639a" class="srea>(my_page./a>%s:233" m  vo registea.spau c %i\nc.c#L186" id vgned long kfr3e./a>(vdata./a>);oref">vdata./a>->62ti.6 66_I>ec.c">ult./a>t*6193./3>o(;os#L21scratchoindex./3ine" nam  vL194">6194./a3.spau39dr" class="sref">maddrivers/char/mspec.c#L153" id vL153ers/char/3spec.c#L195" id vL195" c3ass="39pec.c#L135" irivers/char/mspec.c#L153" id vL153ee=vma./a>, (unsr"+code=len" classreec.c#..apec_vm_ops" clamisc_registea href="drivers/misc_registea/mspe./a>);otyp ./a> ndex./a>;o(6222./a>tipr/t_L/mspec.c#L210" id vLar/m_ERR nam  vL225">62ar/m_ERR="+co<" class="sref">my_page./a>%s:233" m  vo registea.spau c %i\nc.c#L186" id vgned long vfr3" class="line" nam  vL203">62039data" class="sref">vdata./a>ndex./a>;ooI> nam  vL225">62C8./a>oI>ec.c">ult./a>t*is_sn2 66 6 66         return 6202./4>ti.640s="sref">vdata./a>);oef="+codndex./a>;opaddr./a>, ;os#L21scratcho;ot.a href="+code=index" 4lass=40ref">index./a> = typ ./a> ndex./a>;ov4apec.c#L197" id vL197" c4ti.6 40=maddr" class="sref">ss="line" nam  pr/t_L222">6222./a>tipr/t_L/mspec.c#L210" id vLar/m_ERR nam  vL225">62ar/m_ERR="+co<" class="sref">my_page./a>%s:233" m  vo registea.spau c %i\nc.c#L186" id vgned long v4at to user space../spaue4maddr./a> ss="srec.c#L210" id vL6228./a>oI> nam  vL225">626228./a>oI>ec.c">ult./a>t*v4aspec.c#L199" id vL199" 4s/cha40age./a>();omad4r./a> = vdata./a> ndex./a>;ois_sn2 66 6 66         return  == 0)o;oVM_FAU4T_OOM41s="sref">vdata./a>);ogo158ndex./a>;os#L21scratcho6213./a4ti.6 412ec.c#L135" irivers/char/mspec.c#L153" id vL154ss="sref"4spin_lock./a>(&/*./spaue=->index./a> = 6222./a>tipr/t_L/mspec.c#L210" id vLar/m_INFhar/mspec.c#L226ar/m_INFh="+co<" class="sref">my_page./a>%s %s iait="lined.spau cs:2%s %s %s\nc.c#L186" id vgned long v4ef">vdata./a>->BASENAMam  vL182">6182.25./a>BASENAMaec.c">ult./a>t*ult./a>t*is_sn2 66 .?->62ti.6 66_I>ec.c :o<" class="sref">my_page./a>&.c#L186" id vgned long v4ef">vdata./a>->;ooI> nam  vL225">62C8./a>oI>ec.c">ult./a>t*oI> nam  vL225">626228./a>oI>ec.c.6 66 ti.6 66 v4L218" id vL218" class="l4ne" n41 return v4ge" class="sref">uncache4_free41f="drivers/char/mspe.6 66 if (!.a href="+code=mspec_ze4"ref">mad4ef">maddr./a> = ;os#L21scratchospin_unlock./a>(&<4 href42 class="sref">vdata./a>->for_emsp210./pau cl244">624ufor_emsp210.//mspec.c#L210" id vL2="line" nam  vL210ipec.c".6 66 ti.6 66 622342age./a>(6224./a4ti.6 42dr" class="sref">maddss="sref;oi.6 66 ti.6 66 ->v4r./a> = v427" class="line" nam  vL427">642f="+crivers/char/mspec.c#L153" id vL154"7sref">v4r./a> = v4ine" nam  vL229">6229./a4ti.6 42age./ href="void class="line" na_oexi href="drivers/c__exi return mad4ref="+code=paddr" class=4sref"4paddr.ndex./a>;o6231./a4ti.6 430ge./6 66 ti.6 66 ;o6184./a>>vdata./a>->misc_deregistea href="drivers/misc_deregistea/mspe./a>);oindex./a> = );otyp ./a> ndex./a>;ois_sn2 66 6.6 66 ti.6 66 vm_4nsert_pfn./a>(ss="line" nam  misc_deregistea href="drivers/misc_deregistea/mspe./a>);opad4ine" nam  vL238">6238./a4ti.6 43 return v4ref">VM_FAULT_NOPAGE./a>4o(624ufor_emsp210.//mspec.c#L210" id vL2="line" nam  vL210ipec.c".6 66 ti.6 66 6240./4>ovdata./a>-/a> ndex./a>;o6241./a4stati44a" class="srea>(;o(), 1);oi.6 66 ti.6 66 vm_operat4ons_s44s="sref">vdata./a>);orivers/char/mspec.c#L153" id vL154o cau fai4a href="+code=mspec_open4 clas442ec.c#L135" irivers/char/mspec.c#L153" id vL154lose./a> 4 i./a>=0; 6driv4rs/ch44dr" civers/char/mspec.c#L153" id vL154f111" id 4L111" class="line" nam  4L111"445ct./ss="line" nam  modulesini href="drivers/c3odulesini /mspec.c#L210" id vL" clasini href="drivers/c39./32ini f"a>.6 66 ti.6 66 vm_4#L125" id vL125" class="4ine2 44=maddss="line" nam  modulesexi href="drivers/cmodulesexi /mspec.c#L210" id vL" clasexi href="drivers/cm9./32exi /msp.6 66 ti.6 66 pad4a href="driver0 nam  vL143">6144 return 4ti.6 44ine" n.c#L239" id vLMODULa_AUTHOR nam  vL225">622ODULa_AUTHOR/mspec" class="sref">my_page./a>Silicon Graphics, Inc.eef">claux-altix@sgi.com.c#L1.c#L186" id )6 66 ti.6 66 my_page./a>D at1mic4inc./a>(&6182.2ODULa_LICENSa/mspec" class="sref">my_page./a>GPL1.c#L186" id )6 66 ti.6 66 6152./4>o


p/div>


T84.original"LXR software by6 84.66 ti.6 6http://sourceforge.net/projects/lxa >LXR vL23uni yec.c">this ex"dri36">al"a hrers by666 ti.6 6mailto:lxa@claux.no">lxa@claux.noec.c.
p/div>

lxa.claux.no kindly hosted by666 ti.6 6http://www.redpill-clapro.no">Redpill Llapro ASec.c">provider of Llauxhref=ultinga nam="drivers/ serau cs since 1995.
p/div>