diff options
Diffstat (limited to 'include/asm-powerpc')
-rw-r--r-- | include/asm-powerpc/bug.h | 12 | ||||
-rw-r--r-- | include/asm-powerpc/fs_pd.h | 45 | ||||
-rw-r--r-- | include/asm-powerpc/io.h | 1 | ||||
-rw-r--r-- | include/asm-powerpc/kprobes.h | 22 | ||||
-rw-r--r-- | include/asm-powerpc/mpc85xx.h | 53 | ||||
-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/system.h | 4 | ||||
-rw-r--r-- | include/asm-powerpc/time.h | 6 | ||||
-rw-r--r-- | include/asm-powerpc/topology.h | 1 | ||||
-rw-r--r-- | include/asm-powerpc/unistd.h | 7 | ||||
-rw-r--r-- | include/asm-powerpc/xmon.h | 26 |
14 files changed, 167 insertions, 32 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); "i" (__FILE__), "i" (__FUNCTION__)); \ } while (0) -#define WARN_ON(x) do { \ - if (__builtin_constant_p(x)) { \ - if (x) \ +#define WARN_ON(x) ({ \ + typeof(x) __ret_warn_on = (x); \ + if (__builtin_constant_p(__ret_warn_on)) { \ + if (__ret_warn_on) \ __WARN(); \ } else { \ __asm__ __volatile__( \ @@ -80,11 +81,12 @@ struct bug_entry *find_bug(unsigned long bugaddr); ".section __bug_table,\"a\"\n" \ "\t"PPC_LONG" 1b,%1,%2,%3\n" \ ".previous" \ - : : "r" ((long)(x)), \ + : : "r" (__ret_warn_on), \ "i" (__LINE__ + BUG_WARNING_TRAP), \ "i" (__FILE__), "i" (__FUNCTION__)); \ } \ -} while (0) + unlikely(__ret_warn_on); \ +}) #define HAVE_ARCH_BUG #define HAVE_ARCH_BUG_ON diff --git a/include/asm-powerpc/fs_pd.h b/include/asm-powerpc/fs_pd.h new file mode 100644 index 000000000000..3d0e819d37f1 --- /dev/null +++ b/include/asm-powerpc/fs_pd.h @@ -0,0 +1,45 @@ +/* + * Platform information definitions. + * + * 2006 (c) MontaVista Software, Inc. + * Vitaly Bordug <vbordug@ru.mvista.com> + * + * This file is licensed under the terms of the GNU General Public License + * version 2. This program is licensed "as is" without any warranty of any + * kind, whether express or implied. + */ + +#ifndef FS_PD_H +#define FS_PD_H +#include <asm/cpm2.h> +#include <sysdev/fsl_soc.h> +#include <asm/time.h> + +static inline int uart_baudrate(void) +{ + return get_baudrate(); +} + +static inline int uart_clock(void) +{ + return ppc_proc_freq; +} + +#define cpm2_map(member) \ +({ \ + u32 offset = offsetof(cpm2_map_t, member); \ + void *addr = ioremap (CPM_MAP_ADDR + offset, \ + sizeof( ((cpm2_map_t*)0)->member)); \ + addr; \ +}) + +#define cpm2_map_size(member, size) \ +({ \ + u32 offset = offsetof(cpm2_map_t, member); \ + void *addr = ioremap (CPM_MAP_ADDR + offset, size); \ + addr; \ +}) + +#define cpm2_unmap(addr) iounmap(addr) + +#endif 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 @@ /* Check of existence of legacy devices */ extern int check_legacy_ioport(unsigned long base_port); +#define PNPBIOS_BASE 0xf000 /* only relevant for PReP */ #ifndef CONFIG_PPC64 #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; #define IS_TDI(instr) (((instr) & 0xfc000000) == 0x08000000) #define IS_TWI(instr) (((instr) & 0xfc000000) == 0x0c000000) +/* + * 64bit powerpc uses function descriptors. + * Handle cases where: + * - User passes a <.symbol> or <module:.symbol> + * - User passes a <symbol> or <module:symbol> + * - User passes a non-existant symbol, kallsyms_lookup_name + * returns 0. Don't deref the NULL pointer in that case + */ +#define kprobe_lookup_name(name, addr) \ +{ \ + addr = (kprobe_opcode_t *)kallsyms_lookup_name(name); \ + if (addr) { \ + char *colon; \ + if ((colon = strchr(name, ':')) != NULL) { \ + colon++; \ + if (*colon != '\0' && *colon != '.') \ + addr = *(kprobe_opcode_t **)addr; \ + } else if (name[0] != '.') \ + addr = *(kprobe_opcode_t **)addr; \ + } \ +} + #define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)((func_descr_t *)pentry) #define is_trap(instr) (IS_TW(instr) || IS_TD(instr) || \ diff --git a/include/asm-powerpc/mpc85xx.h b/include/asm-powerpc/mpc85xx.h new file mode 100644 index 000000000000..ccdb8a21138f --- /dev/null +++ b/include/asm-powerpc/mpc85xx.h @@ -0,0 +1,53 @@ +/* + * include/asm-powerpc/mpc85xx.h + * + * MPC85xx definitions + * + * Maintainer: Kumar Gala <galak@kernel.crashing.org> + * + * Copyright 2004 Freescale Semiconductor, Inc + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + */ + +#ifdef __KERNEL__ +#ifndef __ASM_MPC85xx_H__ +#define __ASM_MPC85xx_H__ + +#include <asm/mmu.h> + +#ifdef CONFIG_85xx + +#if defined(CONFIG_MPC8540_ADS) || defined(CONFIG_MPC8560_ADS) +#include <platforms/85xx/mpc85xx_ads.h> +#endif +#if defined(CONFIG_MPC8555_CDS) || defined(CONFIG_MPC8548_CDS) +#include <platforms/85xx/mpc8555_cds.h> +#endif +#ifdef CONFIG_MPC85xx_CDS +#include <platforms/85xx/mpc85xx_cds.h> +#endif + +#define _IO_BASE isa_io_base +#define _ISA_MEM_BASE isa_mem_base +#ifdef CONFIG_PCI +#define PCI_DRAM_OFFSET pci_dram_offset +#else +#define PCI_DRAM_OFFSET 0 +#endif + +/* Let modules/drivers get at CCSRBAR */ +extern phys_addr_t get_ccsrbar(void); + +#ifdef MODULE +#define CCSRBAR get_ccsrbar() +#else +#define CCSRBAR BOARD_CCSRBAR +#endif + +#endif /* CONFIG_85xx */ +#endif /* __ASM_MPC85xx_H__ */ +#endif /* __KERNEL__ */ 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 @@ #define pgd_bad(pgd) (pgd_val(pgd) == 0) #define pgd_present(pgd) (pgd_val(pgd) != 0) #define pgd_clear(pgdp) (pgd_val(*(pgdp)) = 0) -#define pgd_page(pgd) (pgd_val(pgd) & ~PGD_MASKED_BITS) +#define pgd_page_vaddr(pgd) (pgd_val(pgd) & ~PGD_MASKED_BITS) +#define pgd_page(pgd) virt_to_page(pgd_page_vaddr(pgd)) #define pud_offset(pgdp, addr) \ - (((pud_t *) pgd_page(*(pgdp))) + \ + (((pud_t *) pgd_page_vaddr(*(pgdp))) + \ (((addr) >> PUD_SHIFT) & (PTRS_PER_PUD - 1))) #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) || (pmd_val(pmd) & PMD_BAD_BITS)) #define pmd_present(pmd) (pmd_val(pmd) != 0) #define pmd_clear(pmdp) (pmd_val(*(pmdp)) = 0) -#define pmd_page_kernel(pmd) (pmd_val(pmd) & ~PMD_MASKED_BITS) -#define pmd_page(pmd) virt_to_page(pmd_page_kernel(pmd)) +#define pmd_page_vaddr(pmd) (pmd_val(pmd) & ~PMD_MASKED_BITS) +#define pmd_page(pmd) virt_to_page(pmd_page_vaddr(pmd)) #define pud_set(pudp, pudval) (pud_val(*(pudp)) = (pudval)) #define pud_none(pud) (!pud_val(pud)) @@ -205,7 +205,8 @@ static inline pte_t pfn_pte(unsigned long pfn, pgprot_t pgprot) || (pud_val(pud) & PUD_BAD_BITS)) #define pud_present(pud) (pud_val(pud) != 0) #define pud_clear(pudp) (pud_val(*(pudp)) = 0) -#define pud_page(pud) (pud_val(pud) & ~PUD_MASKED_BITS) +#define pud_page_vaddr(pud) (pud_val(pud) & ~PUD_MASKED_BITS) +#define pud_page(pud) virt_to_page(pud_page_vaddr(pud)) #define pgd_set(pgdp, pudp) ({pgd_val(*(pgdp)) = (unsigned long)(pudp);}) @@ -219,10 +220,10 @@ static inline pte_t pfn_pte(unsigned long pfn, pgprot_t pgprot) #define pgd_offset(mm, address) ((mm)->pgd + pgd_index(address)) #define pmd_offset(pudp,addr) \ - (((pmd_t *) pud_page(*(pudp))) + (((addr) >> PMD_SHIFT) & (PTRS_PER_PMD - 1))) + (((pmd_t *) pud_page_vaddr(*(pudp))) + (((addr) >> PMD_SHIFT) & (PTRS_PER_PMD - 1))) #define pte_offset_kernel(dir,addr) \ - (((pte_t *) pmd_page_kernel(*(dir))) + (((addr) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))) + (((pte_t *) pmd_page_vaddr(*(dir))) + (((addr) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))) #define pte_offset_map(dir,addr) pte_offset_kernel((dir), (addr)) #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 { #ifndef __ASSEMBLY__ #define instruction_pointer(regs) ((regs)->nip) +#define regs_return_value(regs) ((regs)->gpr[3]) + #ifdef CONFIG_SMP extern unsigned long profile_pc(struct pt_regs *regs); #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) rw->lock = 0; } +#define _raw_spin_relax(lock) __spin_yield(lock) +#define _raw_read_relax(lock) __rw_yield(lock) +#define _raw_write_relax(lock) __rw_yield(lock) + #endif /* __KERNEL__ */ #endif /* __ASM_SPINLOCK_H */ diff --git a/include/asm-powerpc/system.h b/include/asm-powerpc/system.h index 4b41deaa8d8d..43627596003b 100644 --- a/include/asm-powerpc/system.h +++ b/include/asm-powerpc/system.h @@ -91,10 +91,6 @@ DEBUGGER_BOILERPLATE(debugger_iabr_match) DEBUGGER_BOILERPLATE(debugger_dabr_match) DEBUGGER_BOILERPLATE(debugger_fault_handler) -#ifdef CONFIG_XMON -extern void xmon_init(int enable); -#endif - #else static inline int debugger(struct pt_regs *regs) { return 0; } static inline int debugger_ipi(struct pt_regs *regs) { return 0; } diff --git a/include/asm-powerpc/time.h b/include/asm-powerpc/time.h index 5785ac4737b5..b051d4c88c3b 100644 --- a/include/asm-powerpc/time.h +++ b/include/asm-powerpc/time.h @@ -39,6 +39,10 @@ extern void generic_calibrate_decr(void); extern void wakeup_decrementer(void); extern void snapshot_timebase(void); +#ifdef CONFIG_RTC_CLASS +extern int __init rtc_class_hookup(void); +#endif + /* Some sane defaults: 125 MHz timebase, 1GHz processor */ extern unsigned long ppc_proc_freq; #define DEFAULT_PROC_FREQ (DEFAULT_TB_FREQ * 8) @@ -234,4 +238,4 @@ extern void snapshot_timebases(void); #endif #endif /* __KERNEL__ */ -#endif /* __PPC64_TIME_H */ +#endif /* __POWERPC_TIME_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); #define SD_NODE_INIT (struct sched_domain) { \ .span = CPU_MASK_NONE, \ .parent = NULL, \ + .child = NULL, \ .groups = NULL, \ .min_interval = 8, \ .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 #endif /* - * System call prototypes. - */ -#ifdef __KERNEL_SYSCALLS__ -extern int execve(const char *file, char **argv, char **envp); -#endif /* __KERNEL_SYSCALLS__ */ - -/* * "Conditional" syscalls * * What we want is __attribute__((weak,alias("sys_ni_syscall"))), diff --git a/include/asm-powerpc/xmon.h b/include/asm-powerpc/xmon.h index 43f7129984c7..f1d337ed68d5 100644 --- a/include/asm-powerpc/xmon.h +++ b/include/asm-powerpc/xmon.h @@ -1,12 +1,22 @@ -#ifndef __PPC_XMON_H -#define __PPC_XMON_H -#ifdef __KERNEL__ +#ifndef __ASM_POWERPC_XMON_H +#define __ASM_POWERPC_XMON_H -struct pt_regs; +/* + * Copyrignt (C) 2006 IBM Corp + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + */ -extern int xmon(struct pt_regs *excp); -extern void xmon_printf(const char *fmt, ...); -extern void xmon_init(int); +#ifdef __KERNEL__ +#ifdef CONFIG_XMON +extern void xmon_setup(void); +#else +static inline void xmon_setup(void) { }; #endif -#endif + +#endif /* __KERNEL __ */ +#endif /* __ASM_POWERPC_XMON_H */ |