aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-ppc64
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-ppc64')
-rw-r--r--include/asm-ppc64/eeh.h39
-rw-r--r--include/asm-ppc64/io.h42
-rw-r--r--include/asm-ppc64/msgbuf.h27
-rw-r--r--include/asm-ppc64/param.h31
-rw-r--r--include/asm-ppc64/pci-bridge.h45
-rw-r--r--include/asm-ppc64/pci.h13
-rw-r--r--include/asm-ppc64/prom.h19
-rw-r--r--include/asm-ppc64/segment.h6
-rw-r--r--include/asm-ppc64/setup.h6
-rw-r--r--include/asm-ppc64/timex.h26
-rw-r--r--include/asm-ppc64/topology.h69
-rw-r--r--include/asm-ppc64/user.h58
12 files changed, 94 insertions, 287 deletions
diff --git a/include/asm-ppc64/eeh.h b/include/asm-ppc64/eeh.h
index 94298b106a4b..40c8eb57493e 100644
--- a/include/asm-ppc64/eeh.h
+++ b/include/asm-ppc64/eeh.h
@@ -219,23 +219,24 @@ static inline void eeh_raw_writeq(u64 val, volatile void __iomem *addr)
219static inline void eeh_memset_io(volatile void __iomem *addr, int c, 219static inline void eeh_memset_io(volatile void __iomem *addr, int c,
220 unsigned long n) 220 unsigned long n)
221{ 221{
222 void *p = (void __force *)addr;
222 u32 lc = c; 223 u32 lc = c;
223 lc |= lc << 8; 224 lc |= lc << 8;
224 lc |= lc << 16; 225 lc |= lc << 16;
225 226
226 while(n && !EEH_CHECK_ALIGN(addr, 4)) { 227 while(n && !EEH_CHECK_ALIGN(p, 4)) {
227 *((volatile u8 *)addr) = c; 228 *((volatile u8 *)p) = c;
228 addr = (void *)((unsigned long)addr + 1); 229 p++;
229 n--; 230 n--;
230 } 231 }
231 while(n >= 4) { 232 while(n >= 4) {
232 *((volatile u32 *)addr) = lc; 233 *((volatile u32 *)p) = lc;
233 addr = (void *)((unsigned long)addr + 4); 234 p += 4;
234 n -= 4; 235 n -= 4;
235 } 236 }
236 while(n) { 237 while(n) {
237 *((volatile u8 *)addr) = c; 238 *((volatile u8 *)p) = c;
238 addr = (void *)((unsigned long)addr + 1); 239 p++;
239 n--; 240 n--;
240 } 241 }
241 __asm__ __volatile__ ("sync" : : : "memory"); 242 __asm__ __volatile__ ("sync" : : : "memory");
@@ -250,22 +251,22 @@ static inline void eeh_memcpy_fromio(void *dest, const volatile void __iomem *sr
250 while(n && (!EEH_CHECK_ALIGN(vsrc, 4) || !EEH_CHECK_ALIGN(dest, 4))) { 251 while(n && (!EEH_CHECK_ALIGN(vsrc, 4) || !EEH_CHECK_ALIGN(dest, 4))) {
251 *((u8 *)dest) = *((volatile u8 *)vsrc); 252 *((u8 *)dest) = *((volatile u8 *)vsrc);
252 __asm__ __volatile__ ("eieio" : : : "memory"); 253 __asm__ __volatile__ ("eieio" : : : "memory");
253 vsrc = (void *)((unsigned long)vsrc + 1); 254 vsrc++;
254 dest = (void *)((unsigned long)dest + 1); 255 dest++;
255 n--; 256 n--;
256 } 257 }
257 while(n > 4) { 258 while(n > 4) {
258 *((u32 *)dest) = *((volatile u32 *)vsrc); 259 *((u32 *)dest) = *((volatile u32 *)vsrc);
259 __asm__ __volatile__ ("eieio" : : : "memory"); 260 __asm__ __volatile__ ("eieio" : : : "memory");
260 vsrc = (void *)((unsigned long)vsrc + 4); 261 vsrc += 4;
261 dest = (void *)((unsigned long)dest + 4); 262 dest += 4;
262 n -= 4; 263 n -= 4;
263 } 264 }
264 while(n) { 265 while(n) {
265 *((u8 *)dest) = *((volatile u8 *)vsrc); 266 *((u8 *)dest) = *((volatile u8 *)vsrc);
266 __asm__ __volatile__ ("eieio" : : : "memory"); 267 __asm__ __volatile__ ("eieio" : : : "memory");
267 vsrc = (void *)((unsigned long)vsrc + 1); 268 vsrc++;
268 dest = (void *)((unsigned long)dest + 1); 269 dest++;
269 n--; 270 n--;
270 } 271 }
271 __asm__ __volatile__ ("sync" : : : "memory"); 272 __asm__ __volatile__ ("sync" : : : "memory");
@@ -286,20 +287,20 @@ static inline void eeh_memcpy_toio(volatile void __iomem *dest, const void *src,
286 287
287 while(n && (!EEH_CHECK_ALIGN(vdest, 4) || !EEH_CHECK_ALIGN(src, 4))) { 288 while(n && (!EEH_CHECK_ALIGN(vdest, 4) || !EEH_CHECK_ALIGN(src, 4))) {
288 *((volatile u8 *)vdest) = *((u8 *)src); 289 *((volatile u8 *)vdest) = *((u8 *)src);
289 src = (void *)((unsigned long)src + 1); 290 src++;
290 vdest = (void *)((unsigned long)vdest + 1); 291 vdest++;
291 n--; 292 n--;
292 } 293 }
293 while(n > 4) { 294 while(n > 4) {
294 *((volatile u32 *)vdest) = *((volatile u32 *)src); 295 *((volatile u32 *)vdest) = *((volatile u32 *)src);
295 src = (void *)((unsigned long)src + 4); 296 src += 4;
296 vdest = (void *)((unsigned long)vdest + 4); 297 vdest += 4;
297 n-=4; 298 n-=4;
298 } 299 }
299 while(n) { 300 while(n) {
300 *((volatile u8 *)vdest) = *((u8 *)src); 301 *((volatile u8 *)vdest) = *((u8 *)src);
301 src = (void *)((unsigned long)src + 1); 302 src++;
302 vdest = (void *)((unsigned long)vdest + 1); 303 vdest++;
303 n--; 304 n--;
304 } 305 }
305 __asm__ __volatile__ ("sync" : : : "memory"); 306 __asm__ __volatile__ ("sync" : : : "memory");
diff --git a/include/asm-ppc64/io.h b/include/asm-ppc64/io.h
index aba1dfa388ba..59c958aea4db 100644
--- a/include/asm-ppc64/io.h
+++ b/include/asm-ppc64/io.h
@@ -20,10 +20,10 @@
20 20
21#include <asm-generic/iomap.h> 21#include <asm-generic/iomap.h>
22 22
23#define __ide_mm_insw(p, a, c) _insw_ns((volatile u16 *)(p), (a), (c)) 23#define __ide_mm_insw(p, a, c) _insw_ns((volatile u16 __iomem *)(p), (a), (c))
24#define __ide_mm_insl(p, a, c) _insl_ns((volatile u32 *)(p), (a), (c)) 24#define __ide_mm_insl(p, a, c) _insl_ns((volatile u32 __iomem *)(p), (a), (c))
25#define __ide_mm_outsw(p, a, c) _outsw_ns((volatile u16 *)(p), (a), (c)) 25#define __ide_mm_outsw(p, a, c) _outsw_ns((volatile u16 __iomem *)(p), (a), (c))
26#define __ide_mm_outsl(p, a, c) _outsl_ns((volatile u32 *)(p), (a), (c)) 26#define __ide_mm_outsl(p, a, c) _outsl_ns((volatile u32 __iomem *)(p), (a), (c))
27 27
28 28
29#define SIO_CONFIG_RA 0x398 29#define SIO_CONFIG_RA 0x398
@@ -71,8 +71,8 @@ extern unsigned long io_page_mask;
71 * Neither do the standard versions now, these are just here 71 * Neither do the standard versions now, these are just here
72 * for older code. 72 * for older code.
73 */ 73 */
74#define insw_ns(port, buf, ns) _insw_ns((u16 *)((port)+pci_io_base), (buf), (ns)) 74#define insw_ns(port, buf, ns) _insw_ns((u16 __iomem *)((port)+pci_io_base), (buf), (ns))
75#define insl_ns(port, buf, nl) _insl_ns((u32 *)((port)+pci_io_base), (buf), (nl)) 75#define insl_ns(port, buf, nl) _insl_ns((u32 __iomem *)((port)+pci_io_base), (buf), (nl))
76#else 76#else
77 77
78static inline unsigned char __raw_readb(const volatile void __iomem *addr) 78static inline unsigned char __raw_readb(const volatile void __iomem *addr)
@@ -136,9 +136,9 @@ static inline void __raw_writeq(unsigned long v, volatile void __iomem *addr)
136#define insw_ns(port, buf, ns) eeh_insw_ns((port), (buf), (ns)) 136#define insw_ns(port, buf, ns) eeh_insw_ns((port), (buf), (ns))
137#define insl_ns(port, buf, nl) eeh_insl_ns((port), (buf), (nl)) 137#define insl_ns(port, buf, nl) eeh_insl_ns((port), (buf), (nl))
138 138
139#define outsb(port, buf, ns) _outsb((u8 *)((port)+pci_io_base), (buf), (ns)) 139#define outsb(port, buf, ns) _outsb((u8 __iomem *)((port)+pci_io_base), (buf), (ns))
140#define outsw(port, buf, ns) _outsw_ns((u16 *)((port)+pci_io_base), (buf), (ns)) 140#define outsw(port, buf, ns) _outsw_ns((u16 __iomem *)((port)+pci_io_base), (buf), (ns))
141#define outsl(port, buf, nl) _outsl_ns((u32 *)((port)+pci_io_base), (buf), (nl)) 141#define outsl(port, buf, nl) _outsl_ns((u32 __iomem *)((port)+pci_io_base), (buf), (nl))
142 142
143#endif 143#endif
144 144
@@ -147,16 +147,16 @@ static inline void __raw_writeq(unsigned long v, volatile void __iomem *addr)
147#define readl_relaxed(addr) readl(addr) 147#define readl_relaxed(addr) readl(addr)
148#define readq_relaxed(addr) readq(addr) 148#define readq_relaxed(addr) readq(addr)
149 149
150extern void _insb(volatile u8 *port, void *buf, int ns); 150extern void _insb(volatile u8 __iomem *port, void *buf, int ns);
151extern void _outsb(volatile u8 *port, const void *buf, int ns); 151extern void _outsb(volatile u8 __iomem *port, const void *buf, int ns);
152extern void _insw(volatile u16 *port, void *buf, int ns); 152extern void _insw(volatile u16 __iomem *port, void *buf, int ns);
153extern void _outsw(volatile u16 *port, const void *buf, int ns); 153extern void _outsw(volatile u16 __iomem *port, const void *buf, int ns);
154extern void _insl(volatile u32 *port, void *buf, int nl); 154extern void _insl(volatile u32 __iomem *port, void *buf, int nl);
155extern void _outsl(volatile u32 *port, const void *buf, int nl); 155extern void _outsl(volatile u32 __iomem *port, const void *buf, int nl);
156extern void _insw_ns(volatile u16 *port, void *buf, int ns); 156extern void _insw_ns(volatile u16 __iomem *port, void *buf, int ns);
157extern void _outsw_ns(volatile u16 *port, const void *buf, int ns); 157extern void _outsw_ns(volatile u16 __iomem *port, const void *buf, int ns);
158extern void _insl_ns(volatile u32 *port, void *buf, int nl); 158extern void _insl_ns(volatile u32 __iomem *port, void *buf, int nl);
159extern void _outsl_ns(volatile u32 *port, const void *buf, int nl); 159extern void _outsl_ns(volatile u32 __iomem *port, const void *buf, int nl);
160 160
161#define mmiowb() 161#define mmiowb()
162 162
@@ -176,8 +176,8 @@ extern void _outsl_ns(volatile u32 *port, const void *buf, int nl);
176 * Neither do the standard versions now, these are just here 176 * Neither do the standard versions now, these are just here
177 * for older code. 177 * for older code.
178 */ 178 */
179#define outsw_ns(port, buf, ns) _outsw_ns((u16 *)((port)+pci_io_base), (buf), (ns)) 179#define outsw_ns(port, buf, ns) _outsw_ns((u16 __iomem *)((port)+pci_io_base), (buf), (ns))
180#define outsl_ns(port, buf, nl) _outsl_ns((u32 *)((port)+pci_io_base), (buf), (nl)) 180#define outsl_ns(port, buf, nl) _outsl_ns((u32 __iomem *)((port)+pci_io_base), (buf), (nl))
181 181
182 182
183#define IO_SPACE_LIMIT ~(0UL) 183#define IO_SPACE_LIMIT ~(0UL)
diff --git a/include/asm-ppc64/msgbuf.h b/include/asm-ppc64/msgbuf.h
deleted file mode 100644
index 31c1cbf133cc..000000000000
--- a/include/asm-ppc64/msgbuf.h
+++ /dev/null
@@ -1,27 +0,0 @@
1#ifndef _PPC64_MSGBUF_H
2#define _PPC64_MSGBUF_H
3
4/*
5 * The msqid64_ds structure for the PPC architecture.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version
10 * 2 of the License, or (at your option) any later version.
11 */
12
13struct msqid64_ds {
14 struct ipc64_perm msg_perm;
15 __kernel_time_t msg_stime; /* last msgsnd time */
16 __kernel_time_t msg_rtime; /* last msgrcv time */
17 __kernel_time_t msg_ctime; /* last change time */
18 unsigned long msg_cbytes; /* current number of bytes on queue */
19 unsigned long msg_qnum; /* number of messages in queue */
20 unsigned long msg_qbytes; /* max number of bytes on queue */
21 __kernel_pid_t msg_lspid; /* pid of last msgsnd */
22 __kernel_pid_t msg_lrpid; /* last receive pid */
23 unsigned long __unused1;
24 unsigned long __unused2;
25};
26
27#endif /* _PPC64_MSGBUF_H */
diff --git a/include/asm-ppc64/param.h b/include/asm-ppc64/param.h
deleted file mode 100644
index 76c212d475b3..000000000000
--- a/include/asm-ppc64/param.h
+++ /dev/null
@@ -1,31 +0,0 @@
1#ifndef _ASM_PPC64_PARAM_H
2#define _ASM_PPC64_PARAM_H
3
4#include <linux/config.h>
5
6/*
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version
10 * 2 of the License, or (at your option) any later version.
11 */
12
13#ifdef __KERNEL__
14# define HZ CONFIG_HZ /* Internal kernel timer frequency */
15# define USER_HZ 100 /* .. some user interfaces are in "ticks" */
16# define CLOCKS_PER_SEC (USER_HZ) /* like times() */
17#endif
18
19#ifndef HZ
20#define HZ 100
21#endif
22
23#define EXEC_PAGESIZE 4096
24
25#ifndef NOGROUP
26#define NOGROUP (-1)
27#endif
28
29#define MAXHOSTNAMELEN 64 /* max length of hostname */
30
31#endif /* _ASM_PPC64_PARAM_H */
diff --git a/include/asm-ppc64/pci-bridge.h b/include/asm-ppc64/pci-bridge.h
index c4f9023ea5ed..6b4a5b1f695e 100644
--- a/include/asm-ppc64/pci-bridge.h
+++ b/include/asm-ppc64/pci-bridge.h
@@ -48,19 +48,52 @@ struct pci_controller {
48 unsigned long dma_window_size; 48 unsigned long dma_window_size;
49}; 49};
50 50
51/*
52 * PCI stuff, for nodes representing PCI devices, pointed to
53 * by device_node->data.
54 */
55struct pci_controller;
56struct iommu_table;
57
58struct pci_dn {
59 int busno; /* for pci devices */
60 int bussubno; /* for pci devices */
61 int devfn; /* for pci devices */
62 int eeh_mode; /* See eeh.h for possible EEH_MODEs */
63 int eeh_config_addr;
64 int eeh_capable; /* from firmware */
65 int eeh_check_count; /* # times driver ignored error */
66 int eeh_freeze_count; /* # times this device froze up. */
67 int eeh_is_bridge; /* device is pci-to-pci bridge */
68
69 int pci_ext_config_space; /* for pci devices */
70 struct pci_controller *phb; /* for pci devices */
71 struct iommu_table *iommu_table; /* for phb's or bridges */
72 struct pci_dev *pcidev; /* back-pointer to the pci device */
73 struct device_node *node; /* back-pointer to the device_node */
74 u32 config_space[16]; /* saved PCI config space */
75};
76
77/* Get the pointer to a device_node's pci_dn */
78#define PCI_DN(dn) ((struct pci_dn *) (dn)->data)
79
51struct device_node *fetch_dev_dn(struct pci_dev *dev); 80struct device_node *fetch_dev_dn(struct pci_dev *dev);
52 81
53/* Get a device_node from a pci_dev. This code must be fast except in the case 82/* Get a device_node from a pci_dev. This code must be fast except
54 * where the sysdata is incorrect and needs to be fixed up (hopefully just once) 83 * in the case where the sysdata is incorrect and needs to be fixed
84 * up (this will only happen once).
85 * In this case the sysdata will have been inherited from a PCI host
86 * bridge or a PCI-PCI bridge further up the tree, so it will point
87 * to a valid struct pci_dn, just not the one we want.
55 */ 88 */
56static inline struct device_node *pci_device_to_OF_node(struct pci_dev *dev) 89static inline struct device_node *pci_device_to_OF_node(struct pci_dev *dev)
57{ 90{
58 struct device_node *dn = dev->sysdata; 91 struct device_node *dn = dev->sysdata;
92 struct pci_dn *pdn = dn->data;
59 93
60 if (dn->devfn == dev->devfn && dn->busno == dev->bus->number) 94 if (pdn && pdn->devfn == dev->devfn && pdn->busno == dev->bus->number)
61 return dn; /* fast path. sysdata is good */ 95 return dn; /* fast path. sysdata is good */
62 else 96 return fetch_dev_dn(dev);
63 return fetch_dev_dn(dev);
64} 97}
65 98
66static inline struct device_node *pci_bus_to_OF_node(struct pci_bus *bus) 99static inline struct device_node *pci_bus_to_OF_node(struct pci_bus *bus)
@@ -83,7 +116,7 @@ static inline struct pci_controller *pci_bus_to_host(struct pci_bus *bus)
83 struct device_node *busdn = bus->sysdata; 116 struct device_node *busdn = bus->sysdata;
84 117
85 BUG_ON(busdn == NULL); 118 BUG_ON(busdn == NULL);
86 return busdn->phb; 119 return PCI_DN(busdn)->phb;
87} 120}
88 121
89#endif 122#endif
diff --git a/include/asm-ppc64/pci.h b/include/asm-ppc64/pci.h
index 4d057452f59b..a88bbfc26967 100644
--- a/include/asm-ppc64/pci.h
+++ b/include/asm-ppc64/pci.h
@@ -138,6 +138,19 @@ extern void
138pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, 138pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
139 struct pci_bus_region *region); 139 struct pci_bus_region *region);
140 140
141static inline struct resource *
142pcibios_select_root(struct pci_dev *pdev, struct resource *res)
143{
144 struct resource *root = NULL;
145
146 if (res->flags & IORESOURCE_IO)
147 root = &ioport_resource;
148 if (res->flags & IORESOURCE_MEM)
149 root = &iomem_resource;
150
151 return root;
152}
153
141extern int 154extern int
142unmap_bus_range(struct pci_bus *bus); 155unmap_bus_range(struct pci_bus *bus);
143 156
diff --git a/include/asm-ppc64/prom.h b/include/asm-ppc64/prom.h
index dc5330b39509..c02ec1d6b909 100644
--- a/include/asm-ppc64/prom.h
+++ b/include/asm-ppc64/prom.h
@@ -116,14 +116,6 @@ struct property {
116 struct property *next; 116 struct property *next;
117}; 117};
118 118
119/* NOTE: the device_node contains PCI specific info for pci devices.
120 * This perhaps could be hung off the device_node with another struct,
121 * but for now it is directly in the node. The phb ptr is a good
122 * indication of a real PCI node. Other nodes leave these fields zeroed.
123 */
124struct pci_controller;
125struct iommu_table;
126
127struct device_node { 119struct device_node {
128 char *name; 120 char *name;
129 char *type; 121 char *type;
@@ -135,16 +127,6 @@ struct device_node {
135 struct interrupt_info *intrs; 127 struct interrupt_info *intrs;
136 char *full_name; 128 char *full_name;
137 129
138 /* PCI stuff probably doesn't belong here */
139 int busno; /* for pci devices */
140 int bussubno; /* for pci devices */
141 int devfn; /* for pci devices */
142 int eeh_mode; /* See eeh.h for possible EEH_MODEs */
143 int eeh_config_addr;
144 int pci_ext_config_space; /* for pci devices */
145 struct pci_controller *phb; /* for pci devices */
146 struct iommu_table *iommu_table; /* for phb's or bridges */
147
148 struct property *properties; 130 struct property *properties;
149 struct device_node *parent; 131 struct device_node *parent;
150 struct device_node *child; 132 struct device_node *child;
@@ -154,6 +136,7 @@ struct device_node {
154 struct proc_dir_entry *pde; /* this node's proc directory */ 136 struct proc_dir_entry *pde; /* this node's proc directory */
155 struct kref kref; 137 struct kref kref;
156 unsigned long _flags; 138 unsigned long _flags;
139 void *data;
157}; 140};
158 141
159extern struct device_node *of_chosen; 142extern struct device_node *of_chosen;
diff --git a/include/asm-ppc64/segment.h b/include/asm-ppc64/segment.h
deleted file mode 100644
index d80fb68cc79e..000000000000
--- a/include/asm-ppc64/segment.h
+++ /dev/null
@@ -1,6 +0,0 @@
1#ifndef __PPC64_SEGMENT_H
2#define __PPC64_SEGMENT_H
3
4/* Only here because we have some old header files that expect it.. */
5
6#endif /* __PPC64_SEGMENT_H */
diff --git a/include/asm-ppc64/setup.h b/include/asm-ppc64/setup.h
deleted file mode 100644
index b257b8348c73..000000000000
--- a/include/asm-ppc64/setup.h
+++ /dev/null
@@ -1,6 +0,0 @@
1#ifndef _PPC_SETUP_H
2#define _PPC_SETUP_H
3
4#define COMMAND_LINE_SIZE 512
5
6#endif /* _PPC_SETUP_H */
diff --git a/include/asm-ppc64/timex.h b/include/asm-ppc64/timex.h
deleted file mode 100644
index 8db4da4064cd..000000000000
--- a/include/asm-ppc64/timex.h
+++ /dev/null
@@ -1,26 +0,0 @@
1/*
2 * linux/include/asm-ppc/timex.h
3 *
4 * PPC64 architecture timex specifications
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 */
11#ifndef _ASMPPC64_TIMEX_H
12#define _ASMPPC64_TIMEX_H
13
14#define CLOCK_TICK_RATE 1193180 /* Underlying HZ */
15
16typedef unsigned long cycles_t;
17
18static inline cycles_t get_cycles(void)
19{
20 cycles_t ret;
21
22 __asm__ __volatile__("mftb %0" : "=r" (ret) : );
23 return ret;
24}
25
26#endif
diff --git a/include/asm-ppc64/topology.h b/include/asm-ppc64/topology.h
deleted file mode 100644
index 1e9b19073230..000000000000
--- a/include/asm-ppc64/topology.h
+++ /dev/null
@@ -1,69 +0,0 @@
1#ifndef _ASM_PPC64_TOPOLOGY_H
2#define _ASM_PPC64_TOPOLOGY_H
3
4#include <linux/config.h>
5#include <asm/mmzone.h>
6
7#ifdef CONFIG_NUMA
8
9static inline int cpu_to_node(int cpu)
10{
11 int node;
12
13 node = numa_cpu_lookup_table[cpu];
14
15#ifdef DEBUG_NUMA
16 BUG_ON(node == -1);
17#endif
18
19 return node;
20}
21
22#define parent_node(node) (node)
23
24static inline cpumask_t node_to_cpumask(int node)
25{
26 return numa_cpumask_lookup_table[node];
27}
28
29static inline int node_to_first_cpu(int node)
30{
31 cpumask_t tmp;
32 tmp = node_to_cpumask(node);
33 return first_cpu(tmp);
34}
35
36#define pcibus_to_node(node) (-1)
37#define pcibus_to_cpumask(bus) (cpu_online_map)
38
39#define nr_cpus_node(node) (nr_cpus_in_node[node])
40
41/* sched_domains SD_NODE_INIT for PPC64 machines */
42#define SD_NODE_INIT (struct sched_domain) { \
43 .span = CPU_MASK_NONE, \
44 .parent = NULL, \
45 .groups = NULL, \
46 .min_interval = 8, \
47 .max_interval = 32, \
48 .busy_factor = 32, \
49 .imbalance_pct = 125, \
50 .cache_hot_time = (10*1000000), \
51 .cache_nice_tries = 1, \
52 .per_cpu_gain = 100, \
53 .flags = SD_LOAD_BALANCE \
54 | SD_BALANCE_EXEC \
55 | SD_BALANCE_NEWIDLE \
56 | SD_WAKE_IDLE \
57 | SD_WAKE_BALANCE, \
58 .last_balance = jiffies, \
59 .balance_interval = 1, \
60 .nr_balance_failed = 0, \
61}
62
63#else
64
65#include <asm-generic/topology.h>
66
67#endif /* CONFIG_NUMA */
68
69#endif /* _ASM_PPC64_TOPOLOGY_H */
diff --git a/include/asm-ppc64/user.h b/include/asm-ppc64/user.h
deleted file mode 100644
index d7d6554a421f..000000000000
--- a/include/asm-ppc64/user.h
+++ /dev/null
@@ -1,58 +0,0 @@
1#ifndef _PPC_USER_H
2#define _PPC_USER_H
3
4/* Adapted from <asm-alpha/user.h>
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 */
11
12#include <asm/ptrace.h>
13#include <asm/page.h>
14
15/*
16 * Core file format: The core file is written in such a way that gdb
17 * can understand it and provide useful information to the user (under
18 * linux we use the `trad-core' bfd, NOT the osf-core). The file contents
19 * are as follows:
20 *
21 * upage: 1 page consisting of a user struct that tells gdb
22 * what is present in the file. Directly after this is a
23 * copy of the task_struct, which is currently not used by gdb,
24 * but it may come in handy at some point. All of the registers
25 * are stored as part of the upage. The upage should always be
26 * only one page long.
27 * data: The data segment follows next. We use current->end_text to
28 * current->brk to pick up all of the user variables, plus any memory
29 * that may have been sbrk'ed. No attempt is made to determine if a
30 * page is demand-zero or if a page is totally unused, we just cover
31 * the entire range. All of the addresses are rounded in such a way
32 * that an integral number of pages is written.
33 * stack: We need the stack information in order to get a meaningful
34 * backtrace. We need to write the data from usp to
35 * current->start_stack, so we round each of these in order to be able
36 * to write an integer number of pages.
37 */
38struct user {
39 struct pt_regs regs; /* entire machine state */
40 size_t u_tsize; /* text size (pages) */
41 size_t u_dsize; /* data size (pages) */
42 size_t u_ssize; /* stack size (pages) */
43 unsigned long start_code; /* text starting address */
44 unsigned long start_data; /* data starting address */
45 unsigned long start_stack; /* stack starting address */
46 long int signal; /* signal causing core dump */
47 struct regs * u_ar0; /* help gdb find registers */
48 unsigned long magic; /* identifies a core file */
49 char u_comm[32]; /* user command name */
50};
51
52#define NBPG PAGE_SIZE
53#define UPAGES 1
54#define HOST_TEXT_START_ADDR (u.start_code)
55#define HOST_DATA_START_ADDR (u.start_data)
56#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
57
58#endif /* _PPC_USER_H */