diff options
Diffstat (limited to 'include/asm-s390')
-rw-r--r-- | include/asm-s390/cio.h | 4 | ||||
-rw-r--r-- | include/asm-s390/cpu.h | 8 | ||||
-rw-r--r-- | include/asm-s390/debug.h | 5 | ||||
-rw-r--r-- | include/asm-s390/extmem.h | 11 | ||||
-rw-r--r-- | include/asm-s390/hardirq.h | 2 | ||||
-rw-r--r-- | include/asm-s390/lowcore.h | 11 | ||||
-rw-r--r-- | include/asm-s390/processor.h | 7 | ||||
-rw-r--r-- | include/asm-s390/semaphore.h | 108 | ||||
-rw-r--r-- | include/asm-s390/smp.h | 3 | ||||
-rw-r--r-- | include/asm-s390/sysinfo.h | 116 | ||||
-rw-r--r-- | include/asm-s390/system.h | 2 | ||||
-rw-r--r-- | include/asm-s390/timex.h | 13 | ||||
-rw-r--r-- | include/asm-s390/tlbflush.h | 36 | ||||
-rw-r--r-- | include/asm-s390/topology.h | 23 |
14 files changed, 213 insertions, 136 deletions
diff --git a/include/asm-s390/cio.h b/include/asm-s390/cio.h index 123b557c3ff4..0818ecd30ca6 100644 --- a/include/asm-s390/cio.h +++ b/include/asm-s390/cio.h | |||
@@ -397,6 +397,10 @@ struct cio_iplinfo { | |||
397 | 397 | ||
398 | extern int cio_get_iplinfo(struct cio_iplinfo *iplinfo); | 398 | extern int cio_get_iplinfo(struct cio_iplinfo *iplinfo); |
399 | 399 | ||
400 | /* Function from drivers/s390/cio/chsc.c */ | ||
401 | int chsc_sstpc(void *page, unsigned int op, u16 ctrl); | ||
402 | int chsc_sstpi(void *page, void *result, size_t size); | ||
403 | |||
400 | #endif | 404 | #endif |
401 | 405 | ||
402 | #endif | 406 | #endif |
diff --git a/include/asm-s390/cpu.h b/include/asm-s390/cpu.h index 352dde194f3c..e5a6a9ba3adf 100644 --- a/include/asm-s390/cpu.h +++ b/include/asm-s390/cpu.h | |||
@@ -22,4 +22,12 @@ struct s390_idle_data { | |||
22 | 22 | ||
23 | DECLARE_PER_CPU(struct s390_idle_data, s390_idle); | 23 | DECLARE_PER_CPU(struct s390_idle_data, s390_idle); |
24 | 24 | ||
25 | void s390_idle_leave(void); | ||
26 | |||
27 | static inline void s390_idle_check(void) | ||
28 | { | ||
29 | if ((&__get_cpu_var(s390_idle))->in_idle) | ||
30 | s390_idle_leave(); | ||
31 | } | ||
32 | |||
25 | #endif /* _ASM_S390_CPU_H_ */ | 33 | #endif /* _ASM_S390_CPU_H_ */ |
diff --git a/include/asm-s390/debug.h b/include/asm-s390/debug.h index c00dd2b3dc50..335baf4fc64f 100644 --- a/include/asm-s390/debug.h +++ b/include/asm-s390/debug.h | |||
@@ -73,6 +73,7 @@ typedef struct debug_info { | |||
73 | struct dentry* debugfs_entries[DEBUG_MAX_VIEWS]; | 73 | struct dentry* debugfs_entries[DEBUG_MAX_VIEWS]; |
74 | struct debug_view* views[DEBUG_MAX_VIEWS]; | 74 | struct debug_view* views[DEBUG_MAX_VIEWS]; |
75 | char name[DEBUG_MAX_NAME_LEN]; | 75 | char name[DEBUG_MAX_NAME_LEN]; |
76 | mode_t mode; | ||
76 | } debug_info_t; | 77 | } debug_info_t; |
77 | 78 | ||
78 | typedef int (debug_header_proc_t) (debug_info_t* id, | 79 | typedef int (debug_header_proc_t) (debug_info_t* id, |
@@ -122,6 +123,10 @@ debug_entry_t* debug_exception_common(debug_info_t* id, int level, | |||
122 | debug_info_t* debug_register(char* name, int pages, int nr_areas, | 123 | debug_info_t* debug_register(char* name, int pages, int nr_areas, |
123 | int buf_size); | 124 | int buf_size); |
124 | 125 | ||
126 | debug_info_t *debug_register_mode(char *name, int pages, int nr_areas, | ||
127 | int buf_size, mode_t mode, uid_t uid, | ||
128 | gid_t gid); | ||
129 | |||
125 | void debug_unregister(debug_info_t* id); | 130 | void debug_unregister(debug_info_t* id); |
126 | 131 | ||
127 | void debug_set_level(debug_info_t* id, int new_level); | 132 | void debug_set_level(debug_info_t* id, int new_level); |
diff --git a/include/asm-s390/extmem.h b/include/asm-s390/extmem.h index c8802c934b74..33837d756184 100644 --- a/include/asm-s390/extmem.h +++ b/include/asm-s390/extmem.h | |||
@@ -22,11 +22,12 @@ | |||
22 | #define SEGMENT_SHARED 0 | 22 | #define SEGMENT_SHARED 0 |
23 | #define SEGMENT_EXCLUSIVE 1 | 23 | #define SEGMENT_EXCLUSIVE 1 |
24 | 24 | ||
25 | extern int segment_load (char *name,int segtype,unsigned long *addr,unsigned long *length); | 25 | int segment_load (char *name, int segtype, unsigned long *addr, unsigned long *length); |
26 | extern void segment_unload(char *name); | 26 | void segment_unload(char *name); |
27 | extern void segment_save(char *name); | 27 | void segment_save(char *name); |
28 | extern int segment_type (char* name); | 28 | int segment_type (char* name); |
29 | extern int segment_modify_shared (char *name, int do_nonshared); | 29 | int segment_modify_shared (char *name, int do_nonshared); |
30 | void segment_warning(int rc, char *seg_name); | ||
30 | 31 | ||
31 | #endif | 32 | #endif |
32 | #endif | 33 | #endif |
diff --git a/include/asm-s390/hardirq.h b/include/asm-s390/hardirq.h index 31beb18cb3d1..4b7cb964ff35 100644 --- a/include/asm-s390/hardirq.h +++ b/include/asm-s390/hardirq.h | |||
@@ -32,6 +32,6 @@ typedef struct { | |||
32 | 32 | ||
33 | #define HARDIRQ_BITS 8 | 33 | #define HARDIRQ_BITS 8 |
34 | 34 | ||
35 | extern void account_ticks(u64 time); | 35 | void clock_comparator_work(void); |
36 | 36 | ||
37 | #endif /* __ASM_HARDIRQ_H */ | 37 | #endif /* __ASM_HARDIRQ_H */ |
diff --git a/include/asm-s390/lowcore.h b/include/asm-s390/lowcore.h index 801a6fd35b5b..5de3efb31445 100644 --- a/include/asm-s390/lowcore.h +++ b/include/asm-s390/lowcore.h | |||
@@ -56,6 +56,8 @@ | |||
56 | #define __LC_IO_INT_WORD 0x0C0 | 56 | #define __LC_IO_INT_WORD 0x0C0 |
57 | #define __LC_MCCK_CODE 0x0E8 | 57 | #define __LC_MCCK_CODE 0x0E8 |
58 | 58 | ||
59 | #define __LC_LAST_BREAK 0x110 | ||
60 | |||
59 | #define __LC_RETURN_PSW 0x200 | 61 | #define __LC_RETURN_PSW 0x200 |
60 | 62 | ||
61 | #define __LC_SAVE_AREA 0xC00 | 63 | #define __LC_SAVE_AREA 0xC00 |
@@ -80,7 +82,6 @@ | |||
80 | #define __LC_CPUID 0xC60 | 82 | #define __LC_CPUID 0xC60 |
81 | #define __LC_CPUADDR 0xC68 | 83 | #define __LC_CPUADDR 0xC68 |
82 | #define __LC_IPLDEV 0xC7C | 84 | #define __LC_IPLDEV 0xC7C |
83 | #define __LC_JIFFY_TIMER 0xC80 | ||
84 | #define __LC_CURRENT 0xC90 | 85 | #define __LC_CURRENT 0xC90 |
85 | #define __LC_INT_CLOCK 0xC98 | 86 | #define __LC_INT_CLOCK 0xC98 |
86 | #else /* __s390x__ */ | 87 | #else /* __s390x__ */ |
@@ -103,7 +104,6 @@ | |||
103 | #define __LC_CPUID 0xD80 | 104 | #define __LC_CPUID 0xD80 |
104 | #define __LC_CPUADDR 0xD88 | 105 | #define __LC_CPUADDR 0xD88 |
105 | #define __LC_IPLDEV 0xDB8 | 106 | #define __LC_IPLDEV 0xDB8 |
106 | #define __LC_JIFFY_TIMER 0xDC0 | ||
107 | #define __LC_CURRENT 0xDD8 | 107 | #define __LC_CURRENT 0xDD8 |
108 | #define __LC_INT_CLOCK 0xDE8 | 108 | #define __LC_INT_CLOCK 0xDE8 |
109 | #endif /* __s390x__ */ | 109 | #endif /* __s390x__ */ |
@@ -276,7 +276,7 @@ struct _lowcore | |||
276 | /* entry.S sensitive area end */ | 276 | /* entry.S sensitive area end */ |
277 | 277 | ||
278 | /* SMP info area: defined by DJB */ | 278 | /* SMP info area: defined by DJB */ |
279 | __u64 jiffy_timer; /* 0xc80 */ | 279 | __u64 clock_comparator; /* 0xc80 */ |
280 | __u32 ext_call_fast; /* 0xc88 */ | 280 | __u32 ext_call_fast; /* 0xc88 */ |
281 | __u32 percpu_offset; /* 0xc8c */ | 281 | __u32 percpu_offset; /* 0xc8c */ |
282 | __u32 current_task; /* 0xc90 */ | 282 | __u32 current_task; /* 0xc90 */ |
@@ -368,11 +368,12 @@ struct _lowcore | |||
368 | /* entry.S sensitive area end */ | 368 | /* entry.S sensitive area end */ |
369 | 369 | ||
370 | /* SMP info area: defined by DJB */ | 370 | /* SMP info area: defined by DJB */ |
371 | __u64 jiffy_timer; /* 0xdc0 */ | 371 | __u64 clock_comparator; /* 0xdc0 */ |
372 | __u64 ext_call_fast; /* 0xdc8 */ | 372 | __u64 ext_call_fast; /* 0xdc8 */ |
373 | __u64 percpu_offset; /* 0xdd0 */ | 373 | __u64 percpu_offset; /* 0xdd0 */ |
374 | __u64 current_task; /* 0xdd8 */ | 374 | __u64 current_task; /* 0xdd8 */ |
375 | __u64 softirq_pending; /* 0xde0 */ | 375 | __u32 softirq_pending; /* 0xde0 */ |
376 | __u32 pad_0x0de4; /* 0xde4 */ | ||
376 | __u64 int_clock; /* 0xde8 */ | 377 | __u64 int_clock; /* 0xde8 */ |
377 | __u8 pad12[0xe00-0xdf0]; /* 0xdf0 */ | 378 | __u8 pad12[0xe00-0xdf0]; /* 0xdf0 */ |
378 | 379 | ||
diff --git a/include/asm-s390/processor.h b/include/asm-s390/processor.h index 51d88912aa20..8eaf343a12a8 100644 --- a/include/asm-s390/processor.h +++ b/include/asm-s390/processor.h | |||
@@ -175,6 +175,13 @@ extern void task_show_regs(struct seq_file *m, struct task_struct *task); | |||
175 | extern void show_registers(struct pt_regs *regs); | 175 | extern void show_registers(struct pt_regs *regs); |
176 | extern void show_code(struct pt_regs *regs); | 176 | extern void show_code(struct pt_regs *regs); |
177 | extern void show_trace(struct task_struct *task, unsigned long *sp); | 177 | extern void show_trace(struct task_struct *task, unsigned long *sp); |
178 | #ifdef CONFIG_64BIT | ||
179 | extern void show_last_breaking_event(struct pt_regs *regs); | ||
180 | #else | ||
181 | static inline void show_last_breaking_event(struct pt_regs *regs) | ||
182 | { | ||
183 | } | ||
184 | #endif | ||
178 | 185 | ||
179 | unsigned long get_wchan(struct task_struct *p); | 186 | unsigned long get_wchan(struct task_struct *p); |
180 | #define task_pt_regs(tsk) ((struct pt_regs *) \ | 187 | #define task_pt_regs(tsk) ((struct pt_regs *) \ |
diff --git a/include/asm-s390/semaphore.h b/include/asm-s390/semaphore.h index 0e7001ad8392..d9b2034ed1d2 100644 --- a/include/asm-s390/semaphore.h +++ b/include/asm-s390/semaphore.h | |||
@@ -1,107 +1 @@ | |||
1 | /* | #include <linux/semaphore.h> | |
2 | * include/asm-s390/semaphore.h | ||
3 | * | ||
4 | * S390 version | ||
5 | * Copyright (C) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation | ||
6 | * | ||
7 | * Derived from "include/asm-i386/semaphore.h" | ||
8 | * (C) Copyright 1996 Linus Torvalds | ||
9 | */ | ||
10 | |||
11 | #ifndef _S390_SEMAPHORE_H | ||
12 | #define _S390_SEMAPHORE_H | ||
13 | |||
14 | #include <asm/system.h> | ||
15 | #include <asm/atomic.h> | ||
16 | #include <linux/wait.h> | ||
17 | #include <linux/rwsem.h> | ||
18 | |||
19 | struct semaphore { | ||
20 | /* | ||
21 | * Note that any negative value of count is equivalent to 0, | ||
22 | * but additionally indicates that some process(es) might be | ||
23 | * sleeping on `wait'. | ||
24 | */ | ||
25 | atomic_t count; | ||
26 | wait_queue_head_t wait; | ||
27 | }; | ||
28 | |||
29 | #define __SEMAPHORE_INITIALIZER(name,count) \ | ||
30 | { ATOMIC_INIT(count), __WAIT_QUEUE_HEAD_INITIALIZER((name).wait) } | ||
31 | |||
32 | #define __DECLARE_SEMAPHORE_GENERIC(name,count) \ | ||
33 | struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) | ||
34 | |||
35 | #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) | ||
36 | |||
37 | static inline void sema_init (struct semaphore *sem, int val) | ||
38 | { | ||
39 | atomic_set(&sem->count, val); | ||
40 | init_waitqueue_head(&sem->wait); | ||
41 | } | ||
42 | |||
43 | static inline void init_MUTEX (struct semaphore *sem) | ||
44 | { | ||
45 | sema_init(sem, 1); | ||
46 | } | ||
47 | |||
48 | static inline void init_MUTEX_LOCKED (struct semaphore *sem) | ||
49 | { | ||
50 | sema_init(sem, 0); | ||
51 | } | ||
52 | |||
53 | asmlinkage void __down(struct semaphore * sem); | ||
54 | asmlinkage int __down_interruptible(struct semaphore * sem); | ||
55 | asmlinkage int __down_trylock(struct semaphore * sem); | ||
56 | asmlinkage void __up(struct semaphore * sem); | ||
57 | |||
58 | static inline void down(struct semaphore * sem) | ||
59 | { | ||
60 | might_sleep(); | ||
61 | if (atomic_dec_return(&sem->count) < 0) | ||
62 | __down(sem); | ||
63 | } | ||
64 | |||
65 | static inline int down_interruptible(struct semaphore * sem) | ||
66 | { | ||
67 | int ret = 0; | ||
68 | |||
69 | might_sleep(); | ||
70 | if (atomic_dec_return(&sem->count) < 0) | ||
71 | ret = __down_interruptible(sem); | ||
72 | return ret; | ||
73 | } | ||
74 | |||
75 | static inline int down_trylock(struct semaphore * sem) | ||
76 | { | ||
77 | int old_val, new_val; | ||
78 | |||
79 | /* | ||
80 | * This inline assembly atomically implements the equivalent | ||
81 | * to the following C code: | ||
82 | * old_val = sem->count.counter; | ||
83 | * if ((new_val = old_val) > 0) | ||
84 | * sem->count.counter = --new_val; | ||
85 | * In the ppc code this is called atomic_dec_if_positive. | ||
86 | */ | ||
87 | asm volatile( | ||
88 | " l %0,0(%3)\n" | ||
89 | "0: ltr %1,%0\n" | ||
90 | " jle 1f\n" | ||
91 | " ahi %1,-1\n" | ||
92 | " cs %0,%1,0(%3)\n" | ||
93 | " jl 0b\n" | ||
94 | "1:" | ||
95 | : "=&d" (old_val), "=&d" (new_val), "=m" (sem->count.counter) | ||
96 | : "a" (&sem->count.counter), "m" (sem->count.counter) | ||
97 | : "cc", "memory"); | ||
98 | return old_val <= 0; | ||
99 | } | ||
100 | |||
101 | static inline void up(struct semaphore * sem) | ||
102 | { | ||
103 | if (atomic_inc_return(&sem->count) <= 0) | ||
104 | __up(sem); | ||
105 | } | ||
106 | |||
107 | #endif | ||
diff --git a/include/asm-s390/smp.h b/include/asm-s390/smp.h index c7b74326a527..6f3821a6a902 100644 --- a/include/asm-s390/smp.h +++ b/include/asm-s390/smp.h | |||
@@ -90,6 +90,9 @@ extern void __cpu_die (unsigned int cpu); | |||
90 | extern void cpu_die (void) __attribute__ ((noreturn)); | 90 | extern void cpu_die (void) __attribute__ ((noreturn)); |
91 | extern int __cpu_up (unsigned int cpu); | 91 | extern int __cpu_up (unsigned int cpu); |
92 | 92 | ||
93 | extern struct mutex smp_cpu_state_mutex; | ||
94 | extern int smp_cpu_polarization[]; | ||
95 | |||
93 | extern int smp_call_function_mask(cpumask_t mask, void (*func)(void *), | 96 | extern int smp_call_function_mask(cpumask_t mask, void (*func)(void *), |
94 | void *info, int wait); | 97 | void *info, int wait); |
95 | #endif | 98 | #endif |
diff --git a/include/asm-s390/sysinfo.h b/include/asm-s390/sysinfo.h new file mode 100644 index 000000000000..abe10ae15e46 --- /dev/null +++ b/include/asm-s390/sysinfo.h | |||
@@ -0,0 +1,116 @@ | |||
1 | /* | ||
2 | * definition for store system information stsi | ||
3 | * | ||
4 | * Copyright IBM Corp. 2001,2008 | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License (version 2 only) | ||
8 | * as published by the Free Software Foundation. | ||
9 | * | ||
10 | * Author(s): Ulrich Weigand <weigand@de.ibm.com> | ||
11 | * Christian Borntraeger <borntraeger@de.ibm.com> | ||
12 | */ | ||
13 | |||
14 | struct sysinfo_1_1_1 { | ||
15 | char reserved_0[32]; | ||
16 | char manufacturer[16]; | ||
17 | char type[4]; | ||
18 | char reserved_1[12]; | ||
19 | char model_capacity[16]; | ||
20 | char sequence[16]; | ||
21 | char plant[4]; | ||
22 | char model[16]; | ||
23 | char model_perm_cap[16]; | ||
24 | char model_temp_cap[16]; | ||
25 | char model_cap_rating[4]; | ||
26 | char model_perm_cap_rating[4]; | ||
27 | char model_temp_cap_rating[4]; | ||
28 | }; | ||
29 | |||
30 | struct sysinfo_1_2_1 { | ||
31 | char reserved_0[80]; | ||
32 | char sequence[16]; | ||
33 | char plant[4]; | ||
34 | char reserved_1[2]; | ||
35 | unsigned short cpu_address; | ||
36 | }; | ||
37 | |||
38 | struct sysinfo_1_2_2 { | ||
39 | char format; | ||
40 | char reserved_0[1]; | ||
41 | unsigned short acc_offset; | ||
42 | char reserved_1[24]; | ||
43 | unsigned int secondary_capability; | ||
44 | unsigned int capability; | ||
45 | unsigned short cpus_total; | ||
46 | unsigned short cpus_configured; | ||
47 | unsigned short cpus_standby; | ||
48 | unsigned short cpus_reserved; | ||
49 | unsigned short adjustment[0]; | ||
50 | }; | ||
51 | |||
52 | struct sysinfo_1_2_2_extension { | ||
53 | unsigned int alt_capability; | ||
54 | unsigned short alt_adjustment[0]; | ||
55 | }; | ||
56 | |||
57 | struct sysinfo_2_2_1 { | ||
58 | char reserved_0[80]; | ||
59 | char sequence[16]; | ||
60 | char plant[4]; | ||
61 | unsigned short cpu_id; | ||
62 | unsigned short cpu_address; | ||
63 | }; | ||
64 | |||
65 | struct sysinfo_2_2_2 { | ||
66 | char reserved_0[32]; | ||
67 | unsigned short lpar_number; | ||
68 | char reserved_1; | ||
69 | unsigned char characteristics; | ||
70 | unsigned short cpus_total; | ||
71 | unsigned short cpus_configured; | ||
72 | unsigned short cpus_standby; | ||
73 | unsigned short cpus_reserved; | ||
74 | char name[8]; | ||
75 | unsigned int caf; | ||
76 | char reserved_2[16]; | ||
77 | unsigned short cpus_dedicated; | ||
78 | unsigned short cpus_shared; | ||
79 | }; | ||
80 | |||
81 | #define LPAR_CHAR_DEDICATED (1 << 7) | ||
82 | #define LPAR_CHAR_SHARED (1 << 6) | ||
83 | #define LPAR_CHAR_LIMITED (1 << 5) | ||
84 | |||
85 | struct sysinfo_3_2_2 { | ||
86 | char reserved_0[31]; | ||
87 | unsigned char count; | ||
88 | struct { | ||
89 | char reserved_0[4]; | ||
90 | unsigned short cpus_total; | ||
91 | unsigned short cpus_configured; | ||
92 | unsigned short cpus_standby; | ||
93 | unsigned short cpus_reserved; | ||
94 | char name[8]; | ||
95 | unsigned int caf; | ||
96 | char cpi[16]; | ||
97 | char reserved_1[24]; | ||
98 | |||
99 | } vm[8]; | ||
100 | }; | ||
101 | |||
102 | static inline int stsi(void *sysinfo, int fc, int sel1, int sel2) | ||
103 | { | ||
104 | register int r0 asm("0") = (fc << 28) | sel1; | ||
105 | register int r1 asm("1") = sel2; | ||
106 | |||
107 | asm volatile( | ||
108 | " stsi 0(%2)\n" | ||
109 | "0: jz 2f\n" | ||
110 | "1: lhi %0,%3\n" | ||
111 | "2:\n" | ||
112 | EX_TABLE(0b, 1b) | ||
113 | : "+d" (r0) : "d" (r1), "a" (sysinfo), "K" (-ENOSYS) | ||
114 | : "cc", "memory"); | ||
115 | return r0; | ||
116 | } | ||
diff --git a/include/asm-s390/system.h b/include/asm-s390/system.h index 15aba30601a3..92098df4d6e3 100644 --- a/include/asm-s390/system.h +++ b/include/asm-s390/system.h | |||
@@ -406,6 +406,8 @@ __set_psw_mask(unsigned long mask) | |||
406 | #define local_mcck_enable() __set_psw_mask(psw_kernel_bits) | 406 | #define local_mcck_enable() __set_psw_mask(psw_kernel_bits) |
407 | #define local_mcck_disable() __set_psw_mask(psw_kernel_bits & ~PSW_MASK_MCHECK) | 407 | #define local_mcck_disable() __set_psw_mask(psw_kernel_bits & ~PSW_MASK_MCHECK) |
408 | 408 | ||
409 | int stfle(unsigned long long *list, int doublewords); | ||
410 | |||
409 | #ifdef CONFIG_SMP | 411 | #ifdef CONFIG_SMP |
410 | 412 | ||
411 | extern void smp_ctl_set_bit(int cr, int bit); | 413 | extern void smp_ctl_set_bit(int cr, int bit); |
diff --git a/include/asm-s390/timex.h b/include/asm-s390/timex.h index 98229db24314..d744c3d62de5 100644 --- a/include/asm-s390/timex.h +++ b/include/asm-s390/timex.h | |||
@@ -62,16 +62,18 @@ static inline unsigned long long get_clock (void) | |||
62 | return clk; | 62 | return clk; |
63 | } | 63 | } |
64 | 64 | ||
65 | static inline void get_clock_extended(void *dest) | 65 | static inline unsigned long long get_clock_xt(void) |
66 | { | 66 | { |
67 | typedef struct { unsigned long long clk[2]; } __clock_t; | 67 | unsigned char clk[16]; |
68 | 68 | ||
69 | #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2) | 69 | #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2) |
70 | asm volatile("stcke %0" : "=Q" (*((__clock_t *)dest)) : : "cc"); | 70 | asm volatile("stcke %0" : "=Q" (clk) : : "cc"); |
71 | #else /* __GNUC__ */ | 71 | #else /* __GNUC__ */ |
72 | asm volatile("stcke 0(%1)" : "=m" (*((__clock_t *)dest)) | 72 | asm volatile("stcke 0(%1)" : "=m" (clk) |
73 | : "a" ((__clock_t *)dest) : "cc"); | 73 | : "a" (clk) : "cc"); |
74 | #endif /* __GNUC__ */ | 74 | #endif /* __GNUC__ */ |
75 | |||
76 | return *((unsigned long long *)&clk[1]); | ||
75 | } | 77 | } |
76 | 78 | ||
77 | static inline cycles_t get_cycles(void) | 79 | static inline cycles_t get_cycles(void) |
@@ -81,5 +83,6 @@ static inline cycles_t get_cycles(void) | |||
81 | 83 | ||
82 | int get_sync_clock(unsigned long long *clock); | 84 | int get_sync_clock(unsigned long long *clock); |
83 | void init_cpu_timer(void); | 85 | void init_cpu_timer(void); |
86 | unsigned long long monotonic_clock(void); | ||
84 | 87 | ||
85 | #endif | 88 | #endif |
diff --git a/include/asm-s390/tlbflush.h b/include/asm-s390/tlbflush.h index 35fb4f9127b2..9e57a93d7de1 100644 --- a/include/asm-s390/tlbflush.h +++ b/include/asm-s390/tlbflush.h | |||
@@ -13,12 +13,14 @@ static inline void __tlb_flush_local(void) | |||
13 | asm volatile("ptlb" : : : "memory"); | 13 | asm volatile("ptlb" : : : "memory"); |
14 | } | 14 | } |
15 | 15 | ||
16 | #ifdef CONFIG_SMP | ||
16 | /* | 17 | /* |
17 | * Flush all tlb entries on all cpus. | 18 | * Flush all tlb entries on all cpus. |
18 | */ | 19 | */ |
20 | void smp_ptlb_all(void); | ||
21 | |||
19 | static inline void __tlb_flush_global(void) | 22 | static inline void __tlb_flush_global(void) |
20 | { | 23 | { |
21 | extern void smp_ptlb_all(void); | ||
22 | register unsigned long reg2 asm("2"); | 24 | register unsigned long reg2 asm("2"); |
23 | register unsigned long reg3 asm("3"); | 25 | register unsigned long reg3 asm("3"); |
24 | register unsigned long reg4 asm("4"); | 26 | register unsigned long reg4 asm("4"); |
@@ -39,6 +41,25 @@ static inline void __tlb_flush_global(void) | |||
39 | : : "d" (reg2), "d" (reg3), "d" (reg4), "m" (dummy) : "cc" ); | 41 | : : "d" (reg2), "d" (reg3), "d" (reg4), "m" (dummy) : "cc" ); |
40 | } | 42 | } |
41 | 43 | ||
44 | static inline void __tlb_flush_full(struct mm_struct *mm) | ||
45 | { | ||
46 | cpumask_t local_cpumask; | ||
47 | |||
48 | preempt_disable(); | ||
49 | /* | ||
50 | * If the process only ran on the local cpu, do a local flush. | ||
51 | */ | ||
52 | local_cpumask = cpumask_of_cpu(smp_processor_id()); | ||
53 | if (cpus_equal(mm->cpu_vm_mask, local_cpumask)) | ||
54 | __tlb_flush_local(); | ||
55 | else | ||
56 | __tlb_flush_global(); | ||
57 | preempt_enable(); | ||
58 | } | ||
59 | #else | ||
60 | #define __tlb_flush_full(mm) __tlb_flush_local() | ||
61 | #endif | ||
62 | |||
42 | /* | 63 | /* |
43 | * Flush all tlb entries of a page table on all cpus. | 64 | * Flush all tlb entries of a page table on all cpus. |
44 | */ | 65 | */ |
@@ -51,8 +72,6 @@ static inline void __tlb_flush_idte(unsigned long asce) | |||
51 | 72 | ||
52 | static inline void __tlb_flush_mm(struct mm_struct * mm) | 73 | static inline void __tlb_flush_mm(struct mm_struct * mm) |
53 | { | 74 | { |
54 | cpumask_t local_cpumask; | ||
55 | |||
56 | if (unlikely(cpus_empty(mm->cpu_vm_mask))) | 75 | if (unlikely(cpus_empty(mm->cpu_vm_mask))) |
57 | return; | 76 | return; |
58 | /* | 77 | /* |
@@ -69,16 +88,7 @@ static inline void __tlb_flush_mm(struct mm_struct * mm) | |||
69 | mm->context.asce_bits); | 88 | mm->context.asce_bits); |
70 | return; | 89 | return; |
71 | } | 90 | } |
72 | preempt_disable(); | 91 | __tlb_flush_full(mm); |
73 | /* | ||
74 | * If the process only ran on the local cpu, do a local flush. | ||
75 | */ | ||
76 | local_cpumask = cpumask_of_cpu(smp_processor_id()); | ||
77 | if (cpus_equal(mm->cpu_vm_mask, local_cpumask)) | ||
78 | __tlb_flush_local(); | ||
79 | else | ||
80 | __tlb_flush_global(); | ||
81 | preempt_enable(); | ||
82 | } | 92 | } |
83 | 93 | ||
84 | static inline void __tlb_flush_mm_cond(struct mm_struct * mm) | 94 | static inline void __tlb_flush_mm_cond(struct mm_struct * mm) |
diff --git a/include/asm-s390/topology.h b/include/asm-s390/topology.h index 613aa64019da..8e97b06f298a 100644 --- a/include/asm-s390/topology.h +++ b/include/asm-s390/topology.h | |||
@@ -1,6 +1,29 @@ | |||
1 | #ifndef _ASM_S390_TOPOLOGY_H | 1 | #ifndef _ASM_S390_TOPOLOGY_H |
2 | #define _ASM_S390_TOPOLOGY_H | 2 | #define _ASM_S390_TOPOLOGY_H |
3 | 3 | ||
4 | #include <linux/cpumask.h> | ||
5 | |||
6 | #define mc_capable() (1) | ||
7 | |||
8 | cpumask_t cpu_coregroup_map(unsigned int cpu); | ||
9 | |||
10 | int topology_set_cpu_management(int fc); | ||
11 | void topology_schedule_update(void); | ||
12 | |||
13 | #define POLARIZATION_UNKNWN (-1) | ||
14 | #define POLARIZATION_HRZ (0) | ||
15 | #define POLARIZATION_VL (1) | ||
16 | #define POLARIZATION_VM (2) | ||
17 | #define POLARIZATION_VH (3) | ||
18 | |||
19 | #ifdef CONFIG_SMP | ||
20 | void s390_init_cpu_topology(void); | ||
21 | #else | ||
22 | static inline void s390_init_cpu_topology(void) | ||
23 | { | ||
24 | }; | ||
25 | #endif | ||
26 | |||
4 | #include <asm-generic/topology.h> | 27 | #include <asm-generic/topology.h> |
5 | 28 | ||
6 | #endif /* _ASM_S390_TOPOLOGY_H */ | 29 | #endif /* _ASM_S390_TOPOLOGY_H */ |