summaryrefslogtreecommitdiffstats
path: root/include/asm-s390
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-08-08 18:54:49 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-08-08 18:54:49 +0000
commit5514f4babeeb3af00ee0c325e3cda7a562cc3d65 (patch)
treeedd733879cab73e41324a99ca5da7bc154c4196d /include/asm-s390
parent6a9366db547e958e8c9bf8e1c13bcea6cb2bf393 (diff)
Merge with Linux 2.4.0-test6-pre4.
Diffstat (limited to 'include/asm-s390')
-rw-r--r--include/asm-s390/hardirq.h43
-rw-r--r--include/asm-s390/irq.h4
-rw-r--r--include/asm-s390/lowcore.h32
-rw-r--r--include/asm-s390/softirq.h6
4 files changed, 61 insertions, 24 deletions
diff --git a/include/asm-s390/hardirq.h b/include/asm-s390/hardirq.h
index c21db1cd7..b32a0684a 100644
--- a/include/asm-s390/hardirq.h
+++ b/include/asm-s390/hardirq.h
@@ -16,21 +16,50 @@
#include <linux/threads.h>
#include <asm/lowcore.h>
#include <linux/sched.h>
+
+/* No irq_cpustat_t for s390, the data is held directly in S390_lowcore */
+
+/*
+ * Simple wrappers reducing source bloat. S390 specific because each
+ * cpu stores its data in S390_lowcore (PSA) instead of using a cache
+ * aligned array element like most architectures.
+ */
+
+#ifdef CONFIG_SMP
+
+#define softirq_active(cpu) (safe_get_cpu_lowcore(cpu).__softirq_active)
+#define softirq_mask(cpu) (safe_get_cpu_lowcore(cpu).__softirq_mask)
+#define local_irq_count(cpu) (safe_get_cpu_lowcore(cpu).__local_irq_count)
+#define local_bh_count(cpu) (safe_get_cpu_lowcore(cpu).__local_bh_count)
+#define syscall_count(cpu) (safe_get_cpu_lowcore(cpu).__syscall_count)
+
+#else /* CONFIG_SMP */
+
+/* Optimize away the cpu calculation, it is always current PSA */
+#define softirq_active(cpu) ((void)(cpu), S390_lowcore.__softirq_active)
+#define softirq_mask(cpu) ((void)(cpu), S390_lowcore.__softirq_mask)
+#define local_irq_count(cpu) ((void)(cpu), S390_lowcore.__local_irq_count)
+#define local_bh_count(cpu) ((void)(cpu), S390_lowcore.__local_bh_count)
+#define syscall_count(cpu) ((void)(cpu), S390_lowcore.__syscall_count)
+
+#endif /* CONFIG_SMP */
+
/*
* Are we in an interrupt context? Either doing bottom half
* or hardware interrupt processing?
+ * Special definitions for s390, always access current PSA.
*/
-#define in_interrupt() ((atomic_read(&S390_lowcore.local_irq_count) + atomic_read(&S390_lowcore.local_bh_count)) != 0)
+#define in_interrupt() ((S390_lowcore.__local_irq_count + S390_lowcore.__local_bh_count) != 0)
-#define in_irq() (atomic_read(&S390_lowcore.local_irq_count) != 0)
+#define in_irq() (S390_lowcore.__local_irq_count != 0)
#ifndef CONFIG_SMP
-#define hardirq_trylock(cpu) (atomic_read(&S390_lowcore.local_irq_count) == 0)
+#define hardirq_trylock(cpu) (local_irq_count(cpu) == 0)
#define hardirq_endlock(cpu) do { } while (0)
-#define hardirq_enter(cpu) (atomic_inc(&S390_lowcore.local_irq_count))
-#define hardirq_exit(cpu) (atomic_dec(&S390_lowcore.local_irq_count))
+#define hardirq_enter(cpu) (local_irq_count(cpu)++)
+#define hardirq_exit(cpu) (local_irq_count(cpu)--)
#define synchronize_irq() do { } while (0)
@@ -54,14 +83,14 @@ static inline void release_irqlock(int cpu)
static inline void hardirq_enter(int cpu)
{
- atomic_inc(&safe_get_cpu_lowcore(cpu).local_irq_count);
+ ++local_irq_count(cpu);
atomic_inc(&global_irq_count);
}
static inline void hardirq_exit(int cpu)
{
atomic_dec(&global_irq_count);
- atomic_dec(&safe_get_cpu_lowcore(cpu).local_irq_count);
+ --local_irq_count(cpu);
}
static inline int hardirq_trylock(int cpu)
diff --git a/include/asm-s390/irq.h b/include/asm-s390/irq.h
index 895c24649..5efcdd40b 100644
--- a/include/asm-s390/irq.h
+++ b/include/asm-s390/irq.h
@@ -734,8 +734,8 @@ static inline void irq_exit(int cpu, unsigned int irq)
#else
-#define irq_enter(cpu, irq) (++local_irq_count[cpu])
-#define irq_exit(cpu, irq) (--local_irq_count[cpu])
+#define irq_enter(cpu, irq) (++local_irq_count(cpu))
+#define irq_exit(cpu, irq) (--local_irq_count(cpu))
#endif
diff --git a/include/asm-s390/lowcore.h b/include/asm-s390/lowcore.h
index 22ab31bd8..3430056da 100644
--- a/include/asm-s390/lowcore.h
+++ b/include/asm-s390/lowcore.h
@@ -41,9 +41,10 @@
#define __LC_SAVE_AREA 0xC00
#define __LC_KERNEL_STACK 0xC40
#define __LC_KERNEL_LEVEL 0xC44
-#define __LC_CPUID 0xC50
-#define __LC_CPUADDR 0xC58
-#define __LC_IPLDEV 0xC6C
+#define __LC_IRQ_STAT 0xC48
+#define __LC_CPUID 0xC60
+#define __LC_CPUADDR 0xC68
+#define __LC_IPLDEV 0xC7C
/* interrupt handler start with all io, external and mcck interrupt disabled */
@@ -145,19 +146,26 @@ struct _lowcore
__u32 save_area[16]; /* 0xc00 */
__u32 kernel_stack; /* 0xc40 */
__u32 kernel_level; /* 0xc44 */
- atomic_t local_bh_count; /* 0xc48 */
- atomic_t local_irq_count; /* 0xc4c */
- struct cpuinfo_S390 cpu_data; /* 0xc50 */
- __u32 ipl_device; /* 0xc6c */
+ /* entry.S sensitive area start */
+ /* Next 6 words are the s390 equivalent of irq_stat */
+ __u32 __softirq_active; /* 0xc48 */
+ __u32 __softirq_mask; /* 0xc4c */
+ __u32 __local_irq_count; /* 0xc50 */
+ __u32 __local_bh_count; /* 0xc54 */
+ __u32 __syscall_count; /* 0xc58 */
+ __u8 pad10[0xc60-0xc5c]; /* 0xc5c */
+ struct cpuinfo_S390 cpu_data; /* 0xc60 */
+ __u32 ipl_device; /* 0xc7c */
+ /* entry.S sensitive area end */
/* SMP info area: defined by DJB */
- __u64 jiffy_timer_cc; /* 0xc70 */
- atomic_t ext_call_fast; /* 0xc78 */
- atomic_t ext_call_queue; /* 0xc7c */
- atomic_t ext_call_count; /* 0xc80 */
+ __u64 jiffy_timer_cc; /* 0xc80 */
+ atomic_t ext_call_fast; /* 0xc88 */
+ atomic_t ext_call_queue; /* 0xc8c */
+ atomic_t ext_call_count; /* 0xc90 */
/* Align SMP info to the top 1k of prefix area */
- __u8 pad10[0x1000-0xc84]; /* 0xc84 */
+ __u8 pad11[0x1000-0xc94]; /* 0xc94 */
} __attribute__((packed)); /* End structure*/
extern __inline__ void set_prefix(__u32 address)
diff --git a/include/asm-s390/softirq.h b/include/asm-s390/softirq.h
index b0ad1dc56..ce1254eba 100644
--- a/include/asm-s390/softirq.h
+++ b/include/asm-s390/softirq.h
@@ -17,13 +17,13 @@
#include <asm/hardirq.h>
#include <asm/lowcore.h>
-#define cpu_bh_disable(cpu) do { atomic_inc(&S390_lowcore.local_bh_count); barrier(); } while (0)
-#define cpu_bh_enable(cpu) do { barrier(); atomic_dec(&S390_lowcore.local_bh_count); } while (0)
+#define cpu_bh_disable(cpu) do { local_bh_count(cpu)++; barrier(); } while (0)
+#define cpu_bh_enable(cpu) do { barrier(); local_bh_count(cpu)--; } while (0)
#define local_bh_disable() cpu_bh_disable(smp_processor_id())
#define local_bh_enable() cpu_bh_enable(smp_processor_id())
-#define in_softirq() (atomic_read(&S390_lowcore.local_bh_count) != 0)
+#define in_softirq() (local_bh_count(smp_processor_id()) != 0)
#endif /* __ASM_SOFTIRQ_H */