All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jerone Young <jyoung5@us.ibm.com>
To: xen-devel <xen-devel@lists.xensource.com>
Subject: [PATCH] add need definitions to libxc for x86-64
Date: Tue, 17 May 2005 11:59:35 -0500	[thread overview]
Message-ID: <1116349175.7641.3.camel@thinkpad> (raw)

[-- 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

             reply	other threads:[~2005-05-17 16:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-17 16:59 Jerone Young [this message]
2005-05-18 20:50 ` [PATCH] add need definitions to libxc for x86-64 David Hopwood

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1116349175.7641.3.camel@thinkpad \
    --to=jyoung5@us.ibm.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.