summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/alpha/kernel/alpha_ksyms.c3
-rw-r--r--arch/alpha/kernel/entry.S4
-rw-r--r--arch/alpha/kernel/irq_alpha.c4
-rw-r--r--arch/alpha/kernel/irq_smp.c8
-rw-r--r--arch/alpha/kernel/smp.c4
-rw-r--r--arch/arm/kernel/armksyms.c2
-rw-r--r--arch/arm/kernel/entry-common.S12
-rw-r--r--arch/arm/kernel/irq.c4
-rw-r--r--arch/i386/kernel/entry.S16
-rw-r--r--arch/i386/kernel/i386_ksyms.c2
-rw-r--r--arch/i386/kernel/io_apic.c2
-rw-r--r--arch/i386/kernel/irq.c6
-rw-r--r--arch/i386/kernel/traps.c2
-rw-r--r--arch/ia64/kernel/entry.S6
-rw-r--r--arch/ia64/kernel/ia64_ksyms.c4
-rw-r--r--arch/ia64/kernel/irq.c4
-rw-r--r--arch/m68k/atari/ataints.c4
-rw-r--r--arch/m68k/kernel/entry.S10
-rw-r--r--arch/m68k/kernel/ints.c4
-rw-r--r--arch/m68k/kernel/m68k_ksyms.c2
-rw-r--r--arch/mips/baget/irq.c1
-rw-r--r--arch/mips/dec/irq.c4
-rw-r--r--arch/mips/kernel/entry.S4
-rw-r--r--arch/mips/kernel/irq.c6
-rw-r--r--arch/mips/kernel/mips_ksyms.c1
-rw-r--r--arch/mips/kernel/scall_o32.S4
-rw-r--r--arch/mips/orion/irq.c5
-rw-r--r--arch/mips/orion/misc.c2
-rw-r--r--arch/mips/orion/setup.c2
-rw-r--r--arch/mips/sgi/kernel/indy_int.c4
-rw-r--r--arch/mips64/kernel/entry.S6
-rw-r--r--arch/mips64/kernel/scall_64.S4
-rw-r--r--arch/mips64/kernel/scall_o32.S4
-rw-r--r--arch/mips64/sgi-ip22/ip22-int.c4
-rw-r--r--arch/mips64/sgi-ip27/ip27-irq.c4
-rw-r--r--arch/ppc/kernel/entry.S8
-rw-r--r--arch/ppc/kernel/irq.c1
-rw-r--r--arch/ppc/kernel/local_irq.h2
-rw-r--r--arch/ppc/kernel/ppc_ksyms.c1
-rw-r--r--arch/s390/kernel/entry.S28
-rw-r--r--arch/s390/kernel/irq.c14
-rw-r--r--arch/s390/kernel/process.c4
-rw-r--r--arch/s390/kernel/s390io.c7
-rw-r--r--arch/s390/mm/fault.c2
-rw-r--r--arch/sh/kernel/entry.S8
-rw-r--r--arch/sh/kernel/irq.c7
-rw-r--r--arch/sparc/config.in3
-rw-r--r--arch/sparc/kernel/irq.c23
-rw-r--r--arch/sparc/kernel/rtrap.S6
-rw-r--r--arch/sparc/kernel/sparc_ksyms.c2
-rw-r--r--arch/sparc/mm/init.c135
-rw-r--r--arch/sparc/mm/srmmu.c29
-rw-r--r--arch/sparc64/config.in25
-rw-r--r--arch/sparc64/defconfig12
-rw-r--r--arch/sparc64/kernel/ebus.c8
-rw-r--r--arch/sparc64/kernel/entry.S6
-rw-r--r--arch/sparc64/kernel/ioctl32.c13
-rw-r--r--arch/sparc64/kernel/irq.c14
-rw-r--r--arch/sparc64/kernel/process.c4
-rw-r--r--arch/sparc64/kernel/rtrap.S28
-rw-r--r--arch/sparc64/kernel/signal.c6
-rw-r--r--arch/sparc64/kernel/smp.c1
-rw-r--r--arch/sparc64/kernel/sparc64_ksyms.c10
-rw-r--r--arch/sparc64/kernel/sunos_ioctl32.c4
-rw-r--r--arch/sparc64/kernel/sys_sparc.c40
-rw-r--r--arch/sparc64/kernel/sys_sparc32.c134
-rw-r--r--arch/sparc64/kernel/sys_sunos32.c35
-rw-r--r--arch/sparc64/kernel/traps.c13
-rw-r--r--arch/sparc64/solaris/fs.c12
-rw-r--r--arch/sparc64/solaris/ioctl.c13
-rw-r--r--arch/sparc64/solaris/timod.c5
71 files changed, 381 insertions, 440 deletions
diff --git a/arch/alpha/kernel/alpha_ksyms.c b/arch/alpha/kernel/alpha_ksyms.c
index 078aa7d3d..4ac2e8b0d 100644
--- a/arch/alpha/kernel/alpha_ksyms.c
+++ b/arch/alpha/kernel/alpha_ksyms.c
@@ -199,9 +199,6 @@ EXPORT_SYMBOL(debug_spin_trylock);
EXPORT_SYMBOL(write_lock);
EXPORT_SYMBOL(read_lock);
#endif
-#else /* CONFIG_SMP */
-EXPORT_SYMBOL(__local_bh_count);
-EXPORT_SYMBOL(__local_irq_count);
#endif /* CONFIG_SMP */
EXPORT_SYMBOL(rtc_lock);
diff --git a/arch/alpha/kernel/entry.S b/arch/alpha/kernel/entry.S
index 253b8d6c1..ac80051ed 100644
--- a/arch/alpha/kernel/entry.S
+++ b/arch/alpha/kernel/entry.S
@@ -577,10 +577,10 @@ entSys:
ret_from_sys_call:
cmovne $26,0,$19 /* $19 = 0 => non-restartable */
ldl $3,TASK_PROCESSOR($8)
- lda $4,softirq_state
+ lda $4,irq_stat /* softirq_active */
sll $3,L1_CACHE_SHIFT,$3
addq $3,$4,$4
- ldq $4,0($4)
+ ldq $4,0($4) /* softirq_active[32] + softirq_mask[32] */
sll $4,32,$3
and $4,$3,$4
bne $4,handle_softirq
diff --git a/arch/alpha/kernel/irq_alpha.c b/arch/alpha/kernel/irq_alpha.c
index 066af7e1e..59f102496 100644
--- a/arch/alpha/kernel/irq_alpha.c
+++ b/arch/alpha/kernel/irq_alpha.c
@@ -14,11 +14,7 @@
#include "proto.h"
#include "irq_impl.h"
-/* Only uniprocessor needs this IRQ/BH locking depth, on SMP it lives
- in the per-cpu structure for cache reasons. */
#ifndef CONFIG_SMP
-int __local_irq_count;
-int __local_bh_count;
unsigned long __irq_attempt[NR_IRQS];
#endif
diff --git a/arch/alpha/kernel/irq_smp.c b/arch/alpha/kernel/irq_smp.c
index 90a3c30b2..9022228a0 100644
--- a/arch/alpha/kernel/irq_smp.c
+++ b/arch/alpha/kernel/irq_smp.c
@@ -40,13 +40,13 @@ show(char * str, void *where)
printk("\n%s, CPU %d: %p\n", str, cpu, where);
printk("irq: %d [%d %d]\n",
irqs_running(),
- cpu_data[0].irq_count,
- cpu_data[1].irq_count);
+ local_irq_count(0),
+ local_irq_count(1));
printk("bh: %d [%d %d]\n",
spin_is_locked(&global_bh_lock) ? 1 : 0,
- cpu_data[0].bh_count,
- cpu_data[1].bh_count);
+ local_bh_count(0),
+ local_bh_count(1));
#if 0
stack = (unsigned long *) &str;
for (i = 40; i ; i--) {
diff --git a/arch/alpha/kernel/smp.c b/arch/alpha/kernel/smp.c
index e51ff9d18..4f7a04b3f 100644
--- a/arch/alpha/kernel/smp.c
+++ b/arch/alpha/kernel/smp.c
@@ -108,8 +108,8 @@ smp_store_cpu_info(int cpuid)
cpu_data[cpuid].loops_per_sec = loops_per_sec;
cpu_data[cpuid].last_asn
= (cpuid << WIDTH_HARDWARE_ASN) + ASN_FIRST_VERSION;
- cpu_data[cpuid].irq_count = 0;
- cpu_data[cpuid].bh_count = 0;
+ local_irq_count(cpuid) = 0;
+ local_bh_count(cpuid) = 0;
}
/*
diff --git a/arch/arm/kernel/armksyms.c b/arch/arm/kernel/armksyms.c
index 6723291df..fc14d6c45 100644
--- a/arch/arm/kernel/armksyms.c
+++ b/arch/arm/kernel/armksyms.c
@@ -91,8 +91,6 @@ EXPORT_SYMBOL(kd_mksound);
EXPORT_SYMBOL(dump_thread);
EXPORT_SYMBOL(dump_fpu);
EXPORT_SYMBOL(udelay);
-EXPORT_SYMBOL(local_bh_count);
-EXPORT_SYMBOL(local_irq_count);
#ifdef CONFIG_CPU_32
EXPORT_SYMBOL(__ioremap);
EXPORT_SYMBOL(__iounmap);
diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S
index b4fbfe628..c260b8e19 100644
--- a/arch/arm/kernel/entry-common.S
+++ b/arch/arm/kernel/entry-common.S
@@ -9,7 +9,7 @@
#ifdef CONFIG_SMP
#error SMP not supported
#else
- ldr \rd, __softirq_state
+ ldr \rd, __irq_stat
#endif
.endm
@@ -22,7 +22,7 @@ slow_syscall_return:
add sp, sp, #S_OFF
ret_from_sys_call: @ external entry
get_softirq r0
- ldmia r0, {r0, r1}
+ ldmia r0, {r0, r1} @ softirq_active, softirq_mask
mov r4, #1 @ flag this as being syscall return
tst r0, r1
blne SYMBOL_NAME(do_softirq)
@@ -48,7 +48,7 @@ ret_reschedule: adrsvc al, lr, ret_with_reschedule @ internal
.globl ret_from_exception
ret_from_exception: @ external entry
get_softirq r0
- ldmia r0, {r0, r1}
+ ldmia r0, {r0, r1} @ softirq_active, softirq_mask
mov r4, #0
tst r0, r1
blne SYMBOL_NAME(do_softirq)
@@ -129,9 +129,9 @@ vector_swi: save_user_regs
b SYMBOL_NAME(deferred)
.align 5
- .type __softirq_state, #object
-__softirq_state:
- .word SYMBOL_NAME(softirq_state)
+ .type __irq_stat, #object
+__irq_stat:
+ .word SYMBOL_NAME(irq_stat)
.type sys_call_table, #object
ENTRY(sys_call_table)
diff --git a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c
index 40a47c45f..8af0c3b3f 100644
--- a/arch/arm/kernel/irq.c
+++ b/arch/arm/kernel/irq.c
@@ -46,8 +46,6 @@
*/
#define MAX_IRQ_CNT 100000
-unsigned int local_bh_count[NR_CPUS];
-unsigned int local_irq_count[NR_CPUS];
spinlock_t irq_controller_lock;
int setup_arm_irq(int, struct irqaction *);
@@ -236,7 +234,7 @@ asmlinkage void do_IRQ(int irq, struct pt_regs * regs)
irq_exit(cpu, irq);
- if (softirq_state[cpu].active & softirq_state[cpu].mask)
+ if (softirq_active(cpu) & softirq_mask(cpu))
do_softirq();
return;
diff --git a/arch/i386/kernel/entry.S b/arch/i386/kernel/entry.S
index da7fd047d..c36d01cce 100644
--- a/arch/i386/kernel/entry.S
+++ b/arch/i386/kernel/entry.S
@@ -206,11 +206,11 @@ ENTRY(ret_from_sys_call)
#ifdef CONFIG_SMP
movl processor(%ebx),%eax
shll $5,%eax
- movl SYMBOL_NAME(softirq_state)(,%eax),%ecx
- testl SYMBOL_NAME(softirq_state)+4(,%eax),%ecx
+ movl SYMBOL_NAME(irq_stat)(,%eax),%ecx # softirq_active
+ testl SYMBOL_NAME(irq_stat)+4(,%eax),%ecx # softirq_mask
#else
- movl SYMBOL_NAME(softirq_state),%ecx
- testl SYMBOL_NAME(softirq_state)+4,%ecx
+ movl SYMBOL_NAME(irq_stat),%ecx # softirq_active
+ testl SYMBOL_NAME(irq_stat)+4,%ecx # softirq_mask
#endif
jne handle_softirq
@@ -262,11 +262,11 @@ ret_from_exception:
GET_CURRENT(%ebx)
movl processor(%ebx),%eax
shll $5,%eax
- movl SYMBOL_NAME(softirq_state)(,%eax),%ecx
- testl SYMBOL_NAME(softirq_state)+4(,%eax),%ecx
+ movl SYMBOL_NAME(irq_stat)(,%eax),%ecx # softirq_active
+ testl SYMBOL_NAME(irq_stat)+4(,%eax),%ecx # softirq_mask
#else
- movl SYMBOL_NAME(softirq_state),%ecx
- testl SYMBOL_NAME(softirq_state)+4,%ecx
+ movl SYMBOL_NAME(irq_stat),%ecx # softirq_active
+ testl SYMBOL_NAME(irq_stat)+4,%ecx # softirq_mask
#endif
jne handle_softirq
diff --git a/arch/i386/kernel/i386_ksyms.c b/arch/i386/kernel/i386_ksyms.c
index 380ac4996..c11ab01f2 100644
--- a/arch/i386/kernel/i386_ksyms.c
+++ b/arch/i386/kernel/i386_ksyms.c
@@ -141,6 +141,4 @@ EXPORT_SYMBOL(screen_info);
EXPORT_SYMBOL(get_wchan);
-EXPORT_SYMBOL(irq_stat);
-
EXPORT_SYMBOL(rtc_lock);
diff --git a/arch/i386/kernel/io_apic.c b/arch/i386/kernel/io_apic.c
index 406a30771..525f78624 100644
--- a/arch/i386/kernel/io_apic.c
+++ b/arch/i386/kernel/io_apic.c
@@ -1070,7 +1070,7 @@ static int __init nmi_irq_works(void)
for (j = 0; j < smp_num_cpus; j++) {
cpu = cpu_logical_map(j);
- if (nmi_counter(cpu) - tmp[cpu].__nmi_counter <= 3) {
+ if (nmi_count(cpu) - tmp[cpu].__nmi_count <= 3) {
printk(KERN_WARNING "CPU#%d NMI appears to be stuck.\n", cpu);
return 0;
}
diff --git a/arch/i386/kernel/irq.c b/arch/i386/kernel/irq.c
index fcc0a72f5..92ddd01f5 100644
--- a/arch/i386/kernel/irq.c
+++ b/arch/i386/kernel/irq.c
@@ -61,8 +61,6 @@
* interrupt controllers, without having to do assembly magic.
*/
-irq_cpustat_t irq_stat [NR_CPUS];
-
/*
* Controller mappings for all interrupt sources:
*/
@@ -160,7 +158,7 @@ int get_irq_list(char *buf)
p += sprintf(p, "NMI: ");
for (j = 0; j < smp_num_cpus; j++)
p += sprintf(p, "%10u ",
- nmi_counter(cpu_logical_map(j)));
+ nmi_count(cpu_logical_map(j)));
p += sprintf(p, "\n");
#if CONFIG_SMP
p += sprintf(p, "LOC: ");
@@ -624,7 +622,7 @@ out:
desc->handler->end(irq);
spin_unlock(&desc->lock);
- if (softirq_state[cpu].active & softirq_state[cpu].mask)
+ if (softirq_active(cpu) & softirq_mask(cpu))
do_softirq();
return 1;
}
diff --git a/arch/i386/kernel/traps.c b/arch/i386/kernel/traps.c
index eea525873..7bd8a04d0 100644
--- a/arch/i386/kernel/traps.c
+++ b/arch/i386/kernel/traps.c
@@ -459,7 +459,7 @@ asmlinkage void do_nmi(struct pt_regs * regs, long error_code)
unsigned char reason = inb(0x61);
- ++nmi_counter(smp_processor_id());
+ ++nmi_count(smp_processor_id());
if (!(reason & 0xc0)) {
#if CONFIG_X86_IO_APIC
/*
diff --git a/arch/ia64/kernel/entry.S b/arch/ia64/kernel/entry.S
index 3aadb43a0..f9beac21d 100644
--- a/arch/ia64/kernel/entry.S
+++ b/arch/ia64/kernel/entry.S
@@ -506,7 +506,7 @@ GLOBAL_ENTRY(ia64_leave_kernel)
PT_REGS_UNWIND_INFO(0)
#ifdef CONFIG_SMP
adds r2=IA64_TASK_PROCESSOR_OFFSET,r13
- movl r3=softirq_state
+ movl r3=irq_stat // softirq_active
;;
ld4 r2=[r2]
;;
@@ -514,10 +514,10 @@ GLOBAL_ENTRY(ia64_leave_kernel)
;;
add r3=r2,r3
#else
- movl r3=softirq_state
+ movl r3=irq_stat // softirq_active
#endif
;;
- ld8 r2=[r3] // r3 is guaranteed to be 8-byte aligned!
+ ld8 r2=[r3] // r3 (softirq_active+softirq_mask) is guaranteed to be 8-byte aligned!
;;
shr r3=r2,32
;;
diff --git a/arch/ia64/kernel/ia64_ksyms.c b/arch/ia64/kernel/ia64_ksyms.c
index 7f01b667c..2e4ffe403 100644
--- a/arch/ia64/kernel/ia64_ksyms.c
+++ b/arch/ia64/kernel/ia64_ksyms.c
@@ -32,10 +32,6 @@ EXPORT_SYMBOL(csum_partial_copy_nocheck);
EXPORT_SYMBOL(enable_irq);
EXPORT_SYMBOL(disable_irq);
-#include <asm/current.h>
-#include <asm/hardirq.h>
-EXPORT_SYMBOL(irq_stat);
-
#include <asm/processor.h>
EXPORT_SYMBOL(cpu_data);
EXPORT_SYMBOL(kernel_thread);
diff --git a/arch/ia64/kernel/irq.c b/arch/ia64/kernel/irq.c
index ed7eb88fc..c913fdc3d 100644
--- a/arch/ia64/kernel/irq.c
+++ b/arch/ia64/kernel/irq.c
@@ -60,8 +60,6 @@
* interrupt controllers, without having to do assembly magic.
*/
-irq_cpustat_t irq_stat [NR_CPUS];
-
/*
* Controller mappings for all interrupt sources:
*/
@@ -162,7 +160,7 @@ int get_irq_list(char *buf)
p += sprintf(p, "NMI: ");
for (j = 0; j < smp_num_cpus; j++)
p += sprintf(p, "%10u ",
- nmi_counter(cpu_logical_map(j)));
+ nmi_count(cpu_logical_map(j)));
p += sprintf(p, "\n");
#if defined(CONFIG_SMP) && defined(__i386__)
p += sprintf(p, "LOC: ");
diff --git a/arch/m68k/atari/ataints.c b/arch/m68k/atari/ataints.c
index f47ff3a7a..f92c45f60 100644
--- a/arch/m68k/atari/ataints.c
+++ b/arch/m68k/atari/ataints.c
@@ -168,7 +168,7 @@ asmlinkage void IRQ_NAME(n); \
void atari_slow_irq_##n##_dummy (void) { \
__asm__ (__ALIGN_STR "\n" \
SYMBOL_NAME_STR(atari_slow_irq_) #n "_handler:\t" \
-" addql #1,"SYMBOL_NAME_STR(local_irq_count)"\n" \
+" addql #1,"SYMBOL_NAME_STR(irq_stat)"+8\n" /* local_irq_count */ \
SAVE_ALL_INT "\n" \
GET_CURRENT(%%d0) "\n" \
" andb #~(1<<(%c3&7)),%a4:w\n" /* mask this interrupt */ \
@@ -274,7 +274,7 @@ __asm__ (__ALIGN_STR "\n"
SYMBOL_NAME_STR(atari_fast_irq_handler) ":
orw #0x700,%%sr /* disable all interrupts */
"SYMBOL_NAME_STR(atari_prio_irq_handler) ":\t
- addql #1,"SYMBOL_NAME_STR(local_irq_count)"\n"
+ addql #1,"SYMBOL_NAME_STR(irq_stat)"+8\n" /* local_irq_count */
SAVE_ALL_INT "\n"
GET_CURRENT(%%d0) "
/* get vector number from stack frame and convert to source */
diff --git a/arch/m68k/kernel/entry.S b/arch/m68k/kernel/entry.S
index 5f08ef216..7cbb69d03 100644
--- a/arch/m68k/kernel/entry.S
+++ b/arch/m68k/kernel/entry.S
@@ -171,7 +171,7 @@ do_delayed_trace:
#if 0
#if CONFIG_AMIGA
SYMBOL_NAME_LABEL(ami_inthandler)
- addql #1,SYMBOL_NAME(local_irq_count)
+ addql #1,SYMBOL_NAME(irq_stat)+8 | local_irq_count
SAVE_ALL_INT
GET_CURRENT(%d0)
@@ -203,7 +203,7 @@ ENTRY(nmi_handler)
SYMBOL_NAME_LABEL(inthandler)
SAVE_ALL_INT
GET_CURRENT(%d0)
- addql #1,SYMBOL_NAME(local_irq_count)
+ addql #1,SYMBOL_NAME(irq_stat)+8 | local_irq_count
| put exception # in d0
bfextu %sp@(PT_VECTOR){#4,#10},%d0
@@ -222,7 +222,7 @@ SYMBOL_NAME_LABEL(inthandler)
3: addql #8,%sp | pop parameters off stack
SYMBOL_NAME_LABEL(ret_from_interrupt)
- subql #1,SYMBOL_NAME(local_irq_count)
+ subql #1,SYMBOL_NAME(irq_stat)+8 | local_irq_count
jeq 1f
2:
RESTORE_ALL
@@ -236,8 +236,8 @@ SYMBOL_NAME_LABEL(ret_from_interrupt)
#endif
/* check if we need to do software interrupts */
- movel SYMBOL_NAME(softirq_state),%d0
- andl SYMBOL_NAME(softirq_state)+4,%d0
+ movel SYMBOL_NAME(irq_stat),%d0 | softirq_active
+ andl SYMBOL_NAME(irq_stat)+4,%d0 | softirq_mask
jeq SYMBOL_NAME(ret_from_exception)
pea SYMBOL_NAME(ret_from_exception)
diff --git a/arch/m68k/kernel/ints.c b/arch/m68k/kernel/ints.c
index 9dc6427e6..74e1e4c1e 100644
--- a/arch/m68k/kernel/ints.c
+++ b/arch/m68k/kernel/ints.c
@@ -57,10 +57,6 @@ volatile unsigned int num_spurious;
#define NUM_IRQ_NODES 100
static irq_node_t nodes[NUM_IRQ_NODES];
-unsigned int local_irq_count[NR_CPUS];
-
-unsigned int local_bh_count[NR_CPUS];
-
static void dummy_enable_irq(unsigned int irq);
static void dummy_disable_irq(unsigned int irq);
static int dummy_request_irq(unsigned int irq,
diff --git a/arch/m68k/kernel/m68k_ksyms.c b/arch/m68k/kernel/m68k_ksyms.c
index 6f8300422..7bf46149f 100644
--- a/arch/m68k/kernel/m68k_ksyms.c
+++ b/arch/m68k/kernel/m68k_ksyms.c
@@ -52,8 +52,6 @@ EXPORT_SYMBOL(dump_thread);
EXPORT_SYMBOL(strnlen);
EXPORT_SYMBOL(strrchr);
EXPORT_SYMBOL(strstr);
-EXPORT_SYMBOL(local_irq_count);
-EXPORT_SYMBOL(local_bh_count);
EXPORT_SYMBOL(enable_irq);
EXPORT_SYMBOL(disable_irq);
EXPORT_SYMBOL(kernel_thread);
diff --git a/arch/mips/baget/irq.c b/arch/mips/baget/irq.c
index 08b15a7a8..03d68ee17 100644
--- a/arch/mips/baget/irq.c
+++ b/arch/mips/baget/irq.c
@@ -29,7 +29,6 @@
#include <asm/baget/baget.h>
-irq_cpustat_t irq_stat [NR_CPUS];
unsigned long spurious_count = 0;
/*
diff --git a/arch/mips/dec/irq.c b/arch/mips/dec/irq.c
index 7551ae681..91e1ce463 100644
--- a/arch/mips/dec/irq.c
+++ b/arch/mips/dec/irq.c
@@ -31,10 +31,6 @@ extern volatile unsigned int *isr; /* address of the interrupt status register
extern volatile unsigned int *imr; /* address of the interrupt mask register */
extern decint_t dec_interrupt[NR_INTS];
-irq_cpustat_t irq_stat [NR_CPUS];
-
-unsigned int local_bh_count[NR_CPUS];
-unsigned int local_irq_count[NR_CPUS];
unsigned long spurious_count = 0;
static inline void mask_irq(unsigned int irq_nr)
diff --git a/arch/mips/kernel/entry.S b/arch/mips/kernel/entry.S
index bde21011f..bc56db51b 100644
--- a/arch/mips/kernel/entry.S
+++ b/arch/mips/kernel/entry.S
@@ -43,8 +43,8 @@ reschedule: jal schedule
EXPORT(ret_from_sys_call)
EXPORT(ret_from_irq)
.type ret_from_irq,@function
- lw t0, softirq_state
- lw t1, softirq_state+4 # unused delay slot
+ lw t0, irq_stat # softirq_active
+ lw t1, irq_stat+4 # softirq_mask. unused delay slot
and t0, t1
bnez t0, handle_softirq
diff --git a/arch/mips/kernel/irq.c b/arch/mips/kernel/irq.c
index 54c2c3c81..fcb7a632f 100644
--- a/arch/mips/kernel/irq.c
+++ b/arch/mips/kernel/irq.c
@@ -47,8 +47,6 @@
* interrupt controllers, without having to do assembly magic.
*/
-irq_cpustat_t irq_stat [NR_CPUS];
-
/*
* This contains the irq mask for both 8259A irq controllers, it's an
* int so we can deal with the third PIC in some systems like the RM300.
@@ -63,8 +61,6 @@ static unsigned int cached_irq_mask = 0xffff;
#define cached_21 (__byte(0,cached_irq_mask))
#define cached_A1 (__byte(1,cached_irq_mask))
-unsigned int local_bh_count[NR_CPUS];
-unsigned int local_irq_count[NR_CPUS];
unsigned long spurious_count = 0;
/*
@@ -228,7 +224,7 @@ asmlinkage void do_IRQ(int irq, struct pt_regs * regs)
}
irq_exit(cpu);
- if (softirq_state[cpu].active&softirq_state[cpu].mask)
+ if (softirq_active(cpu)&softirq_mask(cpu))
do_softirq();
/* unmasking and bottom half handling is done magically for us. */
diff --git a/arch/mips/kernel/mips_ksyms.c b/arch/mips/kernel/mips_ksyms.c
index b58272f46..3b3c43111 100644
--- a/arch/mips/kernel/mips_ksyms.c
+++ b/arch/mips/kernel/mips_ksyms.c
@@ -140,4 +140,3 @@ EXPORT_SYMBOL(ide_ops);
#endif
EXPORT_SYMBOL(get_wchan);
-EXPORT_SYMBOL(irq_stat);
diff --git a/arch/mips/kernel/scall_o32.S b/arch/mips/kernel/scall_o32.S
index ddf69a964..bdc72ca4e 100644
--- a/arch/mips/kernel/scall_o32.S
+++ b/arch/mips/kernel/scall_o32.S
@@ -65,8 +65,8 @@ stack_done:
1: sw v0, PT_R2(sp) # result
EXPORT(o32_ret_from_sys_call)
- lw t0, softirq_state
- lw t1, softirq_state+4 # unused delay slot
+ lw t0, irq_stat # softirq_active
+ lw t1, irq_stat+4 # softirq_mask. unused delay slot
and t0, t1
bnez t0, o32_handle_softirq
diff --git a/arch/mips/orion/irq.c b/arch/mips/orion/irq.c
index f61690b85..1721b47ae 100644
--- a/arch/mips/orion/irq.c
+++ b/arch/mips/orion/irq.c
@@ -25,9 +25,6 @@
void (*board_time_init)(struct irqaction *irq);
extern asmlinkage void orionIRQ(void);
-irq_cpustat_t irq_stat [NR_CPUS];
-unsigned int local_bh_count[NR_CPUS];
-unsigned int local_irq_count[NR_CPUS];
unsigned long spurious_count = 0;
irq_desc_t irq_desc[NR_IRQS];
@@ -186,7 +183,7 @@ asmlinkage void do_IRQ(int irq, struct pt_regs * regs)
irq_exit(cpu);
- if (softirq_state[cpu].active&softirq_state[cpu].mask)
+ if (softirq_active(cpu)&softirq_mask(cpu))
do_softirq();
/* unmasking and bottom half handling is done magically for us. */
diff --git a/arch/mips/orion/misc.c b/arch/mips/orion/misc.c
index 1c6d9e2fa..0d8881058 100644
--- a/arch/mips/orion/misc.c
+++ b/arch/mips/orion/misc.c
@@ -35,10 +35,8 @@
#include <asm/stackframe.h>
#include <asm/system.h>
#include <asm/cpu.h>
-#include <linux/sched.h>
#include <linux/bootmem.h>
#include <asm/addrspace.h>
-#include <asm/bootinfo.h>
#include <asm/mc146818rtc.h>
char arcs_cmdline[CL_SIZE] = {0, };
diff --git a/arch/mips/orion/setup.c b/arch/mips/orion/setup.c
index 8d4cc54f0..c247d6b52 100644
--- a/arch/mips/orion/setup.c
+++ b/arch/mips/orion/setup.c
@@ -35,10 +35,8 @@
#include <asm/stackframe.h>
#include <asm/system.h>
#include <asm/cpu.h>
-#include <linux/sched.h>
#include <linux/bootmem.h>
#include <asm/addrspace.h>
-#include <asm/bootinfo.h>
#include <asm/mc146818rtc.h>
#include <asm/orion.h>
diff --git a/arch/mips/sgi/kernel/indy_int.c b/arch/mips/sgi/kernel/indy_int.c
index 06d8573cb..2e104bf79 100644
--- a/arch/mips/sgi/kernel/indy_int.c
+++ b/arch/mips/sgi/kernel/indy_int.c
@@ -55,8 +55,6 @@
* interrupt controllers, without having to do assembly magic.
*/
-irq_cpustat_t irq_stat [NR_CPUS];
-
/* #define DEBUG_SGINT */
struct sgi_int2_regs *sgi_i2regs;
@@ -72,8 +70,6 @@ static char lc3msk_to_irqnr[256];
extern asmlinkage void indyIRQ(void);
-unsigned int local_bh_count[NR_CPUS];
-unsigned int local_irq_count[NR_CPUS];
unsigned long spurious_count = 0;
/* Local IRQ's are layed out logically like this:
diff --git a/arch/mips64/kernel/entry.S b/arch/mips64/kernel/entry.S
index 8f61ca7ee..ee4881448 100644
--- a/arch/mips64/kernel/entry.S
+++ b/arch/mips64/kernel/entry.S
@@ -35,14 +35,14 @@ reschedule: jal schedule
FEXPORT(ret_from_sys_call)
FEXPORT(ret_from_irq)
- la t1, softirq_state
+ la t1, irq_stat # softirq_active
#ifdef CONFIG_SMP
lwu t0, TASK_PROCESSOR($28)
dsll t0, t0, 5
daddu t1, t0
#endif
- lw t0, 0 (t1)
- lw t1, 4 (t1) # unused delay slot
+ lw t0, 0 (t1) # softirq_active
+ lw t1, 4 (t1) # softirq_mask. unused delay slot
and t0, t1
bnez t0, handle_softirq
9: ld t0, PT_STATUS(sp) # returning to kernel mode?
diff --git a/arch/mips64/kernel/scall_64.S b/arch/mips64/kernel/scall_64.S
index a6ac27f68..2e65e1732 100644
--- a/arch/mips64/kernel/scall_64.S
+++ b/arch/mips64/kernel/scall_64.S
@@ -63,8 +63,8 @@ NESTED(handle_sys64, PT_SIZE, sp)
1: sd v0, PT_R2(sp) # result
FEXPORT(ret_from_sys_call_64)
- lw t0, softirq_state
- lw t1, softirq_state+4 # unused delay slot
+ lw t0, irq_stat # softirq_active
+ lw t1, irq_stat+4 # softirq_mask. unused delay slot
and t0, t1
bnez t0, handle_softirq_64
diff --git a/arch/mips64/kernel/scall_o32.S b/arch/mips64/kernel/scall_o32.S
index de5b98494..a43fef7bd 100644
--- a/arch/mips64/kernel/scall_o32.S
+++ b/arch/mips64/kernel/scall_o32.S
@@ -76,8 +76,8 @@ stack_done:
1: sd v0, PT_R2(sp) # result
FEXPORT(o32_ret_from_sys_call)
- lw t0, softirq_state
- lw t1, softirq_state+4 # unused delay slot
+ lw t0, irq_stat # softirq_active
+ lw t1, irq_stat+4 # softirq_mask. unused delay slot
and t0, t1
bnez t0, o32_handle_softirq
diff --git a/arch/mips64/sgi-ip22/ip22-int.c b/arch/mips64/sgi-ip22/ip22-int.c
index 891e121f6..19c61e6dc 100644
--- a/arch/mips64/sgi-ip22/ip22-int.c
+++ b/arch/mips64/sgi-ip22/ip22-int.c
@@ -53,8 +53,6 @@
* interrupt controllers, without having to do assembly magic.
*/
-irq_cpustat_t irq_stat [NR_CPUS];
-
struct sgi_int2_regs *sgi_i2regs;
struct sgi_int3_regs *sgi_i3regs;
struct sgi_ioc_ints *ioc_icontrol;
@@ -73,8 +71,6 @@ int (*irq_cannonicalize)(int irq);
extern void rs_kgdb_hook(int);
#endif
-unsigned int local_bh_count[NR_CPUS];
-unsigned int local_irq_count[NR_CPUS];
unsigned long spurious_count = 0;
/* Local IRQ's are layed out logically like this:
diff --git a/arch/mips64/sgi-ip27/ip27-irq.c b/arch/mips64/sgi-ip27/ip27-irq.c
index f5160af15..ead444bb5 100644
--- a/arch/mips64/sgi-ip27/ip27-irq.c
+++ b/arch/mips64/sgi-ip27/ip27-irq.c
@@ -59,16 +59,12 @@
* interrupt controllers, without having to do assembly magic.
*/
-irq_cpustat_t irq_stat [NR_CPUS];
-
extern asmlinkage void ip27_irq(void);
extern int irq_to_bus[], irq_to_slot[], bus_to_cpu[];
int (*irq_cannonicalize)(int irq);
int intr_connect_level(int cpu, int bit);
int intr_disconnect_level(int cpu, int bit);
-unsigned int local_bh_count[NR_CPUS];
-unsigned int local_irq_count[NR_CPUS];
unsigned long spurious_count = 0;
/*
diff --git a/arch/ppc/kernel/entry.S b/arch/ppc/kernel/entry.S
index 8ccb0f571..d40a54cf1 100644
--- a/arch/ppc/kernel/entry.S
+++ b/arch/ppc/kernel/entry.S
@@ -319,16 +319,16 @@ lost_irq_ret:
addi r3,r1,STACK_FRAME_OVERHEAD
bl do_IRQ
b 3b
-1: lis r4,softirq_state@ha
- addi r4,r4,softirq_state@l
+1: lis r4,irq_stat@ha /* &softirq_active for cpu 0 */
+ addi r4,r4,irq_stat@l
#ifdef CONFIG_SMP
/* get processor # */
lwz r3,PROCESSOR(r2)
slwi r3,r3,5
add r4,r4,r3
#endif /* CONFIG_SMP */
- lwz r5,0(r4)
- lwz r4,4(r4)
+ lwz r5,0(r4) /* softirq_active */
+ lwz r4,4(r4) /* softirq_mask */
and. r5,r5,r4
beq+ 2f
bl do_softirq
diff --git a/arch/ppc/kernel/irq.c b/arch/ppc/kernel/irq.c
index ee63ca902..64ef4b4dc 100644
--- a/arch/ppc/kernel/irq.c
+++ b/arch/ppc/kernel/irq.c
@@ -74,7 +74,6 @@ volatile unsigned char *chrp_int_ack_special;
irq_desc_t irq_desc[NR_IRQS];
int ppc_spurious_interrupts = 0;
-irq_cpustat_t irq_stat [NR_CPUS];
struct irqaction *ppc_irq_action[NR_IRQS];
unsigned int ppc_cached_irq_mask[NR_MASK_WORDS];
unsigned int ppc_lost_interrupts[NR_MASK_WORDS];
diff --git a/arch/ppc/kernel/local_irq.h b/arch/ppc/kernel/local_irq.h
index 840b14d6f..5c616bbbd 100644
--- a/arch/ppc/kernel/local_irq.h
+++ b/arch/ppc/kernel/local_irq.h
@@ -15,8 +15,6 @@ void ppc_irq_dispatch_handler(struct pt_regs *regs, int irq);
extern int ppc_spurious_interrupts;
extern int ppc_second_irq;
extern struct irqaction *ppc_irq_action[NR_IRQS];
-extern unsigned int ppc_local_bh_count[NR_CPUS];
-extern unsigned int ppc_local_irq_count[NR_CPUS];
extern unsigned int ppc_cached_irq_mask[NR_MASK_WORDS];
extern unsigned int ppc_lost_interrupts[NR_MASK_WORDS];
extern atomic_t ppc_n_lost_interrupts;
diff --git a/arch/ppc/kernel/ppc_ksyms.c b/arch/ppc/kernel/ppc_ksyms.c
index 3f0b52ead..1317359e7 100644
--- a/arch/ppc/kernel/ppc_ksyms.c
+++ b/arch/ppc/kernel/ppc_ksyms.c
@@ -78,7 +78,6 @@ EXPORT_SYMBOL(do_lost_interrupts);
EXPORT_SYMBOL(enable_irq);
EXPORT_SYMBOL(disable_irq);
EXPORT_SYMBOL(disable_irq_nosync);
-EXPORT_SYMBOL(irq_stat);
#ifdef CONFIG_SMP
EXPORT_SYMBOL(kernel_flag);
#endif /* CONFIG_SMP */
diff --git a/arch/s390/kernel/entry.S b/arch/s390/kernel/entry.S
index 9acccfd97..9913d5967 100644
--- a/arch/s390/kernel/entry.S
+++ b/arch/s390/kernel/entry.S
@@ -193,7 +193,6 @@ RES_DN1:
*/
sysc_lit:
- sysc_softirq_state: .long softirq_state
sysc_do_signal: .long do_signal
sysc_do_softirq: .long do_softirq
sysc_schedule: .long schedule
@@ -237,17 +236,8 @@ sysc_return:
#
# check, if bottom-half has to be done
#
-#ifdef CONFIG_SMP
- l %r1,processor(%r9) # get processor index
- sll %r1,5
- al %r1,sysc_softirq_state-sysc_lit(%r13)
- l %r0,0(%r1) # get softirq_state[cpu].active
- n %r0,4(%r1) # and it with softirq_state[cpu].mask
-#else
- l %r1,sysc_softirq_state-sysc_lit(%r13)
- l %r0,0(%r1) # get softirq_state.active
- n %r0,4(%r1) # and it with softirq_state.mask
-#endif
+ l %r0,__LC_IRQ_STAT # get softirq_active
+ n %r0,__LC_IRQ_STAT+4 # and it with softirq_mask
jnz sysc_handle_bottom_half
#
# check, if reschedule is needed
@@ -714,7 +704,6 @@ io_lit:
io_do_IRQ: .long do_IRQ
io_schedule: .long schedule
io_do_signal: .long do_signal
- io_softirq_state: .long softirq_state
io_do_softirq: .long do_softirq
.globl io_int_handler
@@ -737,17 +726,8 @@ io_return:
#
# check, if bottom-half has to be done
#
-#ifdef CONFIG_SMP
- l %r1,processor(%r9) # get processor index
- sll %r1,5
- al %r1,io_softirq_state-io_lit(%r13)
- l %r0,0(%r1) # get softirq_state[cpu].active
- n %r0,4(%r1) # and it with softirq_state[cpu].mask
-#else
- l %r1,io_softirq_state-io_lit(%r13)
- l %r0,0(%r1) # get softirq_state.active
- n %r0,4(%r1) # and it with softirq_state.mask
-#endif
+ l %r0,__LC_IRQ_STAT # get softirq_active
+ n %r0,__LC_IRQ_STAT+4 # and it with softirq_mask
jnz io_handle_bottom_half
io_return_bh:
#
diff --git a/arch/s390/kernel/irq.c b/arch/s390/kernel/irq.c
index 298aa2482..ba513325a 100644
--- a/arch/s390/kernel/irq.c
+++ b/arch/s390/kernel/irq.c
@@ -143,9 +143,9 @@ static void show(char * str)
printk("\n%s, CPU %d:\n", str, cpu);
printk("irq: %d [%d]\n",
- atomic_read(&global_irq_count),atomic_read(&S390_lowcore.local_irq_count));
+ atomic_read(&global_irq_count),local_irq_count(smp_processor_id()));
printk("bh: %d [%d]\n",
- atomic_read(&global_bh_count),atomic_read(&S390_lowcore.local_bh_count));
+ atomic_read(&global_bh_count),local_bh_count(smp_processor_id()));
stack = (unsigned long *) &str;
for (i = 40; i ; i--) {
unsigned long x = *++stack;
@@ -181,7 +181,7 @@ static inline void wait_on_irq(int cpu)
* already executing in one..
*/
if (!atomic_read(&global_irq_count)) {
- if (atomic_read(&safe_get_cpu_lowcore(cpu).local_bh_count)||
+ if (local_bh_count(cpu)||
!atomic_read(&global_bh_count))
break;
}
@@ -202,7 +202,7 @@ static inline void wait_on_irq(int cpu)
continue;
if (atomic_read(&global_irq_lock))
continue;
- if (!(atomic_read(&safe_get_cpu_lowcore(cpu).local_bh_count))
+ if (!local_bh_count(cpu)
&& atomic_read(&global_bh_count))
continue;
if (!test_and_set_bit(0,&global_irq_lock))
@@ -288,7 +288,7 @@ void __global_cli(void)
if (flags & (1 << EFLAGS_I_SHIFT)) {
int cpu = smp_processor_id();
__cli();
- if (!atomic_read(&S390_lowcore.local_irq_count))
+ if (!in_irq())
get_irqlock(cpu);
}
}
@@ -296,7 +296,7 @@ void __global_cli(void)
void __global_sti(void)
{
- if (!atomic_read(&S390_lowcore.local_irq_count))
+ if (!in_irq())
release_irqlock(smp_processor_id());
__sti();
}
@@ -320,7 +320,7 @@ unsigned long __global_save_flags(void)
retval = 2 + local_enabled;
/* check for global flags if we're not in an interrupt */
- if (!atomic_read(&S390_lowcore.local_irq_count))
+ if (!in_irq())
{
if (local_enabled)
retval = 1;
diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c
index 93d4dff76..6f6a5287b 100644
--- a/arch/s390/kernel/process.c
+++ b/arch/s390/kernel/process.c
@@ -64,8 +64,8 @@ int cpu_idle(void *unused)
wait_psw.mask = _WAIT_PSW_MASK;
wait_psw.addr = (unsigned long) &&idle_wakeup | 0x80000000L;
while(1) {
- if (softirq_state[smp_processor_id()].active &
- softirq_state[smp_processor_id()].mask) {
+ if (softirq_active(smp_processor_id()) &
+ softirq_mask(smp_processor_id())) {
do_softirq();
continue;
}
diff --git a/arch/s390/kernel/s390io.c b/arch/s390/kernel/s390io.c
index 7a4e531d5..b1db16707 100644
--- a/arch/s390/kernel/s390io.c
+++ b/arch/s390/kernel/s390io.c
@@ -621,8 +621,11 @@ void s390_init_IRQ( void )
// Hopefully bh_count's will get set when we copy the prefix lowcore
// structure to other CPI's ( DJB )
- atomic_set(&S390_lowcore.local_bh_count,0);
- atomic_set(&S390_lowcore.local_irq_count,0);
+ softirq_active(smp_processor_id()) = 0;
+ softirq_mask(smp_processor_id()) = 0;
+ local_bh_count(smp_processor_id()) = 0;
+ local_irq_count(smp_processor_id()) = 0;
+ syscall_count(smp_processor_id()) = 0;
asm volatile ("STCK %0" : "=m" (irq_IPL_TOD));
diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c
index cfc744a63..f20a9d49e 100644
--- a/arch/s390/mm/fault.c
+++ b/arch/s390/mm/fault.c
@@ -65,7 +65,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code)
address = S390_lowcore.trans_exc_code&0x7ffff000;
- if (atomic_read(&S390_lowcore.local_irq_count))
+ if (in_irq())
die("page fault from irq handler",regs,error_code);
tsk = current;
diff --git a/arch/sh/kernel/entry.S b/arch/sh/kernel/entry.S
index cbca87e69..450d49824 100644
--- a/arch/sh/kernel/entry.S
+++ b/arch/sh/kernel/entry.S
@@ -462,9 +462,9 @@ syscall_ret:
/* fall through */
ENTRY(ret_from_syscall)
- mov.l __softirq_state, $r0
+ mov.l __irq_stat, $r0 ! softirq_active
mov.l @$r0, $r1
- mov.l @(4,$r0), $r2
+ mov.l @(4,$r0), $r2 ! softirq_mask
tst $r2, $r1
bt ret_with_reschedule
handle_softirq:
@@ -489,8 +489,8 @@ signal_return:
.align 2
__do_signal:
.long SYMBOL_NAME(do_signal)
-__softirq_state:
- .long SYMBOL_NAME(softirq_state)
+__irq_stat:
+ .long SYMBOL_NAME(irq_stat)
__do_softirq:
.long SYMBOL_NAME(do_softirq)
diff --git a/arch/sh/kernel/irq.c b/arch/sh/kernel/irq.c
index 399d435af..a353b0995 100644
--- a/arch/sh/kernel/irq.c
+++ b/arch/sh/kernel/irq.c
@@ -41,9 +41,6 @@
#include <asm/hd64461.h>
#endif
-unsigned int __local_bh_count[NR_CPUS];
-unsigned int __local_irq_count[NR_CPUS];
-
/*
* Micro-access to controllers is serialized over the whole
* system. We never hold this lock when we call the actual
@@ -183,7 +180,7 @@ void disable_irq(unsigned int irq)
{
disable_irq_nosync(irq);
- if (!__local_irq_count[smp_processor_id()]) {
+ if (!local_irq_count(smp_processor_id())) {
do {
barrier();
} while (irq_desc[irq].status & IRQ_INPROGRESS);
@@ -319,7 +316,7 @@ asmlinkage int do_IRQ(unsigned long r4, unsigned long r5,
#if 0
__sti();
#endif
- if (softirq_state[cpu].active&softirq_state[cpu].mask)
+ if (softirq_active(cpu)&softirq_mask(cpu))
do_softirq();
return 1;
}
diff --git a/arch/sparc/config.in b/arch/sparc/config.in
index e79dfd803..570f86325 100644
--- a/arch/sparc/config.in
+++ b/arch/sparc/config.in
@@ -1,10 +1,11 @@
-# $Id: config.in,v 1.98 2000/07/06 01:41:29 davem Exp $
+# $Id: config.in,v 1.99 2000/08/01 04:53:58 anton Exp $
# For a description of the syntax of this configuration file,
# see Documentation/kbuild/config-language.txt.
#
mainmenu_name "Linux/SPARC Kernel Configuration"
define_bool CONFIG_UID16 y
+define_bool CONFIG_HIGHMEM y
mainmenu_option next_comment
comment 'Code maturity level options'
diff --git a/arch/sparc/kernel/irq.c b/arch/sparc/kernel/irq.c
index 65e95afdb..a6fd32fa4 100644
--- a/arch/sparc/kernel/irq.c
+++ b/arch/sparc/kernel/irq.c
@@ -195,16 +195,9 @@ void free_irq(unsigned int irq, void *dev_id)
restore_flags(flags);
}
-#ifndef CONFIG_SMP
-unsigned int __local_bh_count;
-unsigned int __local_irq_count;
-
-#else
+#ifdef CONFIG_SMP
/* SMP interrupt locking on Sparc. */
-unsigned int __local_bh_count[NR_CPUS];
-unsigned int __local_irq_count[NR_CPUS];
-
/* Who has global_irq_lock. */
unsigned char global_irq_holder = NO_PROC_ID;
@@ -229,14 +222,14 @@ static void show(char * str)
printk("irq: %d [ ", atomic_read(&global_irq_count));
for (i = 0; i < NR_CPUS; i++) {
- printk("%d ", __local_irq_count[i]);
+ printk("%d ", local_irq_count(i));
}
printk("]\n");
printk("bh: %d [ ", (spin_is_locked(&global_bh_lock) ? 1 : 0));
for (i = 0; i < NR_CPUS; i++) {
- printk("%d ", __local_bh_count[cpu]);
+ printk("%d ", local_bh_count(cpu));
}
printk("]\n");
@@ -263,7 +256,7 @@ static inline void wait_on_irq(int cpu)
* already executing in one..
*/
if (!atomic_read(&global_irq_count)) {
- if (__local_bh_count[cpu] || !spin_is_locked(&global_bh_lock))
+ if (local_bh_count(cpu) || !spin_is_locked(&global_bh_lock))
break;
}
@@ -282,7 +275,7 @@ static inline void wait_on_irq(int cpu)
continue;
if (spin_is_locked (&global_irq_lock))
continue;
- if (!__local_bh_count[cpu] && spin_is_locked(&global_bh_lock))
+ if (!local_bh_count(cpu) && spin_is_locked(&global_bh_lock))
continue;
if (spin_trylock(&global_irq_lock))
break;
@@ -358,7 +351,7 @@ void __global_cli(void)
if ((flags & PSR_PIL) != PSR_PIL) {
int cpu = smp_processor_id();
__cli();
- if (!__local_irq_count[cpu])
+ if (!local_irq_count(cpu))
get_irqlock(cpu);
}
}
@@ -367,7 +360,7 @@ void __global_sti(void)
{
int cpu = smp_processor_id();
- if (!__local_irq_count[cpu])
+ if (!local_irq_count(cpu))
release_irqlock(cpu);
__sti();
}
@@ -394,7 +387,7 @@ unsigned long __global_save_flags(void)
retval = 2 + local_enabled;
/* check for global flags if we're not in an interrupt */
- if (!__local_irq_count[smp_processor_id()]) {
+ if (!local_irq_count(smp_processor_id())) {
if (local_enabled)
retval = 1;
if (global_irq_holder == (unsigned char) smp_processor_id())
diff --git a/arch/sparc/kernel/rtrap.S b/arch/sparc/kernel/rtrap.S
index dcfc2dc78..c44040bde 100644
--- a/arch/sparc/kernel/rtrap.S
+++ b/arch/sparc/kernel/rtrap.S
@@ -50,10 +50,10 @@ rtrap_7win_patch5: and %g1, 0x7f, %g1
ret_trap_entry:
ld [%curptr + AOFF_task_processor], %l3
sll %l3, 5, %l3
- sethi %hi(C_LABEL(softirq_state)), %l4
+ sethi %hi(C_LABEL(irq_stat)), %l4 ! &softirq_active
add %l4, %l3, %l4
- ld [%l4 + %lo(C_LABEL(softirq_state))], %g5
- ld [%l4 + %lo(C_LABEL(softirq_state) + 4)], %g4
+ ld [%l4 + %lo(C_LABEL(irq_stat))], %g5 ! softirq_active
+ ld [%l4 + %lo(C_LABEL(irq_stat) + 4)], %g4 ! softirq_mask
andcc %g4, %g5, %g0
be C_LABEL(ret_trap_lockless_ipi)
nop
diff --git a/arch/sparc/kernel/sparc_ksyms.c b/arch/sparc/kernel/sparc_ksyms.c
index a51995713..37c276c7f 100644
--- a/arch/sparc/kernel/sparc_ksyms.c
+++ b/arch/sparc/kernel/sparc_ksyms.c
@@ -146,8 +146,6 @@ EXPORT_SYMBOL(global_bh_lock);
EXPORT_SYMBOL(global_irq_count);
EXPORT_SYMBOL(synchronize_irq);
#endif
-EXPORT_SYMBOL(__local_irq_count);
-EXPORT_SYMBOL(__local_bh_count);
EXPORT_SYMBOL(udelay);
EXPORT_SYMBOL(mstk48t02_regs);
diff --git a/arch/sparc/mm/init.c b/arch/sparc/mm/init.c
index 5ac1845a3..ced31b91f 100644
--- a/arch/sparc/mm/init.c
+++ b/arch/sparc/mm/init.c
@@ -1,4 +1,4 @@
-/* $Id: init.c,v 1.88 2000/07/10 20:56:53 anton Exp $
+/* $Id: init.c,v 1.89 2000/08/01 04:53:58 anton Exp $
* linux/arch/sparc/mm/init.c
*
* Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
@@ -51,7 +51,9 @@ extern char __init_begin, __init_end, _start, _end, etext , edata;
extern unsigned int sparc_ramdisk_image;
extern unsigned int sparc_ramdisk_size;
-unsigned long totalram_pages = 0;
+unsigned long highstart_pfn, highend_pfn;
+unsigned long totalram_pages;
+static unsigned long totalhigh_pages;
/*
* BAD_PAGE is the page that is used for page faults when linux
@@ -79,6 +81,21 @@ pte_t __bad_page(void)
PAGE_SHARED));
}
+pte_t *kmap_pte;
+pgprot_t kmap_prot;
+
+#define kmap_get_fixed_pte(vaddr) \
+ pte_offset(pmd_offset(pgd_offset_k(vaddr), (vaddr)), (vaddr))
+
+void __init kmap_init(void)
+{
+ unsigned long pteval;
+
+ /* cache the first kmap pte */
+ kmap_pte = kmap_get_fixed_pte(FIX_KMAP_BEGIN);
+ kmap_prot = __pgprot(SRMMU_ET_PTE | SRMMU_PRIV | SRMMU_CACHE);
+}
+
void show_mem(void)
{
printk("Mem-info:\n");
@@ -119,22 +136,15 @@ void __init sparc_context_init(int numctx)
#define DEBUG_BOOTMEM
extern unsigned long cmdline_memory_size;
+extern unsigned long last_valid_pfn;
-unsigned long __init bootmem_init(void)
+void __init bootmem_init(void)
{
- unsigned long bootmap_size, start_pfn, end_pfn;
+ unsigned long bootmap_size, start_pfn, max_pfn;
unsigned long end_of_phys_memory = 0UL;
unsigned long bootmap_pfn;
int i;
- /*
- * XXX Limit maximum memory until we implement highmem for sparc.
- * The nocache region has taken up some room but I'll rearrange
- * the virtual address regions soon - Anton
- */
- if (!cmdline_memory_size || cmdline_memory_size > 0x0c000000)
- cmdline_memory_size = 0x0c000000;
-
/* XXX It is a bit ambiguous here, whether we should
* XXX treat the user specified mem=xxx as total wanted
* XXX physical memory, or as a limit to the upper
@@ -181,7 +191,16 @@ unsigned long __init bootmem_init(void)
bootmap_pfn = start_pfn;
- end_pfn = end_of_phys_memory >> PAGE_SHIFT;
+ max_pfn = end_of_phys_memory >> PAGE_SHIFT;
+
+ max_low_pfn = max_pfn;
+ highstart_pfn = highend_pfn = max_pfn;
+
+ if (max_low_pfn > (SRMMU_MAXMEM >> PAGE_SHIFT)) {
+ highstart_pfn = max_low_pfn = (SRMMU_MAXMEM >> PAGE_SHIFT);
+ printk(KERN_NOTICE "%ldMB HIGHMEM available.\n",
+ (highend_pfn - highstart_pfn) >> (20-PAGE_SHIFT));
+ }
#ifdef CONFIG_BLK_DEV_INITRD
/* Now have to check initial ramdisk, so that bootmap does not overwrite it */
@@ -205,22 +224,41 @@ unsigned long __init bootmem_init(void)
#endif
/* Initialize the boot-time allocator. */
#ifdef DEBUG_BOOTMEM
- prom_printf("init_bootmem(spfn[%lx],bpfn[%lx],epfn[%lx])\n",
- start_pfn, bootmap_pfn, end_pfn);
+ prom_printf("init_bootmem(spfn[%lx],bpfn[%lx],mlpfn[%lx])\n",
+ start_pfn, bootmap_pfn, max_low_pfn);
#endif
- bootmap_size = init_bootmem(bootmap_pfn, end_pfn);
+ bootmap_size = init_bootmem(bootmap_pfn, max_low_pfn);
/* Now register the available physical memory with the
* allocator.
*/
for (i = 0; sp_banks[i].num_bytes != 0; i++) {
+ unsigned long curr_pfn, last_pfn, size;
+
+ curr_pfn = sp_banks[i].base_addr >> PAGE_SHIFT;
+ if (curr_pfn >= max_low_pfn)
+ break;
+
+ last_pfn = (sp_banks[i].base_addr + sp_banks[i].num_bytes) >> PAGE_SHIFT;
+ if (last_pfn > max_low_pfn)
+ last_pfn = max_low_pfn;
+
+ /*
+ * .. finally, did all the rounding and playing
+ * around just make the area go away?
+ */
+ if (last_pfn <= curr_pfn)
+ continue;
+
+ size = (last_pfn - curr_pfn) << PAGE_SHIFT;
+
#ifdef DEBUG_BOOTMEM
prom_printf("free_bootmem: base[%lx] size[%lx]\n",
sp_banks[i].base_addr,
- sp_banks[i].num_bytes);
+ size);
#endif
free_bootmem(sp_banks[i].base_addr,
- sp_banks[i].num_bytes);
+ size);
}
/* Reserve the kernel text/data/bss, the bootmem bitmap and initrd. */
@@ -245,10 +283,7 @@ unsigned long __init bootmem_init(void)
reserve_bootmem(phys_base, (start_pfn << PAGE_SHIFT) - phys_base);
reserve_bootmem((bootmap_pfn << PAGE_SHIFT), bootmap_size);
-#ifdef DEBUG_BOOTMEM
- prom_printf("init_bootmem: return end_pfn[%lx]\n", end_pfn);
-#endif
- return end_pfn;
+ last_valid_pfn = max_pfn;
}
/*
@@ -391,6 +426,25 @@ void __init free_unused_mem_map(void)
#endif
}
+void map_high_region(unsigned long start_pfn, unsigned long end_pfn)
+{
+ unsigned long tmp;
+
+#ifdef DEBUG_HIGHMEM
+ printk("mapping high region %08lx - %08lx\n", start_pfn, end_pfn);
+#endif
+
+ for (tmp = start_pfn; tmp < end_pfn; tmp++) {
+ struct page *page = mem_map + tmp;
+
+ ClearPageReserved(page);
+ set_bit(PG_highmem, &page->flags);
+ atomic_set(&page->count, 1);
+ __free_page(page);
+ totalhigh_pages++;
+ }
+}
+
void __init mem_init(void)
{
int codepages = 0;
@@ -401,6 +455,10 @@ void __init mem_init(void)
unsigned long addr, last;
#endif
+ highmem_start_page = mem_map + highstart_pfn;
+ /* cache the highmem_mapnr */
+ highmem_mapnr = highstart_pfn;
+
/* Saves us work later. */
memset((void *)&empty_zero_page, 0, PAGE_SIZE);
@@ -419,7 +477,7 @@ void __init mem_init(void)
taint_real_pages();
max_mapnr = last_valid_pfn;
- high_memory = __va(last_valid_pfn << PAGE_SHIFT);
+ high_memory = __va(max_low_pfn << PAGE_SHIFT);
#ifdef DEBUG_BOOTMEM
prom_printf("mem_init: Calling free_all_bootmem().\n");
@@ -430,6 +488,21 @@ void __init mem_init(void)
free_unused_mem_map();
#endif
+ for (i = 0; sp_banks[i].num_bytes != 0; i++) {
+ unsigned long start_pfn = sp_banks[i].base_addr >> PAGE_SHIFT;
+ unsigned long end_pfn = (sp_banks[i].base_addr + sp_banks[i].num_bytes) >> PAGE_SHIFT;
+
+ if (end_pfn <= highstart_pfn)
+ continue;
+
+ if (start_pfn < highstart_pfn)
+ start_pfn = highstart_pfn;
+
+ map_high_region(start_pfn, end_pfn);
+ }
+
+ totalram_pages += totalhigh_pages;
+
codepages = (((unsigned long) &etext) - ((unsigned long)&_start));
codepages = PAGE_ALIGN(codepages) >> PAGE_SHIFT;
datapages = (((unsigned long) &edata) - ((unsigned long)&etext));
@@ -437,11 +510,12 @@ void __init mem_init(void)
initpages = (((unsigned long) &__init_end) - ((unsigned long) &__init_begin));
initpages = PAGE_ALIGN(initpages) >> PAGE_SHIFT;
- printk("Memory: %dk available (%dk kernel code, %dk data, %dk init) [%08lx,%08lx]\n",
+ printk("Memory: %dk available (%dk kernel code, %dk data, %dk init, %ldk highmem) [%08lx,%08lx]\n",
nr_free_pages() << (PAGE_SHIFT-10),
codepages << (PAGE_SHIFT-10),
datapages << (PAGE_SHIFT-10),
initpages << (PAGE_SHIFT-10),
+ totalhigh_pages << (PAGE_SHIFT-10),
(unsigned long)PAGE_OFFSET, (last_valid_pfn << PAGE_SHIFT));
/* NOTE NOTE NOTE NOTE
@@ -501,9 +575,16 @@ void si_meminfo(struct sysinfo *val)
val->sharedram = 0;
val->freeram = nr_free_pages();
val->bufferram = atomic_read(&buffermem_pages);
-
- val->totalhigh = 0;
- val->freehigh = 0;
+ val->totalhigh = totalhigh_pages;
+ val->freehigh = nr_free_highpages();
val->mem_unit = PAGE_SIZE;
}
+
+void flush_page_to_ram(struct page *page)
+{
+ unsigned long vaddr;
+ vaddr = kmap(page);
+ __flush_page_to_ram(page_address(page));
+ kunmap(page);
+}
diff --git a/arch/sparc/mm/srmmu.c b/arch/sparc/mm/srmmu.c
index 612436b47..c7f839f28 100644
--- a/arch/sparc/mm/srmmu.c
+++ b/arch/sparc/mm/srmmu.c
@@ -1,4 +1,4 @@
-/* $Id: srmmu.c,v 1.218 2000/07/10 23:22:32 anton Exp $
+/* $Id: srmmu.c,v 1.219 2000/08/01 04:53:58 anton Exp $
* srmmu.c: SRMMU specific routines for memory management.
*
* Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
@@ -87,7 +87,7 @@ char *srmmu_name;
ctxd_t *srmmu_ctx_table_phys;
ctxd_t *srmmu_context_table;
-int viking_mxcc_present = 0;
+int viking_mxcc_present;
spinlock_t srmmu_context_spinlock = SPIN_LOCK_UNLOCKED;
int is_hypersparc;
@@ -117,10 +117,6 @@ static inline int srmmu_device_memory(unsigned long x)
int srmmu_cache_pagetables;
/* XXX Make this dynamic based on ram size - Anton */
-#define SRMMU_NOCACHE_NPAGES 256
-#define SRMMU_NOCACHE_VADDR 0xfc000000
-#define SRMMU_NOCACHE_SIZE (SRMMU_NOCACHE_NPAGES*PAGE_SIZE)
-#define SRMMU_NOCACHE_END (SRMMU_NOCACHE_VADDR + SRMMU_NOCACHE_SIZE)
#define SRMMU_NOCACHE_BITMAP_SIZE (SRMMU_NOCACHE_NPAGES * 16)
#define SRMMU_NOCACHE_BITMAP_SHIFT (PAGE_SHIFT - 4)
@@ -1190,9 +1186,11 @@ void __init srmmu_paging_init(void)
{
int i, cpunode;
char node_str[128];
- unsigned long end_pfn;
+ pgd_t *pgd;
+ pmd_t *pmd;
+ pte_t *pte;
- sparc_iomap.start = 0xfd000000; /* 16MB of IOSPACE on all sun4m's. */
+ sparc_iomap.start = SUN4M_IOBASE_VADDR; /* 16MB of IOSPACE on all sun4m's. */
if (sparc_cpu_model == sun4d)
num_contexts = 65536; /* We know it is Viking */
@@ -1215,7 +1213,7 @@ void __init srmmu_paging_init(void)
prom_halt();
}
- last_valid_pfn = end_pfn = bootmem_init();
+ bootmem_init();
srmmu_nocache_init();
srmmu_inherit_prom_mappings(0xfe400000,(LINUX_OPPROM_ENDVM-PAGE_SIZE));
@@ -1238,6 +1236,14 @@ void __init srmmu_paging_init(void)
srmmu_allocate_ptable_skeleton(DVMA_VADDR, DVMA_END);
#endif
+ srmmu_allocate_ptable_skeleton(FIX_KMAP_BEGIN, FIX_KMAP_END);
+ srmmu_allocate_ptable_skeleton(PKMAP_BASE, PKMAP_BASE_END);
+
+ pgd = pgd_offset_k(PKMAP_BASE);
+ pmd = pmd_offset(pgd, PKMAP_BASE);
+ pte = pte_offset(pmd, PKMAP_BASE);
+ pkmap_page_table = pte;
+
flush_cache_all();
flush_tlb_all();
@@ -1253,10 +1259,13 @@ void __init srmmu_paging_init(void)
sparc_context_init(num_contexts);
+ kmap_init();
+
{
unsigned long zones_size[MAX_NR_ZONES] = { 0, 0, 0};
- zones_size[ZONE_DMA] = end_pfn;
+ zones_size[ZONE_DMA] = max_low_pfn;
+ zones_size[ZONE_HIGHMEM] = highend_pfn - max_low_pfn;
free_area_init(zones_size);
}
}
diff --git a/arch/sparc64/config.in b/arch/sparc64/config.in
index 95c148eee..c57f14bb1 100644
--- a/arch/sparc64/config.in
+++ b/arch/sparc64/config.in
@@ -1,4 +1,4 @@
-# $Id: config.in,v 1.117 2000/07/10 20:57:35 davem Exp $
+# $Id: config.in,v 1.119 2000/08/02 10:45:03 davem Exp $
# For a description of the syntax of this configuration file,
# see the Configure script.
#
@@ -67,6 +67,7 @@ source drivers/parport/Config.in
dep_tristate ' Parallel printer support' CONFIG_PRINTER $CONFIG_PARPORT
if [ "$CONFIG_PCI" = "y" ]; then
tristate 'SUNW, envctrl support' CONFIG_ENVCTRL
+ tristate '7-Segment Display support' CONFIG_DISPLAY7SEG
fi
endmenu
@@ -200,6 +201,28 @@ endmenu
source drivers/fc4/Config.in
+if [ "$CONFIG_PCI" = "y" -a "$CONFIG_EXPERIMENTAL" = "y" ]; then
+ mainmenu_option next_comment
+ comment 'IEEE 1394 (FireWire) support'
+
+ dep_tristate 'IEEE 1394 (FireWire) support (EXPERIMENTAL)' CONFIG_IEEE1394 $CONFIG_PCI
+
+ if [ "$CONFIG_IEEE1394" != "n" ]; then
+ dep_tristate 'Texas Instruments PCILynx support' CONFIG_IEEE1394_PCILYNX $CONFIG_IEEE1394
+ if [ "$CONFIG_IEEE1394_PCILYNX" != "n" ]; then
+ bool ' Use PCILynx local RAM' CONFIG_IEEE1394_PCILYNX_LOCALRAM
+ bool ' Support for non-IEEE1394 local ports' CONFIG_IEEE1394_PCILYNX_PORTS
+ fi
+
+ dep_tristate 'OHCI (Open Host Controller Interface) support' CONFIG_IEEE1394_OHCI1394 $CONFIG_IEEE1394
+
+ dep_tristate 'Raw IEEE1394 I/O support' CONFIG_IEEE1394_RAWIO $CONFIG_IEEE1394
+
+ bool 'Excessive debugging output' CONFIG_IEEE1394_VERBOSEDEBUG
+ fi
+ endmenu
+fi
+
if [ "$CONFIG_NET" = "y" ]; then
mainmenu_option next_comment
comment 'Network device support'
diff --git a/arch/sparc64/defconfig b/arch/sparc64/defconfig
index e013e47fb..168109d49 100644
--- a/arch/sparc64/defconfig
+++ b/arch/sparc64/defconfig
@@ -65,6 +65,7 @@ CONFIG_PARPORT_PC_FIFO=y
CONFIG_PARPORT_1284=y
CONFIG_PRINTER=m
CONFIG_ENVCTRL=m
+CONFIG_DISPLAY7SEG=m
#
# Console drivers
@@ -323,6 +324,17 @@ CONFIG_SCSI_PLUTO=m
CONFIG_SCSI_FCAL=m
#
+# IEEE 1394 (FireWire) support
+#
+CONFIG_IEEE1394=m
+CONFIG_IEEE1394_PCILYNX=m
+# CONFIG_IEEE1394_PCILYNX_LOCALRAM is not set
+# CONFIG_IEEE1394_PCILYNX_PORTS is not set
+CONFIG_IEEE1394_OHCI1394=m
+CONFIG_IEEE1394_RAWIO=m
+# CONFIG_IEEE1394_VERBOSEDEBUG is not set
+
+#
# Network device support
#
CONFIG_NETDEVICES=y
diff --git a/arch/sparc64/kernel/ebus.c b/arch/sparc64/kernel/ebus.c
index f64422a0e..5872046b1 100644
--- a/arch/sparc64/kernel/ebus.c
+++ b/arch/sparc64/kernel/ebus.c
@@ -1,4 +1,4 @@
-/* $Id: ebus.c,v 1.47 2000/03/25 05:18:10 davem Exp $
+/* $Id: ebus.c,v 1.48 2000/08/02 06:22:35 davem Exp $
* ebus.c: PCI to EBus bridge device.
*
* Copyright (C) 1997 Eddie C. Dost (ecd@skynet.be)
@@ -34,6 +34,9 @@ extern int flash_init(void);
#ifdef CONFIG_ENVCTRL
extern int envctrl_init(void);
#endif
+#ifdef CONFIG_DISPLAY7SEG
+extern int d7s_init(void);
+#endif
static inline void *ebus_alloc(size_t size)
{
@@ -384,6 +387,9 @@ void __init ebus_init(void)
#ifdef CONFIG_OBP_FLASH
flash_init();
#endif
+#ifdef CONFIG_DISPLAY7SEG
+ d7s_init();
+#endif
clock_probe();
power_init();
}
diff --git a/arch/sparc64/kernel/entry.S b/arch/sparc64/kernel/entry.S
index 3195d3e75..e95e0392e 100644
--- a/arch/sparc64/kernel/entry.S
+++ b/arch/sparc64/kernel/entry.S
@@ -1,4 +1,4 @@
-/* $Id: entry.S,v 1.117 2000/07/11 02:21:12 davem Exp $
+/* $Id: entry.S,v 1.118 2000/08/01 00:11:31 davem Exp $
* arch/sparc64/kernel/entry.S: Sparc64 trap low-level entry points.
*
* Copyright (C) 1995,1997 David S. Miller (davem@caip.rutgers.edu)
@@ -980,7 +980,7 @@ linux_syscall_trace:
.align 32
.globl linux_sparc_syscall32
linux_sparc_syscall32:
- /* Direct access to user regs, must faster. */
+ /* Direct access to user regs, much faster. */
cmp %g1, NR_SYSCALLS ! IEU1 Group
bgeu,pn %xcc, linux_sparc_ni_syscall ! CTI
srl %i0, 0, %o0 ! IEU0
@@ -1009,7 +1009,7 @@ linux_sparc_syscall32:
.align 32
.globl linux_sparc_syscall, ret_sys_call
linux_sparc_syscall:
- /* Direct access to user regs, must faster. */
+ /* Direct access to user regs, much faster. */
cmp %g1, NR_SYSCALLS ! IEU1 Group
bgeu,pn %xcc, linux_sparc_ni_syscall ! CTI
mov %i0, %o0 ! IEU0
diff --git a/arch/sparc64/kernel/ioctl32.c b/arch/sparc64/kernel/ioctl32.c
index 98e209de2..d4f499726 100644
--- a/arch/sparc64/kernel/ioctl32.c
+++ b/arch/sparc64/kernel/ioctl32.c
@@ -1,4 +1,4 @@
-/* $Id: ioctl32.c,v 1.93 2000/07/24 22:43:15 anton Exp $
+/* $Id: ioctl32.c,v 1.96 2000/08/02 06:22:35 davem Exp $
* ioctl32.c: Conversion between 32bit and 64bit native ioctls.
*
* Copyright (C) 1997-2000 Jakub Jelinek (jakub@redhat.com)
@@ -72,7 +72,7 @@
#include <asm/envctrl.h>
#include <asm/audioio.h>
#include <asm/ethtool.h>
-
+#include <asm/display7seg.h>
#include <linux/soundcard.h>
#include <linux/atm.h>
@@ -3175,6 +3175,9 @@ COMPATIBLE_IOCTL(RTCGET)
COMPATIBLE_IOCTL(RTCSET)
COMPATIBLE_IOCTL(I2CIOCSADR)
COMPATIBLE_IOCTL(I2CIOCGADR)
+COMPATIBLE_IOCTL(D7SIOCRD)
+COMPATIBLE_IOCTL(D7SIOCWR)
+COMPATIBLE_IOCTL(D7SIOCTM)
/* Little m */
COMPATIBLE_IOCTL(MTIOCTOP)
/* OPENPROMIO, SunOS/Solaris only, the NetBSD one's have
@@ -3725,7 +3728,9 @@ int register_ioctl32_conversion(unsigned int cmd, int (*handler)(unsigned int, u
int i;
if (!additional_ioctls) {
additional_ioctls = module_map(PAGE_SIZE);
- if (!additional_ioctls) return -ENOMEM;
+ if (!additional_ioctls)
+ return -ENOMEM;
+ memset(additional_ioctls, 0, PAGE_SIZE);
}
for (i = 0; i < PAGE_SIZE/sizeof(struct ioctl_trans); i++)
if (!additional_ioctls[i].cmd)
@@ -3773,7 +3778,6 @@ asmlinkage int sys32_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
int (*handler)(unsigned int, unsigned int, unsigned long, struct file * filp);
struct ioctl_trans *t;
- lock_kernel();
filp = fget(fd);
if(!filp)
goto out2;
@@ -3801,6 +3805,5 @@ asmlinkage int sys32_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
out:
fput(filp);
out2:
- unlock_kernel();
return error;
}
diff --git a/arch/sparc64/kernel/irq.c b/arch/sparc64/kernel/irq.c
index 12925b1c2..c7f4905b8 100644
--- a/arch/sparc64/kernel/irq.c
+++ b/arch/sparc64/kernel/irq.c
@@ -1,4 +1,4 @@
-/* $Id: irq.c,v 1.89 2000/06/30 10:18:38 davem Exp $
+/* $Id: irq.c,v 1.90 2000/08/01 00:28:33 davem Exp $
* irq.c: UltraSparc IRQ handling/init/registry.
*
* Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu)
@@ -548,13 +548,7 @@ out:
restore_flags(flags);
}
-/* Only uniprocessor needs this IRQ/BH locking depth, on SMP it
- * lives in the brlock table for cache reasons.
- */
-#ifndef CONFIG_SMP
-unsigned int __local_irq_count;
-unsigned int __local_bh_count;
-#else
+#ifdef CONFIG_SMP
/* Who has global_irq_lock. */
unsigned char global_irq_holder = NO_PROC_ID;
@@ -571,7 +565,7 @@ static void show(char * str)
printk("]\nbh: %d [ ",
(spin_is_locked(&global_bh_lock) ? 1 : 0));
for (i = 0; i < smp_num_cpus; i++)
- printk("%u ", cpu_data[i].bh_count);
+ printk("%u ", local_bh_count(i));
printk("]\n");
}
@@ -768,10 +762,12 @@ void handler_irq(int irq, struct pt_regs *regs)
nbp = __bucket(bp->irq_chain);
if ((flags & IBF_ACTIVE) != 0) {
+#ifdef CONFIG_PCI
if ((flags & IBF_DMA_SYNC) != 0) {
upa_readl(dma_sync_reg_table[bp->synctab_ent]);
upa_readq(pci_dma_wsync);
}
+#endif
if ((flags & IBF_MULTI) == 0) {
struct irqaction *ap = bp->irq_info;
ap->handler(__irq(bp), ap->dev_id, regs);
diff --git a/arch/sparc64/kernel/process.c b/arch/sparc64/kernel/process.c
index 2d5d81452..5784201e2 100644
--- a/arch/sparc64/kernel/process.c
+++ b/arch/sparc64/kernel/process.c
@@ -1,4 +1,4 @@
-/* $Id: process.c,v 1.109 2000/07/11 01:38:57 davem Exp $
+/* $Id: process.c,v 1.110 2000/07/28 09:43:39 davem Exp $
* arch/sparc64/kernel/process.c
*
* Copyright (C) 1995, 1996 David S. Miller (davem@caip.rutgers.edu)
@@ -524,7 +524,7 @@ void synchronize_user_stack(void)
}
}
-void fault_in_user_windows(struct pt_regs *regs)
+void fault_in_user_windows(void)
{
struct thread_struct *t = &current->thread;
unsigned long window;
diff --git a/arch/sparc64/kernel/rtrap.S b/arch/sparc64/kernel/rtrap.S
index 1c9b6ac3f..3295938e6 100644
--- a/arch/sparc64/kernel/rtrap.S
+++ b/arch/sparc64/kernel/rtrap.S
@@ -1,4 +1,4 @@
-/* $Id: rtrap.S,v 1.49 2000/03/29 09:55:31 davem Exp $
+/* $Id: rtrap.S,v 1.51 2000/07/28 09:43:39 davem Exp $
* rtrap.S: Preparing for return from trap on Sparc V9.
*
* Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
@@ -40,8 +40,9 @@ __handle_preemption:
__handle_user_windows:
wrpr %g0, RTRAP_PSTATE, %pstate
call fault_in_user_windows
- add %sp, STACK_BIAS + REGWIN_SZ, %g0
- ba,a,pt %xcc, __handle_user_windows_continue
+ nop
+ ba,pt %xcc, __handle_user_windows_continue
+ nop
__handle_perfctrs:
/* Don't forget to preserve user window invariants. */
wrpr %g0, RTRAP_PSTATE, %pstate
@@ -54,9 +55,9 @@ __handle_perfctrs:
wrpr %g0, RTRAP_PSTATE, %pstate
call fault_in_user_windows
- add %sp, STACK_BIAS + REGWIN_SZ, %o0
+ nop
ba,pt %xcc, __handle_perfctrs_continue
- nop
+ nop
__handle_userfpu:
rd %fprs, %l5
andcc %l5, FPRS_FEF, %g0
@@ -69,18 +70,25 @@ __handle_signal:
mov %l6, %o3
call do_signal
add %sp, STACK_BIAS + REGWIN_SZ, %o1
+ clr %l6
+
+ /* Signal delivery can modify pt_regs tstate, so we must
+ * reload it.
+ */
+ ldx [%sp + PTREGS_OFF + PT_V9_TSTATE], %l1
+ sethi %hi(0xf << 20), %l4
+ and %l1, %l4, %l4
ba,pt %xcc, __handle_signal_continue
- clr %l6
- nop
+ andn %l1, %l4, %l1
.align 64
.globl rtrap_clr_l6, rtrap
rtrap_clr_l6: clr %l6
rtrap: lduw [%g6 + AOFF_task_processor], %l0
- sethi %hi(softirq_state), %l2
- or %l2, %lo(softirq_state), %l2
+ sethi %hi(irq_stat), %l2 ! &softirq_active
+ or %l2, %lo(irq_stat), %l2 ! &softirq_active
sllx %l0, 6, %l0
- ldx [%l2 + %l0], %l1
+ ldx [%l2 + %l0], %l1 ! softirq_active + softirq_mask
srlx %l1, 32, %l2
andcc %l1, %l2, %g0
diff --git a/arch/sparc64/kernel/signal.c b/arch/sparc64/kernel/signal.c
index c666dc408..d1e7e4215 100644
--- a/arch/sparc64/kernel/signal.c
+++ b/arch/sparc64/kernel/signal.c
@@ -1,4 +1,4 @@
-/* $Id: signal.c,v 1.52 2000/07/07 04:25:17 davem Exp $
+/* $Id: signal.c,v 1.53 2000/07/30 23:12:24 davem Exp $
* arch/sparc64/kernel/signal.c
*
* Copyright (C) 1991, 1992 Linus Torvalds
@@ -166,7 +166,6 @@ asmlinkage void sparc64_set_context(struct pt_regs *regs)
return;
do_sigsegv:
- lock_kernel();
do_exit(SIGSEGV);
}
@@ -254,7 +253,6 @@ asmlinkage void sparc64_get_context(struct pt_regs *regs)
return;
do_sigsegv:
- lock_kernel();
do_exit(SIGSEGV);
}
@@ -566,10 +564,8 @@ setup_rt_frame(struct k_sigaction *ka, struct pt_regs *regs,
return;
sigill:
- lock_kernel();
do_exit(SIGILL);
sigsegv:
- lock_kernel();
do_exit(SIGSEGV);
}
diff --git a/arch/sparc64/kernel/smp.c b/arch/sparc64/kernel/smp.c
index f99b9660c..96f8624ca 100644
--- a/arch/sparc64/kernel/smp.c
+++ b/arch/sparc64/kernel/smp.c
@@ -87,7 +87,6 @@ void __init smp_store_cpu_info(int id)
{
int i;
- cpu_data[id].bh_count = 0;
/* multiplier and counter set by
smp_setup_percpu_timer() */
cpu_data[id].udelay_val = loops_per_sec;
diff --git a/arch/sparc64/kernel/sparc64_ksyms.c b/arch/sparc64/kernel/sparc64_ksyms.c
index eccc7885a..4a79b76bf 100644
--- a/arch/sparc64/kernel/sparc64_ksyms.c
+++ b/arch/sparc64/kernel/sparc64_ksyms.c
@@ -1,4 +1,4 @@
-/* $Id: sparc64_ksyms.c,v 1.86 2000/06/30 10:18:38 davem Exp $
+/* $Id: sparc64_ksyms.c,v 1.89 2000/07/28 12:15:02 davem Exp $
* arch/sparc64/kernel/sparc64_ksyms.c: Sparc64 specific ksyms support.
*
* Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
@@ -65,7 +65,6 @@ extern int __strncmp(const char *, const char *, __kernel_size_t);
extern __kernel_size_t __strlen(const char *);
extern __kernel_size_t strlen(const char *);
extern char saved_command_line[];
-extern char *getname32(u32 name);
extern void linux_sparc_syscall(void);
extern void rtrap(void);
extern void show_regs(struct pt_regs *);
@@ -84,6 +83,7 @@ extern long sparc32_open(const char * filename, int flags, int mode);
extern int register_ioctl32_conversion(unsigned int cmd, int (*handler)(unsigned int, unsigned int, unsigned long, struct file *));
extern int unregister_ioctl32_conversion(unsigned int cmd);
extern int io_remap_page_range(unsigned long from, unsigned long offset, unsigned long size, pgprot_t prot, int space);
+extern void flush_dcache_page(void *addr);
extern int __ashrdi3(int, int);
@@ -156,9 +156,6 @@ EXPORT_SYMBOL(_do_write_lock);
EXPORT_SYMBOL(_do_write_unlock);
#endif
-#else
-EXPORT_SYMBOL(__local_bh_count);
-EXPORT_SYMBOL(__local_irq_count);
#endif
/* rw semaphores */
@@ -183,6 +180,8 @@ EXPORT_SYMBOL(disable_irq);
EXPORT_SYMBOL_PRIVATE(flushw_user);
+EXPORT_SYMBOL(flush_dcache_page);
+
EXPORT_SYMBOL(mstk48t02_regs);
EXPORT_SYMBOL(request_fast_irq);
#if CONFIG_SBUS
@@ -279,7 +278,6 @@ EXPORT_SYMBOL(strtok);
EXPORT_SYMBOL(strstr);
#ifdef CONFIG_SOLARIS_EMUL_MODULE
-EXPORT_SYMBOL(getname32);
EXPORT_SYMBOL(linux_sparc_syscall);
EXPORT_SYMBOL(rtrap);
EXPORT_SYMBOL(show_regs);
diff --git a/arch/sparc64/kernel/sunos_ioctl32.c b/arch/sparc64/kernel/sunos_ioctl32.c
index d32ea68c2..bcfa77a39 100644
--- a/arch/sparc64/kernel/sunos_ioctl32.c
+++ b/arch/sparc64/kernel/sunos_ioctl32.c
@@ -1,4 +1,4 @@
-/* $Id: sunos_ioctl32.c,v 1.10 1998/08/15 20:42:46 davem Exp $
+/* $Id: sunos_ioctl32.c,v 1.11 2000/07/30 23:12:24 davem Exp $
* sunos_ioctl32.c: SunOS ioctl compatability on sparc64.
*
* Copyright (C) 1995 Miguel de Icaza (miguel@nuclecu.unam.mx)
@@ -98,7 +98,6 @@ asmlinkage int sunos_ioctl (int fd, u32 cmd, u32 arg)
{
int ret = -EBADF;
- lock_kernel();
if(fd >= SUNOS_NR_OPEN)
goto out;
if(!fcheck(fd))
@@ -281,6 +280,5 @@ asmlinkage int sunos_ioctl (int fd, u32 cmd, u32 arg)
/* so stupid... */
ret = (ret == -EINVAL ? -EOPNOTSUPP : ret);
out:
- unlock_kernel();
return ret;
}
diff --git a/arch/sparc64/kernel/sys_sparc.c b/arch/sparc64/kernel/sys_sparc.c
index 859d0c7ea..e869af4e6 100644
--- a/arch/sparc64/kernel/sys_sparc.c
+++ b/arch/sparc64/kernel/sys_sparc.c
@@ -1,4 +1,4 @@
-/* $Id: sys_sparc.c,v 1.44 2000/07/10 20:57:35 davem Exp $
+/* $Id: sys_sparc.c,v 1.45 2000/07/30 23:12:24 davem Exp $
* linux/arch/sparc64/kernel/sys_sparc.c
*
* This file contains various random system calls that
@@ -299,13 +299,14 @@ c_sys_nis_syscall (struct pt_regs *regs)
static int count=0;
/* Don't make the system unusable, if someone goes stuck */
- if (count++ > 5) return -ENOSYS;
- lock_kernel();
+ if (count++ > 5)
+ return -ENOSYS;
+
printk ("Unimplemented SPARC system call %ld\n",regs->u_regs[1]);
#ifdef DEBUG_UNIMP_SYSCALL
show_regs (regs);
#endif
- unlock_kernel();
+
return -ENOSYS;
}
@@ -316,7 +317,6 @@ sparc_breakpoint (struct pt_regs *regs)
{
siginfo_t info;
- lock_kernel();
#ifdef DEBUG_SPARC_BREAKPOINT
printk ("TRAP: Entering kernel PC=%lx, nPC=%lx\n", regs->tpc, regs->tnpc);
#endif
@@ -329,7 +329,6 @@ sparc_breakpoint (struct pt_regs *regs)
#ifdef DEBUG_SPARC_BREAKPOINT
printk ("TRAP: Returning to space: PC=%lx nPC=%lx\n", regs->tpc, regs->tnpc);
#endif
- unlock_kernel();
}
extern void check_pending(int signum);
@@ -364,7 +363,7 @@ asmlinkage int sys_aplib(void)
asmlinkage int solaris_syscall(struct pt_regs *regs)
{
static int count = 0;
- lock_kernel();
+
regs->tpc = regs->tnpc;
regs->tnpc += 4;
if(++count <= 5) {
@@ -372,7 +371,7 @@ asmlinkage int solaris_syscall(struct pt_regs *regs)
show_regs (regs);
}
send_sig(SIGSEGV, current, 1);
- unlock_kernel();
+
return -ENOSYS;
}
@@ -380,13 +379,13 @@ asmlinkage int solaris_syscall(struct pt_regs *regs)
asmlinkage int sunos_syscall(struct pt_regs *regs)
{
static int count = 0;
- lock_kernel();
+
regs->tpc = regs->tnpc;
regs->tnpc += 4;
if(++count <= 20)
printk ("SunOS binary emulation not compiled in\n");
force_sig(SIGSEGV, current);
- unlock_kernel();
+
return -ENOSYS;
}
#endif
@@ -408,32 +407,37 @@ asmlinkage int sys_utrap_install(utrap_entry_t type, utrap_handler_t new_p,
put_user_ret(NULL, old_d, -EFAULT);
return 0;
}
- lock_kernel();
if (!current->thread.utraps) {
- current->thread.utraps = kmalloc((UT_TRAP_INSTRUCTION_31+1)*sizeof(long), GFP_KERNEL);
+ current->thread.utraps =
+ kmalloc((UT_TRAP_INSTRUCTION_31+1)*sizeof(long), GFP_KERNEL);
if (!current->thread.utraps) return -ENOMEM;
current->thread.utraps[0] = 1;
memset(current->thread.utraps+1, 0, UT_TRAP_INSTRUCTION_31*sizeof(long));
} else {
- if ((utrap_handler_t)current->thread.utraps[type] != new_p && current->thread.utraps[0] > 1) {
+ if ((utrap_handler_t)current->thread.utraps[type] != new_p &&
+ current->thread.utraps[0] > 1) {
long *p = current->thread.utraps;
-
- current->thread.utraps = kmalloc((UT_TRAP_INSTRUCTION_31+1)*sizeof(long), GFP_KERNEL);
+
+ current->thread.utraps =
+ kmalloc((UT_TRAP_INSTRUCTION_31+1)*sizeof(long),
+ GFP_KERNEL);
if (!current->thread.utraps) {
current->thread.utraps = p;
return -ENOMEM;
}
p[0]--;
current->thread.utraps[0] = 1;
- memcpy(current->thread.utraps+1, p+1, UT_TRAP_INSTRUCTION_31*sizeof(long));
+ memcpy(current->thread.utraps+1, p+1,
+ UT_TRAP_INSTRUCTION_31*sizeof(long));
}
}
if (old_p)
- put_user_ret((utrap_handler_t)(current->thread.utraps[type]), old_p, -EFAULT);
+ put_user_ret((utrap_handler_t)(current->thread.utraps[type]),
+ old_p, -EFAULT);
if (old_d)
put_user_ret(NULL, old_d, -EFAULT);
current->thread.utraps[type] = (long)new_p;
- unlock_kernel();
+
return 0;
}
diff --git a/arch/sparc64/kernel/sys_sparc32.c b/arch/sparc64/kernel/sys_sparc32.c
index 89c1a90ea..7d8a71d6a 100644
--- a/arch/sparc64/kernel/sys_sparc32.c
+++ b/arch/sparc64/kernel/sys_sparc32.c
@@ -1,4 +1,4 @@
-/* $Id: sys_sparc32.c,v 1.156 2000/07/13 10:59:13 davem Exp $
+/* $Id: sys_sparc32.c,v 1.158 2000/07/29 00:55:49 davem Exp $
* sys_sparc32.c: Conversion between 32bit and 64bit native syscalls.
*
* Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
@@ -253,45 +253,6 @@ asmlinkage long sys32_getegid16(void)
return high2lowgid(current->egid);
}
-/* In order to reduce some races, while at the same time doing additional
- * checking and hopefully speeding things up, we copy filenames to the
- * kernel data space before using them..
- *
- * POSIX.1 2.4: an empty pathname is invalid (ENOENT).
- */
-static inline int do_getname32(const char *filename, char *page)
-{
- int retval;
-
- /* 32bit pointer will be always far below TASK_SIZE :)) */
- retval = strncpy_from_user((char *)page, (char *)filename, PAGE_SIZE);
- if (retval > 0) {
- if (retval < PAGE_SIZE)
- return 0;
- return -ENAMETOOLONG;
- } else if (!retval)
- retval = -ENOENT;
- return retval;
-}
-
-char * getname32(const char *filename)
-{
- char *tmp, *result;
-
- result = ERR_PTR(-ENOMEM);
- tmp = __getname();
- if (tmp) {
- int retval = do_getname32(filename, tmp);
-
- result = tmp;
- if (retval < 0) {
- putname(tmp);
- result = ERR_PTR(retval);
- }
- }
- return result;
-}
-
/* 32-bit timeval and related flotsam. */
struct timeval32
@@ -799,7 +760,6 @@ asmlinkage int sys32_ipc (u32 call, int first, int second, int third, u32 ptr, u
{
int version, err;
- lock_kernel();
version = call >> 16; /* hack for backward compatibility */
call &= 0xffff;
@@ -861,7 +821,6 @@ asmlinkage int sys32_ipc (u32 call, int first, int second, int third, u32 ptr, u
err = -EINVAL;
out:
- unlock_kernel();
return err;
}
@@ -953,7 +912,7 @@ asmlinkage int sys32_quotactl(int cmd, const char *special, int id, unsigned lon
return sys_quotactl(cmd, special,
id, (caddr_t)addr);
}
- spec = getname32 (special);
+ spec = getname (special);
err = PTR_ERR(spec);
if (IS_ERR(spec)) return err;
old_fs = get_fs ();
@@ -998,7 +957,7 @@ asmlinkage int sys32_statfs(const char * path, struct statfs32 *buf)
mm_segment_t old_fs = get_fs();
char *pth;
- pth = getname32 (path);
+ pth = getname (path);
ret = PTR_ERR(pth);
if (!IS_ERR(pth)) {
set_fs (KERNEL_DS);
@@ -1064,7 +1023,7 @@ asmlinkage int sys32_utime(char * filename, struct utimbuf32 *times)
if (get_user (t.actime, &times->actime) ||
__get_user (t.modtime, &times->modtime))
return -EFAULT;
- filenam = getname32 (filename);
+ filenam = getname (filename);
ret = PTR_ERR(filenam);
if (!IS_ERR(filenam)) {
old_fs = get_fs();
@@ -1572,6 +1531,16 @@ static int cp_new_stat32(struct inode *inode, struct stat32 *statbuf)
return err;
}
+/* Perhaps this belongs in fs.h or similar. -DaveM */
+static __inline__ int
+do_revalidate(struct dentry *dentry)
+{
+ struct inode * inode = dentry->d_inode;
+ if (inode->i_op && inode->i_op->revalidate)
+ return inode->i_op->revalidate(dentry);
+ return 0;
+}
+
asmlinkage int sys32_newstat(char * filename, struct stat32 *statbuf)
{
struct nameidata nd;
@@ -1579,16 +1548,9 @@ asmlinkage int sys32_newstat(char * filename, struct stat32 *statbuf)
error = user_path_walk(filename, &nd);
if (!error) {
- struct inode *inode = nd.dentry->d_inode;
-
- if (inode->i_op &&
- inode->i_op->revalidate)
- error = inode->i_op->revalidate(nd.dentry);
- else
- error = 0;
+ error = do_revalidate(nd.dentry);
if (!error)
- error = cp_new_stat32(inode, statbuf);
-
+ error = cp_new_stat32(nd.dentry->d_inode, statbuf);
path_release(&nd);
}
return error;
@@ -1601,15 +1563,9 @@ asmlinkage int sys32_newlstat(char * filename, struct stat32 *statbuf)
error = user_path_walk_link(filename, &nd);
if (!error) {
- struct inode *inode = nd.dentry->d_inode;
-
- if (inode->i_op &&
- inode->i_op->revalidate)
- error = inode->i_op->revalidate(nd.dentry);
- else
- error = 0;
+ error = do_revalidate(nd.dentry);
if (!error)
- error = cp_new_stat32(inode, statbuf);
+ error = cp_new_stat32(nd.dentry->d_inode, statbuf);
path_release(&nd);
}
@@ -1623,16 +1579,11 @@ asmlinkage int sys32_newfstat(unsigned int fd, struct stat32 *statbuf)
f = fget(fd);
if (f) {
- struct inode *inode = f->f_dentry->d_inode;
+ struct dentry * dentry = f->f_dentry;
- if (inode->i_op &&
- inode->i_op->revalidate)
- err = inode->i_op->revalidate(f->f_dentry);
- else
- err = 0;
+ err = do_revalidate(dentry);
if (!err)
- err = cp_new_stat32(inode, statbuf);
-
+ err = cp_new_stat32(dentry->d_inode, statbuf);
fput(f);
}
return err;
@@ -1738,7 +1689,6 @@ asmlinkage int sys32_mount(char *dev_name, char *dir_name, char *type, unsigned
is_smb = is_ncp = 0;
- lock_kernel();
err = copy_mount_stuff_to_kernel((const void *)type, &type_page);
if (err)
goto out;
@@ -1764,16 +1714,20 @@ asmlinkage int sys32_mount(char *dev_name, char *dir_name, char *type, unsigned
goto dev_out;
if (!is_smb && !is_ncp) {
+ lock_kernel();
err = do_mount((char*)dev_page, (char*)dir_page,
(char*)type_page, new_flags, (char*)data_page);
+ unlock_kernel();
} else {
if (is_ncp)
do_ncp_super_data_conv((void *)data_page);
else
do_smb_super_data_conv((void *)data_page);
+ lock_kernel();
err = do_mount((char*)dev_page, (char*)dir_page,
(char*)type_page, new_flags, (char*)data_page);
+ unlock_kernel();
}
free_page(dir_page);
@@ -1787,7 +1741,6 @@ type_out:
free_page(type_page);
out:
- unlock_kernel();
return err;
}
@@ -2234,34 +2187,9 @@ asmlinkage int sys32_getrusage(int who, struct rusage32 *ru)
24 for IPv6,
about 80 for AX.25 */
-/* XXX These as well... */
-extern __inline__ struct socket *socki_lookup(struct inode *inode)
-{
- return &inode->u.socket_i;
-}
-
-extern __inline__ struct socket *sockfd_lookup(int fd, int *err)
-{
- struct file *file;
- struct inode *inode;
-
- if (!(file = fget(fd)))
- {
- *err = -EBADF;
- return NULL;
- }
-
- inode = file->f_dentry->d_inode;
- if (!inode || !inode->i_sock || !socki_lookup(inode))
- {
- *err = -ENOTSOCK;
- fput(file);
- return NULL;
- }
-
- return socki_lookup(inode);
-}
+extern struct socket *sockfd_lookup(int fd, int *err);
+/* XXX This as well... */
extern __inline__ void sockfd_put(struct socket *sock)
{
fput(sock->file);
@@ -2678,7 +2606,6 @@ asmlinkage int sys32_sendmsg(int fd, struct msghdr32 *user_msg, unsigned user_fl
}
kern_msg.msg_flags = user_flags;
- lock_kernel();
sock = sockfd_lookup(fd, &err);
if (sock != NULL) {
if (sock->file->f_flags & O_NONBLOCK)
@@ -2686,7 +2613,6 @@ asmlinkage int sys32_sendmsg(int fd, struct msghdr32 *user_msg, unsigned user_fl
err = sock_sendmsg(sock, &kern_msg, total_len);
sockfd_put(sock);
}
- unlock_kernel();
/* N.B. Use kfree here, as kern_msg.msg_controllen might change? */
if(ctl_buf != ctl)
@@ -2725,7 +2651,6 @@ asmlinkage int sys32_recvmsg(int fd, struct msghdr32 *user_msg, unsigned int use
cmsg_ptr = (unsigned long) kern_msg.msg_control;
kern_msg.msg_flags = 0;
- lock_kernel();
sock = sockfd_lookup(fd, &err);
if (sock != NULL) {
struct scm_cookie scm;
@@ -2762,7 +2687,6 @@ asmlinkage int sys32_recvmsg(int fd, struct msghdr32 *user_msg, unsigned int use
}
sockfd_put(sock);
}
- unlock_kernel();
if(uaddr != NULL && err >= 0)
err = move_addr_to_user(addr, kern_msg.msg_namelen, uaddr, uaddr_len);
@@ -3084,7 +3008,7 @@ asmlinkage int sparc32_execve(struct pt_regs *regs)
if((u32)regs->u_regs[UREG_G1] == 0)
base = 1;
- filename = getname32((char *)AA(regs->u_regs[base + UREG_I0]));
+ filename = getname((char *)AA(regs->u_regs[base + UREG_I0]));
error = PTR_ERR(filename);
if(IS_ERR(filename))
goto out;
@@ -3926,7 +3850,7 @@ asmlinkage int sys32_utimes(char *filename, struct timeval32 *tvs)
mm_segment_t old_fs;
int ret;
- kfilename = getname32(filename);
+ kfilename = getname(filename);
ret = PTR_ERR(kfilename);
if (!IS_ERR(kfilename)) {
if (tvs) {
diff --git a/arch/sparc64/kernel/sys_sunos32.c b/arch/sparc64/kernel/sys_sunos32.c
index 3f43e99dc..9015a2fec 100644
--- a/arch/sparc64/kernel/sys_sunos32.c
+++ b/arch/sparc64/kernel/sys_sunos32.c
@@ -1,4 +1,4 @@
-/* $Id: sys_sunos32.c,v 1.52 2000/07/10 20:57:35 davem Exp $
+/* $Id: sys_sunos32.c,v 1.53 2000/07/30 23:12:24 davem Exp $
* sys_sunos32.c: SunOS binary compatability layer on sparc64.
*
* Copyright (C) 1995, 1996, 1997 David S. Miller (davem@caip.rutgers.edu)
@@ -179,21 +179,18 @@ asmlinkage u32 sunos_sbrk(int increment)
int error, oldbrk;
/* This should do it hopefully... */
- lock_kernel();
oldbrk = (int)current->mm->brk;
error = sunos_brk(((int) current->mm->brk) + increment);
if(!error)
error = oldbrk;
- unlock_kernel();
return error;
}
asmlinkage u32 sunos_sstk(int increment)
{
- lock_kernel();
printk("%s: Call to sunos_sstk(increment<%d>) is unsupported\n",
current->comm, increment);
- unlock_kernel();
+
return (u32)-1;
}
@@ -213,12 +210,13 @@ static char *vstrings[] = {
asmlinkage void sunos_vadvise(u32 strategy)
{
+ static int count = 0;
+
/* I wanna see who uses this... */
- lock_kernel();
- printk("%s: Advises us to use %s paging strategy\n",
- current->comm,
- strategy <= 3 ? vstrings[strategy] : "BOGUS");
- unlock_kernel();
+ if (count++ < 5)
+ printk("%s: Advises us to use %s paging strategy\n",
+ current->comm,
+ strategy <= 3 ? vstrings[strategy] : "BOGUS");
}
/* This just wants the soft limit (ie. rlim_cur element) of the RLIMIT_NOFILE
@@ -457,7 +455,6 @@ asmlinkage int sunos_nosys(void)
siginfo_t info;
static int cnt;
- lock_kernel();
regs = current->thread.kregs;
info.si_signo = SIGSYS;
info.si_errno = 0;
@@ -470,7 +467,6 @@ asmlinkage int sunos_nosys(void)
(int) regs->u_regs[UREG_G1]);
show_regs(regs);
}
- unlock_kernel();
return -ENOSYS;
}
@@ -726,7 +722,7 @@ sunos_mount(char *type, char *dir, int flags, void *data)
if (!capable (CAP_SYS_ADMIN))
return -EPERM;
- lock_kernel();
+
/* We don't handle the integer fs type */
if ((flags & SMNT_NEWTYPE) == 0)
goto out;
@@ -772,7 +768,9 @@ sunos_mount(char *type, char *dir, int flags, void *data)
ret = PTR_ERR(dev_fname);
if (IS_ERR(dev_fname))
goto out2;
+ lock_kernel();
ret = do_mount(dev_fname, dir_page, type_page, linux_flags, NULL);
+ unlock_kernel();
if (dev_fname)
putname(dev_fname);
out2:
@@ -780,7 +778,6 @@ out2:
out1:
putname(dir_page);
out:
- unlock_kernel();
return ret;
}
@@ -818,12 +815,7 @@ asmlinkage int sunos_wait4(__kernel_pid_t32 pid, u32 stat_addr, int options, u32
extern int kill_pg(int, int, int);
asmlinkage int sunos_killpg(int pgrp, int sig)
{
- int ret;
-
- lock_kernel();
- ret = kill_pg(pgrp, sig, 0);
- unlock_kernel();
- return ret;
+ return kill_pg(pgrp, sig, 0);
}
asmlinkage int sunos_audit(void)
@@ -836,9 +828,8 @@ extern asmlinkage u32 sunos_gethostid(void)
{
u32 ret;
- lock_kernel();
ret = (((u32)idprom->id_machtype << 24) | ((u32)idprom->id_sernum));
- unlock_kernel();
+
return ret;
}
diff --git a/arch/sparc64/kernel/traps.c b/arch/sparc64/kernel/traps.c
index 7b5d32614..de4968ac4 100644
--- a/arch/sparc64/kernel/traps.c
+++ b/arch/sparc64/kernel/traps.c
@@ -1,4 +1,4 @@
-/* $Id: traps.c,v 1.66 2000/05/09 17:40:14 davem Exp $
+/* $Id: traps.c,v 1.67 2000/07/30 23:12:24 davem Exp $
* arch/sparc64/kernel/traps.c
*
* Copyright (C) 1995,1997 David S. Miller (davem@caip.rutgers.edu)
@@ -255,7 +255,6 @@ void bad_trap (struct pt_regs *regs, long lvl)
{
siginfo_t info;
- lock_kernel ();
if (lvl < 0x100) {
char buffer[24];
@@ -270,17 +269,14 @@ void bad_trap (struct pt_regs *regs, long lvl)
info.si_addr = (void *)regs->tpc;
info.si_trapno = lvl - 0x100;
force_sig_info(SIGILL, &info, current);
- unlock_kernel ();
}
void bad_trap_tl1 (struct pt_regs *regs, long lvl)
{
char buffer[24];
- lock_kernel();
sprintf (buffer, "Bad trap %lx at tl>0", lvl);
die_if_kernel (buffer, regs);
- unlock_kernel();
}
void instruction_access_exception (struct pt_regs *regs,
@@ -288,7 +284,6 @@ void instruction_access_exception (struct pt_regs *regs,
{
siginfo_t info;
- lock_kernel();
if (regs->tstate & TSTATE_PRIV) {
#if 1
printk("instruction_access_exception: Shit SFSR[%016lx] SFAR[%016lx], going.\n",
@@ -302,7 +297,6 @@ void instruction_access_exception (struct pt_regs *regs,
info.si_addr = (void *)regs->tpc;
info.si_trapno = 0;
force_sig_info(SIGSEGV, &info, current);
- unlock_kernel();
}
void data_access_exception (struct pt_regs *regs,
@@ -343,9 +337,7 @@ void data_access_exception (struct pt_regs *regs,
info.si_code = SEGV_MAPERR;
info.si_addr = (void *)sfar;
info.si_trapno = 0;
- lock_kernel();
force_sig_info(SIGSEGV, &info, current);
- unlock_kernel();
}
#ifdef CONFIG_PCI
@@ -389,9 +381,7 @@ void do_iae(struct pt_regs *regs)
info.si_code = BUS_OBJERR;
info.si_addr = (void *)0;
info.si_trapno = 0;
- lock_kernel();
force_sig_info(SIGBUS, &info, current);
- unlock_kernel();
}
void do_dae(struct pt_regs *regs)
@@ -692,7 +682,6 @@ void die_if_kernel(char *str, struct pt_regs *regs)
smp_report_regs();
#endif
- lock_kernel(); /* Or else! */
if(regs->tstate & TSTATE_PRIV)
do_exit(SIGKILL);
do_exit(SIGSEGV);
diff --git a/arch/sparc64/solaris/fs.c b/arch/sparc64/solaris/fs.c
index 090eb96a1..3cf5b6883 100644
--- a/arch/sparc64/solaris/fs.c
+++ b/arch/sparc64/solaris/fs.c
@@ -1,4 +1,4 @@
-/* $Id: fs.c,v 1.21 2000/07/10 20:57:35 davem Exp $
+/* $Id: fs.c,v 1.22 2000/07/28 12:15:02 davem Exp $
* fs.c: fs related syscall emulation for Solaris
*
* Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
@@ -25,8 +25,6 @@
#include "conv.h"
-extern char * getname32(u32 filename);
-
#define R4_DEV(DEV) ((DEV & 0xff) | ((DEV & 0xff00) << 10))
#define R4_MAJOR(DEV) (((DEV) >> 18) & 0x3fff)
#define R4_MINOR(DEV) ((DEV) & 0x3ffff)
@@ -136,7 +134,7 @@ asmlinkage int solaris_stat(u32 filename, u32 statbuf)
int (*sys_newstat)(char *,struct stat *) =
(int (*)(char *,struct stat *))SYS(stat);
- filenam = getname32 (filename);
+ filenam = getname ((char *)A(filename));
ret = PTR_ERR(filenam);
if (!IS_ERR(filenam)) {
set_fs (KERNEL_DS);
@@ -164,7 +162,7 @@ asmlinkage int solaris_stat64(u32 filename, u32 statbuf)
int (*sys_newstat)(char *,struct stat *) =
(int (*)(char *,struct stat *))SYS(stat);
- filenam = getname32 (filename);
+ filenam = getname ((char *)A(filename));
ret = PTR_ERR(filenam);
if (!IS_ERR(filenam)) {
set_fs (KERNEL_DS);
@@ -186,7 +184,7 @@ asmlinkage int solaris_lstat(u32 filename, u32 statbuf)
int (*sys_newlstat)(char *,struct stat *) =
(int (*)(char *,struct stat *))SYS(lstat);
- filenam = getname32 (filename);
+ filenam = getname ((char *)A(filename));
ret = PTR_ERR(filenam);
if (!IS_ERR(filenam)) {
set_fs (KERNEL_DS);
@@ -213,7 +211,7 @@ asmlinkage int solaris_lstat64(u32 filename, u32 statbuf)
int (*sys_newlstat)(char *,struct stat *) =
(int (*)(char *,struct stat *))SYS(lstat);
- filenam = getname32 (filename);
+ filenam = getname ((char *)A(filename));
ret = PTR_ERR(filenam);
if (!IS_ERR(filenam)) {
set_fs (KERNEL_DS);
diff --git a/arch/sparc64/solaris/ioctl.c b/arch/sparc64/solaris/ioctl.c
index 18d73e686..0e899da18 100644
--- a/arch/sparc64/solaris/ioctl.c
+++ b/arch/sparc64/solaris/ioctl.c
@@ -1,4 +1,4 @@
-/* $Id: ioctl.c,v 1.14 1999/09/22 09:28:50 davem Exp $
+/* $Id: ioctl.c,v 1.15 2000/07/28 12:15:02 davem Exp $
* ioctl.c: Solaris ioctl emulation.
*
* Copyright (C) 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
@@ -31,9 +31,6 @@
#include "conv.h"
#include "socksys.h"
-extern char *getname32(u32 filename);
-#define putname32 putname
-
extern asmlinkage int sys_ioctl(unsigned int fd, unsigned int cmd,
unsigned long arg);
extern asmlinkage int sys32_ioctl(unsigned int fd, unsigned int cmd,
@@ -486,7 +483,7 @@ static inline int solaris_S(struct file *filp, unsigned int fd, unsigned int cmd
return -ENOSYS;
case 2: /* I_PUSH */
{
- p = getname32 (arg);
+ p = getname ((char *)A(arg));
if (IS_ERR (p))
return PTR_ERR(p);
ret = -EINVAL;
@@ -503,7 +500,7 @@ static inline int solaris_S(struct file *filp, unsigned int fd, unsigned int cmd
break;
}
}
- putname32 (p);
+ putname (p);
return ret;
}
case 3: /* I_POP */
@@ -546,7 +543,7 @@ static inline int solaris_S(struct file *filp, unsigned int fd, unsigned int cmd
case 11: /* I_FIND */
{
int i;
- p = getname32 (arg);
+ p = getname ((char *)A(arg));
if (IS_ERR (p))
return PTR_ERR(p);
ret = 0;
@@ -557,7 +554,7 @@ static inline int solaris_S(struct file *filp, unsigned int fd, unsigned int cmd
break;
}
}
- putname32 (p);
+ putname (p);
return ret;
}
case 19: /* I_SWROPT */
diff --git a/arch/sparc64/solaris/timod.c b/arch/sparc64/solaris/timod.c
index 946b20fae..3ef9c943b 100644
--- a/arch/sparc64/solaris/timod.c
+++ b/arch/sparc64/solaris/timod.c
@@ -1,4 +1,4 @@
-/* $Id: timod.c,v 1.9 2000/07/12 23:21:02 davem Exp $
+/* $Id: timod.c,v 1.10 2000/07/28 12:15:02 davem Exp $
* timod.c: timod emulation.
*
* Copyright (C) 1998 Patrik Rak (prak3264@ss1000.ms.mff.cuni.cz)
@@ -27,9 +27,6 @@
#include "conv.h"
#include "socksys.h"
-extern char *getname32(u32 filename);
-#define putname32 putname
-
extern asmlinkage int sys_ioctl(unsigned int fd, unsigned int cmd,
unsigned long arg);
extern asmlinkage int sys32_ioctl(unsigned int fd, unsigned int cmd,