server: Processor dependent fallbacks in init_page_size (try 2)
André Hentschel
nerv at dawncrow.de
Sun Oct 2 08:28:21 CDT 2011
This time taking x86_64 into the faster way
---
server/mapping.c | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/server/mapping.c b/server/mapping.c
index f37016f..6fffe44 100644
--- a/server/mapping.c
+++ b/server/mapping.c
@@ -108,14 +108,14 @@ static const struct fd_ops mapping_fd_ops =
static struct list shared_list = LIST_INIT(shared_list);
-#ifdef __i386__
+#if defined(__i386__) || defined(__x86_64__)
-/* These are always the same on an i386, and it will be faster this way */
+/* These are always the same on an i386/x86_64, and it will be faster this way */
# define page_mask 0xfff
# define page_shift 12
# define init_page_size() do { /* nothing */ } while(0)
-#else /* __i386__ */
+#else /* defined(__i386__) || defined(__x86_64__) */
static int page_shift, page_mask;
@@ -127,6 +127,10 @@ static void init_page_size(void)
# else
# ifdef __svr4__
page_size = sysconf(_SC_PAGESIZE);
+# elif defined(__arm__) || defined(__powerpc__)
+ page_size = 4096;
+# elif defined(__sparc__)
+ page_size = 8192;
# else
# error Cannot get the page size on this platform
# endif
@@ -137,7 +141,7 @@ static void init_page_size(void)
page_shift = 0;
while ((1 << page_shift) != page_size) page_shift++;
}
-#endif /* __i386__ */
+#endif /* defined(__i386__) || defined(__x86_64__) */
#define ROUND_SIZE(size) (((size) + page_mask) & ~page_mask)
--
Best Regards, André Hentschel
More information about the wine-patches
mailing list