aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-ppc
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-ppc')
-rw-r--r--include/asm-ppc/cputable.h1
-rw-r--r--include/asm-ppc/dma-mapping.h4
-rw-r--r--include/asm-ppc/futex.h2
-rw-r--r--include/asm-ppc/io.h20
-rw-r--r--include/asm-ppc/irq.h14
-rw-r--r--include/asm-ppc/macio.h1
-rw-r--r--include/asm-ppc/mpc8xx.h16
-rw-r--r--include/asm-ppc/msgbuf.h25
-rw-r--r--include/asm-ppc/mv64x60.h12
-rw-r--r--include/asm-ppc/of_device.h5
-rw-r--r--include/asm-ppc/param.h24
-rw-r--r--include/asm-ppc/pci.h13
-rw-r--r--include/asm-ppc/pgtable.h11
-rw-r--r--include/asm-ppc/ppc_sys.h2
-rw-r--r--include/asm-ppc/ptrace.h7
-rw-r--r--include/asm-ppc/reg.h6
-rw-r--r--include/asm-ppc/segment.h1
-rw-r--r--include/asm-ppc/setup.h14
-rw-r--r--include/asm-ppc/smp.h6
-rw-r--r--include/asm-ppc/spinlock.h91
-rw-r--r--include/asm-ppc/spinlock_types.h20
-rw-r--r--include/asm-ppc/system.h1
-rw-r--r--include/asm-ppc/timex.h40
-rw-r--r--include/asm-ppc/tlbflush.h2
-rw-r--r--include/asm-ppc/topology.h6
-rw-r--r--include/asm-ppc/user.h54
26 files changed, 124 insertions, 274 deletions
diff --git a/include/asm-ppc/cputable.h b/include/asm-ppc/cputable.h
index 41d8f8425c0..e17c492c870 100644
--- a/include/asm-ppc/cputable.h
+++ b/include/asm-ppc/cputable.h
@@ -24,6 +24,7 @@
24#define PPC_FEATURE_HAS_SPE 0x00800000 24#define PPC_FEATURE_HAS_SPE 0x00800000
25#define PPC_FEATURE_HAS_EFP_SINGLE 0x00400000 25#define PPC_FEATURE_HAS_EFP_SINGLE 0x00400000
26#define PPC_FEATURE_HAS_EFP_DOUBLE 0x00200000 26#define PPC_FEATURE_HAS_EFP_DOUBLE 0x00200000
27#define PPC_FEATURE_NO_TB 0x00100000
27 28
28#ifdef __KERNEL__ 29#ifdef __KERNEL__
29 30
diff --git a/include/asm-ppc/dma-mapping.h b/include/asm-ppc/dma-mapping.h
index 92b8ee78dcc..6e963511443 100644
--- a/include/asm-ppc/dma-mapping.h
+++ b/include/asm-ppc/dma-mapping.h
@@ -19,7 +19,7 @@
19 * allocate the space "normally" and use the cache management functions 19 * allocate the space "normally" and use the cache management functions
20 * to ensure it is consistent. 20 * to ensure it is consistent.
21 */ 21 */
22extern void *__dma_alloc_coherent(size_t size, dma_addr_t *handle, int gfp); 22extern void *__dma_alloc_coherent(size_t size, dma_addr_t *handle, gfp_t gfp);
23extern void __dma_free_coherent(size_t size, void *vaddr); 23extern void __dma_free_coherent(size_t size, void *vaddr);
24extern void __dma_sync(void *vaddr, size_t size, int direction); 24extern void __dma_sync(void *vaddr, size_t size, int direction);
25extern void __dma_sync_page(struct page *page, unsigned long offset, 25extern void __dma_sync_page(struct page *page, unsigned long offset,
@@ -61,7 +61,7 @@ static inline int dma_set_mask(struct device *dev, u64 dma_mask)
61 61
62static inline void *dma_alloc_coherent(struct device *dev, size_t size, 62static inline void *dma_alloc_coherent(struct device *dev, size_t size,
63 dma_addr_t * dma_handle, 63 dma_addr_t * dma_handle,
64 unsigned int __nocast gfp) 64 gfp_t gfp)
65{ 65{
66#ifdef CONFIG_NOT_COHERENT_CACHE 66#ifdef CONFIG_NOT_COHERENT_CACHE
67 return __dma_alloc_coherent(size, dma_handle, gfp); 67 return __dma_alloc_coherent(size, dma_handle, gfp);
diff --git a/include/asm-ppc/futex.h b/include/asm-ppc/futex.h
index 2cac5ecd9d0..9feff4ce142 100644
--- a/include/asm-ppc/futex.h
+++ b/include/asm-ppc/futex.h
@@ -14,7 +14,7 @@ futex_atomic_op_inuser (int encoded_op, int __user *uaddr)
14 int cmp = (encoded_op >> 24) & 15; 14 int cmp = (encoded_op >> 24) & 15;
15 int oparg = (encoded_op << 8) >> 20; 15 int oparg = (encoded_op << 8) >> 20;
16 int cmparg = (encoded_op << 20) >> 20; 16 int cmparg = (encoded_op << 20) >> 20;
17 int oldval = 0, ret, tem; 17 int oldval = 0, ret;
18 if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28)) 18 if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28))
19 oparg = 1 << oparg; 19 oparg = 1 << oparg;
20 20
diff --git a/include/asm-ppc/io.h b/include/asm-ppc/io.h
index 7eb7cf6360b..94d83998a75 100644
--- a/include/asm-ppc/io.h
+++ b/include/asm-ppc/io.h
@@ -56,7 +56,7 @@ extern unsigned long pci_dram_offset;
56 * is actually performed (i.e. the data has come back) before we start 56 * is actually performed (i.e. the data has come back) before we start
57 * executing any following instructions. 57 * executing any following instructions.
58 */ 58 */
59extern inline int in_8(volatile unsigned char __iomem *addr) 59extern inline int in_8(const volatile unsigned char __iomem *addr)
60{ 60{
61 int ret; 61 int ret;
62 62
@@ -72,7 +72,7 @@ extern inline void out_8(volatile unsigned char __iomem *addr, int val)
72 __asm__ __volatile__("stb%U0%X0 %1,%0; eieio" : "=m" (*addr) : "r" (val)); 72 __asm__ __volatile__("stb%U0%X0 %1,%0; eieio" : "=m" (*addr) : "r" (val));
73} 73}
74 74
75extern inline int in_le16(volatile unsigned short __iomem *addr) 75extern inline int in_le16(const volatile unsigned short __iomem *addr)
76{ 76{
77 int ret; 77 int ret;
78 78
@@ -83,7 +83,7 @@ extern inline int in_le16(volatile unsigned short __iomem *addr)
83 return ret; 83 return ret;
84} 84}
85 85
86extern inline int in_be16(volatile unsigned short __iomem *addr) 86extern inline int in_be16(const volatile unsigned short __iomem *addr)
87{ 87{
88 int ret; 88 int ret;
89 89
@@ -104,7 +104,7 @@ extern inline void out_be16(volatile unsigned short __iomem *addr, int val)
104 __asm__ __volatile__("sth%U0%X0 %1,%0; eieio" : "=m" (*addr) : "r" (val)); 104 __asm__ __volatile__("sth%U0%X0 %1,%0; eieio" : "=m" (*addr) : "r" (val));
105} 105}
106 106
107extern inline unsigned in_le32(volatile unsigned __iomem *addr) 107extern inline unsigned in_le32(const volatile unsigned __iomem *addr)
108{ 108{
109 unsigned ret; 109 unsigned ret;
110 110
@@ -115,7 +115,7 @@ extern inline unsigned in_le32(volatile unsigned __iomem *addr)
115 return ret; 115 return ret;
116} 116}
117 117
118extern inline unsigned in_be32(volatile unsigned __iomem *addr) 118extern inline unsigned in_be32(const volatile unsigned __iomem *addr)
119{ 119{
120 unsigned ret; 120 unsigned ret;
121 121
@@ -139,7 +139,7 @@ extern inline void out_be32(volatile unsigned __iomem *addr, int val)
139#define readb(addr) in_8((volatile u8 *)(addr)) 139#define readb(addr) in_8((volatile u8 *)(addr))
140#define writeb(b,addr) out_8((volatile u8 *)(addr), (b)) 140#define writeb(b,addr) out_8((volatile u8 *)(addr), (b))
141#else 141#else
142static inline __u8 readb(volatile void __iomem *addr) 142static inline __u8 readb(const volatile void __iomem *addr)
143{ 143{
144 return in_8(addr); 144 return in_8(addr);
145} 145}
@@ -150,11 +150,11 @@ static inline void writeb(__u8 b, volatile void __iomem *addr)
150#endif 150#endif
151 151
152#if defined(CONFIG_APUS) 152#if defined(CONFIG_APUS)
153static inline __u16 readw(volatile void __iomem *addr) 153static inline __u16 readw(const volatile void __iomem *addr)
154{ 154{
155 return *(__force volatile __u16 *)(addr); 155 return *(__force volatile __u16 *)(addr);
156} 156}
157static inline __u32 readl(volatile void __iomem *addr) 157static inline __u32 readl(const volatile void __iomem *addr)
158{ 158{
159 return *(__force volatile __u32 *)(addr); 159 return *(__force volatile __u32 *)(addr);
160} 160}
@@ -173,11 +173,11 @@ static inline void writel(__u32 b, volatile void __iomem *addr)
173#define writew(b,addr) out_le16((volatile u16 *)(addr),(b)) 173#define writew(b,addr) out_le16((volatile u16 *)(addr),(b))
174#define writel(b,addr) out_le32((volatile u32 *)(addr),(b)) 174#define writel(b,addr) out_le32((volatile u32 *)(addr),(b))
175#else 175#else
176static inline __u16 readw(volatile void __iomem *addr) 176static inline __u16 readw(const volatile void __iomem *addr)
177{ 177{
178 return in_le16(addr); 178 return in_le16(addr);
179} 179}
180static inline __u32 readl(volatile void __iomem *addr) 180static inline __u32 readl(const volatile void __iomem *addr)
181{ 181{
182 return in_le32(addr); 182 return in_le32(addr);
183} 183}
diff --git a/include/asm-ppc/irq.h b/include/asm-ppc/irq.h
index b4b270457ed..bd9674807f0 100644
--- a/include/asm-ppc/irq.h
+++ b/include/asm-ppc/irq.h
@@ -138,6 +138,16 @@ irq_canonicalize(int irq)
138#define SIU_IRQ7 (14) 138#define SIU_IRQ7 (14)
139#define SIU_LEVEL7 (15) 139#define SIU_LEVEL7 (15)
140 140
141#define MPC8xx_INT_FEC1 SIU_LEVEL1
142#define MPC8xx_INT_FEC2 SIU_LEVEL3
143
144#define MPC8xx_INT_SCC1 (CPM_IRQ_OFFSET + CPMVEC_SCC1)
145#define MPC8xx_INT_SCC2 (CPM_IRQ_OFFSET + CPMVEC_SCC2)
146#define MPC8xx_INT_SCC3 (CPM_IRQ_OFFSET + CPMVEC_SCC3)
147#define MPC8xx_INT_SCC4 (CPM_IRQ_OFFSET + CPMVEC_SCC4)
148#define MPC8xx_INT_SMC1 (CPM_IRQ_OFFSET + CPMVEC_SMC1)
149#define MPC8xx_INT_SMC2 (CPM_IRQ_OFFSET + CPMVEC_SMC2)
150
141/* The internal interrupts we can configure as we see fit. 151/* The internal interrupts we can configure as we see fit.
142 * My personal preference is CPM at level 2, which puts it above the 152 * My personal preference is CPM at level 2, which puts it above the
143 * MBX PCI/ISA/IDE interrupts. 153 * MBX PCI/ISA/IDE interrupts.
@@ -404,9 +414,5 @@ extern unsigned long ppc_cached_irq_mask[NR_MASK_WORDS];
404extern unsigned long ppc_lost_interrupts[NR_MASK_WORDS]; 414extern unsigned long ppc_lost_interrupts[NR_MASK_WORDS];
405extern atomic_t ppc_n_lost_interrupts; 415extern atomic_t ppc_n_lost_interrupts;
406 416
407struct irqaction;
408struct pt_regs;
409int handle_IRQ_event(unsigned int, struct pt_regs *, struct irqaction *);
410
411#endif /* _ASM_IRQ_H */ 417#endif /* _ASM_IRQ_H */
412#endif /* __KERNEL__ */ 418#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/macio.h b/include/asm-ppc/macio.h
index a481b772d15..b553dd4b139 100644
--- a/include/asm-ppc/macio.h
+++ b/include/asm-ppc/macio.h
@@ -1,7 +1,6 @@
1#ifndef __MACIO_ASIC_H__ 1#ifndef __MACIO_ASIC_H__
2#define __MACIO_ASIC_H__ 2#define __MACIO_ASIC_H__
3 3
4#include <linux/mod_devicetable.h>
5#include <asm/of_device.h> 4#include <asm/of_device.h>
6 5
7extern struct bus_type macio_bus_type; 6extern struct bus_type macio_bus_type;
diff --git a/include/asm-ppc/mpc8xx.h b/include/asm-ppc/mpc8xx.h
index dc8e5989605..208a2e11dae 100644
--- a/include/asm-ppc/mpc8xx.h
+++ b/include/asm-ppc/mpc8xx.h
@@ -97,6 +97,22 @@ extern unsigned char __res[];
97 97
98struct pt_regs; 98struct pt_regs;
99 99
100enum ppc_sys_devices {
101 MPC8xx_CPM_FEC1,
102 MPC8xx_CPM_FEC2,
103 MPC8xx_CPM_I2C,
104 MPC8xx_CPM_SCC1,
105 MPC8xx_CPM_SCC2,
106 MPC8xx_CPM_SCC3,
107 MPC8xx_CPM_SCC4,
108 MPC8xx_CPM_SPI,
109 MPC8xx_CPM_MCC1,
110 MPC8xx_CPM_MCC2,
111 MPC8xx_CPM_SMC1,
112 MPC8xx_CPM_SMC2,
113 MPC8xx_CPM_USB,
114};
115
100#endif /* !__ASSEMBLY__ */ 116#endif /* !__ASSEMBLY__ */
101#endif /* CONFIG_8xx */ 117#endif /* CONFIG_8xx */
102#endif /* __CONFIG_8xx_DEFS */ 118#endif /* __CONFIG_8xx_DEFS */
diff --git a/include/asm-ppc/msgbuf.h b/include/asm-ppc/msgbuf.h
deleted file mode 100644
index 1053452a937..00000000000
--- a/include/asm-ppc/msgbuf.h
+++ /dev/null
@@ -1,25 +0,0 @@
1#ifndef _PPC_MSGBUF_H
2#define _PPC_MSGBUF_H
3
4/*
5 * The msqid64_ds structure for the PPC architecture.
6 */
7
8struct msqid64_ds {
9 struct ipc64_perm msg_perm;
10 unsigned int __unused1;
11 __kernel_time_t msg_stime; /* last msgsnd time */
12 unsigned int __unused2;
13 __kernel_time_t msg_rtime; /* last msgrcv time */
14 unsigned int __unused3;
15 __kernel_time_t msg_ctime; /* last change time */
16 unsigned long msg_cbytes; /* current number of bytes on queue */
17 unsigned long msg_qnum; /* number of messages in queue */
18 unsigned long msg_qbytes; /* max number of bytes on queue */
19 __kernel_pid_t msg_lspid; /* pid of last msgsnd */
20 __kernel_pid_t msg_lrpid; /* last receive pid */
21 unsigned long __unused4;
22 unsigned long __unused5;
23};
24
25#endif /* _PPC_MSGBUF_H */
diff --git a/include/asm-ppc/mv64x60.h b/include/asm-ppc/mv64x60.h
index 835930d6faa..ee2f9188cc6 100644
--- a/include/asm-ppc/mv64x60.h
+++ b/include/asm-ppc/mv64x60.h
@@ -119,6 +119,14 @@ extern spinlock_t mv64x60_lock;
119 119
120#define MV64x60_64BIT_WIN_COUNT 24 120#define MV64x60_64BIT_WIN_COUNT 24
121 121
122/* Watchdog Platform Device, Driver Data */
123#define MV64x60_WDT_NAME "wdt"
124
125struct mv64x60_wdt_pdata {
126 int timeout; /* watchdog expiry in seconds, default 10 */
127 int bus_clk; /* bus clock in MHz, default 133 */
128};
129
122/* 130/*
123 * Define a structure that's used to pass in config information to the 131 * Define a structure that's used to pass in config information to the
124 * core routines. 132 * core routines.
@@ -225,7 +233,7 @@ struct mv64x60_chip_info {
225struct mv64x60_handle { 233struct mv64x60_handle {
226 u32 type; /* type of bridge */ 234 u32 type; /* type of bridge */
227 u32 rev; /* revision of bridge */ 235 u32 rev; /* revision of bridge */
228 void *v_base; /* virtual base addr of bridge regs */ 236 void __iomem *v_base;/* virtual base addr of bridge regs */
229 phys_addr_t p_base; /* physical base addr of bridge regs */ 237 phys_addr_t p_base; /* physical base addr of bridge regs */
230 238
231 u32 pci_mode_a; /* pci 0 mode: conventional pci, pci-x*/ 239 u32 pci_mode_a; /* pci 0 mode: conventional pci, pci-x*/
@@ -295,7 +303,7 @@ void mv64x60_alloc_hose(struct mv64x60_handle *bh, u32 cfg_addr,
295 u32 cfg_data, struct pci_controller **hose); 303 u32 cfg_data, struct pci_controller **hose);
296int mv64x60_get_type(struct mv64x60_handle *bh); 304int mv64x60_get_type(struct mv64x60_handle *bh);
297int mv64x60_setup_for_chip(struct mv64x60_handle *bh); 305int mv64x60_setup_for_chip(struct mv64x60_handle *bh);
298void *mv64x60_get_bridge_vbase(void); 306void __iomem *mv64x60_get_bridge_vbase(void);
299u32 mv64x60_get_bridge_type(void); 307u32 mv64x60_get_bridge_type(void);
300u32 mv64x60_get_bridge_rev(void); 308u32 mv64x60_get_bridge_rev(void);
301void mv64x60_get_mem_windows(struct mv64x60_handle *bh, 309void mv64x60_get_mem_windows(struct mv64x60_handle *bh,
diff --git a/include/asm-ppc/of_device.h b/include/asm-ppc/of_device.h
index 4b264cfd399..575bce418f8 100644
--- a/include/asm-ppc/of_device.h
+++ b/include/asm-ppc/of_device.h
@@ -2,6 +2,7 @@
2#define __OF_DEVICE_H__ 2#define __OF_DEVICE_H__
3 3
4#include <linux/device.h> 4#include <linux/device.h>
5#include <linux/mod_devicetable.h>
5#include <asm/prom.h> 6#include <asm/prom.h>
6 7
7/* 8/*
@@ -55,7 +56,9 @@ extern int of_register_driver(struct of_platform_driver *drv);
55extern void of_unregister_driver(struct of_platform_driver *drv); 56extern void of_unregister_driver(struct of_platform_driver *drv);
56extern int of_device_register(struct of_device *ofdev); 57extern int of_device_register(struct of_device *ofdev);
57extern void of_device_unregister(struct of_device *ofdev); 58extern void of_device_unregister(struct of_device *ofdev);
58extern struct of_device *of_platform_device_create(struct device_node *np, const char *bus_id); 59extern struct of_device *of_platform_device_create(struct device_node *np,
60 const char *bus_id,
61 struct device *parent);
59extern void of_release_dev(struct device *dev); 62extern void of_release_dev(struct device *dev);
60 63
61#endif /* __OF_DEVICE_H__ */ 64#endif /* __OF_DEVICE_H__ */
diff --git a/include/asm-ppc/param.h b/include/asm-ppc/param.h
deleted file mode 100644
index 6198b1657a4..00000000000
--- a/include/asm-ppc/param.h
+++ /dev/null
@@ -1,24 +0,0 @@
1#ifndef _ASM_PPC_PARAM_H
2#define _ASM_PPC_PARAM_H
3
4#include <linux/config.h>
5
6#ifdef __KERNEL__
7#define HZ CONFIG_HZ /* internal timer frequency */
8#define USER_HZ 100 /* for user interfaces in "ticks" */
9#define CLOCKS_PER_SEC (USER_HZ) /* frequency at which times() counts */
10#endif /* __KERNEL__ */
11
12#ifndef HZ
13#define HZ 100
14#endif
15
16#define EXEC_PAGESIZE 4096
17
18#ifndef NOGROUP
19#define NOGROUP (-1)
20#endif
21
22#define MAXHOSTNAMELEN 64 /* max length of hostname */
23
24#endif
diff --git a/include/asm-ppc/pci.h b/include/asm-ppc/pci.h
index a811e440c97..9dd06cd4009 100644
--- a/include/asm-ppc/pci.h
+++ b/include/asm-ppc/pci.h
@@ -109,6 +109,19 @@ extern void
109pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, 109pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
110 struct pci_bus_region *region); 110 struct pci_bus_region *region);
111 111
112static inline struct resource *
113pcibios_select_root(struct pci_dev *pdev, struct resource *res)
114{
115 struct resource *root = NULL;
116
117 if (res->flags & IORESOURCE_IO)
118 root = &ioport_resource;
119 if (res->flags & IORESOURCE_MEM)
120 root = &iomem_resource;
121
122 return root;
123}
124
112extern void pcibios_add_platform_entries(struct pci_dev *dev); 125extern void pcibios_add_platform_entries(struct pci_dev *dev);
113 126
114struct file; 127struct file;
diff --git a/include/asm-ppc/pgtable.h b/include/asm-ppc/pgtable.h
index 92f30b28b25..eee601bb9ad 100644
--- a/include/asm-ppc/pgtable.h
+++ b/include/asm-ppc/pgtable.h
@@ -812,15 +812,6 @@ extern void kernel_set_cachemode (unsigned long address, unsigned long size,
812#ifdef CONFIG_PHYS_64BIT 812#ifdef CONFIG_PHYS_64BIT
813extern int remap_pfn_range(struct vm_area_struct *vma, unsigned long from, 813extern int remap_pfn_range(struct vm_area_struct *vma, unsigned long from,
814 unsigned long paddr, unsigned long size, pgprot_t prot); 814 unsigned long paddr, unsigned long size, pgprot_t prot);
815static inline int io_remap_page_range(struct vm_area_struct *vma,
816 unsigned long vaddr,
817 unsigned long paddr,
818 unsigned long size,
819 pgprot_t prot)
820{
821 phys_addr_t paddr64 = fixup_bigphys_addr(paddr, size);
822 return remap_pfn_range(vma, vaddr, paddr64 >> PAGE_SHIFT, size, prot);
823}
824 815
825static inline int io_remap_pfn_range(struct vm_area_struct *vma, 816static inline int io_remap_pfn_range(struct vm_area_struct *vma,
826 unsigned long vaddr, 817 unsigned long vaddr,
@@ -832,8 +823,6 @@ static inline int io_remap_pfn_range(struct vm_area_struct *vma,
832 return remap_pfn_range(vma, vaddr, paddr64 >> PAGE_SHIFT, size, prot); 823 return remap_pfn_range(vma, vaddr, paddr64 >> PAGE_SHIFT, size, prot);
833} 824}
834#else 825#else
835#define io_remap_page_range(vma, vaddr, paddr, size, prot) \
836 remap_pfn_range(vma, vaddr, (paddr) >> PAGE_SHIFT, size, prot)
837#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \ 826#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \
838 remap_pfn_range(vma, vaddr, pfn, size, prot) 827 remap_pfn_range(vma, vaddr, pfn, size, prot)
839#endif 828#endif
diff --git a/include/asm-ppc/ppc_sys.h b/include/asm-ppc/ppc_sys.h
index 048f7c8596e..549f44843c5 100644
--- a/include/asm-ppc/ppc_sys.h
+++ b/include/asm-ppc/ppc_sys.h
@@ -27,6 +27,8 @@
27#include <asm/mpc83xx.h> 27#include <asm/mpc83xx.h>
28#elif defined(CONFIG_85xx) 28#elif defined(CONFIG_85xx)
29#include <asm/mpc85xx.h> 29#include <asm/mpc85xx.h>
30#elif defined(CONFIG_8xx)
31#include <asm/mpc8xx.h>
30#elif defined(CONFIG_PPC_MPC52xx) 32#elif defined(CONFIG_PPC_MPC52xx)
31#include <asm/mpc52xx.h> 33#include <asm/mpc52xx.h>
32#elif defined(CONFIG_MPC10X_BRIDGE) 34#elif defined(CONFIG_MPC10X_BRIDGE)
diff --git a/include/asm-ppc/ptrace.h b/include/asm-ppc/ptrace.h
index 9d4e4ea530c..7043c164b53 100644
--- a/include/asm-ppc/ptrace.h
+++ b/include/asm-ppc/ptrace.h
@@ -142,4 +142,11 @@ do { \
142#define PTRACE_GETEVRREGS 20 142#define PTRACE_GETEVRREGS 20
143#define PTRACE_SETEVRREGS 21 143#define PTRACE_SETEVRREGS 21
144 144
145/*
146 * Get or set a debug register. The first 16 are DABR registers and the
147 * second 16 are IABR registers.
148 */
149#define PTRACE_GET_DEBUGREG 25
150#define PTRACE_SET_DEBUGREG 26
151
145#endif 152#endif
diff --git a/include/asm-ppc/reg.h b/include/asm-ppc/reg.h
index 88b4222154d..73c33e3ef9c 100644
--- a/include/asm-ppc/reg.h
+++ b/include/asm-ppc/reg.h
@@ -366,12 +366,6 @@
366#define PVR_STB03XXX 0x40310000 366#define PVR_STB03XXX 0x40310000
367#define PVR_NP405H 0x41410000 367#define PVR_NP405H 0x41410000
368#define PVR_NP405L 0x41610000 368#define PVR_NP405L 0x41610000
369#define PVR_440GP_RB 0x40120440
370#define PVR_440GP_RC1 0x40120481
371#define PVR_440GP_RC2 0x40200481
372#define PVR_440GX_RA 0x51b21850
373#define PVR_440GX_RB 0x51b21851
374#define PVR_440GX_RC 0x51b21892
375#define PVR_601 0x00010000 369#define PVR_601 0x00010000
376#define PVR_602 0x00050000 370#define PVR_602 0x00050000
377#define PVR_603 0x00030000 371#define PVR_603 0x00030000
diff --git a/include/asm-ppc/segment.h b/include/asm-ppc/segment.h
deleted file mode 100644
index 0f2f7428d43..00000000000
--- a/include/asm-ppc/segment.h
+++ /dev/null
@@ -1 +0,0 @@
1#include <asm/uaccess.h>
diff --git a/include/asm-ppc/setup.h b/include/asm-ppc/setup.h
deleted file mode 100644
index d2d19ee103d..00000000000
--- a/include/asm-ppc/setup.h
+++ /dev/null
@@ -1,14 +0,0 @@
1#ifdef __KERNEL__
2#ifndef _PPC_SETUP_H
3#define _PPC_SETUP_H
4
5#define m68k_num_memory num_memory
6#define m68k_memory memory
7
8#include <asm-m68k/setup.h>
9/* We have a bigger command line buffer. */
10#undef COMMAND_LINE_SIZE
11#define COMMAND_LINE_SIZE 512
12
13#endif /* _PPC_SETUP_H */
14#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/smp.h b/include/asm-ppc/smp.h
index 17530c232c7..829481c0a9d 100644
--- a/include/asm-ppc/smp.h
+++ b/include/asm-ppc/smp.h
@@ -41,6 +41,10 @@ extern void smp_send_xmon_break(int cpu);
41struct pt_regs; 41struct pt_regs;
42extern void smp_message_recv(int, struct pt_regs *); 42extern void smp_message_recv(int, struct pt_regs *);
43 43
44extern int __cpu_disable(void);
45extern void __cpu_die(unsigned int cpu);
46extern void cpu_die(void) __attribute__((noreturn));
47
44#define NO_PROC_ID 0xFF /* No processor magic marker */ 48#define NO_PROC_ID 0xFF /* No processor magic marker */
45#define PROC_CHANGE_PENALTY 20 49#define PROC_CHANGE_PENALTY 20
46 50
@@ -64,6 +68,8 @@ extern struct klock_info_struct klock_info;
64 68
65#else /* !(CONFIG_SMP) */ 69#else /* !(CONFIG_SMP) */
66 70
71static inline void cpu_die(void) { }
72
67#endif /* !(CONFIG_SMP) */ 73#endif /* !(CONFIG_SMP) */
68 74
69#endif /* !(_PPC_SMP_H) */ 75#endif /* !(_PPC_SMP_H) */
diff --git a/include/asm-ppc/spinlock.h b/include/asm-ppc/spinlock.h
index 909199aae10..20edcf2a6e0 100644
--- a/include/asm-ppc/spinlock.h
+++ b/include/asm-ppc/spinlock.h
@@ -5,41 +5,21 @@
5 5
6/* 6/*
7 * Simple spin lock operations. 7 * Simple spin lock operations.
8 *
9 * (the type definitions are in asm/raw_spinlock_types.h)
8 */ 10 */
9 11
10typedef struct { 12#define __raw_spin_is_locked(x) ((x)->lock != 0)
11 volatile unsigned long lock; 13#define __raw_spin_unlock_wait(lock) \
12#ifdef CONFIG_DEBUG_SPINLOCK 14 do { while (__raw_spin_is_locked(lock)) cpu_relax(); } while (0)
13 volatile unsigned long owner_pc; 15#define __raw_spin_lock_flags(lock, flags) __raw_spin_lock(lock)
14 volatile unsigned long owner_cpu; 16
15#endif 17static inline void __raw_spin_lock(raw_spinlock_t *lock)
16#ifdef CONFIG_PREEMPT
17 unsigned int break_lock;
18#endif
19} spinlock_t;
20
21#ifdef __KERNEL__
22#ifdef CONFIG_DEBUG_SPINLOCK
23#define SPINLOCK_DEBUG_INIT , 0, 0
24#else
25#define SPINLOCK_DEBUG_INIT /* */
26#endif
27
28#define SPIN_LOCK_UNLOCKED (spinlock_t) { 0 SPINLOCK_DEBUG_INIT }
29
30#define spin_lock_init(x) do { *(x) = SPIN_LOCK_UNLOCKED; } while(0)
31#define spin_is_locked(x) ((x)->lock != 0)
32#define spin_unlock_wait(x) do { barrier(); } while(spin_is_locked(x))
33#define _raw_spin_lock_flags(lock, flags) _raw_spin_lock(lock)
34
35#ifndef CONFIG_DEBUG_SPINLOCK
36
37static inline void _raw_spin_lock(spinlock_t *lock)
38{ 18{
39 unsigned long tmp; 19 unsigned long tmp;
40 20
41 __asm__ __volatile__( 21 __asm__ __volatile__(
42 "b 1f # spin_lock\n\ 22 "b 1f # __raw_spin_lock\n\
432: lwzx %0,0,%1\n\ 232: lwzx %0,0,%1\n\
44 cmpwi 0,%0,0\n\ 24 cmpwi 0,%0,0\n\
45 bne+ 2b\n\ 25 bne+ 2b\n\
@@ -55,21 +35,13 @@ static inline void _raw_spin_lock(spinlock_t *lock)
55 : "cr0", "memory"); 35 : "cr0", "memory");
56} 36}
57 37
58static inline void _raw_spin_unlock(spinlock_t *lock) 38static inline void __raw_spin_unlock(raw_spinlock_t *lock)
59{ 39{
60 __asm__ __volatile__("eieio # spin_unlock": : :"memory"); 40 __asm__ __volatile__("eieio # __raw_spin_unlock": : :"memory");
61 lock->lock = 0; 41 lock->lock = 0;
62} 42}
63 43
64#define _raw_spin_trylock(l) (!test_and_set_bit(0,&(l)->lock)) 44#define __raw_spin_trylock(l) (!test_and_set_bit(0,&(l)->lock))
65
66#else
67
68extern void _raw_spin_lock(spinlock_t *lock);
69extern void _raw_spin_unlock(spinlock_t *lock);
70extern int _raw_spin_trylock(spinlock_t *lock);
71
72#endif
73 45
74/* 46/*
75 * Read-write spinlocks, allowing multiple readers 47 * Read-write spinlocks, allowing multiple readers
@@ -81,22 +53,11 @@ extern int _raw_spin_trylock(spinlock_t *lock);
81 * irq-safe write-lock, but readers can get non-irqsafe 53 * irq-safe write-lock, but readers can get non-irqsafe
82 * read-locks. 54 * read-locks.
83 */ 55 */
84typedef struct {
85 volatile signed int lock;
86#ifdef CONFIG_PREEMPT
87 unsigned int break_lock;
88#endif
89} rwlock_t;
90 56
91#define RW_LOCK_UNLOCKED (rwlock_t) { 0 } 57#define __raw_read_can_lock(rw) ((rw)->lock >= 0)
92#define rwlock_init(lp) do { *(lp) = RW_LOCK_UNLOCKED; } while(0) 58#define __raw_write_can_lock(rw) (!(rw)->lock)
93 59
94#define read_can_lock(rw) ((rw)->lock >= 0) 60static __inline__ int __raw_read_trylock(raw_rwlock_t *rw)
95#define write_can_lock(rw) (!(rw)->lock)
96
97#ifndef CONFIG_DEBUG_SPINLOCK
98
99static __inline__ int _raw_read_trylock(rwlock_t *rw)
100{ 61{
101 signed int tmp; 62 signed int tmp;
102 63
@@ -116,7 +77,7 @@ static __inline__ int _raw_read_trylock(rwlock_t *rw)
116 return tmp > 0; 77 return tmp > 0;
117} 78}
118 79
119static __inline__ void _raw_read_lock(rwlock_t *rw) 80static __inline__ void __raw_read_lock(raw_rwlock_t *rw)
120{ 81{
121 signed int tmp; 82 signed int tmp;
122 83
@@ -137,7 +98,7 @@ static __inline__ void _raw_read_lock(rwlock_t *rw)
137 : "cr0", "memory"); 98 : "cr0", "memory");
138} 99}
139 100
140static __inline__ void _raw_read_unlock(rwlock_t *rw) 101static __inline__ void __raw_read_unlock(raw_rwlock_t *rw)
141{ 102{
142 signed int tmp; 103 signed int tmp;
143 104
@@ -153,7 +114,7 @@ static __inline__ void _raw_read_unlock(rwlock_t *rw)
153 : "cr0", "memory"); 114 : "cr0", "memory");
154} 115}
155 116
156static __inline__ int _raw_write_trylock(rwlock_t *rw) 117static __inline__ int __raw_write_trylock(raw_rwlock_t *rw)
157{ 118{
158 signed int tmp; 119 signed int tmp;
159 120
@@ -173,7 +134,7 @@ static __inline__ int _raw_write_trylock(rwlock_t *rw)
173 return tmp == 0; 134 return tmp == 0;
174} 135}
175 136
176static __inline__ void _raw_write_lock(rwlock_t *rw) 137static __inline__ void __raw_write_lock(raw_rwlock_t *rw)
177{ 138{
178 signed int tmp; 139 signed int tmp;
179 140
@@ -194,22 +155,10 @@ static __inline__ void _raw_write_lock(rwlock_t *rw)
194 : "cr0", "memory"); 155 : "cr0", "memory");
195} 156}
196 157
197static __inline__ void _raw_write_unlock(rwlock_t *rw) 158static __inline__ void __raw_write_unlock(raw_rwlock_t *rw)
198{ 159{
199 __asm__ __volatile__("eieio # write_unlock": : :"memory"); 160 __asm__ __volatile__("eieio # write_unlock": : :"memory");
200 rw->lock = 0; 161 rw->lock = 0;
201} 162}
202 163
203#else
204
205extern void _raw_read_lock(rwlock_t *rw);
206extern void _raw_read_unlock(rwlock_t *rw);
207extern void _raw_write_lock(rwlock_t *rw);
208extern void _raw_write_unlock(rwlock_t *rw);
209extern int _raw_read_trylock(rwlock_t *rw);
210extern int _raw_write_trylock(rwlock_t *rw);
211
212#endif
213
214#endif /* __ASM_SPINLOCK_H */ 164#endif /* __ASM_SPINLOCK_H */
215#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/spinlock_types.h b/include/asm-ppc/spinlock_types.h
new file mode 100644
index 00000000000..7919ccc75b8
--- /dev/null
+++ b/include/asm-ppc/spinlock_types.h
@@ -0,0 +1,20 @@
1#ifndef __ASM_SPINLOCK_TYPES_H
2#define __ASM_SPINLOCK_TYPES_H
3
4#ifndef __LINUX_SPINLOCK_TYPES_H
5# error "please don't include this file directly"
6#endif
7
8typedef struct {
9 volatile unsigned long lock;
10} raw_spinlock_t;
11
12#define __RAW_SPIN_LOCK_UNLOCKED { 0 }
13
14typedef struct {
15 volatile signed int lock;
16} raw_rwlock_t;
17
18#define __RAW_RW_LOCK_UNLOCKED { 0 }
19
20#endif
diff --git a/include/asm-ppc/system.h b/include/asm-ppc/system.h
index 513a334c581..d754ab570fe 100644
--- a/include/asm-ppc/system.h
+++ b/include/asm-ppc/system.h
@@ -88,6 +88,7 @@ extern void *cacheable_memcpy(void *, const void *, unsigned int);
88extern int do_page_fault(struct pt_regs *, unsigned long, unsigned long); 88extern int do_page_fault(struct pt_regs *, unsigned long, unsigned long);
89extern void bad_page_fault(struct pt_regs *, unsigned long, int); 89extern void bad_page_fault(struct pt_regs *, unsigned long, int);
90extern void die(const char *, struct pt_regs *, long); 90extern void die(const char *, struct pt_regs *, long);
91extern void _exception(int, struct pt_regs *, int, unsigned long);
91#ifdef CONFIG_BOOKE_WDT 92#ifdef CONFIG_BOOKE_WDT
92extern u32 booke_wdt_enabled; 93extern u32 booke_wdt_enabled;
93extern u32 booke_wdt_period; 94extern u32 booke_wdt_period;
diff --git a/include/asm-ppc/timex.h b/include/asm-ppc/timex.h
deleted file mode 100644
index cffc8712077..00000000000
--- a/include/asm-ppc/timex.h
+++ /dev/null
@@ -1,40 +0,0 @@
1/*
2 * include/asm-ppc/timex.h
3 *
4 * ppc architecture timex specifications
5 */
6#ifdef __KERNEL__
7#ifndef _ASMppc_TIMEX_H
8#define _ASMppc_TIMEX_H
9
10#include <linux/config.h>
11#include <asm/cputable.h>
12
13#define CLOCK_TICK_RATE 1193180 /* Underlying HZ */
14
15typedef unsigned long cycles_t;
16
17/*
18 * For the "cycle" counter we use the timebase lower half.
19 * Currently only used on SMP.
20 */
21
22static inline cycles_t get_cycles(void)
23{
24 cycles_t ret = 0;
25
26 __asm__ __volatile__(
27 "98: mftb %0\n"
28 "99:\n"
29 ".section __ftr_fixup,\"a\"\n"
30 " .long %1\n"
31 " .long 0\n"
32 " .long 98b\n"
33 " .long 99b\n"
34 ".previous"
35 : "=r" (ret) : "i" (CPU_FTR_601));
36 return ret;
37}
38
39#endif
40#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/tlbflush.h b/include/asm-ppc/tlbflush.h
index 9850f53f54b..9afee4ffc83 100644
--- a/include/asm-ppc/tlbflush.h
+++ b/include/asm-ppc/tlbflush.h
@@ -72,7 +72,7 @@ static inline void flush_tlb_page(struct vm_area_struct *vma,
72static inline void flush_tlb_page_nohash(struct vm_area_struct *vma, 72static inline void flush_tlb_page_nohash(struct vm_area_struct *vma,
73 unsigned long vmaddr) 73 unsigned long vmaddr)
74 { _tlbie(vmaddr); } 74 { _tlbie(vmaddr); }
75static inline void flush_tlb_range(struct mm_struct *mm, 75static inline void flush_tlb_range(struct vm_area_struct *vma,
76 unsigned long start, unsigned long end) 76 unsigned long start, unsigned long end)
77 { __tlbia(); } 77 { __tlbia(); }
78static inline void flush_tlb_kernel_range(unsigned long start, 78static inline void flush_tlb_kernel_range(unsigned long start,
diff --git a/include/asm-ppc/topology.h b/include/asm-ppc/topology.h
deleted file mode 100644
index 6a029bbba6e..00000000000
--- a/include/asm-ppc/topology.h
+++ /dev/null
@@ -1,6 +0,0 @@
1#ifndef _ASM_PPC_TOPOLOGY_H
2#define _ASM_PPC_TOPOLOGY_H
3
4#include <asm-generic/topology.h>
5
6#endif /* _ASM_PPC_TOPOLOGY_H */
diff --git a/include/asm-ppc/user.h b/include/asm-ppc/user.h
deleted file mode 100644
index d662b215137..00000000000
--- a/include/asm-ppc/user.h
+++ /dev/null
@@ -1,54 +0,0 @@
1#ifdef __KERNEL__
2#ifndef _PPC_USER_H
3#define _PPC_USER_H
4
5/* Adapted from <asm-alpha/user.h> */
6
7#include <linux/ptrace.h>
8#include <asm/page.h>
9
10/*
11 * Core file format: The core file is written in such a way that gdb
12 * can understand it and provide useful information to the user (under
13 * linux we use the `trad-core' bfd, NOT the osf-core). The file contents
14 * are as follows:
15 *
16 * upage: 1 page consisting of a user struct that tells gdb
17 * what is present in the file. Directly after this is a
18 * copy of the task_struct, which is currently not used by gdb,
19 * but it may come in handy at some point. All of the registers
20 * are stored as part of the upage. The upage should always be
21 * only one page long.
22 * data: The data segment follows next. We use current->end_text to
23 * current->brk to pick up all of the user variables, plus any memory
24 * that may have been sbrk'ed. No attempt is made to determine if a
25 * page is demand-zero or if a page is totally unused, we just cover
26 * the entire range. All of the addresses are rounded in such a way
27 * that an integral number of pages is written.
28 * stack: We need the stack information in order to get a meaningful
29 * backtrace. We need to write the data from usp to
30 * current->start_stack, so we round each of these in order to be able
31 * to write an integer number of pages.
32 */
33struct user {
34 struct pt_regs regs; /* entire machine state */
35 size_t u_tsize; /* text size (pages) */
36 size_t u_dsize; /* data size (pages) */
37 size_t u_ssize; /* stack size (pages) */
38 unsigned long start_code; /* text starting address */
39 unsigned long start_data; /* data starting address */
40 unsigned long start_stack; /* stack starting address */
41 long int signal; /* signal causing core dump */
42 struct regs * u_ar0; /* help gdb find registers */
43 unsigned long magic; /* identifies a core file */
44 char u_comm[32]; /* user command name */
45};
46
47#define NBPG PAGE_SIZE
48#define UPAGES 1
49#define HOST_TEXT_START_ADDR (u.start_code)
50#define HOST_DATA_START_ADDR (u.start_data)
51#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
52
53#endif /* _PPC_USER_H */
54#endif /* __KERNEL__ */