summaryrefslogtreecommitdiff
path: root/src/runtime/c/pgf/lightning/i386/funcs.h
diff options
context:
space:
mode:
authorkr.angelov <kr.angelov@gmail.com>2013-06-20 08:27:04 +0000
committerkr.angelov <kr.angelov@gmail.com>2013-06-20 08:27:04 +0000
commitfa7ac00838827672f5c4a08dd1a37021285326e6 (patch)
treeafa7fced77a8eb31ff83793bc206022094c369c5 /src/runtime/c/pgf/lightning/i386/funcs.h
parentf8073ea1cd935154a50b0b9b8221db1254119100 (diff)
add x86_64 support to GNU lightning
Diffstat (limited to 'src/runtime/c/pgf/lightning/i386/funcs.h')
-rw-r--r--src/runtime/c/pgf/lightning/i386/funcs.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/runtime/c/pgf/lightning/i386/funcs.h b/src/runtime/c/pgf/lightning/i386/funcs.h
index e90cfa430..c35849956 100644
--- a/src/runtime/c/pgf/lightning/i386/funcs.h
+++ b/src/runtime/c/pgf/lightning/i386/funcs.h
@@ -7,14 +7,14 @@
/***********************************************************************
*
- * Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
+ * Copyright 2000, 2001, 2002, 2006 Free Software Foundation, Inc.
* Written by Paolo Bonzini.
*
* This file is part of GNU lightning.
*
* GNU lightning is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1, or (at your option)
+ * by the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* GNU lightning is distributed in the hope that it will be useful, but
@@ -24,8 +24,8 @@
*
* You should have received a copy of the GNU Lesser General Public License
* along with GNU lightning; see the file COPYING.LESSER; if not, write to the
- * Free Software Foundation, 59 Temple Place - Suite 330, Boston,
- * MA 02111-1307, USA.
+ * Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
*
***********************************************************************/
@@ -62,7 +62,7 @@ jit_flush_code(void *dest, void *end)
page_size = sysconf (_SC_PAGESIZE);
#endif
- page = (unsigned long) dest & ~(page_size - 1);
+ page = (long) dest & ~(page_size - 1);
length = ((char *) end - (char *) page + page_size - 1) & ~(page_size - 1);
/* Simple-minded attempt at optimizing the common case where a single
@@ -79,7 +79,8 @@ jit_flush_code(void *dest, void *end)
/* See if we can extend the previously mprotect'ed memory area towards
lower addresses: the highest address remains the same as before. */
- else if (page < prev_page && page + length <= prev_page + prev_length)
+ else if (page < prev_page && page + length >= prev_page
+ && page + length <= prev_page + prev_length)
prev_length += prev_page - page, prev_page = page;
/* Nothing to do, replace the area. */