提交 f7fe8781 编写于 作者: P Paolo 'Blaisorblade' Giarrusso 提交者: Linus Torvalds

[PATCH] uml: obvious compile fixes for x86-64 Subarch and x86 regression fixes

This patch does some totally trivial compilation fixes.  It also restores the
debugregs manipulation, which was commented out simply because it doesn't
compile on x86_64 (we haven't yet implemented there debugregs handling).
Signed-off-by: NPaolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 1f8d419e
...@@ -98,12 +98,14 @@ long sys_ptrace(long request, long pid, long addr, long data) ...@@ -98,12 +98,14 @@ long sys_ptrace(long request, long pid, long addr, long data)
if(addr < MAX_REG_OFFSET){ if(addr < MAX_REG_OFFSET){
tmp = getreg(child, addr); tmp = getreg(child, addr);
} }
#if defined(CONFIG_UML_X86) && !defined(CONFIG_64BIT)
else if((addr >= offsetof(struct user, u_debugreg[0])) && else if((addr >= offsetof(struct user, u_debugreg[0])) &&
(addr <= offsetof(struct user, u_debugreg[7]))){ (addr <= offsetof(struct user, u_debugreg[7]))){
addr -= offsetof(struct user, u_debugreg[0]); addr -= offsetof(struct user, u_debugreg[0]);
addr = addr >> 2; addr = addr >> 2;
tmp = child->thread.arch.debugregs[addr]; tmp = child->thread.arch.debugregs[addr];
} }
#endif
ret = put_user(tmp, (unsigned long __user *) data); ret = put_user(tmp, (unsigned long __user *) data);
break; break;
} }
...@@ -127,7 +129,7 @@ long sys_ptrace(long request, long pid, long addr, long data) ...@@ -127,7 +129,7 @@ long sys_ptrace(long request, long pid, long addr, long data)
ret = putreg(child, addr, data); ret = putreg(child, addr, data);
break; break;
} }
#if 0 /* XXX x86_64 */ #if defined(CONFIG_UML_X86) && !defined(CONFIG_64BIT)
else if((addr >= offsetof(struct user, u_debugreg[0])) && else if((addr >= offsetof(struct user, u_debugreg[0])) &&
(addr <= offsetof(struct user, u_debugreg[7]))){ (addr <= offsetof(struct user, u_debugreg[7]))){
addr -= offsetof(struct user, u_debugreg[0]); addr -= offsetof(struct user, u_debugreg[0]);
......
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
#include "linux/linkage.h" #include "linux/linkage.h"
#include "linux/slab.h" #include "linux/slab.h"
#include "linux/shm.h" #include "linux/shm.h"
#include "linux/utsname.h"
#include "linux/personality.h"
#include "asm/uaccess.h" #include "asm/uaccess.h"
#define __FRAME_OFFSETS #define __FRAME_OFFSETS
#include "asm/ptrace.h" #include "asm/ptrace.h"
......
#ifndef __UM_IPC_H #include <asm-generic/ipc.h>
#define __UM_IPC_H
#include "asm/arch/ipc.h"
#endif
...@@ -45,6 +45,9 @@ typedef struct { unsigned long pgd; } pgd_t; ...@@ -45,6 +45,9 @@ typedef struct { unsigned long pgd; } pgd_t;
({ (pte).pte_high = (phys) >> 32; \ ({ (pte).pte_high = (phys) >> 32; \
(pte).pte_low = (phys) | pgprot_val(prot); }) (pte).pte_low = (phys) | pgprot_val(prot); })
#define pmd_val(x) ((x).pmd)
#define __pmd(x) ((pmd_t) { (x) } )
typedef unsigned long long pfn_t; typedef unsigned long long pfn_t;
typedef unsigned long long phys_t; typedef unsigned long long phys_t;
......
...@@ -149,7 +149,7 @@ static inline pmd_t pfn_pmd(pfn_t page_nr, pgprot_t pgprot) ...@@ -149,7 +149,7 @@ static inline pmd_t pfn_pmd(pfn_t page_nr, pgprot_t pgprot)
#define pte_to_pgoff(p) ((p).pte >> 32) #define pte_to_pgoff(p) ((p).pte >> 32)
#define pgoff_to_pte(off) ((pte_t) { ((off) < 32) | _PAGE_FILE }) #define pgoff_to_pte(off) ((pte_t) { ((off) << 32) | _PAGE_FILE })
#else #else
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册