* [PATCH] add need definitions to libxc for x86-64
@ 2005-05-17 16:59 Jerone Young
2005-05-18 20:50 ` David Hopwood
0 siblings, 1 reply; 2+ messages in thread
From: Jerone Young @ 2005-05-17 16:59 UTC (permalink / raw)
To: xen-devel
[-- Attachment #1: Type: text/plain, Size: 230 bytes --]
This patch adds need definitions to xc_private.h so that libxc can be
x86-64 enabled.
Signed-off-by: Jerone Young <jyoung5@us.ibm.com>
--
Jerone Young
IBM Linux Technology Center
jyoung5@us.ibm.com
512-838-1157 (T/L: 678-1157)
[-- Attachment #2: libxc_x64_xc_private_patch.diff --]
[-- Type: text/x-patch, Size: 1815 bytes --]
--- xen-unstable.orig/tools/libxc/xc_private.h 2005-03-18 22:33:27.000000000 -0600
+++ xen-unstable/tools/libxc/xc_private.h 2005-03-19 19:30:35.000000000 -0600
@@ -29,12 +29,25 @@
#define _PAGE_PSE 0x080
#define _PAGE_GLOBAL 0x100
-
+#if defined(__i386__)
#define L1_PAGETABLE_SHIFT 12
#define L2_PAGETABLE_SHIFT 22
-
+#elif defined(__x86_64__)
+#define L1_PAGETABLE_SHIFT 12
+#define L2_PAGETABLE_SHIFT 21
+#define L3_PAGETABLE_SHIFT 30
+#define L4_PAGETABLE_SHIFT 39
+#endif
+
+#if defined(__i386__)
#define ENTRIES_PER_L1_PAGETABLE 1024
#define ENTRIES_PER_L2_PAGETABLE 1024
+#elif defined(__x86_64__)
+#define L1_PAGETABLE_ENTRIES 512
+#define L2_PAGETABLE_ENTRIES 512
+#define L3_PAGETABLE_ENTRIES 512
+#define L4_PAGETABLE_ENTRIES 512
+#endif
#define PAGE_SHIFT L1_PAGETABLE_SHIFT
#define PAGE_SIZE (1UL << PAGE_SHIFT)
@@ -42,11 +55,26 @@
typedef unsigned long l1_pgentry_t;
typedef unsigned long l2_pgentry_t;
+#if defined(__x86_64__)
+typedef unsigned long l3_pgentry_t;
+typedef unsigned long l4_pgentry_t;
+#endif
+#if defined(__i386__)
#define l1_table_offset(_a) \
(((_a) >> L1_PAGETABLE_SHIFT) & (ENTRIES_PER_L1_PAGETABLE - 1))
#define l2_table_offset(_a) \
((_a) >> L2_PAGETABLE_SHIFT)
+#elif defined(__x86_64__)
+#define l1_table_offset(_a) \
+ (((_a) >> L1_PAGETABLE_SHIFT) & (L1_PAGETABLE_ENTRIES - 1))
+#define l2_table_offset(_a) \
+ (((_a) >> L2_PAGETABLE_SHIFT) & (L2_PAGETABLE_ENTRIES - 1))
+#define l3_table_offset(_a) \
+ (((_a) >> L3_PAGETABLE_SHIFT) & (L3_PAGETABLE_ENTRIES - 1))
+#define l4_table_offset(_a) \
+ (((_a) >> L4_PAGETABLE_SHIFT) & (L4_PAGETABLE_ENTRIES - 1))
+#endif
#define ERROR(_m, _a...) \
fprintf(stderr, "ERROR: " _m "\n" , ## _a )
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] add need definitions to libxc for x86-64
2005-05-17 16:59 [PATCH] add need definitions to libxc for x86-64 Jerone Young
@ 2005-05-18 20:50 ` David Hopwood
0 siblings, 0 replies; 2+ messages in thread
From: David Hopwood @ 2005-05-18 20:50 UTC (permalink / raw)
To: xen-devel
Jerone Young wrote:
> This patch adds need definitions to xc_private.h so that libxc can be
> x86-64 enabled.
> +#if defined(__i386__)
> #define ENTRIES_PER_L1_PAGETABLE 1024
> #define ENTRIES_PER_L2_PAGETABLE 1024
> +#elif defined(__x86_64__)
> +#define L1_PAGETABLE_ENTRIES 512
> +#define L2_PAGETABLE_ENTRIES 512
> +#define L3_PAGETABLE_ENTRIES 512
> +#define L4_PAGETABLE_ENTRIES 512
> +#endif
Why aren't these named consistently (all "ENTRIES_PER_Lx_PAGETABLE" or
all "Lx_PAGETABLE_ENTRIES")?
--
David Hopwood <david.nospam.hopwood@blueyonder.co.uk>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-05-18 20:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-17 16:59 [PATCH] add need definitions to libxc for x86-64 Jerone Young
2005-05-18 20:50 ` David Hopwood
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.