blob: 58eaaccd3cf03a0b423b344894b753ad7c42a49e [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
Linus Torvalds1da177e2005-04-16 15:20:36 -07002 * S390 version
Heiko Carstensa53c8fa2012-07-20 11:15:04 +02003 * Copyright IBM Corp. 1999
Linus Torvalds1da177e2005-04-16 15:20:36 -07004 * Author(s): Hartmut Penner (hp@de.ibm.com),
5 * Martin Schwidefsky (schwidefsky@de.ibm.com)
6 *
7 * Derived from "include/asm-i386/processor.h"
8 * Copyright (C) 1994, Linus Torvalds
9 */
10
11#ifndef __ASM_S390_PROCESSOR_H
12#define __ASM_S390_PROCESSOR_H
13
Heiko Carstens92778b92015-10-06 16:23:39 +020014#include <linux/const.h>
15
Martin Schwidefskyd3a73ac2014-04-15 12:55:07 +020016#define CIF_MCCK_PENDING 0 /* machine check handling is pending */
Heiko Carstens606aa4a2017-02-17 08:12:30 +010017#define CIF_ASCE_PRIMARY 1 /* primary asce needs fixup / uaccess */
Heiko Carstensb5a882f2017-02-17 08:13:28 +010018#define CIF_ASCE_SECONDARY 2 /* secondary asce needs fixup / uaccess */
19#define CIF_NOHZ_DELAY 3 /* delay HZ disable for a tick */
20#define CIF_FPU 4 /* restore FPU registers */
21#define CIF_IGNORE_IRQ 5 /* ignore interrupt (for udelay) */
22#define CIF_ENABLED_WAIT 6 /* in enabled wait state */
QingFeng Haoc9295002017-06-07 11:30:42 +020023#define CIF_MCCK_GUEST 7 /* machine check happening in guest */
Martin Schwidefskyd3a73ac2014-04-15 12:55:07 +020024
Heiko Carstens92778b92015-10-06 16:23:39 +020025#define _CIF_MCCK_PENDING _BITUL(CIF_MCCK_PENDING)
Heiko Carstens606aa4a2017-02-17 08:12:30 +010026#define _CIF_ASCE_PRIMARY _BITUL(CIF_ASCE_PRIMARY)
Heiko Carstensb5a882f2017-02-17 08:13:28 +010027#define _CIF_ASCE_SECONDARY _BITUL(CIF_ASCE_SECONDARY)
Heiko Carstens92778b92015-10-06 16:23:39 +020028#define _CIF_NOHZ_DELAY _BITUL(CIF_NOHZ_DELAY)
29#define _CIF_FPU _BITUL(CIF_FPU)
30#define _CIF_IGNORE_IRQ _BITUL(CIF_IGNORE_IRQ)
Martin Schwidefsky419123f2015-11-19 11:09:45 +010031#define _CIF_ENABLED_WAIT _BITUL(CIF_ENABLED_WAIT)
QingFeng Haoc9295002017-06-07 11:30:42 +020032#define _CIF_MCCK_GUEST _BITUL(CIF_MCCK_GUEST)
Martin Schwidefskyd3a73ac2014-04-15 12:55:07 +020033
Heiko Carstenseb608fb2012-09-05 13:26:11 +020034#ifndef __ASSEMBLY__
35
Heiko Carstensedd53782008-12-25 13:39:16 +010036#include <linux/linkage.h>
David Howellsa0616cd2012-03-28 18:30:02 +010037#include <linux/irqflags.h>
Heiko Carstense86a6ed2009-09-11 10:29:04 +020038#include <asm/cpu.h>
Christian Ehrhardt25097bf2009-04-14 15:36:16 +020039#include <asm/page.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070040#include <asm/ptrace.h>
Christian Ehrhardt25097bf2009-04-14 15:36:16 +020041#include <asm/setup.h>
Jan Glaubere4b8b3f2012-07-31 10:52:05 +020042#include <asm/runtime_instr.h>
Hendrik Bruecknerb0753902015-10-06 12:25:59 +020043#include <asm/fpu/types.h>
44#include <asm/fpu/internal.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070045
Martin Schwidefskyd3a73ac2014-04-15 12:55:07 +020046static inline void set_cpu_flag(int flag)
47{
Heiko Carstensac25e792015-10-06 16:23:29 +020048 S390_lowcore.cpu_flags |= (1UL << flag);
Martin Schwidefskyd3a73ac2014-04-15 12:55:07 +020049}
50
51static inline void clear_cpu_flag(int flag)
52{
Heiko Carstensac25e792015-10-06 16:23:29 +020053 S390_lowcore.cpu_flags &= ~(1UL << flag);
Martin Schwidefskyd3a73ac2014-04-15 12:55:07 +020054}
55
56static inline int test_cpu_flag(int flag)
57{
Heiko Carstensac25e792015-10-06 16:23:29 +020058 return !!(S390_lowcore.cpu_flags & (1UL << flag));
Martin Schwidefskyd3a73ac2014-04-15 12:55:07 +020059}
60
Martin Schwidefsky419123f2015-11-19 11:09:45 +010061/*
62 * Test CIF flag of another CPU. The caller needs to ensure that
63 * CPU hotplug can not happen, e.g. by disabling preemption.
64 */
65static inline int test_cpu_flag_of(int flag, int cpu)
66{
Heiko Carstensc667aea2015-12-31 10:29:00 +010067 struct lowcore *lc = lowcore_ptr[cpu];
Martin Schwidefsky419123f2015-11-19 11:09:45 +010068 return !!(lc->cpu_flags & (1UL << flag));
69}
70
Martin Schwidefskyfe0f4972014-09-30 17:37:52 +020071#define arch_needs_cpu() test_cpu_flag(CIF_NOHZ_DELAY)
72
Linus Torvalds1da177e2005-04-16 15:20:36 -070073/*
74 * Default implementation of macro that returns current
75 * instruction pointer ("program counter").
76 */
Martin Schwidefsky94c12cc2006-09-28 16:56:43 +020077#define current_text_addr() ({ void *pc; asm("basr %0,0" : "=a" (pc)); pc; })
Linus Torvalds1da177e2005-04-16 15:20:36 -070078
Heiko Carstense86a6ed2009-09-11 10:29:04 +020079static inline void get_cpu_id(struct cpuid *ptr)
Michael Holzheu72960a02007-02-21 10:55:18 +010080{
Martin Schwidefsky987bcda2010-02-26 22:37:31 +010081 asm volatile("stidp %0" : "=Q" (*ptr));
Michael Holzheu72960a02007-02-21 10:55:18 +010082}
83
Heiko Carstens097a1162016-04-14 12:35:22 +020084void s390_adjust_jiffies(void);
85void s390_update_cpu_mhz(void);
86void cpu_detect_mhz_feature(void);
87
Martin Schwidefsky638ad342011-10-30 15:17:13 +010088extern const struct seq_operations cpuinfo_op;
89extern int sysctl_ieee_emulation_warnings;
Al Viro65f22a92012-09-06 15:48:11 -040090extern void execve_tail(void);
Linus Torvalds1da177e2005-04-16 15:20:36 -070091
Linus Torvalds1da177e2005-04-16 15:20:36 -070092/*
Martin Schwidefskyf481bfa2009-03-18 13:27:36 +010093 * User space process size: 2GB for 31 bit, 4TB or 8PT for 64 bit.
Linus Torvalds1da177e2005-04-16 15:20:36 -070094 */
Linus Torvalds1da177e2005-04-16 15:20:36 -070095
Martin Schwidefskyee71d162017-04-20 14:43:51 +020096#define TASK_SIZE_OF(tsk) (test_tsk_thread_flag(tsk, TIF_31BIT) ? \
Martin Schwidefsky1aea9b32017-04-24 18:19:10 +020097 (1UL << 31) : -PAGE_SIZE)
Martin Schwidefsky5a216a22008-02-09 18:24:36 +010098#define TASK_UNMAPPED_BASE (test_thread_flag(TIF_31BIT) ? \
99 (1UL << 30) : (1UL << 41))
100#define TASK_SIZE TASK_SIZE_OF(current)
Martin Schwidefsky1aea9b32017-04-24 18:19:10 +0200101#define TASK_SIZE_MAX (-PAGE_SIZE)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700102
Martin Schwidefskyee71d162017-04-20 14:43:51 +0200103#define STACK_TOP (test_thread_flag(TIF_31BIT) ? \
104 (1UL << 31) : (1UL << 42))
Martin Schwidefsky6252d702008-02-09 18:24:37 +0100105#define STACK_TOP_MAX (1UL << 42)
David Howells922a70d2008-02-08 04:19:26 -0800106
Linus Torvalds1da177e2005-04-16 15:20:36 -0700107#define HAVE_ARCH_PICK_MMAP_LAYOUT
108
109typedef struct {
110 __u32 ar4;
111} mm_segment_t;
112
113/*
114 * Thread structure
115 */
116struct thread_struct {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700117 unsigned int acrs[NUM_ACRS];
118 unsigned long ksp; /* kernel stack pointer */
Martin Schwidefsky90c53e62016-11-08 12:15:59 +0100119 unsigned long user_timer; /* task cputime in user space */
Martin Schwidefskyb7394a52017-01-05 18:11:49 +0100120 unsigned long guest_timer; /* task cputime in kvm guest */
Martin Schwidefsky90c53e62016-11-08 12:15:59 +0100121 unsigned long system_timer; /* task cputime in kernel space */
Martin Schwidefskyb7394a52017-01-05 18:11:49 +0100122 unsigned long hardirq_timer; /* task cputime in hardirq context */
123 unsigned long softirq_timer; /* task cputime in softirq context */
Martin Schwidefskyef280c82016-11-08 12:33:38 +0100124 unsigned long sys_call_table; /* system call table address */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700125 mm_segment_t mm_segment;
Martin Schwidefskye5992f22011-07-24 10:48:20 +0200126 unsigned long gmap_addr; /* address of last gmap fault. */
Martin Schwidefsky4be130a2016-03-08 12:12:18 +0100127 unsigned int gmap_write_flag; /* gmap fault write indication */
David Hildenbrand4a494432016-03-08 12:31:52 +0100128 unsigned int gmap_int_code; /* int code of last gmap fault */
Dominik Dingel24eb3a82013-06-17 16:25:18 +0200129 unsigned int gmap_pfault; /* signal of a pending guest pfault */
Martin Schwidefskyf8fc82b2016-11-08 11:11:02 +0100130 /* Per-thread information related to debugging */
Martin Schwidefsky5e9a2692011-01-05 12:48:10 +0100131 struct per_regs per_user; /* User specified PER registers */
132 struct per_event per_event; /* Cause of the last PER trap */
Martin Schwidefskyd35339a2012-07-31 11:03:04 +0200133 unsigned long per_flags; /* Flags to control debug behavior */
Martin Schwidefskyf8fc82b2016-11-08 11:11:02 +0100134 unsigned int system_call; /* system call number in signal */
Martin Schwidefskyef280c82016-11-08 12:33:38 +0100135 unsigned long last_break; /* last breaking-event-address. */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700136 /* pfault_wait is used to block the process on a pfault event */
137 unsigned long pfault_wait;
Heiko Carstensf2db2e62011-05-23 10:24:34 +0200138 struct list_head list;
Jan Glaubere4b8b3f2012-07-31 10:52:05 +0200139 /* cpu runtime instrumentation */
140 struct runtime_instr_cb *ri_cb;
Martin Schwidefsky916cda12016-01-26 14:10:34 +0100141 struct gs_cb *gs_cb; /* Current guarded storage cb */
142 struct gs_cb *gs_bc_cb; /* Broadcast guarded storage cb */
Martin Schwidefskyd35339a2012-07-31 11:03:04 +0200143 unsigned char trap_tdb[256]; /* Transaction abort diagnose block */
Martin Schwidefsky3f6813b2016-04-01 15:42:15 +0200144 /*
145 * Warning: 'fpu' is dynamically-sized. It *MUST* be at
146 * the end.
147 */
148 struct fpu fpu; /* FP and VX register save area */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700149};
150
Michael Mueller64597f92013-07-02 22:58:26 +0200151/* Flag to disable transactions. */
152#define PER_FLAG_NO_TE 1UL
153/* Flag to enable random transaction aborts. */
154#define PER_FLAG_TE_ABORT_RAND 2UL
155/* Flag to specify random transaction abort mode:
156 * - abort each transaction at a random instruction before TEND if set.
157 * - abort random transactions at a random instruction if cleared.
158 */
159#define PER_FLAG_TE_ABORT_RAND_TEND 4UL
Martin Schwidefskyd35339a2012-07-31 11:03:04 +0200160
Linus Torvalds1da177e2005-04-16 15:20:36 -0700161typedef struct thread_struct thread_struct;
162
163/*
164 * Stack layout of a C stack frame.
165 */
166#ifndef __PACK_STACK
167struct stack_frame {
168 unsigned long back_chain;
169 unsigned long empty1[5];
170 unsigned long gprs[10];
171 unsigned int empty2[8];
172};
173#else
174struct stack_frame {
175 unsigned long empty1[5];
176 unsigned int empty2[8];
177 unsigned long gprs[10];
178 unsigned long back_chain;
179};
180#endif
181
182#define ARCH_MIN_TASKALIGN 8
183
Martin Schwidefsky6f3fa3f2007-10-22 12:52:45 +0200184#define INIT_THREAD { \
185 .ksp = sizeof(init_stack) + (unsigned long) &init_stack, \
Martin Schwidefsky3f6813b2016-04-01 15:42:15 +0200186 .fpu.regs = (void *) init_task.thread.fpu.fprs, \
Martin Schwidefsky6f3fa3f2007-10-22 12:52:45 +0200187}
Linus Torvalds1da177e2005-04-16 15:20:36 -0700188
189/*
190 * Do necessary setup to start up a new thread.
191 */
Martin Schwidefskyb50511e2011-10-30 15:16:50 +0100192#define start_thread(regs, new_psw, new_stackp) do { \
Martin Schwidefskye258d712013-09-24 09:14:56 +0200193 regs->psw.mask = PSW_USER_BITS | PSW_MASK_EA | PSW_MASK_BA; \
Heiko Carstensfecc868a2016-01-18 12:49:44 +0100194 regs->psw.addr = new_psw; \
Martin Schwidefskyb50511e2011-10-30 15:16:50 +0100195 regs->gprs[15] = new_stackp; \
Al Viro65f22a92012-09-06 15:48:11 -0400196 execve_tail(); \
Martin Schwidefsky63506c42008-07-14 09:58:54 +0200197} while (0)
198
Martin Schwidefskyb50511e2011-10-30 15:16:50 +0100199#define start_thread31(regs, new_psw, new_stackp) do { \
Martin Schwidefskye258d712013-09-24 09:14:56 +0200200 regs->psw.mask = PSW_USER_BITS | PSW_MASK_BA; \
Heiko Carstensfecc868a2016-01-18 12:49:44 +0100201 regs->psw.addr = new_psw; \
Martin Schwidefskyb50511e2011-10-30 15:16:50 +0100202 regs->gprs[15] = new_stackp; \
Gerald Schaefer723cacb2016-04-15 16:38:40 +0200203 crst_table_downgrade(current->mm); \
Al Viro65f22a92012-09-06 15:48:11 -0400204 execve_tail(); \
Linus Torvalds1da177e2005-04-16 15:20:36 -0700205} while (0)
206
Linus Torvalds1da177e2005-04-16 15:20:36 -0700207/* Forward declaration, a strange C thing */
208struct task_struct;
209struct mm_struct;
Eric W. Biedermandf5f8312008-02-08 04:18:33 -0800210struct seq_file;
Heiko Carstensb5a882f2017-02-17 08:13:28 +0100211struct pt_regs;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700212
Heiko Carstensd0208632016-10-17 11:08:31 +0200213typedef int (*dump_trace_func_t)(void *data, unsigned long address, int reliable);
Heiko Carstens758d39e2016-02-09 12:58:54 +0100214void dump_trace(dump_trace_func_t func, void *data,
215 struct task_struct *task, unsigned long sp);
Heiko Carstensb5a882f2017-02-17 08:13:28 +0100216void show_registers(struct pt_regs *regs);
Heiko Carstens758d39e2016-02-09 12:58:54 +0100217
Heiko Carstens5a798592015-02-12 13:08:27 +0100218void show_cacheinfo(struct seq_file *m);
Heiko Carstens66680222012-08-29 14:12:20 +0200219
Linus Torvalds1da177e2005-04-16 15:20:36 -0700220/* Free all resources held by a thread. */
Heiko Carstens80764282017-09-11 11:24:22 +0200221static inline void release_thread(struct task_struct *tsk) { }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700222
Heiko Carstens7b83c622017-09-11 11:24:23 +0200223/* Free guarded storage control block */
224void guarded_storage_release(struct task_struct *tsk);
Martin Schwidefsky916cda12016-01-26 14:10:34 +0100225
Linus Torvalds1da177e2005-04-16 15:20:36 -0700226unsigned long get_wchan(struct task_struct *p);
Al Viroc7584fb2006-01-12 01:05:49 -0800227#define task_pt_regs(tsk) ((struct pt_regs *) \
Al Viro30af7122006-01-12 01:05:50 -0800228 (task_stack_page(tsk) + THREAD_SIZE) - 1)
Al Viroc7584fb2006-01-12 01:05:49 -0800229#define KSTK_EIP(tsk) (task_pt_regs(tsk)->psw.addr)
230#define KSTK_ESP(tsk) (task_pt_regs(tsk)->gprs[15])
Linus Torvalds1da177e2005-04-16 15:20:36 -0700231
Heiko Carstens5ebf2502013-10-16 09:58:01 +0200232/* Has task runtime instrumentation enabled ? */
233#define is_ri_task(tsk) (!!(tsk)->thread.ri_cb)
234
Heiko Carstens76737ce2016-01-31 17:06:16 +0100235static inline unsigned long current_stack_pointer(void)
236{
237 unsigned long sp;
238
239 asm volatile("la %0,0(15)" : "=a" (sp));
240 return sp;
241}
242
David Howellsa0616cd2012-03-28 18:30:02 +0100243static inline unsigned short stap(void)
244{
245 unsigned short cpu_address;
246
247 asm volatile("stap %0" : "=m" (cpu_address));
248 return cpu_address;
249}
250
Linus Torvalds1da177e2005-04-16 15:20:36 -0700251/*
252 * Give up the time slice of the virtual PU.
253 */
Christian Borntraeger6d0d2872016-11-16 13:23:05 +0100254#define cpu_relax_yield cpu_relax_yield
Christian Borntraeger79ab11c2016-10-25 11:03:11 +0200255void cpu_relax_yield(void);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700256
Christian Borntraeger22b64302016-10-25 11:03:13 +0200257#define cpu_relax() barrier()
Heiko Carstens083986e2013-09-28 11:23:59 +0200258
Heiko Carstens097a1162016-04-14 12:35:22 +0200259#define ECAG_CACHE_ATTRIBUTE 0
260#define ECAG_CPU_ATTRIBUTE 1
261
262static inline unsigned long __ecag(unsigned int asi, unsigned char parm)
263{
264 unsigned long val;
265
266 asm volatile(".insn rsy,0xeb000000004c,%0,0,0(%1)" /* ecag */
267 : "=d" (val) : "a" (asi << 8 | parm));
268 return val;
269}
270
Heiko Carstensdc74d7f2007-06-19 13:10:06 +0200271static inline void psw_set_key(unsigned int key)
272{
273 asm volatile("spka 0(%0)" : : "d" (key));
274}
275
Linus Torvalds1da177e2005-04-16 15:20:36 -0700276/*
Heiko Carstens77fa2242005-06-25 14:55:30 -0700277 * Set PSW to specified value.
278 */
279static inline void __load_psw(psw_t psw)
280{
Martin Schwidefsky987bcda2010-02-26 22:37:31 +0100281 asm volatile("lpswe %0" : : "Q" (psw) : "cc");
Heiko Carstens77fa2242005-06-25 14:55:30 -0700282}
283
284/*
Linus Torvalds1da177e2005-04-16 15:20:36 -0700285 * Set PSW mask to specified value, while leaving the
286 * PSW addr pointing to the next instruction.
287 */
Heiko Carstensecbafda2015-10-12 11:54:03 +0200288static inline void __load_psw_mask(unsigned long mask)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700289{
290 unsigned long addr;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700291 psw_t psw;
Heiko Carstens77fa2242005-06-25 14:55:30 -0700292
Linus Torvalds1da177e2005-04-16 15:20:36 -0700293 psw.mask = mask;
294
Martin Schwidefsky94c12cc2006-09-28 16:56:43 +0200295 asm volatile(
296 " larl %0,1f\n"
Martin Schwidefsky987bcda2010-02-26 22:37:31 +0100297 " stg %0,%O1+8(%R1)\n"
298 " lpswe %1\n"
Linus Torvalds1da177e2005-04-16 15:20:36 -0700299 "1:"
Martin Schwidefsky987bcda2010-02-26 22:37:31 +0100300 : "=&d" (addr), "=Q" (psw) : "Q" (psw) : "memory", "cc");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700301}
Martin Schwidefskyccf45ca2011-10-30 15:16:48 +0100302
303/*
Martin Schwidefsky22362a02015-07-08 10:20:04 +0200304 * Extract current PSW mask
305 */
306static inline unsigned long __extract_psw(void)
307{
308 unsigned int reg1, reg2;
309
310 asm volatile("epsw %0,%1" : "=d" (reg1), "=a" (reg2));
311 return (((unsigned long) reg1) << 32) | ((unsigned long) reg2);
312}
313
Heiko Carstensecbafda2015-10-12 11:54:03 +0200314static inline void local_mcck_enable(void)
315{
316 __load_psw_mask(__extract_psw() | PSW_MASK_MCHECK);
317}
318
319static inline void local_mcck_disable(void)
320{
321 __load_psw_mask(__extract_psw() & ~PSW_MASK_MCHECK);
322}
323
Martin Schwidefsky22362a02015-07-08 10:20:04 +0200324/*
Martin Schwidefskyccf45ca2011-10-30 15:16:48 +0100325 * Rewind PSW instruction address by specified number of bytes.
326 */
327static inline unsigned long __rewind_psw(psw_t psw, unsigned long ilc)
328{
Martin Schwidefskyccf45ca2011-10-30 15:16:48 +0100329 unsigned long mask;
330
331 mask = (psw.mask & PSW_MASK_EA) ? -1UL :
332 (psw.mask & PSW_MASK_BA) ? (1UL << 31) - 1 :
333 (1UL << 24) - 1;
334 return (psw.addr - ilc) & mask;
Martin Schwidefskyccf45ca2011-10-30 15:16:48 +0100335}
Martin Schwidefskyb5f87f12014-10-01 10:57:57 +0200336
337/*
338 * Function to stop a processor until the next interrupt occurs
339 */
340void enabled_wait(void);
341
Linus Torvalds1da177e2005-04-16 15:20:36 -0700342/*
Linus Torvalds1da177e2005-04-16 15:20:36 -0700343 * Function to drop a processor into disabled wait state
344 */
Joe Perchesff2d8b12012-01-12 17:17:21 -0800345static inline void __noreturn disabled_wait(unsigned long code)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700346{
Heiko Carstensf9e6edf2015-10-12 12:28:28 +0200347 psw_t psw;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700348
Heiko Carstensf9e6edf2015-10-12 12:28:28 +0200349 psw.mask = PSW_MASK_BASE | PSW_MASK_WAIT | PSW_MASK_BA | PSW_MASK_EA;
350 psw.addr = code;
351 __load_psw(psw);
Heiko Carstensedd53782008-12-25 13:39:16 +0100352 while (1);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700353}
354
355/*
Heiko Carstensab14de62007-02-05 21:18:37 +0100356 * Basic Machine Check/Program Check Handler.
357 */
358
359extern void s390_base_mcck_handler(void);
360extern void s390_base_pgm_handler(void);
361extern void s390_base_ext_handler(void);
362
363extern void (*s390_base_mcck_handler_fn)(void);
364extern void (*s390_base_pgm_handler_fn)(void);
365extern void (*s390_base_ext_handler_fn)(void);
366
Heiko Carstensdfd54cb2006-09-25 23:31:33 -0700367#define ARCH_LOW_ADDRESS_LIMIT 0x7fffffffUL
368
Heiko Carstensfbe76562012-06-05 09:59:52 +0200369extern int memcpy_real(void *, void *, size_t);
370extern void memcpy_absolute(void *, void *, size_t);
371
Heiko Carstens1228f7b2017-02-16 10:41:52 +0100372#define mem_assign_absolute(dest, val) do { \
Heiko Carstensfbe76562012-06-05 09:59:52 +0200373 __typeof__(dest) __tmp = (val); \
374 \
375 BUILD_BUG_ON(sizeof(__tmp) != sizeof(val)); \
376 memcpy_absolute(&(dest), &__tmp, sizeof(__tmp)); \
Heiko Carstens1228f7b2017-02-16 10:41:52 +0100377} while (0)
Heiko Carstensfbe76562012-06-05 09:59:52 +0200378
Heiko Carstenseb608fb2012-09-05 13:26:11 +0200379#endif /* __ASSEMBLY__ */
380
381#endif /* __ASM_S390_PROCESSOR_H */