aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-um
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-um')
-rw-r--r--include/asm-um/alternative-asm.i6
-rw-r--r--include/asm-um/frame.i6
-rw-r--r--include/asm-um/pgtable-2level.h2
-rw-r--r--include/asm-um/pgtable-3level.h5
-rw-r--r--include/asm-um/pgtable.h4
-rw-r--r--include/asm-um/processor-generic.h8
-rw-r--r--include/asm-um/ptrace-generic.h14
-rw-r--r--include/asm-um/ptrace-x86_64.h7
8 files changed, 25 insertions, 27 deletions
diff --git a/include/asm-um/alternative-asm.i b/include/asm-um/alternative-asm.i
new file mode 100644
index 000000000000..cae9faca132f
--- /dev/null
+++ b/include/asm-um/alternative-asm.i
@@ -0,0 +1,6 @@
1#ifndef __UM_ALTERNATIVE_ASM_I
2#define __UM_ALTERNATIVE_ASM_I
3
4#include "asm/arch/alternative-asm.i"
5
6#endif
diff --git a/include/asm-um/frame.i b/include/asm-um/frame.i
new file mode 100644
index 000000000000..09d5dca5d928
--- /dev/null
+++ b/include/asm-um/frame.i
@@ -0,0 +1,6 @@
1#ifndef __UM_FRAME_I
2#define __UM_FRAME_I
3
4#include "asm/arch/frame.i"
5
6#endif
diff --git a/include/asm-um/pgtable-2level.h b/include/asm-um/pgtable-2level.h
index ffe017f6b64b..6050e0eb257e 100644
--- a/include/asm-um/pgtable-2level.h
+++ b/include/asm-um/pgtable-2level.h
@@ -41,7 +41,7 @@ static inline void pgd_mkuptodate(pgd_t pgd) { }
41#define pfn_pte(pfn, prot) __pte(pfn_to_phys(pfn) | pgprot_val(prot)) 41#define pfn_pte(pfn, prot) __pte(pfn_to_phys(pfn) | pgprot_val(prot))
42#define pfn_pmd(pfn, prot) __pmd(pfn_to_phys(pfn) | pgprot_val(prot)) 42#define pfn_pmd(pfn, prot) __pmd(pfn_to_phys(pfn) | pgprot_val(prot))
43 43
44#define pmd_page_kernel(pmd) \ 44#define pmd_page_vaddr(pmd) \
45 ((unsigned long) __va(pmd_val(pmd) & PAGE_MASK)) 45 ((unsigned long) __va(pmd_val(pmd) & PAGE_MASK))
46 46
47/* 47/*
diff --git a/include/asm-um/pgtable-3level.h b/include/asm-um/pgtable-3level.h
index 786c25727289..ca0c2a92a112 100644
--- a/include/asm-um/pgtable-3level.h
+++ b/include/asm-um/pgtable-3level.h
@@ -74,11 +74,12 @@ extern inline void pud_clear (pud_t *pud)
74 set_pud(pud, __pud(0)); 74 set_pud(pud, __pud(0));
75} 75}
76 76
77#define pud_page(pud) \ 77#define pud_page(pud) phys_to_page(pud_val(pud) & PAGE_MASK)
78#define pud_page_vaddr(pud) \
78 ((struct page *) __va(pud_val(pud) & PAGE_MASK)) 79 ((struct page *) __va(pud_val(pud) & PAGE_MASK))
79 80
80/* Find an entry in the second-level page table.. */ 81/* Find an entry in the second-level page table.. */
81#define pmd_offset(pud, address) ((pmd_t *) pud_page(*(pud)) + \ 82#define pmd_offset(pud, address) ((pmd_t *) pud_page_vaddr(*(pud)) + \
82 pmd_index(address)) 83 pmd_index(address))
83 84
84static inline unsigned long pte_pfn(pte_t pte) 85static inline unsigned long pte_pfn(pte_t pte)
diff --git a/include/asm-um/pgtable.h b/include/asm-um/pgtable.h
index ac64eb955868..4862daf8b906 100644
--- a/include/asm-um/pgtable.h
+++ b/include/asm-um/pgtable.h
@@ -349,7 +349,7 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
349 return pte; 349 return pte;
350} 350}
351 351
352#define pmd_page_kernel(pmd) ((unsigned long) __va(pmd_val(pmd) & PAGE_MASK)) 352#define pmd_page_vaddr(pmd) ((unsigned long) __va(pmd_val(pmd) & PAGE_MASK))
353 353
354/* 354/*
355 * the pgd page can be thought of an array like this: pgd_t[PTRS_PER_PGD] 355 * the pgd page can be thought of an array like this: pgd_t[PTRS_PER_PGD]
@@ -389,7 +389,7 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
389 */ 389 */
390#define pte_index(address) (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)) 390#define pte_index(address) (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
391#define pte_offset_kernel(dir, address) \ 391#define pte_offset_kernel(dir, address) \
392 ((pte_t *) pmd_page_kernel(*(dir)) + pte_index(address)) 392 ((pte_t *) pmd_page_vaddr(*(dir)) + pte_index(address))
393#define pte_offset_map(dir, address) \ 393#define pte_offset_map(dir, address) \
394 ((pte_t *)page_address(pmd_page(*(dir))) + pte_index(address)) 394 ((pte_t *)page_address(pmd_page(*(dir))) + pte_index(address))
395#define pte_offset_map_nested(dir, address) pte_offset_map(dir, address) 395#define pte_offset_map_nested(dir, address) pte_offset_map(dir, address)
diff --git a/include/asm-um/processor-generic.h b/include/asm-um/processor-generic.h
index 824c28896382..d99bbddffdb9 100644
--- a/include/asm-um/processor-generic.h
+++ b/include/asm-um/processor-generic.h
@@ -13,6 +13,7 @@ struct task_struct;
13#include "asm/ptrace.h" 13#include "asm/ptrace.h"
14#include "choose-mode.h" 14#include "choose-mode.h"
15#include "registers.h" 15#include "registers.h"
16#include "sysdep/archsetjmp.h"
16 17
17struct mm_struct; 18struct mm_struct;
18 19
@@ -43,8 +44,7 @@ struct thread_struct {
43#endif 44#endif
44#ifdef CONFIG_MODE_SKAS 45#ifdef CONFIG_MODE_SKAS
45 struct { 46 struct {
46 void *switch_buf; 47 jmp_buf switch_buf;
47 void *fork_buf;
48 int mm_count; 48 int mm_count;
49 } skas; 49 } skas;
50#endif 50#endif
@@ -138,9 +138,7 @@ extern struct cpuinfo_um cpu_data[];
138 138
139#ifdef CONFIG_MODE_SKAS 139#ifdef CONFIG_MODE_SKAS
140#define KSTK_REG(tsk, reg) \ 140#define KSTK_REG(tsk, reg) \
141 ({ union uml_pt_regs regs; \ 141 get_thread_reg(reg, &tsk->thread.mode.skas.switch_buf)
142 get_thread_regs(&regs, tsk->thread.mode.skas.switch_buf); \
143 UPT_REG(&regs, reg); })
144#else 142#else
145#define KSTK_REG(tsk, reg) (0xbadbabe) 143#define KSTK_REG(tsk, reg) (0xbadbabe)
146#endif 144#endif
diff --git a/include/asm-um/ptrace-generic.h b/include/asm-um/ptrace-generic.h
index a36f5371b36b..99c87c5ce994 100644
--- a/include/asm-um/ptrace-generic.h
+++ b/include/asm-um/ptrace-generic.h
@@ -8,19 +8,7 @@
8 8
9#ifndef __ASSEMBLY__ 9#ifndef __ASSEMBLY__
10 10
11 11#include "asm/arch/ptrace-abi.h"
12#define pt_regs pt_regs_subarch
13#define show_regs show_regs_subarch
14#define send_sigtrap send_sigtrap_subarch
15
16#include "asm/arch/ptrace.h"
17
18#undef pt_regs
19#undef show_regs
20#undef send_sigtrap
21#undef user_mode
22#undef instruction_pointer
23
24#include "sysdep/ptrace.h" 12#include "sysdep/ptrace.h"
25 13
26struct pt_regs { 14struct pt_regs {
diff --git a/include/asm-um/ptrace-x86_64.h b/include/asm-um/ptrace-x86_64.h
index c894e68b1f96..03b4af4ac09a 100644
--- a/include/asm-um/ptrace-x86_64.h
+++ b/include/asm-um/ptrace-x86_64.h
@@ -11,21 +11,20 @@
11#include "asm/errno.h" 11#include "asm/errno.h"
12#include "asm/host_ldt.h" 12#include "asm/host_ldt.h"
13 13
14#define signal_fault signal_fault_x86_64
15#define __FRAME_OFFSETS /* Needed to get the R* macros */ 14#define __FRAME_OFFSETS /* Needed to get the R* macros */
16#include "asm/ptrace-generic.h" 15#include "asm/ptrace-generic.h"
17#undef signal_fault
18 16
19#define HOST_AUDIT_ARCH AUDIT_ARCH_X86_64 17#define HOST_AUDIT_ARCH AUDIT_ARCH_X86_64
20 18
21void signal_fault(struct pt_regs_subarch *regs, void *frame, char *where); 19/* Also defined in sysdep/ptrace.h, so may already be defined. */
22 20#ifndef FS_BASE
23#define FS_BASE (21 * sizeof(unsigned long)) 21#define FS_BASE (21 * sizeof(unsigned long))
24#define GS_BASE (22 * sizeof(unsigned long)) 22#define GS_BASE (22 * sizeof(unsigned long))
25#define DS (23 * sizeof(unsigned long)) 23#define DS (23 * sizeof(unsigned long))
26#define ES (24 * sizeof(unsigned long)) 24#define ES (24 * sizeof(unsigned long))
27#define FS (25 * sizeof(unsigned long)) 25#define FS (25 * sizeof(unsigned long))
28#define GS (26 * sizeof(unsigned long)) 26#define GS (26 * sizeof(unsigned long))
27#endif
29 28
30#define PT_REGS_RBX(r) UPT_RBX(&(r)->regs) 29#define PT_REGS_RBX(r) UPT_RBX(&(r)->regs)
31#define PT_REGS_RCX(r) UPT_RCX(&(r)->regs) 30#define PT_REGS_RCX(r) UPT_RCX(&(r)->regs)