summaryrefslogtreecommitdiff
path: root/bridges/inc
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2009-01-20 10:20:47 +0000
committerVladimir Glazounov <vg@openoffice.org>2009-01-20 10:20:47 +0000
commitbb490edf4371d7a792a3fb4d7ac9dd0abed129f8 (patch)
tree77ad2ba4eb0131f06adf0aa6d29b4b98f57942b8 /bridges/inc
parentc6762e7b75a3bea150ebefa827679e485f01c9f7 (diff)
CWS-TOOLING: integrate CWS selinux01
2009-01-13 12:54:38 +0100 cmc r266213 : #i97320# might as well be silent if we fallback 2009-01-07 11:17:16 +0100 cmc r265957 : #i97320# use a double-mmap of an anonymous file under linux to keep onside of selinux
Diffstat (limited to 'bridges/inc')
-rw-r--r--bridges/inc/bridges/cpp_uno/shared/vtablefactory.hxx25
1 files changed, 25 insertions, 0 deletions
diff --git a/bridges/inc/bridges/cpp_uno/shared/vtablefactory.hxx b/bridges/inc/bridges/cpp_uno/shared/vtablefactory.hxx
index bed106b49db0..9d7fe10df838 100644
--- a/bridges/inc/bridges/cpp_uno/shared/vtablefactory.hxx
+++ b/bridges/inc/bridges/cpp_uno/shared/vtablefactory.hxx
@@ -39,6 +39,11 @@
#include <hash_map>
+/*See: http://people.redhat.com/drepper/selinux-mem.html*/
+#ifdef LINUX
+#define USE_DOUBLE_MMAP
+#endif
+
namespace bridges { namespace cpp_uno { namespace shared {
/** Hand out vtable structures for interface type descriptions.
@@ -63,6 +68,18 @@ public:
*/
void * start;
+#ifdef USE_DOUBLE_MMAP
+ /** When seperately mmapping the block for writing and executing
+ exec points to the same memory as start, except start is used
+ exclusively for writing and exec for executing
+ */
+ void * exec;
+
+ /** File handle for the underlying anonymous file
+ */
+ int fd;
+#endif
+
/** The size of the raw vtable block, in bytes.
*/
sal_Size size;
@@ -111,6 +128,8 @@ private:
VtableFactory(VtableFactory &); // not implemented
void operator =(VtableFactory); // not implemented
+ bool createBlock(Block &block, sal_Int32 slotCount) const;
+
void freeBlock(Block const & block) const;
void createVtables(
@@ -151,6 +170,9 @@ private:
given type
@param code points to the start of the area where code snippets can be
generated
+ @param writetoexecdiff when the same code area is mmaped twice, once for
+ writing for code-generation, and once for code-execution, then this
+ records the offset from a writable address to its executable address
@param type the interface type description for which to generate vtable
slots
@param functionOffset the function offset of the first vtable slot
@@ -165,6 +187,9 @@ private:
*/
static unsigned char * addLocalFunctions(
Slot ** slots, unsigned char * code,
+#ifdef USE_DOUBLE_MMAP
+ sal_PtrDiff writetoexecdiff,
+#endif
typelib_InterfaceTypeDescription const * type, sal_Int32 functionOffset,
sal_Int32 functionCount, sal_Int32 vtableOffset);