diff options
Diffstat (limited to 'include/asm-powerpc')
-rw-r--r-- | include/asm-powerpc/bug.h | 12 | ||||
-rw-r--r-- | include/asm-powerpc/io.h | 1 | ||||
-rw-r--r-- | include/asm-powerpc/kprobes.h | 22 | ||||
-rw-r--r-- | include/asm-powerpc/pgtable-4k.h | 5 | ||||
-rw-r--r-- | include/asm-powerpc/pgtable.h | 11 | ||||
-rw-r--r-- | include/asm-powerpc/ptrace.h | 2 | ||||
-rw-r--r-- | include/asm-powerpc/spinlock.h | 4 | ||||
-rw-r--r-- | include/asm-powerpc/topology.h | 1 | ||||
-rw-r--r-- | include/asm-powerpc/unistd.h | 7 |
9 files changed, 46 insertions, 19 deletions
diff --git a/include/asm-powerpc/bug.h b/include/asm-powerpc/bug.h index f44b529e3298..978b2c7e84ea 100644 --- a/include/asm-powerpc/bug.h +++ b/include/asm-powerpc/bug.h | |||
@@ -70,9 +70,10 @@ struct bug_entry *find_bug(unsigned long bugaddr); | |||
70 | "i" (__FILE__), "i" (__FUNCTION__)); \ | 70 | "i" (__FILE__), "i" (__FUNCTION__)); \ |
71 | } while (0) | 71 | } while (0) |
72 | 72 | ||
73 | #define WARN_ON(x) do { \ | 73 | #define WARN_ON(x) ({ \ |
74 | if (__builtin_constant_p(x)) { \ | 74 | typeof(x) __ret_warn_on = (x); \ |
75 | if (x) \ | 75 | if (__builtin_constant_p(__ret_warn_on)) { \ |
76 | if (__ret_warn_on) \ | ||
76 | __WARN(); \ | 77 | __WARN(); \ |
77 | } else { \ | 78 | } else { \ |
78 | __asm__ __volatile__( \ | 79 | __asm__ __volatile__( \ |
@@ -80,11 +81,12 @@ struct bug_entry *find_bug(unsigned long bugaddr); | |||
80 | ".section __bug_table,\"a\"\n" \ | 81 | ".section __bug_table,\"a\"\n" \ |
81 | "\t"PPC_LONG" 1b,%1,%2,%3\n" \ | 82 | "\t"PPC_LONG" 1b,%1,%2,%3\n" \ |
82 | ".previous" \ | 83 | ".previous" \ |
83 | : : "r" ((long)(x)), \ | 84 | : : "r" (__ret_warn_on), \ |
84 | "i" (__LINE__ + BUG_WARNING_TRAP), \ | 85 | "i" (__LINE__ + BUG_WARNING_TRAP), \ |
85 | "i" (__FILE__), "i" (__FUNCTION__)); \ | 86 | "i" (__FILE__), "i" (__FUNCTION__)); \ |
86 | } \ | 87 | } \ |
87 | } while (0) | 88 | unlikely(__ret_warn_on); \ |
89 | }) | ||
88 | 90 | ||
89 | #define HAVE_ARCH_BUG | 91 | #define HAVE_ARCH_BUG |
90 | #define HAVE_ARCH_BUG_ON | 92 | #define HAVE_ARCH_BUG_ON |
diff --git a/include/asm-powerpc/io.h b/include/asm-powerpc/io.h index 46bae1cf385b..cbbd8c648df1 100644 --- a/include/asm-powerpc/io.h +++ b/include/asm-powerpc/io.h | |||
@@ -11,6 +11,7 @@ | |||
11 | 11 | ||
12 | /* Check of existence of legacy devices */ | 12 | /* Check of existence of legacy devices */ |
13 | extern int check_legacy_ioport(unsigned long base_port); | 13 | extern int check_legacy_ioport(unsigned long base_port); |
14 | #define PNPBIOS_BASE 0xf000 /* only relevant for PReP */ | ||
14 | 15 | ||
15 | #ifndef CONFIG_PPC64 | 16 | #ifndef CONFIG_PPC64 |
16 | #include <asm-ppc/io.h> | 17 | #include <asm-ppc/io.h> |
diff --git a/include/asm-powerpc/kprobes.h b/include/asm-powerpc/kprobes.h index 34e1f89a5fa0..2dafa376a63f 100644 --- a/include/asm-powerpc/kprobes.h +++ b/include/asm-powerpc/kprobes.h | |||
@@ -44,6 +44,28 @@ typedef unsigned int kprobe_opcode_t; | |||
44 | #define IS_TDI(instr) (((instr) & 0xfc000000) == 0x08000000) | 44 | #define IS_TDI(instr) (((instr) & 0xfc000000) == 0x08000000) |
45 | #define IS_TWI(instr) (((instr) & 0xfc000000) == 0x0c000000) | 45 | #define IS_TWI(instr) (((instr) & 0xfc000000) == 0x0c000000) |
46 | 46 | ||
47 | /* | ||
48 | * 64bit powerpc uses function descriptors. | ||
49 | * Handle cases where: | ||
50 | * - User passes a <.symbol> or <module:.symbol> | ||
51 | * - User passes a <symbol> or <module:symbol> | ||
52 | * - User passes a non-existant symbol, kallsyms_lookup_name | ||
53 | * returns 0. Don't deref the NULL pointer in that case | ||
54 | */ | ||
55 | #define kprobe_lookup_name(name, addr) \ | ||
56 | { \ | ||
57 | addr = (kprobe_opcode_t *)kallsyms_lookup_name(name); \ | ||
58 | if (addr) { \ | ||
59 | char *colon; \ | ||
60 | if ((colon = strchr(name, ':')) != NULL) { \ | ||
61 | colon++; \ | ||
62 | if (*colon != '\0' && *colon != '.') \ | ||
63 | addr = *(kprobe_opcode_t **)addr; \ | ||
64 | } else if (name[0] != '.') \ | ||
65 | addr = *(kprobe_opcode_t **)addr; \ | ||
66 | } \ | ||
67 | } | ||
68 | |||
47 | #define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)((func_descr_t *)pentry) | 69 | #define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)((func_descr_t *)pentry) |
48 | 70 | ||
49 | #define is_trap(instr) (IS_TW(instr) || IS_TD(instr) || \ | 71 | #define is_trap(instr) (IS_TW(instr) || IS_TD(instr) || \ |
diff --git a/include/asm-powerpc/pgtable-4k.h b/include/asm-powerpc/pgtable-4k.h index e7036155672e..345d9b07b3e2 100644 --- a/include/asm-powerpc/pgtable-4k.h +++ b/include/asm-powerpc/pgtable-4k.h | |||
@@ -88,10 +88,11 @@ | |||
88 | #define pgd_bad(pgd) (pgd_val(pgd) == 0) | 88 | #define pgd_bad(pgd) (pgd_val(pgd) == 0) |
89 | #define pgd_present(pgd) (pgd_val(pgd) != 0) | 89 | #define pgd_present(pgd) (pgd_val(pgd) != 0) |
90 | #define pgd_clear(pgdp) (pgd_val(*(pgdp)) = 0) | 90 | #define pgd_clear(pgdp) (pgd_val(*(pgdp)) = 0) |
91 | #define pgd_page(pgd) (pgd_val(pgd) & ~PGD_MASKED_BITS) | 91 | #define pgd_page_vaddr(pgd) (pgd_val(pgd) & ~PGD_MASKED_BITS) |
92 | #define pgd_page(pgd) virt_to_page(pgd_page_vaddr(pgd)) | ||
92 | 93 | ||
93 | #define pud_offset(pgdp, addr) \ | 94 | #define pud_offset(pgdp, addr) \ |
94 | (((pud_t *) pgd_page(*(pgdp))) + \ | 95 | (((pud_t *) pgd_page_vaddr(*(pgdp))) + \ |
95 | (((addr) >> PUD_SHIFT) & (PTRS_PER_PUD - 1))) | 96 | (((addr) >> PUD_SHIFT) & (PTRS_PER_PUD - 1))) |
96 | 97 | ||
97 | #define pud_ERROR(e) \ | 98 | #define pud_ERROR(e) \ |
diff --git a/include/asm-powerpc/pgtable.h b/include/asm-powerpc/pgtable.h index 8dbf5ad8150f..10f52743f4ff 100644 --- a/include/asm-powerpc/pgtable.h +++ b/include/asm-powerpc/pgtable.h | |||
@@ -196,8 +196,8 @@ static inline pte_t pfn_pte(unsigned long pfn, pgprot_t pgprot) | |||
196 | || (pmd_val(pmd) & PMD_BAD_BITS)) | 196 | || (pmd_val(pmd) & PMD_BAD_BITS)) |
197 | #define pmd_present(pmd) (pmd_val(pmd) != 0) | 197 | #define pmd_present(pmd) (pmd_val(pmd) != 0) |
198 | #define pmd_clear(pmdp) (pmd_val(*(pmdp)) = 0) | 198 | #define pmd_clear(pmdp) (pmd_val(*(pmdp)) = 0) |
199 | #define pmd_page_kernel(pmd) (pmd_val(pmd) & ~PMD_MASKED_BITS) | 199 | #define pmd_page_vaddr(pmd) (pmd_val(pmd) & ~PMD_MASKED_BITS) |
200 | #define pmd_page(pmd) virt_to_page(pmd_page_kernel(pmd)) | 200 | #define pmd_page(pmd) virt_to_page(pmd_page_vaddr(pmd)) |
201 | 201 | ||
202 | #define pud_set(pudp, pudval) (pud_val(*(pudp)) = (pudval)) | 202 | #define pud_set(pudp, pudval) (pud_val(*(pudp)) = (pudval)) |
203 | #define pud_none(pud) (!pud_val(pud)) | 203 | #define pud_none(pud) (!pud_val(pud)) |
@@ -205,7 +205,8 @@ static inline pte_t pfn_pte(unsigned long pfn, pgprot_t pgprot) | |||
205 | || (pud_val(pud) & PUD_BAD_BITS)) | 205 | || (pud_val(pud) & PUD_BAD_BITS)) |
206 | #define pud_present(pud) (pud_val(pud) != 0) | 206 | #define pud_present(pud) (pud_val(pud) != 0) |
207 | #define pud_clear(pudp) (pud_val(*(pudp)) = 0) | 207 | #define pud_clear(pudp) (pud_val(*(pudp)) = 0) |
208 | #define pud_page(pud) (pud_val(pud) & ~PUD_MASKED_BITS) | 208 | #define pud_page_vaddr(pud) (pud_val(pud) & ~PUD_MASKED_BITS) |
209 | #define pud_page(pud) virt_to_page(pud_page_vaddr(pud)) | ||
209 | 210 | ||
210 | #define pgd_set(pgdp, pudp) ({pgd_val(*(pgdp)) = (unsigned long)(pudp);}) | 211 | #define pgd_set(pgdp, pudp) ({pgd_val(*(pgdp)) = (unsigned long)(pudp);}) |
211 | 212 | ||
@@ -219,10 +220,10 @@ static inline pte_t pfn_pte(unsigned long pfn, pgprot_t pgprot) | |||
219 | #define pgd_offset(mm, address) ((mm)->pgd + pgd_index(address)) | 220 | #define pgd_offset(mm, address) ((mm)->pgd + pgd_index(address)) |
220 | 221 | ||
221 | #define pmd_offset(pudp,addr) \ | 222 | #define pmd_offset(pudp,addr) \ |
222 | (((pmd_t *) pud_page(*(pudp))) + (((addr) >> PMD_SHIFT) & (PTRS_PER_PMD - 1))) | 223 | (((pmd_t *) pud_page_vaddr(*(pudp))) + (((addr) >> PMD_SHIFT) & (PTRS_PER_PMD - 1))) |
223 | 224 | ||
224 | #define pte_offset_kernel(dir,addr) \ | 225 | #define pte_offset_kernel(dir,addr) \ |
225 | (((pte_t *) pmd_page_kernel(*(dir))) + (((addr) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))) | 226 | (((pte_t *) pmd_page_vaddr(*(dir))) + (((addr) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))) |
226 | 227 | ||
227 | #define pte_offset_map(dir,addr) pte_offset_kernel((dir), (addr)) | 228 | #define pte_offset_map(dir,addr) pte_offset_kernel((dir), (addr)) |
228 | #define pte_offset_map_nested(dir,addr) pte_offset_kernel((dir), (addr)) | 229 | #define pte_offset_map_nested(dir,addr) pte_offset_kernel((dir), (addr)) |
diff --git a/include/asm-powerpc/ptrace.h b/include/asm-powerpc/ptrace.h index 4435efe85d0e..4ad77a13f865 100644 --- a/include/asm-powerpc/ptrace.h +++ b/include/asm-powerpc/ptrace.h | |||
@@ -73,6 +73,8 @@ struct pt_regs { | |||
73 | #ifndef __ASSEMBLY__ | 73 | #ifndef __ASSEMBLY__ |
74 | 74 | ||
75 | #define instruction_pointer(regs) ((regs)->nip) | 75 | #define instruction_pointer(regs) ((regs)->nip) |
76 | #define regs_return_value(regs) ((regs)->gpr[3]) | ||
77 | |||
76 | #ifdef CONFIG_SMP | 78 | #ifdef CONFIG_SMP |
77 | extern unsigned long profile_pc(struct pt_regs *regs); | 79 | extern unsigned long profile_pc(struct pt_regs *regs); |
78 | #else | 80 | #else |
diff --git a/include/asm-powerpc/spinlock.h b/include/asm-powerpc/spinlock.h index c31e4382a775..cc4cfceac67c 100644 --- a/include/asm-powerpc/spinlock.h +++ b/include/asm-powerpc/spinlock.h | |||
@@ -285,5 +285,9 @@ static __inline__ void __raw_write_unlock(raw_rwlock_t *rw) | |||
285 | rw->lock = 0; | 285 | rw->lock = 0; |
286 | } | 286 | } |
287 | 287 | ||
288 | #define _raw_spin_relax(lock) __spin_yield(lock) | ||
289 | #define _raw_read_relax(lock) __rw_yield(lock) | ||
290 | #define _raw_write_relax(lock) __rw_yield(lock) | ||
291 | |||
288 | #endif /* __KERNEL__ */ | 292 | #endif /* __KERNEL__ */ |
289 | #endif /* __ASM_SPINLOCK_H */ | 293 | #endif /* __ASM_SPINLOCK_H */ |
diff --git a/include/asm-powerpc/topology.h b/include/asm-powerpc/topology.h index bbc3844b086f..8f7ee16781a4 100644 --- a/include/asm-powerpc/topology.h +++ b/include/asm-powerpc/topology.h | |||
@@ -43,6 +43,7 @@ extern int pcibus_to_node(struct pci_bus *bus); | |||
43 | #define SD_NODE_INIT (struct sched_domain) { \ | 43 | #define SD_NODE_INIT (struct sched_domain) { \ |
44 | .span = CPU_MASK_NONE, \ | 44 | .span = CPU_MASK_NONE, \ |
45 | .parent = NULL, \ | 45 | .parent = NULL, \ |
46 | .child = NULL, \ | ||
46 | .groups = NULL, \ | 47 | .groups = NULL, \ |
47 | .min_interval = 8, \ | 48 | .min_interval = 8, \ |
48 | .max_interval = 32, \ | 49 | .max_interval = 32, \ |
diff --git a/include/asm-powerpc/unistd.h b/include/asm-powerpc/unistd.h index eb66eae6616f..464a48cce7f5 100644 --- a/include/asm-powerpc/unistd.h +++ b/include/asm-powerpc/unistd.h | |||
@@ -479,13 +479,6 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6 | |||
479 | #endif | 479 | #endif |
480 | 480 | ||
481 | /* | 481 | /* |
482 | * System call prototypes. | ||
483 | */ | ||
484 | #ifdef __KERNEL_SYSCALLS__ | ||
485 | extern int execve(const char *file, char **argv, char **envp); | ||
486 | #endif /* __KERNEL_SYSCALLS__ */ | ||
487 | |||
488 | /* | ||
489 | * "Conditional" syscalls | 482 | * "Conditional" syscalls |
490 | * | 483 | * |
491 | * What we want is __attribute__((weak,alias("sys_ni_syscall"))), | 484 | * What we want is __attribute__((weak,alias("sys_ni_syscall"))), |