aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-powerpc
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-powerpc')
-rw-r--r--include/asm-powerpc/hardirq.h3
-rw-r--r--include/asm-powerpc/hw_irq.h1
-rw-r--r--include/asm-powerpc/ppc_asm.h92
-rw-r--r--include/asm-powerpc/prom.h3
-rw-r--r--include/asm-powerpc/system.h3
5 files changed, 75 insertions, 27 deletions
diff --git a/include/asm-powerpc/hardirq.h b/include/asm-powerpc/hardirq.h
index 2c0a31b1008d..3b3e3b49ec12 100644
--- a/include/asm-powerpc/hardirq.h
+++ b/include/asm-powerpc/hardirq.h
@@ -1,6 +1,9 @@
1#ifndef _ASM_POWERPC_HARDIRQ_H 1#ifndef _ASM_POWERPC_HARDIRQ_H
2#define _ASM_POWERPC_HARDIRQ_H 2#define _ASM_POWERPC_HARDIRQ_H
3 3
4#include <asm/irq.h>
5#include <asm/bug.h>
6
4/* The __last_jiffy_stamp field is needed to ensure that no decrementer 7/* The __last_jiffy_stamp field is needed to ensure that no decrementer
5 * interrupt is lost on SMP machines. Since on most CPUs it is in the same 8 * interrupt is lost on SMP machines. Since on most CPUs it is in the same
6 * cache line as local_irq_count, it is cheap to access and is also used on UP 9 * cache line as local_irq_count, it is cheap to access and is also used on UP
diff --git a/include/asm-powerpc/hw_irq.h b/include/asm-powerpc/hw_irq.h
index 605a65e42063..c37b31b96337 100644
--- a/include/asm-powerpc/hw_irq.h
+++ b/include/asm-powerpc/hw_irq.h
@@ -10,7 +10,6 @@
10#include <linux/errno.h> 10#include <linux/errno.h>
11#include <asm/ptrace.h> 11#include <asm/ptrace.h>
12#include <asm/processor.h> 12#include <asm/processor.h>
13#include <asm/irq.h>
14 13
15extern void timer_interrupt(struct pt_regs *); 14extern void timer_interrupt(struct pt_regs *);
16extern void ppc_irq_dispatch_handler(struct pt_regs *regs, int irq); 15extern void ppc_irq_dispatch_handler(struct pt_regs *regs, int irq);
diff --git a/include/asm-powerpc/ppc_asm.h b/include/asm-powerpc/ppc_asm.h
index 6cd52c130332..e4350e406d2a 100644
--- a/include/asm-powerpc/ppc_asm.h
+++ b/include/asm-powerpc/ppc_asm.h
@@ -1,10 +1,12 @@
1/* 1/*
2 * Copyright (C) 1995-1999 Gary Thomas, Paul Mackerras, Cort Dougan. 2 * Copyright (C) 1995-1999 Gary Thomas, Paul Mackerras, Cort Dougan.
3 */ 3 */
4
5#ifndef _ASM_POWERPC_PPC_ASM_H 4#ifndef _ASM_POWERPC_PPC_ASM_H
6#define _ASM_POWERPC_PPC_ASM_H 5#define _ASM_POWERPC_PPC_ASM_H
7 6
7#include <linux/stringify.h>
8#include <linux/config.h>
9
8#ifdef __ASSEMBLY__ 10#ifdef __ASSEMBLY__
9 11
10/* 12/*
@@ -87,6 +89,66 @@
87#define RFDI .long 0x4c00004e /* rfdi instruction */ 89#define RFDI .long 0x4c00004e /* rfdi instruction */
88#define RFMCI .long 0x4c00004c /* rfmci instruction */ 90#define RFMCI .long 0x4c00004c /* rfmci instruction */
89 91
92#ifdef CONFIG_PPC64
93
94#define XGLUE(a,b) a##b
95#define GLUE(a,b) XGLUE(a,b)
96
97#define _GLOBAL(name) \
98 .section ".text"; \
99 .align 2 ; \
100 .globl name; \
101 .globl GLUE(.,name); \
102 .section ".opd","aw"; \
103name: \
104 .quad GLUE(.,name); \
105 .quad .TOC.@tocbase; \
106 .quad 0; \
107 .previous; \
108 .type GLUE(.,name),@function; \
109GLUE(.,name):
110
111#define _KPROBE(name) \
112 .section ".kprobes.text","a"; \
113 .align 2 ; \
114 .globl name; \
115 .globl GLUE(.,name); \
116 .section ".opd","aw"; \
117name: \
118 .quad GLUE(.,name); \
119 .quad .TOC.@tocbase; \
120 .quad 0; \
121 .previous; \
122 .type GLUE(.,name),@function; \
123GLUE(.,name):
124
125#define _STATIC(name) \
126 .section ".text"; \
127 .align 2 ; \
128 .section ".opd","aw"; \
129name: \
130 .quad GLUE(.,name); \
131 .quad .TOC.@tocbase; \
132 .quad 0; \
133 .previous; \
134 .type GLUE(.,name),@function; \
135GLUE(.,name):
136
137#else /* 32-bit */
138
139#define _GLOBAL(n) \
140 .text; \
141 .stabs __stringify(n:F-1),N_FUN,0,0,n;\
142 .globl n; \
143n:
144
145#define _KPROBE(n) \
146 .section ".kprobes.text","a"; \
147 .globl n; \
148n:
149
150#endif
151
90/* 152/*
91 * LOADADDR( rn, name ) 153 * LOADADDR( rn, name )
92 * loads the address of 'name' into 'rn' 154 * loads the address of 'name' into 'rn'
@@ -251,31 +313,9 @@ END_FTR_SECTION_IFCLR(CPU_FTR_601)
251 .previous 313 .previous
252#endif 314#endif
253 315
254/* 316#ifdef CONFIG_PPC64
255 * On 64-bit cpus, we use the rfid instruction instead of rfi, but 317#define RFI rfid
256 * we then have to make sure we preserve the top 32 bits except for 318#define MTMSRD(r) mtmsrd r
257 * the 64-bit mode bit, which we clear.
258 */
259#if defined(CONFIG_PPC64BRIDGE)
260#define FIX_SRR1(ra, rb) \
261 mr rb,ra; \
262 mfmsr ra; \
263 clrldi ra,ra,1; /* turn off 64-bit mode */ \
264 rldimi ra,rb,0,32
265#define RFI .long 0x4c000024 /* rfid instruction */
266#define MTMSRD(r) .long (0x7c000164 + ((r) << 21)) /* mtmsrd */
267#define CLR_TOP32(r) rlwinm (r),(r),0,0,31 /* clear top 32 bits */
268#elif defined(CONFIG_PPC64)
269/* Insert the high 32 bits of the MSR into what will be the new
270 MSR (via SRR1 and rfid) This preserves the MSR.SF and MSR.ISF
271 bits. */
272
273#define FIX_SRR1(ra, rb) \
274 mr rb,ra; \
275 mfmsr ra; \
276 rldimi ra,rb,0,32
277
278#define CLR_TOP32(r) rlwinm (r),(r),0,0,31 /* clear top 32 bits */
279 319
280#else 320#else
281#define FIX_SRR1(ra, rb) 321#define FIX_SRR1(ra, rb)
diff --git a/include/asm-powerpc/prom.h b/include/asm-powerpc/prom.h
index 194b56ee1693..efc40980cb48 100644
--- a/include/asm-powerpc/prom.h
+++ b/include/asm-powerpc/prom.h
@@ -196,6 +196,7 @@ extern int prom_n_intr_cells(struct device_node* np);
196extern void prom_get_irq_senses(unsigned char *senses, int off, int max); 196extern void prom_get_irq_senses(unsigned char *senses, int off, int max);
197extern void prom_add_property(struct device_node* np, struct property* prop); 197extern void prom_add_property(struct device_node* np, struct property* prop);
198 198
199#ifdef CONFIG_PPC32
199/* 200/*
200 * PCI <-> OF matching functions 201 * PCI <-> OF matching functions
201 * (XXX should these be here?) 202 * (XXX should these be here?)
@@ -207,6 +208,8 @@ extern int pci_device_from_OF_node(struct device_node *node,
207extern struct device_node* pci_busdev_to_OF_node(struct pci_bus *, int); 208extern struct device_node* pci_busdev_to_OF_node(struct pci_bus *, int);
208extern struct device_node* pci_device_to_OF_node(struct pci_dev *); 209extern struct device_node* pci_device_to_OF_node(struct pci_dev *);
209extern void pci_create_OF_bus_map(void); 210extern void pci_create_OF_bus_map(void);
211#endif
212
210extern struct resource *request_OF_resource(struct device_node* node, 213extern struct resource *request_OF_resource(struct device_node* node,
211 int index, const char* name_postfix); 214 int index, const char* name_postfix);
212extern int release_OF_resource(struct device_node* node, int index); 215extern int release_OF_resource(struct device_node* node, int index);
diff --git a/include/asm-powerpc/system.h b/include/asm-powerpc/system.h
index 66866f7301a9..6463453b61a3 100644
--- a/include/asm-powerpc/system.h
+++ b/include/asm-powerpc/system.h
@@ -9,6 +9,7 @@
9 9
10#include <asm/hw_irq.h> 10#include <asm/hw_irq.h>
11#include <asm/ppc_asm.h> 11#include <asm/ppc_asm.h>
12#include <asm/atomic.h>
12 13
13/* 14/*
14 * Memory barrier. 15 * Memory barrier.
@@ -127,6 +128,7 @@ extern void flush_fp_to_thread(struct task_struct *);
127extern void enable_kernel_altivec(void); 128extern void enable_kernel_altivec(void);
128extern void giveup_altivec(struct task_struct *); 129extern void giveup_altivec(struct task_struct *);
129extern void load_up_altivec(struct task_struct *); 130extern void load_up_altivec(struct task_struct *);
131extern int emulate_altivec(struct pt_regs *);
130extern void giveup_spe(struct task_struct *); 132extern void giveup_spe(struct task_struct *);
131extern void load_up_spe(struct task_struct *); 133extern void load_up_spe(struct task_struct *);
132extern int fix_alignment(struct pt_regs *); 134extern int fix_alignment(struct pt_regs *);
@@ -176,6 +178,7 @@ extern struct task_struct *_switch(struct thread_struct *prev,
176 struct thread_struct *next); 178 struct thread_struct *next);
177 179
178extern unsigned int rtas_data; 180extern unsigned int rtas_data;
181extern int mem_init_done; /* set on boot once kmalloc can be called */
179 182
180/* 183/*
181 * Atomic exchange 184 * Atomic exchange