diff options
Diffstat (limited to 'include/asm-powerpc')
-rw-r--r-- | include/asm-powerpc/dma-mapping.h | 2 | ||||
-rw-r--r-- | include/asm-powerpc/kvm_ppc.h | 3 | ||||
-rw-r--r-- | include/asm-powerpc/namei.h | 20 | ||||
-rw-r--r-- | include/asm-powerpc/pgtable-4k.h | 2 | ||||
-rw-r--r-- | include/asm-powerpc/pgtable-64k.h | 2 | ||||
-rw-r--r-- | include/asm-powerpc/pgtable-ppc64.h | 4 | ||||
-rw-r--r-- | include/asm-powerpc/ptrace.h | 1 | ||||
-rw-r--r-- | include/asm-powerpc/signal.h | 3 | ||||
-rw-r--r-- | include/asm-powerpc/smp.h | 2 | ||||
-rw-r--r-- | include/asm-powerpc/syscall.h | 84 | ||||
-rw-r--r-- | include/asm-powerpc/thread_info.h | 5 | ||||
-rw-r--r-- | include/asm-powerpc/topology.h | 2 |
12 files changed, 103 insertions, 27 deletions
diff --git a/include/asm-powerpc/dma-mapping.h b/include/asm-powerpc/dma-mapping.h index 74c549780987..c7ca45f97dd2 100644 --- a/include/asm-powerpc/dma-mapping.h +++ b/include/asm-powerpc/dma-mapping.h | |||
@@ -415,7 +415,7 @@ static inline void dma_sync_sg_for_device(struct device *dev, | |||
415 | __dma_sync_page(sg_page(sg), sg->offset, sg->length, direction); | 415 | __dma_sync_page(sg_page(sg), sg->offset, sg->length, direction); |
416 | } | 416 | } |
417 | 417 | ||
418 | static inline int dma_mapping_error(dma_addr_t dma_addr) | 418 | static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr) |
419 | { | 419 | { |
420 | #ifdef CONFIG_PPC64 | 420 | #ifdef CONFIG_PPC64 |
421 | return (dma_addr == DMA_ERROR_CODE); | 421 | return (dma_addr == DMA_ERROR_CODE); |
diff --git a/include/asm-powerpc/kvm_ppc.h b/include/asm-powerpc/kvm_ppc.h index 5a21115228af..a8b068792260 100644 --- a/include/asm-powerpc/kvm_ppc.h +++ b/include/asm-powerpc/kvm_ppc.h | |||
@@ -61,7 +61,8 @@ extern int kvmppc_emulate_mmio(struct kvm_run *run, struct kvm_vcpu *vcpu); | |||
61 | 61 | ||
62 | extern void kvmppc_mmu_map(struct kvm_vcpu *vcpu, u64 gvaddr, gfn_t gfn, | 62 | extern void kvmppc_mmu_map(struct kvm_vcpu *vcpu, u64 gvaddr, gfn_t gfn, |
63 | u64 asid, u32 flags); | 63 | u64 asid, u32 flags); |
64 | extern void kvmppc_mmu_invalidate(struct kvm_vcpu *vcpu, u64 eaddr, u64 asid); | 64 | extern void kvmppc_mmu_invalidate(struct kvm_vcpu *vcpu, gva_t eaddr, |
65 | gva_t eend, u32 asid); | ||
65 | extern void kvmppc_mmu_priv_switch(struct kvm_vcpu *vcpu, int usermode); | 66 | extern void kvmppc_mmu_priv_switch(struct kvm_vcpu *vcpu, int usermode); |
66 | 67 | ||
67 | extern void kvmppc_check_and_deliver_interrupts(struct kvm_vcpu *vcpu); | 68 | extern void kvmppc_check_and_deliver_interrupts(struct kvm_vcpu *vcpu); |
diff --git a/include/asm-powerpc/namei.h b/include/asm-powerpc/namei.h deleted file mode 100644 index 657443474a6a..000000000000 --- a/include/asm-powerpc/namei.h +++ /dev/null | |||
@@ -1,20 +0,0 @@ | |||
1 | #ifndef _ASM_POWERPC_NAMEI_H | ||
2 | #define _ASM_POWERPC_NAMEI_H | ||
3 | |||
4 | #ifdef __KERNEL__ | ||
5 | |||
6 | /* | ||
7 | * Adapted from include/asm-alpha/namei.h | ||
8 | * | ||
9 | * Included from fs/namei.c | ||
10 | */ | ||
11 | |||
12 | /* This dummy routine maybe changed to something useful | ||
13 | * for /usr/gnemul/ emulation stuff. | ||
14 | * Look at asm-sparc/namei.h for details. | ||
15 | */ | ||
16 | |||
17 | #define __emul_prefix() NULL | ||
18 | |||
19 | #endif /* __KERNEL__ */ | ||
20 | #endif /* _ASM_POWERPC_NAMEI_H */ | ||
diff --git a/include/asm-powerpc/pgtable-4k.h b/include/asm-powerpc/pgtable-4k.h index c9601dfb4a1e..6b18ba9d2d85 100644 --- a/include/asm-powerpc/pgtable-4k.h +++ b/include/asm-powerpc/pgtable-4k.h | |||
@@ -46,6 +46,8 @@ | |||
46 | #define _PAGE_GROUP_IX 0x7000 /* software: HPTE index within group */ | 46 | #define _PAGE_GROUP_IX 0x7000 /* software: HPTE index within group */ |
47 | #define _PAGE_F_SECOND _PAGE_SECONDARY | 47 | #define _PAGE_F_SECOND _PAGE_SECONDARY |
48 | #define _PAGE_F_GIX _PAGE_GROUP_IX | 48 | #define _PAGE_F_GIX _PAGE_GROUP_IX |
49 | #define _PAGE_SPECIAL 0x10000 /* software: special page */ | ||
50 | #define __HAVE_ARCH_PTE_SPECIAL | ||
49 | 51 | ||
50 | /* PTE flags to conserve for HPTE identification */ | 52 | /* PTE flags to conserve for HPTE identification */ |
51 | #define _PAGE_HPTEFLAGS (_PAGE_BUSY | _PAGE_HASHPTE | \ | 53 | #define _PAGE_HPTEFLAGS (_PAGE_BUSY | _PAGE_HASHPTE | \ |
diff --git a/include/asm-powerpc/pgtable-64k.h b/include/asm-powerpc/pgtable-64k.h index 7e54adb35596..07b0d8f09cb6 100644 --- a/include/asm-powerpc/pgtable-64k.h +++ b/include/asm-powerpc/pgtable-64k.h | |||
@@ -70,6 +70,8 @@ static inline struct subpage_prot_table *pgd_subpage_prot(pgd_t *pgd) | |||
70 | #define PGDIR_MASK (~(PGDIR_SIZE-1)) | 70 | #define PGDIR_MASK (~(PGDIR_SIZE-1)) |
71 | 71 | ||
72 | /* Additional PTE bits (don't change without checking asm in hash_low.S) */ | 72 | /* Additional PTE bits (don't change without checking asm in hash_low.S) */ |
73 | #define __HAVE_ARCH_PTE_SPECIAL | ||
74 | #define _PAGE_SPECIAL 0x00000400 /* software: special page */ | ||
73 | #define _PAGE_HPTE_SUB 0x0ffff000 /* combo only: sub pages HPTE bits */ | 75 | #define _PAGE_HPTE_SUB 0x0ffff000 /* combo only: sub pages HPTE bits */ |
74 | #define _PAGE_HPTE_SUB0 0x08000000 /* combo only: first sub page */ | 76 | #define _PAGE_HPTE_SUB0 0x08000000 /* combo only: first sub page */ |
75 | #define _PAGE_COMBO 0x10000000 /* this is a combo 4k page */ | 77 | #define _PAGE_COMBO 0x10000000 /* this is a combo 4k page */ |
diff --git a/include/asm-powerpc/pgtable-ppc64.h b/include/asm-powerpc/pgtable-ppc64.h index ba8000352b9a..5fc78c0be302 100644 --- a/include/asm-powerpc/pgtable-ppc64.h +++ b/include/asm-powerpc/pgtable-ppc64.h | |||
@@ -245,7 +245,7 @@ static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_RW;} | |||
245 | static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY;} | 245 | static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY;} |
246 | static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED;} | 246 | static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED;} |
247 | static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE;} | 247 | static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE;} |
248 | static inline int pte_special(pte_t pte) { return 0; } | 248 | static inline int pte_special(pte_t pte) { return pte_val(pte) & _PAGE_SPECIAL; } |
249 | 249 | ||
250 | static inline void pte_uncache(pte_t pte) { pte_val(pte) |= _PAGE_NO_CACHE; } | 250 | static inline void pte_uncache(pte_t pte) { pte_val(pte) |= _PAGE_NO_CACHE; } |
251 | static inline void pte_cache(pte_t pte) { pte_val(pte) &= ~_PAGE_NO_CACHE; } | 251 | static inline void pte_cache(pte_t pte) { pte_val(pte) &= ~_PAGE_NO_CACHE; } |
@@ -265,7 +265,7 @@ static inline pte_t pte_mkyoung(pte_t pte) { | |||
265 | static inline pte_t pte_mkhuge(pte_t pte) { | 265 | static inline pte_t pte_mkhuge(pte_t pte) { |
266 | return pte; } | 266 | return pte; } |
267 | static inline pte_t pte_mkspecial(pte_t pte) { | 267 | static inline pte_t pte_mkspecial(pte_t pte) { |
268 | return pte; } | 268 | pte_val(pte) |= _PAGE_SPECIAL; return pte; } |
269 | static inline unsigned long pte_pgprot(pte_t pte) | 269 | static inline unsigned long pte_pgprot(pte_t pte) |
270 | { | 270 | { |
271 | return __pgprot(pte_val(pte)) & PAGE_PROT_BITS; | 271 | return __pgprot(pte_val(pte)) & PAGE_PROT_BITS; |
diff --git a/include/asm-powerpc/ptrace.h b/include/asm-powerpc/ptrace.h index 3d6e31024e56..734e0754fb9b 100644 --- a/include/asm-powerpc/ptrace.h +++ b/include/asm-powerpc/ptrace.h | |||
@@ -84,6 +84,7 @@ struct pt_regs { | |||
84 | #ifndef __ASSEMBLY__ | 84 | #ifndef __ASSEMBLY__ |
85 | 85 | ||
86 | #define instruction_pointer(regs) ((regs)->nip) | 86 | #define instruction_pointer(regs) ((regs)->nip) |
87 | #define user_stack_pointer(regs) ((regs)->gpr[1]) | ||
87 | #define regs_return_value(regs) ((regs)->gpr[3]) | 88 | #define regs_return_value(regs) ((regs)->gpr[3]) |
88 | 89 | ||
89 | #ifdef CONFIG_SMP | 90 | #ifdef CONFIG_SMP |
diff --git a/include/asm-powerpc/signal.h b/include/asm-powerpc/signal.h index a8c7babf4950..a7360cdd99eb 100644 --- a/include/asm-powerpc/signal.h +++ b/include/asm-powerpc/signal.h | |||
@@ -122,8 +122,7 @@ typedef struct sigaltstack { | |||
122 | 122 | ||
123 | #ifdef __KERNEL__ | 123 | #ifdef __KERNEL__ |
124 | struct pt_regs; | 124 | struct pt_regs; |
125 | extern int do_signal(sigset_t *oldset, struct pt_regs *regs); | 125 | extern void do_signal(struct pt_regs *regs, unsigned long thread_info_flags); |
126 | extern int do_signal32(sigset_t *oldset, struct pt_regs *regs); | ||
127 | #define ptrace_signal_deliver(regs, cookie) do { } while (0) | 126 | #define ptrace_signal_deliver(regs, cookie) do { } while (0) |
128 | #endif /* __KERNEL__ */ | 127 | #endif /* __KERNEL__ */ |
129 | 128 | ||
diff --git a/include/asm-powerpc/smp.h b/include/asm-powerpc/smp.h index 416d4c288cea..4d28e1e4521b 100644 --- a/include/asm-powerpc/smp.h +++ b/include/asm-powerpc/smp.h | |||
@@ -62,6 +62,8 @@ extern int smp_hw_index[]; | |||
62 | #endif | 62 | #endif |
63 | 63 | ||
64 | DECLARE_PER_CPU(cpumask_t, cpu_sibling_map); | 64 | DECLARE_PER_CPU(cpumask_t, cpu_sibling_map); |
65 | DECLARE_PER_CPU(cpumask_t, cpu_core_map); | ||
66 | extern int cpu_to_core_id(int cpu); | ||
65 | 67 | ||
66 | /* Since OpenPIC has only 4 IPIs, we use slightly different message numbers. | 68 | /* Since OpenPIC has only 4 IPIs, we use slightly different message numbers. |
67 | * | 69 | * |
diff --git a/include/asm-powerpc/syscall.h b/include/asm-powerpc/syscall.h new file mode 100644 index 000000000000..efa7f0b879f3 --- /dev/null +++ b/include/asm-powerpc/syscall.h | |||
@@ -0,0 +1,84 @@ | |||
1 | /* | ||
2 | * Access to user system call parameters and results | ||
3 | * | ||
4 | * Copyright (C) 2008 Red Hat, Inc. All rights reserved. | ||
5 | * | ||
6 | * This copyrighted material is made available to anyone wishing to use, | ||
7 | * modify, copy, or redistribute it subject to the terms and conditions | ||
8 | * of the GNU General Public License v.2. | ||
9 | * | ||
10 | * See asm-generic/syscall.h for descriptions of what we must do here. | ||
11 | */ | ||
12 | |||
13 | #ifndef _ASM_SYSCALL_H | ||
14 | #define _ASM_SYSCALL_H 1 | ||
15 | |||
16 | #include <linux/sched.h> | ||
17 | |||
18 | static inline long syscall_get_nr(struct task_struct *task, | ||
19 | struct pt_regs *regs) | ||
20 | { | ||
21 | return TRAP(regs) == 0xc00 ? regs->gpr[0] : -1L; | ||
22 | } | ||
23 | |||
24 | static inline void syscall_rollback(struct task_struct *task, | ||
25 | struct pt_regs *regs) | ||
26 | { | ||
27 | regs->gpr[3] = regs->orig_gpr3; | ||
28 | } | ||
29 | |||
30 | static inline long syscall_get_error(struct task_struct *task, | ||
31 | struct pt_regs *regs) | ||
32 | { | ||
33 | return (regs->ccr & 0x1000) ? -regs->gpr[3] : 0; | ||
34 | } | ||
35 | |||
36 | static inline long syscall_get_return_value(struct task_struct *task, | ||
37 | struct pt_regs *regs) | ||
38 | { | ||
39 | return regs->gpr[3]; | ||
40 | } | ||
41 | |||
42 | static inline void syscall_set_return_value(struct task_struct *task, | ||
43 | struct pt_regs *regs, | ||
44 | int error, long val) | ||
45 | { | ||
46 | if (error) { | ||
47 | regs->ccr |= 0x1000L; | ||
48 | regs->gpr[3] = -error; | ||
49 | } else { | ||
50 | regs->ccr &= ~0x1000L; | ||
51 | regs->gpr[3] = val; | ||
52 | } | ||
53 | } | ||
54 | |||
55 | static inline void syscall_get_arguments(struct task_struct *task, | ||
56 | struct pt_regs *regs, | ||
57 | unsigned int i, unsigned int n, | ||
58 | unsigned long *args) | ||
59 | { | ||
60 | BUG_ON(i + n > 6); | ||
61 | #ifdef CONFIG_PPC64 | ||
62 | if (test_tsk_thread_flag(task, TIF_32BIT)) { | ||
63 | /* | ||
64 | * Zero-extend 32-bit argument values. The high bits are | ||
65 | * garbage ignored by the actual syscall dispatch. | ||
66 | */ | ||
67 | while (n-- > 0) | ||
68 | args[n] = (u32) regs->gpr[3 + i + n]; | ||
69 | return; | ||
70 | } | ||
71 | #endif | ||
72 | memcpy(args, ®s->gpr[3 + i], n * sizeof(args[0])); | ||
73 | } | ||
74 | |||
75 | static inline void syscall_set_arguments(struct task_struct *task, | ||
76 | struct pt_regs *regs, | ||
77 | unsigned int i, unsigned int n, | ||
78 | const unsigned long *args) | ||
79 | { | ||
80 | BUG_ON(i + n > 6); | ||
81 | memcpy(®s->gpr[3 + i], args, n * sizeof(args[0])); | ||
82 | } | ||
83 | |||
84 | #endif /* _ASM_SYSCALL_H */ | ||
diff --git a/include/asm-powerpc/thread_info.h b/include/asm-powerpc/thread_info.h index a9db562df69a..9665a26a253a 100644 --- a/include/asm-powerpc/thread_info.h +++ b/include/asm-powerpc/thread_info.h | |||
@@ -108,6 +108,7 @@ static inline struct thread_info *current_thread_info(void) | |||
108 | #define TIF_SECCOMP 10 /* secure computing */ | 108 | #define TIF_SECCOMP 10 /* secure computing */ |
109 | #define TIF_RESTOREALL 11 /* Restore all regs (implies NOERROR) */ | 109 | #define TIF_RESTOREALL 11 /* Restore all regs (implies NOERROR) */ |
110 | #define TIF_NOERROR 12 /* Force successful syscall return */ | 110 | #define TIF_NOERROR 12 /* Force successful syscall return */ |
111 | #define TIF_NOTIFY_RESUME 13 /* callback before returning to user */ | ||
111 | #define TIF_FREEZE 14 /* Freezing for suspend */ | 112 | #define TIF_FREEZE 14 /* Freezing for suspend */ |
112 | #define TIF_RUNLATCH 15 /* Is the runlatch enabled? */ | 113 | #define TIF_RUNLATCH 15 /* Is the runlatch enabled? */ |
113 | #define TIF_ABI_PENDING 16 /* 32/64 bit switch needed */ | 114 | #define TIF_ABI_PENDING 16 /* 32/64 bit switch needed */ |
@@ -125,12 +126,14 @@ static inline struct thread_info *current_thread_info(void) | |||
125 | #define _TIF_SECCOMP (1<<TIF_SECCOMP) | 126 | #define _TIF_SECCOMP (1<<TIF_SECCOMP) |
126 | #define _TIF_RESTOREALL (1<<TIF_RESTOREALL) | 127 | #define _TIF_RESTOREALL (1<<TIF_RESTOREALL) |
127 | #define _TIF_NOERROR (1<<TIF_NOERROR) | 128 | #define _TIF_NOERROR (1<<TIF_NOERROR) |
129 | #define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME) | ||
128 | #define _TIF_FREEZE (1<<TIF_FREEZE) | 130 | #define _TIF_FREEZE (1<<TIF_FREEZE) |
129 | #define _TIF_RUNLATCH (1<<TIF_RUNLATCH) | 131 | #define _TIF_RUNLATCH (1<<TIF_RUNLATCH) |
130 | #define _TIF_ABI_PENDING (1<<TIF_ABI_PENDING) | 132 | #define _TIF_ABI_PENDING (1<<TIF_ABI_PENDING) |
131 | #define _TIF_SYSCALL_T_OR_A (_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SECCOMP) | 133 | #define _TIF_SYSCALL_T_OR_A (_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SECCOMP) |
132 | 134 | ||
133 | #define _TIF_USER_WORK_MASK (_TIF_SIGPENDING | _TIF_NEED_RESCHED) | 135 | #define _TIF_USER_WORK_MASK (_TIF_SIGPENDING | _TIF_NEED_RESCHED | \ |
136 | _TIF_NOTIFY_RESUME) | ||
134 | #define _TIF_PERSYSCALL_MASK (_TIF_RESTOREALL|_TIF_NOERROR) | 137 | #define _TIF_PERSYSCALL_MASK (_TIF_RESTOREALL|_TIF_NOERROR) |
135 | 138 | ||
136 | /* Bits in local_flags */ | 139 | /* Bits in local_flags */ |
diff --git a/include/asm-powerpc/topology.h b/include/asm-powerpc/topology.h index 100c6fbfc587..c32da6f97999 100644 --- a/include/asm-powerpc/topology.h +++ b/include/asm-powerpc/topology.h | |||
@@ -108,6 +108,8 @@ static inline void sysfs_remove_device_from_node(struct sys_device *dev, | |||
108 | #include <asm/smp.h> | 108 | #include <asm/smp.h> |
109 | 109 | ||
110 | #define topology_thread_siblings(cpu) (per_cpu(cpu_sibling_map, cpu)) | 110 | #define topology_thread_siblings(cpu) (per_cpu(cpu_sibling_map, cpu)) |
111 | #define topology_core_siblings(cpu) (per_cpu(cpu_core_map, cpu)) | ||
112 | #define topology_core_id(cpu) (cpu_to_core_id(cpu)) | ||
111 | #endif | 113 | #endif |
112 | #endif | 114 | #endif |
113 | 115 | ||