summaryrefslogtreecommitdiff
path: root/virt
diff options
context:
space:
mode:
authorMario Smarduch <m.smarduch@samsung.com>2015-01-15 15:58:52 -0800
committerChristoffer Dall <christoffer.dall@linaro.org>2015-01-16 14:40:14 +0100
commita6d5101661c88d642b1fc85657fb0c58da821aa7 (patch)
tree09c2aa154c076abf729f27818f3787692126ef94 /virt
parent924de80db9cab3e2ee53933deee7945e81808151 (diff)
KVM: Add architecture-defined TLB flush support
Allow architectures to override the generic kvm_flush_remote_tlbs() function via HAVE_KVM_ARCH_TLB_FLUSH_ALL. ARMv7 will need this to provide its own TLB flush interface. Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org> Reviewed-by: Marc Zyngier <marc.zyngier@arm.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Mario Smarduch <m.smarduch@samsung.com>
Diffstat (limited to 'virt')
-rw-r--r--virt/kvm/Kconfig3
-rw-r--r--virt/kvm/kvm_main.c2
2 files changed, 5 insertions, 0 deletions
diff --git a/virt/kvm/Kconfig b/virt/kvm/Kconfig
index fc0c5e603eb4..3796a2132a06 100644
--- a/virt/kvm/Kconfig
+++ b/virt/kvm/Kconfig
@@ -37,3 +37,6 @@ config HAVE_KVM_CPU_RELAX_INTERCEPT
config KVM_VFIO
bool
+
+config HAVE_KVM_ARCH_TLB_FLUSH_ALL
+ bool
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 167e8c14b143..d03bd2255801 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -176,6 +176,7 @@ bool kvm_make_all_cpus_request(struct kvm *kvm, unsigned int req)
return called;
}
+#ifndef CONFIG_HAVE_KVM_ARCH_TLB_FLUSH_ALL
void kvm_flush_remote_tlbs(struct kvm *kvm)
{
long dirty_count = kvm->tlbs_dirty;
@@ -186,6 +187,7 @@ void kvm_flush_remote_tlbs(struct kvm *kvm)
cmpxchg(&kvm->tlbs_dirty, dirty_count, 0);
}
EXPORT_SYMBOL_GPL(kvm_flush_remote_tlbs);
+#endif
void kvm_reload_remote_mmus(struct kvm *kvm)
{
pup main, development code repositoryroot
summaryrefslogtreecommitdiff
path: root/autodoc/inc/ary/ary.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'autodoc/inc/ary/ary.hxx')
-rw-r--r--autodoc/inc/ary/ary.hxx90
1 files changed, 90 insertions, 0 deletions
diff --git a/autodoc/inc/ary/ary.hxx b/autodoc/inc/ary/ary.hxx
new file mode 100644
index 000000000000..9b1afeebba3f
--- /dev/null
+++ b/autodoc/inc/ary/ary.hxx
@@ -0,0 +1,90 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org 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 version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef ARY_ARY_HXX
+#define ARY_ARY_HXX
+
+
+// USED SERVICES
+ // BASE CLASSES
+ // OTHER
+
+namespace ary
+{
+namespace idl
+{
+ class Gate;
+}
+
+namespace cpp
+{
+ class Gate;
+}
+}
+
+
+
+namespace ary
+{
+
+/** Starting point for all work with the
+ Autodoc Sourcecode Repository.
+
+ Create and destroy the repository and
+ give access to the "Gates" for different tasks.
+
+ @collab ::ary::cpp::Gate
+ @collab ::ary::idl::Gate
+*/
+
+class Repository
+{
+ public:
+ // LIFECYCLE
+ virtual ~Repository() {}
+ static DYN Repository &
+ Create_();
+ // INQUIRY
+ virtual const String &
+ Title() const = 0;
+ virtual const ::ary::cpp::Gate &
+ Gate_Cpp() const = 0;
+ virtual const ::ary::idl::Gate &
+ Gate_Idl() const = 0;
+ // ACCESS
+ virtual ::ary::cpp::Gate &
+ Gate_Cpp() = 0;
+ virtual ::ary::idl::Gate &
+ Gate_Idl() = 0;
+ virtual void Set_Title(
+ const String & i_sName ) = 0;
+};
+
+
+
+} // namespace ary
+#endif
it doesn't need to */ static int FreeCo (pmap, client, color, npixIn, ppixIn, mask) ColormapPtr pmap; /* which colormap head */ int client; int color; /* which sub-map, eg RED, BLUE, PSEUDO */ int npixIn; /* number of pixels passed in */ Pixel *ppixIn; /* list of base pixels */ Pixel mask; /* mask client gave us */ { Pixel *ppixClient, pixTest; int npixClient, npixNew, npix; Pixel bits, base, cmask, rgbbad; Pixel *pptr, *cptr; int n, zapped; int errVal = Success; int offset, numents; #ifdef LBX Bool grabbed; Bool zeroRefCount; Bool anyRefCountReachedZero = 0; #endif if (npixIn == 0) return (errVal); bits = 0; zapped = 0; base = lowbit (mask); switch(color) { case REDMAP: cmask = pmap->pVisual->redMask; rgbbad = ~RGBMASK(pmap->pVisual); offset = pmap->pVisual->offsetRed; numents = (cmask >> offset) + 1; ppixClient = pmap->clientPixelsRed[client]; npixClient = pmap->numPixelsRed[client]; break; case GREENMAP: cmask = pmap->pVisual->greenMask; rgbbad = ~RGBMASK(pmap->pVisual); offset = pmap->pVisual->offsetGreen; numents = (cmask >> offset) + 1; ppixClient = pmap->clientPixelsGreen[client]; npixClient = pmap->numPixelsGreen[client]; break; case BLUEMAP: cmask = pmap->pVisual->blueMask; rgbbad = ~RGBMASK(pmap->pVisual); offset = pmap->pVisual->offsetBlue; numents = (cmask >> offset) + 1; ppixClient = pmap->clientPixelsBlue[client]; npixClient = pmap->numPixelsBlue[client]; break; default: /* so compiler can see that everything gets initialized */ case PSEUDOMAP: cmask = ~((Pixel)0); rgbbad = 0; offset = 0; numents = pmap->pVisual->ColormapEntries; ppixClient = pmap->clientPixelsRed[client]; npixClient = pmap->numPixelsRed[client]; break; } #ifdef LBX grabbed = LbxCheckCmapGrabbed (pmap); if (grabbed) { /* * If the colormap is grabbed by a proxy, the server must * notify the proxy of all cells that are freed (the refcount * has reached zero on these cells). */ LbxBeginFreeCellsEvent (pmap); LbxSortPixelList (ppixIn, npixIn); } #endif /* zap all pixels which match */ while (1) { /* go through pixel list */ for (pptr = ppixIn, n = npixIn; --n >= 0; pptr++) { pixTest = ((*pptr | bits) & cmask) >> offset; if ((pixTest >= numents) || (*pptr & rgbbad)) { clientErrorValue = *pptr | bits; errVal = BadValue; continue; } /* find match in client list */ for (cptr = ppixClient, npix = npixClient; --npix >= 0 && *cptr != pixTest; cptr++) ; if (npix >= 0) { if (pmap->class & DynamicClass) { FreeCell(pmap, pixTest, color); #ifdef LBX /* * Only PSEUDO colormaps are grabbed by LBX proxies. * Check if the ref count reached zero on this pixel. */ zeroRefCount = pmap->red[pixTest].refcnt == 0; if (zeroRefCount) anyRefCountReachedZero = 1; if (grabbed && zeroRefCount) LbxAddFreeCellToEvent (pmap, pixTest); #endif } *cptr = ~((Pixel)0); zapped++; } else errVal = BadAccess; } /* generate next bits value */ GetNextBitsOrBreak(bits, mask, base); } #ifdef LBX if (grabbed) LbxEndFreeCellsEvent (pmap); else if (anyRefCountReachedZero) { /* * We only send LbxFreeCell events to a proxy that has the colormap * grabbed. If the colormap is not grabbed, the proxy that last * had the colormap grabbed will not be able to do a smart grab * in the future. A smart grab can only occur if the proxy is kept * up to date on every alloc/free change in the colormap. */ LbxDisableSmartGrab (pmap); } #endif /* delete freed pixels from client pixel list */ if (zapped) { npixNew = npixClient - zapped; if (npixNew) { /* Since the list can only get smaller, we can do a copy in * place and then realloc to a smaller size */ pptr = cptr = ppixClient; /* If we have all the new pixels, we don't have to examine the * rest of the old ones */ for(npix = 0; npix < npixNew; cptr++) { if (*cptr != ~((Pixel)0)) { *pptr++ = *cptr; npix++; } } pptr = (Pixel *)xrealloc(ppixClient, npixNew * sizeof(Pixel)); if (pptr) ppixClient = pptr; npixClient = npixNew; } else { npixClient = 0; xfree(ppixClient); ppixClient = (Pixel *)NULL; } switch(color) { case PSEUDOMAP: case REDMAP: pmap->clientPixelsRed[client] = ppixClient; pmap->numPixelsRed[client] = npixClient; break; case GREENMAP: pmap->clientPixelsGreen[client] = ppixClient; pmap->numPixelsGreen[client] = npixClient; break; case BLUEMAP: pmap->clientPixelsBlue[client] = ppixClient; pmap->numPixelsBlue[client] = npixClient; break; } } return (errVal); } /* Redefine color values */ int StoreColors (pmap, count, defs) ColormapPtr pmap; int count; xColorItem *defs; { register Pixel pix; register xColorItem *pdef; register EntryPtr pent, pentT, pentLast; register VisualPtr pVisual; SHAREDCOLOR *pred, *pgreen, *pblue; int n, ChgRed, ChgGreen, ChgBlue, idef; int class, errVal = Success; int ok; class = pmap->class; if(!(class & DynamicClass) && !(pmap->flags & BeingCreated)) { return(BadAccess); } pVisual = pmap->pVisual; idef = 0; if((class | DynamicClass) == DirectColor) { int numred, numgreen, numblue; Pixel rgbbad; numred = NUMRED(pVisual); numgreen = NUMGREEN(pVisual); numblue = NUMBLUE(pVisual); rgbbad = ~RGBMASK(pVisual); for (pdef = defs, n = 0; n < count; pdef++, n++) { ok = TRUE; (*pmap->pScreen->ResolveColor) (&pdef->red, &pdef->green, &pdef->blue, pmap->pVisual); if (pdef->pixel & rgbbad) { errVal = BadValue; clientErrorValue = pdef->pixel; continue; } pix = (pdef->pixel & pVisual->redMask) >> pVisual->offsetRed; if (pix >= numred) { errVal = BadValue; ok = FALSE; } else if (pmap->red[pix].refcnt != AllocPrivate) { errVal = BadAccess; ok = FALSE; } else if (pdef->flags & DoRed) { pmap->red[pix].co.local.red = pdef->red; } else { pdef->red = pmap->red[pix].co.local.red; } pix = (pdef->pixel & pVisual->greenMask) >> pVisual->offsetGreen; if (pix >= numgreen) { errVal = BadValue; ok = FALSE; } else if (pmap->green[pix].refcnt != AllocPrivate) { errVal = BadAccess; ok = FALSE; } else if (pdef->flags & DoGreen) { pmap->green[pix].co.local.green = pdef->green; } else { pdef->green = pmap->green[pix].co.local.green; } pix = (pdef->pixel & pVisual->blueMask) >> pVisual->offsetBlue; if (pix >= numblue) { errVal = BadValue; ok = FALSE; } else if (pmap->blue[pix].refcnt != AllocPrivate) { errVal = BadAccess; ok = FALSE; } else if (pdef->flags & DoBlue) { pmap->blue[pix].co.local.blue = pdef->blue; } else { pdef->blue = pmap->blue[pix].co.local.blue; } /* If this is an o.k. entry, then it gets added to the list * to be sent to the hardware. If not, skip it. Once we've * skipped one, we have to copy all the others. */ if(ok) { if(idef != n) defs[idef] = defs[n]; idef++; } else clientErrorValue = pdef->pixel; } } else { for (pdef = defs, n = 0; n < count; pdef++, n++) { ok = TRUE; if (pdef->pixel >= pVisual->ColormapEntries) { clientErrorValue = pdef->pixel; errVal = BadValue; ok = FALSE; } else if (pmap->red[pdef->pixel].refcnt != AllocPrivate) { errVal = BadAccess; ok = FALSE; } /* If this is an o.k. entry, then it gets added to the list * to be sent to the hardware. If not, skip it. Once we've * skipped one, we have to copy all the others. */ if(ok) { if(idef != n) defs[idef] = defs[n]; idef++; } else continue; (*pmap->pScreen->ResolveColor) (&pdef->red, &pdef->green, &pdef->blue, pmap->pVisual); pent = &pmap->red[pdef->pixel]; if(pdef->flags & DoRed) { if(pent->fShared) { pent->co.shco.red->color = pdef->red; if (pent->co.shco.red->refcnt > 1) ok = FALSE; } else pent->co.local.red = pdef->red; } else { if(pent->fShared) pdef->red = pent->co.shco.red->color; else pdef->red = pent->co.local.red; } if(pdef->flags & DoGreen) { if(pent->fShared) { pent->co.shco.green->color = pdef->green; if (pent->co.shco.green->refcnt > 1) ok = FALSE; } else pent->co.local.green = pdef->green; } else { if(pent->fShared) pdef->green = pent->co.shco.green->color; else pdef->green = pent->co.local.green; } if(pdef->flags & DoBlue) { if(pent->fShared) { pent->co.shco.blue->color = pdef->blue; if (pent->co.shco.blue->refcnt > 1) ok = FALSE; } else pent->co.local.blue = pdef->blue; } else { if(pent->fShared) pdef->blue = pent->co.shco.blue->color; else pdef->blue = pent->co.local.blue; } if(!ok) { /* have to run through the colormap and change anybody who * shares this value */ pred = pent->co.shco.red; pgreen = pent->co.shco.green; pblue = pent->co.shco.blue; ChgRed = pdef->flags & DoRed; ChgGreen = pdef->flags & DoGreen; ChgBlue = pdef->flags & DoBlue; pentLast = pmap->red + pVisual->ColormapEntries; for(pentT = pmap->red; pentT < pentLast; pentT++) { if(pentT->fShared && (pentT != pent)) { xColorItem defChg; /* There are, alas, devices in this world too dumb * to read their own hardware colormaps. Sick, but * true. So we're going to be really nice and load * the xColorItem with the proper value for all the * fields. We will only set the flags for those * fields that actually change. Smart devices can * arrange to change only those fields. Dumb devices * can rest assured that we have provided for them, * and can change all three fields */ defChg.flags = 0; if(ChgRed && pentT->co.shco.red == pred) { defChg.flags |= DoRed; } if(ChgGreen && pentT->co.shco.green == pgreen) { defChg.flags |= DoGreen; } if(ChgBlue && pentT->co.shco.blue == pblue) { defChg.flags |= DoBlue; } if(defChg.flags != 0) { defChg.pixel = pentT - pmap->red; defChg.red = pentT->co.shco.red->color; defChg.green = pentT->co.shco.green->color; defChg.blue = pentT->co.shco.blue->color; (*pmap->pScreen->StoreColors) (pmap, 1, &defChg); } } } } } } /* Note that we use idef, the count of acceptable entries, and not * count, the count of proposed entries */ if (idef != 0) ( *pmap->pScreen->StoreColors) (pmap, idef, defs); return (errVal); } int IsMapInstalled(map, pWin) Colormap map; WindowPtr pWin; { Colormap *pmaps; int imap, nummaps, found; pmaps = (Colormap *) ALLOCATE_LOCAL( pWin->drawable.pScreen->maxInstalledCmaps * sizeof(Colormap)); if(!pmaps) return(FALSE); nummaps = (*pWin->drawable.pScreen->ListInstalledColormaps) (pWin->drawable.pScreen, pmaps); found = FALSE; for(imap = 0; imap < nummaps; imap++) { if(pmaps[imap] == map) { found = TRUE; break; } } DEALLOCATE_LOCAL(pmaps); return (found); }