| Bits 5-3: | Reeived Offset. Indicates the
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/MAINTAINERS linux.20p9/MAINTAINERS
--- linux.vanilla/MAINTAINERS Sun Mar 25 17:37:29 2001
+++ linux.20p9/MAINTAINERS Wed Aug 8 22:21:15 2001
@@ -211,7 +211,8 @@
CONFIGURE, MENUCONFIG, XCONFIG
P: Michael Elizabeth Chastain
M: mec@shout.net
-L: linux-kbuild@torque.net
+L: kbuild-devel@lists.sourceforge.net
+W: http://kbuild.sourceforge.net
S: Maintained
CONFIGURE.HELP
@@ -242,8 +243,8 @@
S: Supported
CYCLADES PC300 DRIVER
-P: Ivan Passos
-M: ivan@cyclades.com
+P: Daniela Squassoni
+M: daniela@cyclades.com
W: http://www.cyclades.com/
S: Supported
@@ -532,17 +533,13 @@
W: http://www.cs.uit.no/linux-irda/
S: Maintained
-ISDN SUBSYSTEM (general)
-P: Fritz Elfert
-M: fritz@isdn4linux.de
-L: isdn4linux@listserv.isdn4linux.de
-W: www.isdn4linux.de
-S: Maintained
-
-ISDN SUBSYSTEM (HiSax)
+ISDN SUBSYSTEM
P: Karsten Keil
-M: keil@isdn4linux.de
+M: kkeil@suse.de
+P: Kai Germaschewski
+M: kai.germaschewski@gmx.de
L: isdn4linux@listserv.isdn4linux.de
+W: http://www.isdn4linux.de
S: Maintained
ISDN SUBSYSTEM (Eicon active card driver)
@@ -764,13 +761,13 @@
P: Phil Blundell
M: Philip.Blundell@pobox.com
P: Tim Waugh
-M: tim@cyberelk.demon.co.uk
+M: tim@cyberelk.net
P: David Campbell
M: campbell@torque.net
P: Andrea Arcangeli
M: andrea@e-mind.com
L: linux-parport@torque.net
-W: http://www.cyberelk.demon.co.uk/parport.html
+W: http://people.redhat.com/twaugh/parport/
S: Maintained
PARIDE DRIVERS FOR PARALLEL PORT IDE DEVICES
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/Makefile linux.20p9/Makefile
--- linux.vanilla/Makefile Sun Mar 25 17:39:55 2001
+++ linux.20p9/Makefile Wed Aug 8 23:26:59 2001
@@ -1,7 +1,7 @@
VERSION = 2
PATCHLEVEL = 2
-SUBLEVEL = 19
-EXTRAVERSION =
+SUBLEVEL = 20
+EXTRAVERSION = pre9
ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
@@ -200,6 +200,10 @@
ifeq ($(CONFIG_USB),y)
DRIVERS := $(DRIVERS) drivers/usb/usbdrv.o
+else
+ ifdef CONFIG_INPUT_ADBHID
+ DRIVERS := $(DRIVERS) drivers/usb/usbdrv.o
+ endif
endif
ifeq ($(CONFIG_I2O),y)
@@ -423,7 +427,8 @@
rm -rf modules
distclean: mrproper
- rm -f core `find . \( -name '*.orig' -o -name '*.rej' -o -name '*~' \
+ rm -f core `find . \( -not -type d \) -and \
+ \( -name '*.orig' -o -name '*.rej' -o -name '*~' \
-o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
-o -name '.*.rej' -o -name '.SUMS' -o -size 0 \) -print` TAGS
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/alpha/kernel/entry.S linux.20p9/arch/alpha/kernel/entry.S
--- linux.vanilla/arch/alpha/kernel/entry.S Sun Mar 25 17:37:29 2001
+++ linux.20p9/arch/alpha/kernel/entry.S Wed Jul 4 16:03:53 2001
@@ -32,11 +32,12 @@
#define TASK_ADDR_LIMIT 24
#define TASK_EXEC_DOMAIN 32
#define TASK_NEED_RESCHED 40
+#define TASK_PTRACE 48
/*
* task flags (must match include/linux/sched.h):
*/
-#define PF_PTRACED 0x00000010
+#define PT_PTRACED 0x00000001
/*
* This defines the normal kernel pt-regs layout.
@@ -558,7 +559,7 @@
ldq $3,TASK_FLAGS($8)
stq $17,SP_OFF+32($30)
s8addq $0,$5,$5
- and $3,PF_PTRACED,$3
+ and $3,PT_PTRACED,$3
stq $18,SP_OFF+40($30)
bne $3,strace
beq $4,1f
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/alpha/kernel/ptrace.c linux.20p9/arch/alpha/kernel/ptrace.c
--- linux.vanilla/arch/alpha/kernel/ptrace.c Sun Mar 25 17:31:46 2001
+++ linux.20p9/arch/alpha/kernel/ptrace.c Wed Jul 4 16:03:53 2001
@@ -527,10 +527,10 @@
ret = -EPERM;
if (request == PTRACE_TRACEME) {
/* are we already being traced? */
- if (current->flags & PF_PTRACED)
+ if (current->ptrace & PT_PTRACED)
goto out;
/* set the ptrace bit in the process flags. */
- current->flags |= PF_PTRACED;
+ current->ptrace |= PT_PTRACED;
ret = 0;
goto out;
}
@@ -553,9 +553,9 @@
&& !capable(CAP_SYS_PTRACE))
goto out;
/* the same process cannot be attached many times */
- if (child->flags & PF_PTRACED)
+ if (child->ptrace & PT_PTRACED)
goto out;
- child->flags |= PF_PTRACED;
+ child->ptrace |= PT_PTRACED;
if (child->p_pptr != current) {
REMOVE_LINKS(child);
child->p_pptr = current;
@@ -566,7 +566,7 @@
goto out;
}
ret = -ESRCH;
- if (!(child->flags & PF_PTRACED)) {
+ if (!(child->ptrace & PT_PTRACED)) {
DBG(DBG_MEM, ("child not traced\n"));
goto out;
}
@@ -622,9 +622,9 @@
if ((unsigned long) data > _NSIG)
goto out;
if (request == PTRACE_SYSCALL)
- child->flags |= PF_TRACESYS;
+ child->ptrace |= PT_TRACESYS;
else
- child->flags &= ~PF_TRACESYS;
+ child->ptrace &= ~PT_TRACESYS;
child->exit_code = data;
wake_up_process(child);
/* make sure single-step breakpoint is gone. */
@@ -652,7 +652,7 @@
if ((unsigned long) data > _NSIG)
goto out;
child->tss.bpt_nsaved = -1; /* mark single-stepping */
- child->flags &= ~PF_TRACESYS;
+ child->ptrace &= ~PT_TRACESYS;
wake_up_process(child);
child->exit_code = data;
/* give it a chance to run. */
@@ -663,7 +663,7 @@
ret = -EIO;
if ((unsigned long) data > _NSIG)
goto out;
- child->flags &= ~(PF_PTRACED|PF_TRACESYS);
+ child->ptrace &= ~(PT_PTRACED|PT_TRACESYS);
wake_up_process(child);
child->exit_code = data;
REMOVE_LINKS(child);
@@ -686,8 +686,8 @@
asmlinkage void
syscall_trace(void)
{
- if ((current->flags & (PF_PTRACED|PF_TRACESYS))
- != (PF_PTRACED|PF_TRACESYS))
+ if ((current->ptrace & (PT_PTRACED|PT_TRACESYS))
+ != (PT_PTRACED|PT_TRACESYS))
return;
current->exit_code = SIGTRAP;
current->state = TASK_STOPPED;
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/alpha/kernel/signal.c linux.20p9/arch/alpha/kernel/signal.c
--- linux.vanilla/arch/alpha/kernel/signal.c Sun Mar 25 17:31:46 2001
+++ linux.20p9/arch/alpha/kernel/signal.c Wed Jul 4 16:03:53 2001
@@ -621,7 +621,7 @@
if (!signr)
break;
- if ((current->flags & PF_PTRACED) && signr != SIGKILL) {
+ if ((current->ptrace & PT_PTRACED) && signr != SIGKILL) {
/* Let the debugger run. */
current->exit_code = signr;
current->state = TASK_STOPPED;
@@ -692,12 +692,8 @@
case SIGQUIT: case SIGILL: case SIGTRAP:
case SIGABRT: case SIGFPE: case SIGSEGV:
- lock_kernel();
- if (current->binfmt
- && current->binfmt->core_dump
- && current->binfmt->core_dump(signr, regs))
+ if (do_coredump(signr, regs))
exit_code |= 0x80;
- unlock_kernel();
/* FALLTHRU */
default:
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/alpha/kernel/sys_alcor.c linux.20p9/arch/alpha/kernel/sys_alcor.c
--- linux.vanilla/arch/alpha/kernel/sys_alcor.c Sun Mar 25 17:31:46 2001
+++ linux.20p9/arch/alpha/kernel/sys_alcor.c Wed Jul 4 16:03:53 2001
@@ -15,6 +15,7 @@
#include
#include
#include
+#include
#include
#include
@@ -186,13 +187,21 @@
static void
alcor_kill_arch (int mode, char *reboot_cmd)
{
- /* Who said DEC engineer's have no sense of humor? ;-) */
- if (alpha_using_srm) {
- *(vuip) GRU_RESET = 0x0000dead;
- mb();
+ switch(mode) {
+ case LINUX_REBOOT_CMD_RESTART:
+ /* Who said DEC engineer's have no sense of humor? ;-) */
+ if (alpha_using_srm) {
+ *(vuip) GRU_RESET = 0x0000dead;
+ mb();
+ }
+ break;
+ case LINUX_REBOOT_CMD_HALT:
+ break;
+ case LINUX_REBOOT_CMD_POWER_OFF:
+ break;
}
- generic_kill_arch(mode, reboot_cmd);
+ halt();
}
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/alpha/kernel/sys_miata.c linux.20p9/arch/alpha/kernel/sys_miata.c
--- linux.vanilla/arch/alpha/kernel/sys_miata.c Sun Mar 25 17:31:46 2001
+++ linux.20p9/arch/alpha/kernel/sys_miata.c Wed Jul 4 16:03:53 2001
@@ -14,6 +14,7 @@
#include
#include
#include
+#include
#include
#include
@@ -274,12 +275,22 @@
static void
miata_kill_arch (int mode, char *reboot_cmd)
{
- /* Who said DEC engineers have no sense of humor? ;-) */
- if (alpha_using_srm) {
- *(vuip) PYXIS_RESET = 0x0000dead;
- mb();
- }
- generic_kill_arch(mode, reboot_cmd);
+ switch(mode) {
+ case LINUX_REBOOT_CMD_HALT:
+ break;
+ case LINUX_REBOOT_CMD_RESTART:
+ /* Who said DEC engineers have no sense of humor? ;-) */
+ if (alpha_using_srm) {
+ *(vuip) PYXIS_RESET = 0x0000dead;
+ mb();
+ }
+ generic_kill_arch(mode, reboot_cmd);
+ break;
+ case LINUX_REBOOT_CMD_POWER_OFF:
+ break;
+ }
+
+ halt();
}
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/alpha/kernel/traps.c linux.20p9/arch/alpha/kernel/traps.c
--- linux.vanilla/arch/alpha/kernel/traps.c Sun Mar 25 17:37:29 2001
+++ linux.20p9/arch/alpha/kernel/traps.c Thu Jul 26 15:58:15 2001
@@ -19,6 +19,8 @@
#include
#include
#include
+#include
+#include
#include "proto.h"
@@ -98,6 +100,30 @@
static alist * int_name[] = {inta_name, intl_name, ints_name, intm_name};
+static int opDEC_testing = 0;
+static int opDEC_fix = 0;
+static unsigned long opDEC_test_pc = 0;
+
+static void
+opDEC_check(void)
+{
+ unsigned long test_pc;
+
+ lock_kernel();
+ opDEC_testing = 1;
+
+ __asm__ __volatile__(
+ " br %0,1f\n"
+ "1: addq %0,8,%0\n"
+ " stq %0,%1\n"
+ " cvttq/svm $f31,$f31\n"
+ : "=&r"(test_pc), "=m"(opDEC_test_pc)
+ : );
+
+ opDEC_testing = 0;
+ unlock_kernel();
+}
+
static char *
assoc(int fcode, alist * a)
{
@@ -358,7 +384,9 @@
unsigned long a2, unsigned long a3, unsigned long a4,
unsigned long a5, struct pt_regs regs)
{
- die_if_kernel("Instruction fault", ®s, type, 0);
+ if (!opDEC_testing || type != 4) {
+ die_if_kernel("Instruction fault", ®s, type, 0);
+ }
switch (type) {
case 0: /* breakpoint */
if (ptrace_cancel_bpt(current)) {
@@ -414,6 +442,22 @@
case 4: /* opDEC */
if (implver() == IMPLVER_EV4) {
+ /* The some versions of SRM do not handle
+ the opDEC properly - they return the PC of the
+ opDEC fault, not the instruction after as the
+ Alpha architecture requires. Here we fix it up.
+ We do this by intentionally causing an opDEC
+ fault during the boot sequence and testing if
+ we get the correct PC. If not, we set a flag
+ to correct it every time through.
+ */
+ if (opDEC_testing && regs.pc == opDEC_test_pc) {
+ opDEC_fix = 4;
+ printk("opDEC fixup enabled.\n");
+ }
+
+ regs.pc += opDEC_fix;
+
/* EV4 does not implement anything except normal
rounding. Everything else will come here as
an illegal instruction. Emulate them. */
@@ -1105,4 +1149,11 @@
wrent(entUna, 4);
wrent(entSys, 5);
wrent(entDbg, 6);
+
+ /* Hack for Multia (UDB) and JENSEN: some of their SRMs have
+ * a bug in the handling of the opDEC fault. Fix it up.
+ */
+ if (implver() == IMPLVER_EV4) {
+ opDEC_check();
+ }
}
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/arm/kernel/ptrace.c linux.20p9/arch/arm/kernel/ptrace.c
--- linux.vanilla/arch/arm/kernel/ptrace.c Sun Mar 25 17:37:29 2001
+++ linux.20p9/arch/arm/kernel/ptrace.c Wed Jul 4 16:03:53 2001
@@ -662,9 +662,9 @@
if ((unsigned long) data > _NSIG)
break;
if (request == PTRACE_SYSCALL)
- child->flags |= PF_TRACESYS;
+ child->ptrace |= PT_TRACESYS;
else
- child->flags &= ~PF_TRACESYS;
+ child->ptrace &= ~PT_TRACESYS;
child->exit_code = data;
/* make sure single-step breakpoint is gone. */
ptrace_cancel_bpt(child);
@@ -697,7 +697,7 @@
if ((unsigned long) data > _NSIG)
break;
child->tss.debug.nsaved = -1;
- child->flags &= ~PF_TRACESYS;
+ child->ptrace &= ~PT_TRACESYS;
child->exit_code = data;
/* give it a chance to run. */
wake_up_process(child);
@@ -711,7 +711,7 @@
ret = -EIO;
if ((unsigned long) data > _NSIG)
break;
- child->flags &= ~(PF_PTRACED|PF_TRACESYS);
+ child->ptrace &= ~(PT_PTRACED|PT_TRACESYS);
child->exit_code = data;
REMOVE_LINKS(child);
child->p_pptr = child->p_opptr;
@@ -799,10 +799,10 @@
ret = -EPERM;
if (request == PTRACE_TRACEME) {
/* are we already being traced? */
- if (current->flags & PF_PTRACED)
+ if (current->ptrace & PT_PTRACED)
goto out;
/* set the ptrace bit in the process flags. */
- current->flags |= PF_PTRACED;
+ current->ptrace |= PT_PTRACED;
ret = 0;
goto out;
}
@@ -826,9 +826,9 @@
(current->gid != child->gid)) && !capable(CAP_SYS_PTRACE))
goto out;
/* the same process cannot be attached many times */
- if (child->flags & PF_PTRACED)
+ if (child->ptrace & PT_PTRACED)
goto out;
- child->flags |= PF_PTRACED;
+ child->ptrace |= PT_PTRACED;
if (child->p_pptr != current) {
REMOVE_LINKS(child);
@@ -841,7 +841,7 @@
goto out;
}
ret = -ESRCH;
- if (!(child->flags & PF_PTRACED))
+ if (!(child->ptrace & PT_PTRACED))
goto out;
if (child->state != TASK_STOPPED && request != PTRACE_KILL)
goto out;
@@ -857,8 +857,8 @@
asmlinkage void syscall_trace(void)
{
- if ((current->flags & (PF_PTRACED|PF_TRACESYS))
- != (PF_PTRACED|PF_TRACESYS))
+ if ((current->ptrace & (PT_PTRACED|PT_TRACESYS))
+ != (PT_PTRACED|PT_TRACESYS))
return;
current->exit_code = SIGTRAP;
current->state = TASK_STOPPED;
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/arm/kernel/signal.c linux.20p9/arch/arm/kernel/signal.c
--- linux.vanilla/arch/arm/kernel/signal.c Sun Mar 25 17:37:29 2001
+++ linux.20p9/arch/arm/kernel/signal.c Wed Jul 4 16:03:53 2001
@@ -474,7 +474,7 @@
if (!signr)
break;
- if ((current->flags & PF_PTRACED) && signr != SIGKILL) {
+ if ((current->ptrace & PT_PTRACED) && signr != SIGKILL) {
/* Let the debugger run. */
current->exit_code = signr;
current->state = TASK_STOPPED;
@@ -544,12 +544,8 @@
case SIGQUIT: case SIGILL: case SIGTRAP:
case SIGABRT: case SIGFPE: case SIGSEGV:
- lock_kernel();
- if (current->binfmt
- && current->binfmt->core_dump
- && current->binfmt->core_dump(signr, regs))
+ if (do_coredump(signr, regs))
exit_code |= 0x80;
- unlock_kernel();
/* FALLTHRU */
default:
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/i386/boot/compressed/head.S linux.20p9/arch/i386/boot/compressed/head.S
--- linux.vanilla/arch/i386/boot/compressed/head.S Sun Mar 25 17:31:45 2001
+++ linux.20p9/arch/i386/boot/compressed/head.S Wed Jul 4 16:03:53 2001
@@ -65,6 +65,7 @@
movl %eax,0x000000 # loop forever if it isn't
cmpl %eax,0x100000
je 1b
+
/*
* Initialize eflags. Some BIOS's leave bits like NT set. This would
* confuse the debugger if this code is traced.
@@ -86,10 +87,14 @@
* Do the decompression, and jump to the new kernel..
*/
subl $16,%esp # place for structure on the stack
- pushl %esp # address of structure as first arg
+ movl %esp,%eax
+ pushl %esi # real mode pointer as second arg
+ pushl %eax # address of structure as first arg
call SYMBOL_NAME(decompress_kernel)
orl %eax,%eax
jnz 3f
+ popl %esi # discard address
+ popl %esi # real mode pointer
xorl %ebx,%ebx
ljmp $(__KERNEL_CS), $0x100000
@@ -104,11 +109,14 @@
movl $0x1000,%edi
movl $move_routine_end,%ecx
subl %esi,%ecx
+ addl $3,%ecx
+ shrl $2,%ecx
cld
rep
- movsb
+ movsl
popl %esi # discard the address
+ popl %ebx # real mode pointer
popl %esi # low_buffer_start
popl %ecx # lcount
popl %edx # high_buffer_start
@@ -122,18 +130,21 @@
* if we were high loaded. This _must_ PIC-code !
*/
move_routine_start:
+ movl %ecx,%ebp
+ shrl $2,%ecx
+ rep
+ movsl
+ movl %ebp,%ecx
+ andl $3,%ecx
rep
movsb
movl %edx,%esi
movl %eax,%ecx # NOTE: rep movsb won't move if %ecx == 0
+ addl $3,%ecx
+ shrl $2,%ecx
rep
- movsb
+ movsl
+ movl %ebx,%esi # Restore setup pointer
xorl %ebx,%ebx
-/*
- * Well, the kernel relies on %esp pointing into low mem,
- * with the decompressor loaded high this is no longer true,
- * so we set esp here.
- */
- mov $0x90000,%esp
ljmp $(__KERNEL_CS), $0x100000
move_routine_end:
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/i386/boot/compressed/misc.c linux.20p9/arch/i386/boot/compressed/misc.c
--- linux.vanilla/arch/i386/boot/compressed/misc.c Sun Mar 25 17:31:45 2001
+++ linux.20p9/arch/i386/boot/compressed/misc.c Wed Jul 4 16:03:53 2001
@@ -74,11 +74,13 @@
/*
* This is set up by the setup-routine at boot-time
*/
-#define EXT_MEM_K (*(unsigned short *)0x90002)
+static unsigned char *real_mode; /* Pointer to real-mode data */
+
+#define EXT_MEM_K (*(unsigned short *)(real_mode + 0x2))
#ifndef STANDARD_MEMORY_BIOS_CALL
-#define ALT_MEM_K (*(unsigned long *) 0x901e0)
+#define ALT_MEM_K (*(unsigned long *)(real_mode + 0x1e0))
#endif
-#define SCREEN_INFO (*(struct screen_info *)0x90000)
+#define SCREEN_INFO (*(struct screen_info *)(real_mode+0))
extern char input_data[];
extern int input_len;
@@ -98,13 +100,13 @@
extern int end;
static long free_mem_ptr = (long)&end;
-static long free_mem_end_ptr = 0x90000;
+static long free_mem_end_ptr;
#define INPLACE_MOVE_ROUTINE 0x1000
#define LOW_BUFFER_START 0x2000
-#define LOW_BUFFER_END 0x90000
-#define LOW_BUFFER_SIZE ( LOW_BUFFER_END - LOW_BUFFER_START )
+#define LOW_BUFFER_MAX 0x90000
#define HEAP_SIZE 0x2400
+static unsigned int low_buffer_end, low_buffer_size;
static int high_loaded =0;
static uch *high_buffer_start /* = (uch *)(((ulg)&end) + HEAP_SIZE)*/;
@@ -255,7 +257,7 @@
in = window;
for (n = 0; n < outcnt; n++) {
ch = *output_data++ = *in++;
- if ((ulg)output_data == LOW_BUFFER_END) output_data=high_buffer_start;
+ if ((ulg)output_data == low_buffer_end) output_data=high_buffer_start;
c = crc_32_tab[((int)c ^ ch) & 0xff] ^ (c >> 8);
}
crc = c;
@@ -311,10 +313,13 @@
if ((ALT_MEM_K > EXT_MEM_K ? ALT_MEM_K : EXT_MEM_K) < (3*1024)) error("Less than 4MB of memory.\n");
#endif
mv->low_buffer_start = output_data = (char *)LOW_BUFFER_START;
+ low_buffer_end = ((unsigned int)real_mode > LOW_BUFFER_MAX
+ ? LOW_BUFFER_MAX : (unsigned int)real_mode) & ~0xfff;
+ low_buffer_size = low_buffer_end - LOW_BUFFER_START;
high_loaded = 1;
free_mem_end_ptr = (long)high_buffer_start;
- if ( (0x100000 + LOW_BUFFER_SIZE) > ((ulg)high_buffer_start)) {
- high_buffer_start = (uch *)(0x100000 + LOW_BUFFER_SIZE);
+ if ( (0x100000 + low_buffer_size) > ((ulg)high_buffer_start)) {
+ high_buffer_start = (uch *)(0x100000 + low_buffer_size);
mv->hcount = 0; /* say: we need not to move high_buffer */
}
else mv->hcount = -1;
@@ -323,17 +328,21 @@
void close_output_buffer_if_we_run_high(struct moveparams *mv)
{
- mv->lcount = bytes_out;
- if (bytes_out > LOW_BUFFER_SIZE) {
- mv->lcount = LOW_BUFFER_SIZE;
- if (mv->hcount) mv->hcount = bytes_out - LOW_BUFFER_SIZE;
+ if (bytes_out > low_buffer_size) {
+ mv->lcount = low_buffer_size;
+ if (mv->hcount)
+ mv->hcount = bytes_out - low_buffer_size;
+ } else {
+ mv->lcount = bytes_out;
+ mv->hcount = 0;
}
- else mv->hcount = 0;
}
-int decompress_kernel(struct moveparams *mv)
+int decompress_kernel(struct moveparams *mv, void *rmode)
{
+ real_mode = rmode;
+
if (SCREEN_INFO.orig_video_mode == 7) {
vidmem = (char *) 0xb0000;
vidport = 0x3b4;
@@ -355,4 +364,3 @@
if (high_loaded) close_output_buffer_if_we_run_high(mv);
return high_loaded;
}
-
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/i386/boot/setup.S linux.20p9/arch/i386/boot/setup.S
--- linux.vanilla/arch/i386/boot/setup.S Sun Mar 25 17:37:29 2001
+++ linux.20p9/arch/i386/boot/setup.S Wed Jul 4 16:03:53 2001
@@ -69,7 +69,7 @@
! SETUP-header, must start at CS:2 (old 0x9020:2)
!
.ascii "HdrS" ! Signature for SETUP-header
- .word 0x0201 ! Version number of header format
+ .word 0x0202 ! Version number of header format
! (must be >= 0x0105
! else old loadlin-1.5 will fail)
realmode_swtch: .word 0,0 ! default_switch,SETUPSEG
@@ -120,9 +120,28 @@
ramdisk_size: .long 0 ! its size in bytes
bootsect_kludge:
.word bootsect_helper,SETUPSEG
-heap_end_ptr: .word modelist+1024 ! space from here (exclusive) down to
- ! end of setup code can be used by setup
- ! for local heap purposes.
+heap_end_ptr: .word modelist+1024 ! (Header version 0x0201 or later)
+ ! space from here (exclusive) down to
+ ! end of setup code can be used by setup
+ ! for local heap purposes.
+
+pad1: .word 0 ! Reserved for future use
+
+cmd_line_ptr: .long 0 ! (Header version 0x0202 or later)
+ ! If nonzero, a 32-bit pointer
+ ! to the kernel command line.
+ ! The command line should be
+ ! located between the start of
+ ! setup and the end of low
+ ! memory (0xa0000), or it may
+ ! get overwritten before it
+ ! gets read. If this field is
+ ! used, there is no longer
+ ! anything magical about the
+ ! 0x90000 segment; the setup
+ ! can be located anywhere in
+ ! low memory 0x10000 or higher.
+
! ------------------------ end of header ----------------------------------
start_of_setup:
@@ -534,6 +553,13 @@
mov ax,cs ! aka #SETUPSEG ! right, forgot this at first. didn't work :-)
mov ds,ax
+! Check whether we need to be downward compatible with version <= 0x0201
+ cmp dword ptr [cmd_line_ptr],#0
+ jne end_move_self
+ cmp byte ptr [type_of_loader],#0x20
+ je end_move_self
+
+! Boot loader does not support boot protocol version 2.02.
! If we have our code not at 0x90000, we need to move it there now.
! We also then need to move the parameters behind it (command line)
! Because we would overwrite the code on the current IP, we move
@@ -572,9 +598,14 @@
mov ds,ax
mov ss,dx
! now we are at the right place
-end_move_self:
+end_move_self:
lidt idt_48 ! load idt with 0,0
+ xor eax,eax
+ mov ax,ds
+ shl eax,#4
+ add eax,#gdt
+ mov [gdt_48+2],eax
lgdt gdt_48 ! load gdt with whatever appropriate
! that was painless, now we enable A20
@@ -679,7 +710,11 @@
jmp flush_instr
flush_instr:
xor bx,bx ! Flag to indicate a boot
-
+ xor esi,esi ! Pointer to real-mode code
+ mov si,cs
+ sub si,#DELTA_INITSEG
+ shl esi,#4 ! Convert to 32-bit pointer
+
! NOTE: For high loaded big kernels we need a
! jmpi 0x100000,__KERNEL_CS
!
@@ -873,7 +908,7 @@
gdt_48:
.word 0x800 ! gdt limit=2048, 256 GDT entries
- .word 512+gdt,0x9 ! gdt base = 0X9xxxx
+ .word 0, 0 ! gdt base (filled in later)
!
! Include video setup & detection code
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/i386/config.in linux.20p9/arch/i386/config.in
--- linux.vanilla/arch/i386/config.in Sun Mar 25 17:37:29 2001
+++ linux.20p9/arch/i386/config.in Thu Jul 26 15:41:04 2001
@@ -4,6 +4,8 @@
#
mainmenu_name "Linux Kernel Configuration"
+define_bool CONFIG_X86 y
+
mainmenu_option next_comment
comment 'Code maturity level options'
bool 'Prompt for development and/or incomplete code/drivers' CONFIG_EXPERIMENTAL
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/i386/kernel/bluesmoke.c linux.20p9/arch/i386/kernel/bluesmoke.c
--- linux.vanilla/arch/i386/kernel/bluesmoke.c Sun Mar 25 17:31:45 2001
+++ linux.20p9/arch/i386/kernel/bluesmoke.c Wed Jul 4 16:03:53 2001
@@ -46,6 +46,7 @@
printk(" at %08x%08x",
high, low);
}
+ printk("\n");
/* Clear it */
wrmsr(0x401+i*4, 0UL, 0UL);
/* Serialize */
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/i386/kernel/entry.S linux.20p9/arch/i386/kernel/entry.S
--- linux.vanilla/arch/i386/kernel/entry.S Sun Mar 25 17:37:29 2001
+++ linux.20p9/arch/i386/kernel/entry.S Wed Jul 4 16:03:53 2001
@@ -76,6 +76,7 @@
addr_limit = 12
exec_domain = 16
need_resched = 20
+ptrace = 24
ENOSYS = 38
@@ -174,7 +175,7 @@
GET_CURRENT(%ebx)
cmpl $(NR_syscalls),%eax
jae badsys
- testb $0x20,flags(%ebx) # PF_TRACESYS
+ testb $0x02,ptrace(%ebx) # PT_TRACESYS
jne tracesys
call *SYMBOL_NAME(sys_call_table)(,%eax,4)
movl %eax,EAX(%esp) # save the return value
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/i386/kernel/head.S linux.20p9/arch/i386/kernel/head.S
--- linux.vanilla/arch/i386/kernel/head.S Sun Mar 25 17:31:45 2001
+++ linux.20p9/arch/i386/kernel/head.S Wed Jul 4 16:03:53 2001
@@ -14,11 +14,11 @@
#include
#include
-
-#define CL_MAGIC_ADDR 0x90020
-#define CL_MAGIC 0xA33F
-#define CL_BASE_ADDR 0x90000
-#define CL_OFFSET 0x90022
+#define OLD_CL_MAGIC_ADDR 0x90020
+#define OLD_CL_MAGIC 0xA33F
+#define OLD_CL_BASE_ADDR 0x90000
+#define OLD_CL_OFFSET 0x90022
+#define NEW_CL_POINTER 0x228 /* Relative to real mode data */
/*
* References to members of the boot_cpu_data structure.
@@ -36,6 +36,8 @@
/*
* swapper_pg_dir is the main page directory, address 0x00101000
+ *
+ * On entry, %esi points to the real-mode code as a 32-bit pointer.
*/
ENTRY(stext)
ENTRY(_stext)
@@ -52,6 +54,9 @@
#ifdef __SMP__
orw %bx,%bx
jz 1f
+#endif
+
+#ifdef __SMP__
/*
* New page tables may be in 4Mbyte page mode and may
* be using the global pages.
@@ -89,6 +94,7 @@
jmp checkCPUtype
1:
#endif __SMP__
+
/*
* Clear BSS first so that there are no surprises...
*/
@@ -99,6 +105,7 @@
cld
rep
stosb
+
/*
* start system 32-bit setup. We need to re-do some of the things done
* in 16-bit mode for the "real" operations.
@@ -115,8 +122,9 @@
* Copy bootup parameters out of the way. First 2kB of
* _empty_zero_page is for boot parameters, second 2kB
* is for the command line.
+ *
+ * Note: %esi still has the pointer to the real-mode data.
*/
- movl $0x90000,%esi
movl $ SYMBOL_NAME(empty_zero_page),%edi
movl $512,%ecx
cld
@@ -126,11 +134,15 @@
movl $512,%ecx
rep
stosl
- cmpw $(CL_MAGIC),CL_MAGIC_ADDR
+ movl SYMBOL_NAME(empty_zero_page)+NEW_CL_POINTER,%esi
+ andl %esi,%esi
+ jnz 2f
+ cmpw $(OLD_CL_MAGIC),OLD_CL_MAGIC_ADDR
jne 1f
+ movzwl OLD_CL_OFFSET,%esi
+ addl $(OLD_CL_BASE_ADDR),%esi
+2:
movl $ SYMBOL_NAME(empty_zero_page)+2048,%edi
- movzwl CL_OFFSET,%esi
- addl $(CL_BASE_ADDR),%esi
movl $2048,%ecx
rep
movsb
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/i386/kernel/io_apic.c linux.20p9/arch/i386/kernel/io_apic.c
--- linux.vanilla/arch/i386/kernel/io_apic.c Sun Mar 25 17:31:45 2001
+++ linux.20p9/arch/i386/kernel/io_apic.c Wed Aug 8 22:16:31 2001
@@ -199,9 +199,9 @@
/*
* We disable IO-APIC IRQs by setting their 'destination CPU mask' to
* zero. Trick by Ramesh Nalluri.
+ * Not anymore. This causes problems on some IO-APIC's, notably AMD 760MP's
+ * So we do it a more 2.4 kind of way now which should be safer -jerdfelt
*/
-DO_ACTION( disable, 1, &= 0x00ffffff, io_apic_sync(entry->apic))/* destination = 0x00 */
-DO_ACTION( enable, 1, |= 0xff000000, ) /* destination = 0xff */
DO_ACTION( mask, 0, |= 0x00010000, io_apic_sync(entry->apic))/* mask = 1 */
DO_ACTION( unmask, 0, &= 0xfffeffff, ) /* mask = 0 */
@@ -611,8 +611,8 @@
entry.delivery_mode = dest_LowestPrio;
entry.dest_mode = 1; /* logical delivery */
- entry.mask = 0; /* enable IRQ */
- entry.dest.logical.logical_dest = 0; /* but no route */
+ entry.mask = 1; /* disable IRQ */
+ entry.dest.logical.logical_dest = 0xff;
idx = find_irq_entry(apic,pin,mp_INT);
if (idx == -1) {
@@ -931,18 +931,60 @@
panic("could not set ID");
}
+static int __init ELCR_trigger(unsigned int irq)
+{
+ unsigned int port;
+
+ port = 0x4d0 + (irq >> 3);
+ return (inb(port) >> (irq & 7)) & 1;
+}
+
static void __init construct_default_ISA_mptable(void)
{
int i, pos = 0;
+ int ELCR_fallback = 0;
const int bus_type = (mpc_default_type == 2 || mpc_default_type == 3 ||
mpc_default_type == 6) ? MP_BUS_EISA : MP_BUS_ISA;
+ /*
+ * If true, we have an ISA/PCI system with no IRQ entries
+ * in the MP table. To prevent the PCI interrupts from being set up
+ * incorrectly, we try to use the ELCR. The sanity check to see if
+ * there is good ELCR data is very simple - IRQ0, 1, 2 and 13 can
+ * never be level sensitive, so we simply see if the ELCR agrees.
+ * If it does, we assume it's valid.
+ */
+ if (mpc_default_type == 5) {
+ printk("ISA/PCI bus type with no IRQ information... falling back to ELCR\n");
+
+ if (ELCR_trigger(0) || ELCR_trigger(1) || ELCR_trigger(2) || ELCR_trigger(13))
+ printk("ELCR contains invalid data... not using ELCR\n");
+ else {
+ printk("Using ELCR to identify PCI interrupts\n");
+ ELCR_fallback = 1;
+ }
+ }
+
for (i = 0; i < 16; i++) {
if (!IO_APIC_IRQ(i))
continue;
mp_irqs[pos].mpc_irqtype = mp_INT;
- mp_irqs[pos].mpc_irqflag = 0; /* default */
+
+ if (ELCR_fallback) {
+ /*
+ * If the ELCR indicates a level-sensitive interrupt, we
+ * copy that information over to the MP table in the
+ * irqflag field (level sensitive, active high polarity).
+ */
+ if (ELCR_trigger(i))
+ mp_irqs[pos].mpc_irqflag = 13;
+ else
+ mp_irqs[pos].mpc_irqflag = 0;
+ }
+ else
+ mp_irqs[pos].mpc_irqflag = 0; /* default */
+
mp_irqs[pos].mpc_srcbus = 0;
mp_irqs[pos].mpc_srcbusirq = i;
mp_irqs[pos].mpc_dstapic = 0;
@@ -1017,13 +1059,10 @@
static void enable_edge_ioapic_irq(unsigned int irq)
{
self_IPI(irq);
- enable_IO_APIC_irq(irq);
+ unmask_IO_APIC_irq(irq);
}
-static void disable_edge_ioapic_irq(unsigned int irq)
-{
- disable_IO_APIC_irq(irq);
-}
+static void disable_edge_ioapic_irq(unsigned int irq) { /* nothing */ }
/*
* Starting up a edge-triggered IO-APIC interrupt is
@@ -1239,7 +1278,7 @@
pin1 = find_timer_pin(mp_INT);
pin2 = find_timer_pin(mp_ExtINT);
- enable_IO_APIC_irq(0);
+ unmask_IO_APIC_irq(0);
if (!timer_irq_works()) {
if (pin1 != -1)
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/i386/kernel/irq.h linux.20p9/arch/i386/kernel/irq.h
--- linux.vanilla/arch/i386/kernel/irq.h Sun Mar 25 17:31:45 2001
+++ linux.20p9/arch/i386/kernel/irq.h Thu Jul 26 17:51:35 2001
@@ -85,6 +85,7 @@
extern void init_IRQ_SMP(void);
extern int handle_IRQ_event(unsigned int, struct pt_regs *, struct irqaction *);
extern int setup_x86_irq(unsigned int, struct irqaction *);
+extern void release_x86_irqs(struct task_struct *);
/*
* Various low-level irq details needed by irq.c, process.c,
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/i386/kernel/process.c linux.20p9/arch/i386/kernel/process.c
--- linux.vanilla/arch/i386/kernel/process.c Sun Mar 25 17:31:45 2001
+++ linux.20p9/arch/i386/kernel/process.c Wed Jul 4 16:10:31 2001
@@ -544,6 +544,7 @@
void release_thread(struct task_struct *dead_task)
{
+ release_x86_irqs(dead_task);
}
/*
@@ -808,7 +809,7 @@
goto out;
error = do_execve(filename, (char **) regs.ecx, (char **) regs.edx, ®s);
if (error == 0)
- current->flags &= ~PF_DTRACE;
+ current->ptrace &= ~PT_DTRACE;
putname(filename);
out:
unlock_kernel();
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/i386/kernel/ptrace.c linux.20p9/arch/i386/kernel/ptrace.c
--- linux.vanilla/arch/i386/kernel/ptrace.c Sun Mar 25 17:31:45 2001
+++ linux.20p9/arch/i386/kernel/ptrace.c Wed Jul 4 16:03:53 2001
@@ -394,10 +394,10 @@
ret = -EPERM;
if (request == PTRACE_TRACEME) {
/* are we already being traced? */
- if (current->flags & PF_PTRACED)
+ if (current->ptrace & PT_PTRACED)
goto out;
/* set the ptrace bit in the process flags. */
- current->flags |= PF_PTRACED;
+ current->ptrace |= PT_PTRACED;
ret = 0;
goto out;
}
@@ -423,9 +423,9 @@
(current->gid != child->gid)) && !capable(CAP_SYS_PTRACE))
goto out;
/* the same process cannot be attached many times */
- if (child->flags & PF_PTRACED)
+ if (child->ptrace & PT_PTRACED)
goto out;
- child->flags |= PF_PTRACED;
+ child->ptrace |= PT_PTRACED;
write_lock_irqsave(&tasklist_lock, flags);
if (child->p_pptr != current) {
@@ -440,7 +440,7 @@
goto out;
}
ret = -ESRCH;
- if (!(child->flags & PF_PTRACED))
+ if (!(child->ptrace & PT_PTRACED))
goto out;
if (child->state != TASK_STOPPED) {
if (request != PTRACE_KILL)
@@ -542,9 +542,9 @@
if ((unsigned long) data > _NSIG)
goto out;
if (request == PTRACE_SYSCALL)
- child->flags |= PF_TRACESYS;
+ child->ptrace |= PT_TRACESYS;
else
- child->flags &= ~PF_TRACESYS;
+ child->ptrace &= ~PT_TRACESYS;
child->exit_code = data;
/* make sure the single step bit is not set. */
tmp = get_stack_long(child, EFL_OFFSET) & ~TRAP_FLAG;
@@ -579,10 +579,10 @@
ret = -EIO;
if ((unsigned long) data > _NSIG)
goto out;
- child->flags &= ~PF_TRACESYS;
- if ((child->flags & PF_DTRACE) == 0) {
+ child->ptrace &= ~PT_TRACESYS;
+ if ((child->ptrace & PT_DTRACE) == 0) {
/* Spurious delayed TF traps may occur */
- child->flags |= PF_DTRACE;
+ child->ptrace |= PT_DTRACE;
}
tmp = get_stack_long(child, EFL_OFFSET) | TRAP_FLAG;
put_stack_long(child, EFL_OFFSET, tmp);
@@ -599,7 +599,7 @@
ret = -EIO;
if ((unsigned long) data > _NSIG)
goto out;
- child->flags &= ~(PF_PTRACED|PF_TRACESYS);
+ child->ptrace &= ~(PT_PTRACED|PT_TRACESYS);
child->exit_code = data;
write_lock_irqsave(&tasklist_lock, flags);
REMOVE_LINKS(child);
@@ -710,8 +710,8 @@
asmlinkage void syscall_trace(void)
{
- if ((current->flags & (PF_PTRACED|PF_TRACESYS))
- != (PF_PTRACED|PF_TRACESYS))
+ if ((current->ptrace & (PT_PTRACED|PT_TRACESYS))
+ != (PT_PTRACED|PT_TRACESYS))
return;
current->exit_code = SIGTRAP;
current->state = TASK_STOPPED;
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/i386/kernel/signal.c linux.20p9/arch/i386/kernel/signal.c
--- linux.vanilla/arch/i386/kernel/signal.c Sun Mar 25 17:31:45 2001
+++ linux.20p9/arch/i386/kernel/signal.c Wed Jul 4 16:03:53 2001
@@ -629,7 +629,7 @@
if (!signr)
break;
- if ((current->flags & PF_PTRACED) && signr != SIGKILL) {
+ if ((current->ptrace & PT_PTRACED) && signr != SIGKILL) {
/* Let the debugger run. */
current->exit_code = signr;
current->state = TASK_STOPPED;
@@ -697,12 +697,8 @@
case SIGQUIT: case SIGILL: case SIGTRAP:
case SIGABRT: case SIGFPE: case SIGSEGV:
- lock_kernel();
- if (current->binfmt
- && current->binfmt->core_dump
- && current->binfmt->core_dump(signr, regs))
+ if (do_coredump(signr, regs))
exit_code |= 0x80;
- unlock_kernel();
/* FALLTHRU */
default:
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/i386/kernel/traps.c linux.20p9/arch/i386/kernel/traps.c
--- linux.vanilla/arch/i386/kernel/traps.c Sun Mar 25 17:37:30 2001
+++ linux.20p9/arch/i386/kernel/traps.c Wed Jul 4 16:03:53 2001
@@ -375,12 +375,12 @@
* The TF error should be masked out only if the current
* process is not traced and if the TRAP flag has been set
* previously by a tracing process (condition detected by
- * the PF_DTRACE flag); remember that the i386 TRAP flag
+ * the PT_DTRACE flag); remember that the i386 TRAP flag
* can be modified by the process itself in user mode,
* allowing programs to debug themselves without the ptrace()
* interface.
*/
- if ((tsk->flags & (PF_DTRACE|PF_PTRACED)) == PF_DTRACE)
+ if ((tsk->ptrace & (PT_DTRACE|PT_PTRACED)) == PT_DTRACE)
goto clear_TF;
}
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/i386/kernel/vm86.c linux.20p9/arch/i386/kernel/vm86.c
--- linux.vanilla/arch/i386/kernel/vm86.c Sun Mar 25 17:31:45 2001
+++ linux.20p9/arch/i386/kernel/vm86.c Wed Jul 4 16:10:31 2001
@@ -439,7 +439,7 @@
}
if (trapno !=1)
return 1; /* we let this handle by the calling routine */
- if (current->flags & PF_PTRACED) {
+ if (current->ptrace & PT_PTRACED) {
unsigned long flags;
spin_lock_irqsave(¤t->sigmask_lock, flags);
sigdelset(¤t->blocked, SIGTRAP);
@@ -620,6 +620,14 @@
return ret;
}
+void release_x86_irqs(struct task_struct *task)
+{
+ int i;
+ for (i=3; i<16; i++)
+ if (vm86_irqs[i].tsk == task)
+ free_vm86_irq(i);
+}
+
static inline void handle_irq_zombies(void)
{
int i;
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/i386/math-emu/fpu_entry.c linux.20p9/arch/i386/math-emu/fpu_entry.c
--- linux.vanilla/arch/i386/math-emu/fpu_entry.c Sun Mar 25 17:31:45 2001
+++ linux.20p9/arch/i386/math-emu/fpu_entry.c Wed Jul 4 16:03:53 2001
@@ -210,7 +210,7 @@
}
FPU_lookahead = 1;
- if (current->flags & PF_PTRACED)
+ if (current->ptrace & PT_PTRACED)
FPU_lookahead = 0;
if ( !valid_prefix(&byte1, (u_char **)&FPU_EIP,
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/m68k/kernel/ptrace.c linux.20p9/arch/m68k/kernel/ptrace.c
--- linux.vanilla/arch/m68k/kernel/ptrace.c Sun Mar 25 17:31:50 2001
+++ linux.20p9/arch/m68k/kernel/ptrace.c Wed Jul 4 16:03:53 2001
@@ -320,10 +320,10 @@
ret = -EPERM;
if (request == PTRACE_TRACEME) {
/* are we already being traced? */
- if (current->flags & PF_PTRACED)
+ if (current->ptrace & PT_PTRACED)
goto out;
/* set the ptrace bit in the process flags. */
- current->flags |= PF_PTRACED;
+ current->ptrace |= PT_PTRACED;
ret = 0;
goto out;
}
@@ -349,9 +349,9 @@
(current->gid != child->gid)) && !capable(CAP_SYS_PTRACE))
goto out;
/* the same process cannot be attached many times */
- if (child->flags & PF_PTRACED)
+ if (child->ptrace & PT_PTRACED)
goto out;
- child->flags |= PF_PTRACED;
+ child->ptrace |= PT_PTRACED;
write_lock_irqsave(&tasklist_lock, flags);
if (child->p_pptr != current) {
@@ -366,7 +366,7 @@
goto out;
}
ret = -ESRCH;
- if (!(child->flags & PF_PTRACED))
+ if (!(child->ptrace & PT_PTRACED))
goto out;
if (child->state != TASK_STOPPED) {
if (request != PTRACE_KILL)
@@ -473,9 +473,9 @@
if ((unsigned long) data > _NSIG)
goto out;
if (request == PTRACE_SYSCALL)
- child->flags |= PF_TRACESYS;
+ child->ptrace |= PT_TRACESYS;
else
- child->flags &= ~PF_TRACESYS;
+ child->ptrace &= ~PT_TRACESYS;
child->exit_code = data;
/* make sure the single step bit is not set. */
tmp = get_reg(child, PT_SR) & ~(TRACE_BITS << 16);
@@ -510,7 +510,7 @@
ret = -EIO;
if ((unsigned long) data > _NSIG)
goto out;
- child->flags &= ~PF_TRACESYS;
+ child->ptrace &= ~PT_TRACESYS;
tmp = get_reg(child, PT_SR) | (TRACE_BITS << 16);
put_reg(child, PT_SR, tmp);
@@ -527,7 +527,7 @@
ret = -EIO;
if ((unsigned long) data > _NSIG)
goto out;
- child->flags &= ~(PF_PTRACED|PF_TRACESYS);
+ child->ptrace &= ~(PT_PTRACED|PT_TRACESYS);
child->exit_code = data;
write_lock_irqsave(&tasklist_lock, flags);
REMOVE_LINKS(child);
@@ -607,8 +607,8 @@
asmlinkage void syscall_trace(void)
{
lock_kernel();
- if ((current->flags & (PF_PTRACED|PF_TRACESYS))
- != (PF_PTRACED|PF_TRACESYS))
+ if ((current->ptrace & (PT_PTRACED|PT_TRACESYS))
+ != (PT_PTRACED|PT_TRACESYS))
goto out;
current->exit_code = SIGTRAP;
current->state = TASK_STOPPED;
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/m68k/kernel/signal.c linux.20p9/arch/m68k/kernel/signal.c
--- linux.vanilla/arch/m68k/kernel/signal.c Sun Mar 25 17:31:50 2001
+++ linux.20p9/arch/m68k/kernel/signal.c Wed Jul 4 16:03:53 2001
@@ -1007,7 +1007,7 @@
if (!signr)
break;
- if ((current->flags & PF_PTRACED) && signr != SIGKILL) {
+ if ((current->ptrace & PT_PTRACED) && signr != SIGKILL) {
current->exit_code = signr;
current->state = TASK_STOPPED;
regs->sr &= ~PS_T;
@@ -1093,9 +1093,7 @@
case SIGQUIT: case SIGILL: case SIGTRAP:
case SIGIOT: case SIGFPE: case SIGSEGV:
- if (current->binfmt
- && current->binfmt->core_dump
- && current->binfmt->core_dump(signr, regs))
+ if (do_coredump(signr, regs))
exit_code |= 0x80;
/* FALLTHRU */
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/m68k/kernel/traps.c linux.20p9/arch/m68k/kernel/traps.c
--- linux.vanilla/arch/m68k/kernel/traps.c Sun Mar 25 17:31:50 2001
+++ linux.20p9/arch/m68k/kernel/traps.c Wed Jul 4 16:03:53 2001
@@ -921,7 +921,7 @@
if (fp->ptregs.sr & PS_S) {
if ((fp->ptregs.vector >> 2) == VEC_TRACE) {
/* traced a trapping instruction */
- current->flags |= PF_DTRACE;
+ current->ptrace |= PT_DTRACE;
} else
bad_super_trap(fp);
return;
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/mips/baget/irq.c linux.20p9/arch/mips/baget/irq.c
--- linux.vanilla/arch/mips/baget/irq.c Sun Mar 25 17:31:48 2001
+++ linux.20p9/arch/mips/baget/irq.c Wed Jul 4 16:03:53 2001
@@ -212,7 +212,7 @@
add_interrupt_randomness(irq);
__cli();
} else {
- printk("do_IRQ: Unregistered IRQ (0x%X) occured\n", irq);
+ printk("do_IRQ: Unregistered IRQ (0x%X) occurred\n", irq);
}
unmask_irq(irq);
hardirq_exit(cpu);
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/mips/dec/prom/memory.c linux.20p9/arch/mips/dec/prom/memory.c
--- linux.vanilla/arch/mips/dec/prom/memory.c Sun Mar 25 17:31:48 2001
+++ linux.20p9/arch/mips/dec/prom/memory.c Wed Jul 4 16:03:53 2001
@@ -25,7 +25,7 @@
extern unsigned long mips_memory_upper;
-volatile unsigned long mem_err = 0; /* So we know an error occured */
+volatile unsigned long mem_err = 0; /* So we know an error occurred */
/*
* Probe memory in 4MB chunks, waiting for an error to tell us we've fallen
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/mips/kernel/irixelf.c linux.20p9/arch/mips/kernel/irixelf.c
--- linux.vanilla/arch/mips/kernel/irixelf.c Sun Mar 25 17:31:48 2001
+++ linux.20p9/arch/mips/kernel/irixelf.c Thu Jul 26 15:53:46 2001
@@ -43,16 +43,16 @@
#undef DEBUG_ELF
static int load_irix_binary(struct linux_binprm * bprm, struct pt_regs * regs);
-static int load_irix_library(int fd);
-static int irix_core_dump(long signr, struct pt_regs * regs);
+static int load_irix_library(struct file *file);
+static int irix_core_dump(long signr, struct pt_regs * regs, struct file *);
extern int dump_fpu (elf_fpregset_t *);
static struct linux_binfmt irix_format = {
-#ifndef MODULE
- NULL, NULL, load_irix_binary, load_irix_library, irix_core_dump
-#else
- NULL, &__this_module.usecount, load_irix_binary, load_irix_library, irix_core_dump
-#endif
+ module: THIS_MODULE,
+ load_binary: load_irix_binary,
+ load_shlib: load_irix_library,
+ core_dump: irix_core_dump,
+ min_coredump: PAGE_SIZE,
};
#ifndef elf_addr_t
@@ -610,8 +610,7 @@
/* These are the functions used to load ELF style executables and shared
* libraries. There is no binary dependent code anywhere else.
*/
-static inline int do_load_irix_binary(struct linux_binprm * bprm,
- struct pt_regs * regs)
+static int load_irix_binary(struct linux_binprm * bprm, struct pt_regs * regs)
{
struct elfhdr elf_ex, interp_elf_ex;
struct dentry *interpreter_dentry;
@@ -750,16 +749,12 @@
sys_close(elf_exec_fileno);
current->personality = PER_IRIX32;
+ set_binfmt(&irix_format);
if (current->exec_domain && current->exec_domain->module)
__MOD_DEC_USE_COUNT(current->exec_domain->module);
- if (current->binfmt && current->binfmt->module)
- __MOD_DEC_USE_COUNT(current->binfmt->module);
current->exec_domain = lookup_exec_domain(current->personality);
- current->binfmt = &irix_format;
if (current->exec_domain && current->exec_domain->module)
__MOD_INC_USE_COUNT(current->exec_domain->module);
- if (current->binfmt && current->binfmt->module)
- __MOD_INC_USE_COUNT(current->binfmt->module);
compute_creds(bprm);
current->flags &= ~PF_FORKNOEXEC;
@@ -806,7 +801,7 @@
#endif
start_thread(regs, elf_entry, bprm->p);
- if (current->flags & PF_PTRACED)
+ if (current->ptrace & PT_PTRACED)
send_sig(SIGTRAP, current, 0);
return 0;
@@ -822,20 +817,10 @@
return retval;
}
-static int load_irix_binary(struct linux_binprm * bprm, struct pt_regs * regs)
-{
- int retval;
-
- MOD_INC_USE_COUNT;
- retval = do_load_irix_binary(bprm, regs);
- MOD_DEC_USE_COUNT;
- return retval;
-}
-
/* This is really simpleminded and specialized - we are loading an
* a.out library that is given an ELF header.
*/
-static inline int do_load_irix_library(struct file *file)
+static int load_irix_library(struct file *file)
{
struct elfhdr elf_ex;
struct elf_phdr *elf_phdata = NULL;
@@ -931,21 +916,6 @@
return 0;
}
-static int load_irix_library(int fd)
-{
- int retval = -EACCES;
- struct file *file;
-
- MOD_INC_USE_COUNT;
- file = fget(fd);
- if (file) {
- retval = do_load_irix_library(file);
- fput(file);
- }
- MOD_DEC_USE_COUNT;
- return retval;
-}
-
/* Called through irix_syssgi() to map an elf image given an FD,
* a phdr ptr USER_PHDRP in userspace, and a count CNT telling how many
* phdrs there are in the USER_PHDRP array. We return the vaddr the
@@ -1128,14 +1098,10 @@
* and then they are actually written out. If we run out of core limit
* we just truncate.
*/
-static int irix_core_dump(long signr, struct pt_regs * regs)
+static int irix_core_dump(long signr, struct pt_regs * regs, struct file * file)
{
int has_dumped = 0;
- struct file *file;
- struct dentry *dentry;
- struct inode *inode;
mm_segment_t fs;
- char corefile[6+sizeof(current->comm)];
int segs;
int i;
size_t size;
@@ -1148,14 +1114,6 @@
struct elf_prstatus prstatus; /* NT_PRSTATUS */
elf_fpregset_t fpu; /* NT_PRFPREG */
struct elf_prpsinfo psinfo; /* NT_PRPSINFO */
-
- if (!current->dumpable || limit < PAGE_SIZE)
- return 0;
- current->dumpable = 0;
-
-#ifndef CONFIG_BINFMT_IRIX
- MOD_INC_USE_COUNT;
-#endif
/* Count what's needed to dump, up to the limit of coredump size. */
segs = 0;
@@ -1201,27 +1159,6 @@
fs = get_fs();
set_fs(KERNEL_DS);
- memcpy(corefile,"core.", 5);
-#if 0
- memcpy(corefile+5,current->comm,sizeof(current->comm));
-#else
- corefile[4] = '\0';
-#endif
- file = filp_open(corefile, O_CREAT | 2 | O_TRUNC | O_NOFOLLOW, 0600);
- if (IS_ERR(file))
- goto end_coredump;
- dentry = file->f_dentry;
- inode = dentry->d_inode;
- if (inode->i_nlink > 1)
- goto close_coredump; /* multiple links - don't dump */
-
- if (!S_ISREG(inode->i_mode))
- goto close_coredump;
- if (!inode->i_op || !inode->i_op->default_file_ops)
- goto close_coredump;
- if (!file->f_op->write)
- goto close_coredump;
-
has_dumped = 1;
current->flags |= PF_DUMPCORE;
@@ -1386,13 +1323,7 @@
}
close_coredump:
- filp_close(file, NULL);
-
- end_coredump:
set_fs(fs);
-#ifndef CONFIG_BINFMT_ELF
- MOD_DEC_USE_COUNT;
-#endif
return has_dumped;
}
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/mips/kernel/irixsig.c linux.20p9/arch/mips/kernel/irixsig.c
--- linux.vanilla/arch/mips/kernel/irixsig.c Sun Mar 25 17:31:48 2001
+++ linux.20p9/arch/mips/kernel/irixsig.c Wed Jul 4 16:03:53 2001
@@ -193,7 +193,7 @@
if (!signr)
break;
- if ((current->flags & PF_PTRACED) && signr != SIGKILL) {
+ if ((current->ptrace & PT_PTRACED) && signr != SIGKILL) {
/* Let the debugger run. */
current->exit_code = signr;
current->state = TASK_STOPPED;
@@ -261,12 +261,8 @@
case SIGQUIT: case SIGILL: case SIGTRAP:
case SIGABRT: case SIGFPE: case SIGSEGV:
- lock_kernel();
- if (current->binfmt
- && current->binfmt->core_dump
- && current->binfmt->core_dump(signr, regs))
+ if (do_coredump(signr, regs))
exit_code |= 0x80;
- unlock_kernel();
/* FALLTHRU */
default:
@@ -707,7 +703,7 @@
if (!p->exit_code)
continue;
if (!(options & (W_TRAPPED|W_STOPPED)) &&
- !(p->flags & PF_PTRACED))
+ !(p->ptrace & PT_PTRACED))
continue;
if (ru != NULL)
getrusage(p, RUSAGE_BOTH, ru);
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/mips/kernel/ptrace.c linux.20p9/arch/mips/kernel/ptrace.c
--- linux.vanilla/arch/mips/kernel/ptrace.c Sun Mar 25 17:31:48 2001
+++ linux.20p9/arch/mips/kernel/ptrace.c Wed Jul 4 16:03:53 2001
@@ -270,12 +270,12 @@
#endif
if (request == PTRACE_TRACEME) {
/* are we already being traced? */
- if (current->flags & PF_PTRACED) {
+ if (current->ptrace & PT_PTRACED) {
res = -EPERM;
goto out;
}
/* set the ptrace bit in the process flags. */
- current->flags |= PF_PTRACED;
+ current->ptrace |= PT_PTRACED;
res = 0;
goto out;
}
@@ -306,9 +306,9 @@
goto out;
}
/* the same process cannot be attached many times */
- if (child->flags & PF_PTRACED)
+ if (child->ptrace & PT_PTRACED)
goto out;
- child->flags |= PF_PTRACED;
+ child->ptrace |= PT_PTRACED;
write_lock_irqsave(&tasklist_lock, flags);
if (child->p_pptr != current) {
@@ -322,7 +322,7 @@
res = 0;
goto out;
}
- if (!(child->flags & PF_PTRACED)) {
+ if (!(child->ptrace & PT_PTRACED)) {
res = -ESRCH;
goto out;
}
@@ -473,9 +473,9 @@
goto out;
}
if (request == PTRACE_SYSCALL)
- child->flags |= PF_TRACESYS;
+ child->ptrace |= PT_TRACESYS;
else
- child->flags &= ~PF_TRACESYS;
+ child->ptrace &= ~PT_TRACESYS;
child->exit_code = data;
wake_up_process(child);
res = data;
@@ -501,7 +501,7 @@
res = -EIO;
goto out;
}
- child->flags &= ~(PF_PTRACED|PF_TRACESYS);
+ child->ptrace &= ~(PT_PTRACED|PT_TRACESYS);
child->exit_code = data;
REMOVE_LINKS(child);
child->p_pptr = child->p_opptr;
@@ -522,8 +522,8 @@
asmlinkage void syscall_trace(void)
{
- if ((current->flags & (PF_PTRACED|PF_TRACESYS))
- != (PF_PTRACED|PF_TRACESYS))
+ if ((current->ptrace & (PT_PTRACED|PT_TRACESYS))
+ != (PT_PTRACED|PT_TRACESYS))
return;
current->exit_code = SIGTRAP;
current->state = TASK_STOPPED;
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/mips/kernel/scall_o32.S linux.20p9/arch/mips/kernel/scall_o32.S
--- linux.vanilla/arch/mips/kernel/scall_o32.S Sun Mar 25 17:31:48 2001
+++ linux.20p9/arch/mips/kernel/scall_o32.S Wed Jul 4 16:03:53 2001
@@ -15,7 +15,7 @@
#include
/* This duplicates the definition from */
-#define PF_TRACESYS 0x00000020 /* tracing system calls */
+#define PT_TRACESYS 0x00000002 /* tracing system calls */
/* This duplicates the definition from */
#define SIGILL 4 /* Illegal instruction (ANSI). */
@@ -48,8 +48,8 @@
bgez t0, stackargs
stack_done:
- lw t0, TASK_FLAGS($28) # syscall tracing enabled?
- andi t0, PF_TRACESYS
+ lw t0, TASK_PTRACE($28) # syscall tracing enabled?
+ andi t0, PT_TRACESYS
bnez t0, trace_a_syscall
jalr t2 # Do The Real Thing (TM)
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/mips/kernel/signal.c linux.20p9/arch/mips/kernel/signal.c
--- linux.vanilla/arch/mips/kernel/signal.c Sun Mar 25 17:31:48 2001
+++ linux.20p9/arch/mips/kernel/signal.c Wed Jul 4 16:03:53 2001
@@ -424,7 +424,7 @@
if (!signr)
break;
- if ((current->flags & PF_PTRACED) && signr != SIGKILL) {
+ if ((current->ptrace & PT_PTRACED) && signr != SIGKILL) {
/* Let the debugger run. */
current->exit_code = signr;
current->state = TASK_STOPPED;
@@ -493,12 +493,8 @@
case SIGQUIT: case SIGILL: case SIGTRAP:
case SIGABRT: case SIGFPE: case SIGSEGV:
case SIGBUS:
- lock_kernel();
- if (current->binfmt
- && current->binfmt->core_dump
- && current->binfmt->core_dump(signr, regs))
+ if (do_coredump(signr, regs))
exit_code |= 0x80;
- unlock_kernel();
/* FALLTHRU */
default:
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/ppc/config.in linux.20p9/arch/ppc/config.in
--- linux.vanilla/arch/ppc/config.in Sun Mar 25 17:37:30 2001
+++ linux.20p9/arch/ppc/config.in Wed Aug 8 22:18:17 2001
@@ -179,12 +179,10 @@
mainmenu_option next_comment
comment 'Mac device drivers'
-if [ "$CONFIG_INPUT_KEYBDEV" = "y" -o "$CONFIG_INPUT_MOUSEDEV" = "y" ]; then
- bool 'Use input layer for ADB keyboard and mouse' CONFIG_INPUT_ADBHID
-fi
+bool 'Use input layer for ADB keyboard and mouse' CONFIG_INPUT_ADBHID
if [ "$CONFIG_INPUT_ADBHID" = "y" ]; then
- define_bool CONFIG_INPUT_KEYBDEV $CONFIG_VT
- define_bool CONFIG_INPUT_MOUSEDEV y
+ define_bool CONFIG_INPUT_KEYBDEV $CONFIG_INPUT_ADBHID $CONFIG_VT
+ define_bool CONFIG_INPUT_MOUSEDEV $CONFIG_INPUT_ADBHID
define_bool CONFIG_MAC_HID y
bool ' Support for ADB raw keycodes' CONFIG_MAC_ADBKEYCODES
bool ' Support for mouse button 2+3 emulation' CONFIG_MAC_EMUMOUSEBTN
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/ppc/kernel/head.S linux.20p9/arch/ppc/kernel/head.S
--- linux.vanilla/arch/ppc/kernel/head.S Sun Mar 25 17:31:48 2001
+++ linux.20p9/arch/ppc/kernel/head.S Wed Jul 4 16:03:53 2001
@@ -2129,8 +2129,8 @@
cmpi 1,r0,0x6666 /* Special case for 'sys_rt_sigreturn' */
beq- 10f
beq- cr1,16f
- lwz r10,TASK_FLAGS(r2)
- andi. r10,r10,PF_TRACESYS
+ lwz r10,TASK_PTRACE(r2)
+ andi. r10,r10,PT_TRACESYS
bne- 50f
cmpli 0,r0,NR_syscalls
bge- 66f
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/ppc/kernel/mk_defs.c linux.20p9/arch/ppc/kernel/mk_defs.c
--- linux.vanilla/arch/ppc/kernel/mk_defs.c Sun Mar 25 17:31:48 2001
+++ linux.20p9/arch/ppc/kernel/mk_defs.c Wed Jul 4 16:03:53 2001
@@ -43,8 +43,9 @@
DEFINE(PGD, offsetof(struct mm_struct, pgd));
DEFINE(LAST_SYSCALL, offsetof(struct thread_struct, last_syscall));
DEFINE(PT_REGS, offsetof(struct thread_struct, regs));
- DEFINE(PF_TRACESYS, PF_TRACESYS);
+ DEFINE(PT_TRACESYS, PT_TRACESYS);
DEFINE(TASK_FLAGS, offsetof(struct task_struct, flags));
+ DEFINE(TASK_PTRACE, offsetof(struct task_struct, ptrace));
DEFINE(NEED_RESCHED, offsetof(struct task_struct, need_resched));
DEFINE(TSS_FPR0, offsetof(struct thread_struct, fpr[0]));
DEFINE(TSS_FPSCR, offsetof(struct thread_struct, fpscr));
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/ppc/kernel/openpic.c linux.20p9/arch/ppc/kernel/openpic.c
--- linux.vanilla/arch/ppc/kernel/openpic.c Sun Mar 25 17:37:30 2001
+++ linux.20p9/arch/ppc/kernel/openpic.c Wed Jul 4 16:03:53 2001
@@ -242,8 +242,8 @@
openpic_mapirq(i, 1<<0);
}
} else {
- /* Prevent any interrupt from occuring during initialisation.
- * Hum... I beleive this is not necessary, Apple does that in
+ /* Prevent any interrupt from occurring during initialisation.
+ * Hum... I believe this is not necessary, Apple does that in
* Darwin's PowerExpress code.
*/
openpic_set_priority(0, 0xf);
@@ -635,4 +635,4 @@
for (i=0; iProcessor[i].Current_Task_Priority, save_cpu_task_pri[i]);
}
-#endif /* CONFIG_PMAC_PBOOK */
\ No newline at end of file
+#endif /* CONFIG_PMAC_PBOOK */
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/ppc/kernel/pmac_pci.c linux.20p9/arch/ppc/kernel/pmac_pci.c
--- linux.vanilla/arch/ppc/kernel/pmac_pci.c Sun Mar 25 17:31:49 2001
+++ linux.20p9/arch/ppc/kernel/pmac_pci.c Wed Jul 4 16:03:53 2001
@@ -109,7 +109,7 @@
bridge_node = NULL;
node = find_pci_device_OFnode(bus, dev_fn & 0xf8);
if (node) {
- /* note: we don't stop on the first occurence since we need to go
+ /* note: we don't stop on the first occurrence since we need to go
* up to the root bridge */
do {
if (node->type && !strcmp(node->type, "pci")
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/ppc/kernel/ptrace.c linux.20p9/arch/ppc/kernel/ptrace.c
--- linux.vanilla/arch/ppc/kernel/ptrace.c Sun Mar 25 17:31:49 2001
+++ linux.20p9/arch/ppc/kernel/ptrace.c Wed Jul 4 16:03:53 2001
@@ -341,10 +341,10 @@
lock_kernel();
if (request == PTRACE_TRACEME) {
/* are we already being traced? */
- if (current->flags & PF_PTRACED)
+ if (current->ptrace & PT_PTRACED)
goto out;
/* set the ptrace bit in the process flags. */
- current->flags |= PF_PTRACED;
+ current->ptrace |= PT_PTRACED;
ret = 0;
goto out;
}
@@ -370,9 +370,9 @@
(current->gid != child->gid)) && !capable(CAP_SYS_PTRACE))
goto out;
/* the same process cannot be attached many times */
- if (child->flags & PF_PTRACED)
+ if (child->ptrace & PT_PTRACED)
goto out;
- child->flags |= PF_PTRACED;
+ child->ptrace |= PT_PTRACED;
write_lock_irqsave(&tasklist_lock, flags);
if (child->p_pptr != current) {
@@ -387,7 +387,7 @@
goto out;
}
ret = -ESRCH;
- if (!(child->flags & PF_PTRACED))
+ if (!(child->ptrace & PT_PTRACED))
goto out;
if (child->state != TASK_STOPPED) {
if (request != PTRACE_KILL)
@@ -472,9 +472,9 @@
if ((unsigned long) data > _NSIG)
goto out;
if (request == PTRACE_SYSCALL)
- child->flags |= PF_TRACESYS;
+ child->ptrace |= PT_TRACESYS;
else
- child->flags &= ~PF_TRACESYS;
+ child->ptrace &= ~PT_TRACESYS;
child->exit_code = data;
/* make sure the single step bit is not set. */
clear_single_step(child);
@@ -503,7 +503,7 @@
ret = -EIO;
if ((unsigned long) data > _NSIG)
goto out;
- child->flags &= ~PF_TRACESYS;
+ child->ptrace &= ~PT_TRACESYS;
set_single_step(child);
child->exit_code = data;
/* give it a chance to run. */
@@ -516,7 +516,7 @@
ret = -EIO;
if ((unsigned long) data > _NSIG)
goto out;
- child->flags &= ~(PF_PTRACED|PF_TRACESYS);
+ child->ptrace &= ~(PT_PTRACED|PT_TRACESYS);
child->exit_code = data;
write_lock_irqsave(&tasklist_lock, flags);
REMOVE_LINKS(child);
@@ -541,8 +541,8 @@
asmlinkage void syscall_trace(void)
{
- if ((current->flags & (PF_PTRACED|PF_TRACESYS))
- != (PF_PTRACED|PF_TRACESYS))
+ if ((current->ptrace & (PT_PTRACED|PT_TRACESYS))
+ != (PT_PTRACED|PT_TRACESYS))
return;
current->exit_code = SIGTRAP;
current->state = TASK_STOPPED;
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/ppc/kernel/signal.c linux.20p9/arch/ppc/kernel/signal.c
--- linux.vanilla/arch/ppc/kernel/signal.c Sun Mar 25 17:31:49 2001
+++ linux.20p9/arch/ppc/kernel/signal.c Wed Jul 4 16:03:53 2001
@@ -558,7 +558,7 @@
if (!signr)
break;
- if ((current->flags & PF_PTRACED) && signr != SIGKILL) {
+ if ((current->ptrace & PT_PTRACED) && signr != SIGKILL) {
/* Let the debugger run. */
current->exit_code = signr;
current->state = TASK_STOPPED;
@@ -626,12 +626,8 @@
case SIGQUIT: case SIGILL: case SIGTRAP:
case SIGABRT: case SIGFPE: case SIGSEGV:
- lock_kernel();
- if (current->binfmt
- && current->binfmt->core_dump
- && current->binfmt->core_dump(signr, regs))
+ if (do_coredump(signr, regs))
exit_code |= 0x80;
- unlock_kernel();
/* FALLTHRU */
default:
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/s390/boot/Makefile linux.20p9/arch/s390/boot/Makefile
--- linux.vanilla/arch/s390/boot/Makefile Sun Mar 25 17:31:54 2001
+++ linux.20p9/arch/s390/boot/Makefile Wed Aug 8 22:14:04 2001
@@ -24,15 +24,27 @@
$(OBJCOPY) -O binary $< $@
image: $(CONFIGURE) $(TOPDIR)/vmlinux \
- iplfba.boot ipleckd.boot ipldump.boot
+ iplfba.boot ipleckd.boot dumptape.boot dumpeckd.boot
$(OBJCOPY) -O binary $(TOPDIR)/vmlinux image
$(NM) $(TOPDIR)/vmlinux | grep -v '\(compiled\)\|\( [aU] \)\|\(\.\)\|\(LASH[RL]DI\)' | sort > $(TOPDIR)/System.map
+dumptape.lnk: dumptape.o
+ $(LD) -Ttext 0x2000 -o $@ $<
+
+dumpeckd.boot: dumpeckd.lnk
+ $(OBJCOPY) -O binary $< dumpeckd.boot2
+ dd if=dumpeckd.boot2 > dumpeckd.boot
+ dd if=dumpeckd.boot2 >> dumpeckd.boot
+ rm dumpeckd.boot2
+
+dumpeckd.lnk: dumpeckd.o
+ $(LD) -Ttext 0x2000 -o $@ $<
+
listing: ../../../vmlinux
$(OBJDUMP) --disassemble --disassemble-all --disassemble-zeroes --reloc $(TOPDIR)/vmlinux > listing
dep:
clean:
- rm -f image listing iplfba.boot ipleckd.boot ipldump.boot
+ rm -f image listing iplfba.boot ipleckd.boot dumptape.boot dumpeckd.boot *.lnk *.o
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/s390/boot/common.S linux.20p9/arch/s390/boot/common.S
--- linux.vanilla/arch/s390/boot/common.S Thu Jan 1 01:00:00 1970
+++ linux.20p9/arch/s390/boot/common.S Wed Aug 8 22:14:04 2001
@@ -0,0 +1,298 @@
+#
+# Common code for the different second stage boot loaders
+# Copyright (C) 2001 IBM Deutschland Entwicklung GmbH, IBM Corporation
+# Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com),
+#
+
+# some definitions from kernel land
+__LC_IPLDEV = 0xC6C
+IPL_DEVICE = 0x10404
+INITRD_START = 0x1040C
+INITRD_SIZE = 0x10414
+COMMAND_LINE = 0x10480
+
+# error codes shown as address in disabled wait psw
+
+EENABLE_DEV = 0x00000100 # enable device failed
+EDISABLE_DEV = 0x00000101 # disable device failed
+ESSCH = 0x00000102 # start subchannel failed
+
+ .macro stage2_start
+#
+# Function entry point at 0x2000 is called with C linkage
+# %r2-%r3: load descriptor
+# %r3 : device subchannel id
+# %r4 : load address
+#
+ basr %r1,0
+ b _load_blocklist-.(%r1)
+ .align 8
+
+#
+# Program execution of the second stage boot loader starts at 0x1008
+#
+ .globl _start
+_start: stm %r0,%r15,0x180 # store all registers
+ basr %r13,0
+0: l %r15,3f-0b(%r13) # load end of stack address
+ l %r11,0xb8 # load ipl device subchannel id
+ lr %r2,%r11
+ bas %r14,_enable_device-0b(%r13)
+ lm %r2,%r3,STAGE2_DESC # get block with load descriptors
+ lr %r4,%r11
+ l %r5,4f-0b(%r13)
+ la %r12,0(%r5) # FIXME: provide the correct offset
+ bas %r14,_load_direct-0b(%r13)
+1: lm %r2,%r5,0(%r12) # load 16 bytes = one load descriptor
+ cl %r4,6f-0b(%r13) # check type range
+ bh 2f
+ sll %r4,2
+ l %r1,5f-0b(%r4,%r13) # function pointer according to type
+ lr %r4,%r11 # pass subchannel id
+ bas %r14,0(%r1)
+2: la %r12,16(%r12) # next load descriptor
+ b 1b-0b(%r13)
+3: .long 0x10000-96
+4: .long 0x8000
+5: .long _load_kernel # type 0: kernel image
+ .long _load_parmfile # type 1: parameter file
+ .long _load_ramdisk # type 2: initial ramdisk
+ .long _jump_target # type 3: jump to target
+6: .long 3 # highest index in list
+
+_load_kernel:
+ stm %r6,%r15,24(%r15)
+ basr %r13,0 # base register
+0: s %r15,1f-0b(%r13) # create stack frame
+ lr %r12,%r4
+ bas %r14,_load_blocklist-0b(%r13)
+ st %r12,__LC_IPLDEV # old ipl device storage location
+ l %r6,2f-0b(%r13) # load address of IPL_DEVICE
+ st %r12,0(%r6) # new ipl device storage location
+ l %r6,3f-0b(%r13) # load address of INITRD_START
+ xc 0(4,%r6),0(%r6) # clear INITRD_START
+ l %r6,4f-0b(%r13) # load address of INITRD_SIZE
+ xc 0(4,%r6),0(%r6) # clear INITRD_SIZE
+ lm %r6,%r15,120(%r15)
+ br %r14
+1: .long 96
+2: .long IPL_DEVICE
+3: .long INITRD_START
+4: .long INITRD_SIZE
+
+_load_parmfile: # load parameter file to 0x10480
+ stm %r6,%r15,24(%r15)
+ basr %r13,0 # base register
+0: s %r15,1f-0b(%r13) # create stack frame
+ bas %r14,_load_blocklist-0b(%r13)
+ l %r1,12(%r12)
+ l %r2,2f-0b(%r13) # load address of kernel command line
+ mvc 0x0(256,%r2),0(%r1) # move command line to 0x10480
+ mvc 0x100(256,%r2),0x100(%r1)
+ mvc 0x200(256,%r2),0x200(%r1)
+ mvc 0x300(127,%r2),0x300(%r1)
+ xc 0x37f(1,%r2),0x37f(%r2)
+ lm %r6,%r15,120(%r15)
+ br %r14
+1: .long 96
+2: .long COMMAND_LINE
+
+_load_ramdisk: # load initial ramdisk
+ stm %r6,%r15,24(%r15)
+ basr %r13,0 # base register
+0: s %r15,1f-0b(%r13) # create stack frame
+ lr %r12,%r5 # save load address
+ bas %r14,_load_blocklist-0b(%r13)
+ l %r1,2f-0b(%r13) # ramdisk start storage location
+ st %r12,0(%r1) # store start of ramdisk
+ slr %r2,%r12
+ l %r1,3f-0b(%r13) # ramdisk size storage location
+ st %r2,0(%r1) # store size of ramdisk
+ lm %r6,%r15,120(%r15)
+ br %r14
+1: .long 96
+2: .long INITRD_START
+3: .long INITRD_SIZE
+
+_jump_target:
+ basr %r1,0
+0: lr %r2,%r11
+ lr %r14,%r5 # make branch target return address
+ b _disable_device-0b(%r1)
+
+ .endm
+
+#
+# The load descriptor is 16 bytes in length and contains 3 entries:
+# offset 0 : a blocklist descriptor (fba or eckd)
+# offset 8 : a type
+# offset 12: an address
+# The meaning of the address and the validity of the blocklst
+# depends on the type.
+# type = 0 : kernel image, blocklist valid, address = load address
+# type = 1 : parameter line, blocklist valid, address = load address
+# type = 2 : initial ramdisk, blocklist valid, address = load address
+# type = 3 : jump command, blocklist invalid, address = branch address
+#
+ .macro blocklist_traverser
+# parameter
+# %r2+%r3: blocklist head descriptor
+# %r4 : device subchannel id
+# %r5 : load address
+_load_blocklist:
+ stm %r6,%r15,24(%r15)
+ basr %r13,0 # base register
+0: s %r15,4f-0b(%r13) # create stack frame
+1: lr %r12,%r4 # save device subchannel id
+ lr %r11,%r5 # save load address
+ lr %r8,%r2 # save descriptor
+ lr %r9,%r3
+ bas %r14,_extract_length-0b(%r13) # get length from descriptor
+ lr %r10,%r2 # save returned length
+ lr %r2,%r8 # reload descriptor to %r2/%r3
+ lr %r3,%r9
+ lr %r4,%r12 # reload device id to %r4
+ l %r5,6f-0b(%r13) # get memory area for indirect block
+ bas %r14,_load_direct-0b(%r13) # load indirect block
+ lr %r5,%r11 # restore load address
+ lr %r9,%r10 # (length / 8 - 1) = # direct descr.
+ srl %r9,3
+ bctr %r9,0
+ l %r8,6f-0b(%r13)
+2: clc 0(8,%r8),5f-0b(%r13) # test block descriptor
+ be 3f-0b(%r13) # descriptor == 0 -> done
+ lm %r2,%r3,0(%r8) # pass block descriptor
+ lr %r4,%r12 # pass device subchannel id
+ bas %r14,_load_direct-0b(%r13) # load indirect block
+ lr %r5,%r2 # move updated load address
+ la %r8,8(%r8) # next descriptor
+ bct %r9,2b-0b(%r13)
+ lm %r2,%r3,0(%r8) # load continuation descriptor
+ lr %r4,%r12 # move device id for next round
+ clc 0(8,%r8),5f-0b(%r13) # test continuation descriptor
+ bne 1b-0b(%r13) # != 0 -> load next indirect block
+3: lr %r2,%r5 # return updated load address
+ lm %r6,%r15,120(%r15)
+ br %r14
+4: .long 96
+5: .long 0,0
+6: .long 0x8200 # memory address for indirect blocks
+
+ .endm
+
+ .macro device_fn
+#
+# Enable I/O on the ipl device.
+# %r2 : device subchannel id
+#
+_enable_device:
+ stm %r6,%r15,24(%r15)
+ basr %r13,0 # base register
+0: s %r15,1f-0b(%r13)
+ lr %r1,%r2
+ l %r2,4f-0b(%r13) # set panik code early
+ stsch 2f-0b(%r13)
+ oi 2f-0b+5(%r13),0x84 # enable ssch and multipath mode
+ msch 2f-0b(%r13)
+ bnz _panik-0b(%r13) # subchannel busy or in error ?
+ lctl %c6,%c6,3f-0b(%r13) # enable all interrupt classes
+ lm %r6,%r15,120(%r15)
+ br %r14
+1: .long 96
+ .align 8
+2: .fill 64,1,0
+3: .long 0xff000000 # CR6 initial value
+4: .long EENABLE_DEV
+
+#
+# Disable I/O on the ipl device.
+# %r2 : device subchannel id
+#
+_disable_device:
+ stm %r6,%r15,24(%r15)
+ basr %r13,0 # base register
+0: s %r15,1f-0b(%r13)
+ lr %r1,%r2
+ l %r2,3f-0b(%r13) # set panik code early
+ lctl %c6,%c6,2f-0b(%r13) # disable all interrupt classes
+ stsch 2f-0b(%r13)
+ ni 2f-0b+5(%r13),0x7B # disable ssch and multipath mode
+ msch 2f-0b(%r13)
+ bnz _panik-0b(%r13) # subchannel busy or in error ?
+ lm %r6,%r15,120(%r15)
+ br %r14
+1: .long 96
+ .align 8
+2: .long 0x00000000 # CR6 (all interrupts classes disabled)
+3: .long EDISABLE_DEV
+ .endm
+
+ .macro io_subroutines
+#
+# Start I/O
+# %r2 : device subchannel id
+# %r3 : address of orb
+# %r4 : address of irb
+# %r5 : retry count
+#
+_ssch:
+ stm %r6,%r15,24(%r15)
+ basr %r13,0 # base register
+0: s %r15,6f-0b(%r13) # create stack frame
+ lr %r12,%r2 # save subchannel id
+ lr %r11,%r3 # save orb
+ lr %r10,%r4 # save irb
+ lr %r9,%r5 # save retry count
+1: lr %r1,%r12
+ ssch 0(%r11) # go
+ bnz 4f-0b(%r13) # houston, we have a problem
+2: lr %r2,%r12 # call _wait4de with subchannel id
+ lr %r3,%r10 # and irb address as parameters
+ bas %r14,_wait4de-0b(%r13) # wait until DE or error
+ tm 9(%r10),0xff # test channel status
+ bnz 4f-0b(%r13)
+ tm 8(%r10),0xf3 # test device status
+ bz 5f-0b(%r13)
+ bct %r9,1b-0b(%r13) # something went wrong, retry.
+4: l %r2,7f-0b(%r13)
+ bas %r4,_panik-0b(%r13) # won't return
+5: lm %r6,%r15,120(%r15)
+ br %r14
+6: .long 96
+7: .long ESSCH
+
+#
+# Wait for interrupt subroutine
+# %r2 : device subchannel id
+# %r3 : address of irb
+#
+_wait4de:
+ lr %r1,%r2
+ basr %r4,0
+0: mvc 0x78(8),5f-0b(%r4) # set i/o new psw
+1: lpsw 4f-0b(%r4)
+2: c %r1,0xb8 # compare subchannel id
+ bne 1b-0b(%r4) # unequal -> continue waiting
+ tsch 0(%r3)
+ tm 9(%r3),0xff # test channel status
+ bnz 3f-0b(%r4)
+ tm 8(%r3),0xf3 # got something unusual ?
+ bnz 3f-0b(%r4)
+ tm 8(%r3),0x04 # got device end ?
+ bz 1b-0b(%r4) # still busy -> continue waiting
+3: br %r14
+ .align 8
+4: .long 0x020a0000,0x80000000+1b
+5: .long 0x00080000,0x80000000+2b # io new psw
+
+#
+# Panik routine. Loads a disabled wait psw
+# %r2 : panik code
+#
+_panik:
+ basr %r1,0
+0: st %r2,1f-0b+4(%r1) # store code in address part of psw
+ lpsw 1f-0b(%r1)
+ .align 8
+1: .long 0x000a0000,0x00000000
+ .endm
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/s390/boot/dumpcommon.S linux.20p9/arch/s390/boot/dumpcommon.S
--- linux.vanilla/arch/s390/boot/dumpcommon.S Thu Jan 1 01:00:00 1970
+++ linux.20p9/arch/s390/boot/dumpcommon.S Wed Aug 8 22:14:04 2001
@@ -0,0 +1,220 @@
+/*
+ * dumpcommon.S
+ *
+ * Common routines for dump records
+ * Copyright (C) 2001 IBM Deutschland Entwicklung GmbH, IBM Corporation
+ * Author(s): Michael Holzheu
+ *
+ * Uses extern functions:
+ * - _dump_mem (device dependent function to write dump)
+ *
+ * Functions:
+ * - _take_dump
+ */
+
+
+.include "common.S"
+
+/* General defines */
+#define PAGE_SIZE 0x1000 /* 4096 */
+#define HEADER_SIZE 0x1000 /* 4096 */
+#define END_MARKER_SIZE 0x10
+#define DUMP_END_MARKER 0x44554d50,0x5f454e44 /* DUMP_END */
+#define IPL_SC 0xb8 /* Address of ipl subchannel */
+#define S390_DUMP_MAGIC 0xa8190173,0x618f23fd /* magic number */
+#define ARCH_S390 0x1 /* arch flag for s390 */
+
+/* Error codes */
+#define OK 0x00000000 /* Dump completed successfully */
+#define EMEM 0x00000001 /* Device too small for dump */
+#define EDEV_INVAL 0x00000002 /* Device not supported */
+
+################################################################################
+# Take the dump
+################################################################################
+
+.macro dump_common_fn:
+
+_take_dump:
+ stm %r6,%r15,24(%r15)
+ basr %r13,0
+.Lbase: s %r15,.Lc96-.Lbase(%r13) # create stack frame
+ bas %r14,_store_status-.Lbase(%r13) # store status
+ bas %r14,_count_mem-.Lbase(%r13) # count memory
+ l %r14,.Ldump_mem-.Lbase(%r13)
+ basr %r14,%r14 # dump memory
+ la %r2,OK
+ bas %r14,_panik-.Lbase(%r13) # everything ok: stop now
+
+################################################################################
+# Find out memory size:
+# When accessing a page which is not there, we get a program check
+################################################################################
+
+_count_mem:
+ stm %r6,%r15,24(%r15)
+ basr %r13,0 # base register
+0: s %r15,.Lc96-0b(%r13) # create stack frame
+ slr %r9,%r9 # base register for zero page
+ mvc 104(8,%r9),.Lcount_mem_psw-0b(%r13) # setup program check new psw
+ slr %r10,%r10
+ la %r11,1
+ sll %r11,20 # 1 MB
+.Lloop0:
+ l %r12,0(%r10) # test page
+ ar %r10,%r11 # add 1M
+ bnm .Lloop0-0b(%r13) # r10 < 0x80000000 -> loop
+.Lchkmem0:
+ n %r10,.L4malign0-0b(%r13) # align to multiples of 4M
+ st %r10,.Ldh_mem_size+4-0b(%r13) # store memory size
+ st %r10,.Ldh_mem_end+4-0b(%r13) # store memory end
+ srl %r10,12 # calculate page count (/ 4096)
+ st %r10,.Ldh_num_pages-0b(%r13) # store page count
+ mvc 88(32,%r9),.Lnew_psws-0b(%r13) # restore disabled wait new psws
+ lm %r6,%r15,120(%r15)
+ br %r14
+.Lcount_mem_psw: .long 0x00080000,0x80000000 + .Lchkmem0
+.Lnew_psws:
+.long 0x000a0000,0x00000058 # external new psw
+.long 0x000a0000,0x00000060 # svc new psw
+.long 0x000a0000,0x00000068 # program check new psw
+.long 0x000a0000,0x00000070 # machine check new psw
+.L4malign0:
+.long 0xffc00000
+
+################################################################################
+# store status of all cpus in their lowcores
+################################################################################
+
+
+_store_status:
+ stm %r6,%r15,24(%r15)
+ basr %r13,0 # base register
+0: s %r15,.Lc96-0b(%r13)
+ la %r7,0x0 # base register for 0 page
+
+ ######## move lowcore info (assume user has made store ########
+ ######## status) to prefix-page ########
+
+ lr %r2,%r7 # zero page (source)
+ bas %r14,_copy_lowcore-0b(%r13)
+
+ ######## stop all cpus and store status in prefix pages ########
+
+.Lstore_all:
+ la %r8,0 # first cpu
+ stap .Lcurrent_cpu+2-0b(%r13) # store current cpu address
+
+.Lstatus_loop:
+ cl %r8,.Lcurrent_cpu-0b(%r13) # is ipl cpu ?
+ be .Lnext_cpu-0b(%r13) # if yes get next cpu
+.Lstop_loop:
+ sigp %r9,%r8,0x5 # stop cpu
+ bc 8,.Lcpu_stopped-0b(%r13) # accepted
+ bc 4,.Lnext_cpu-0b(%r13) # status stored in register:
+ # next cpu
+ bc 2,.Lstop_loop-0b(%r13) # busy: try again
+ bc 1,.Lnext_cpu-0b(%r13) # not op: next cpu
+.Lcpu_stopped:
+ lr %r9,%r7
+ sigp %r9,%r8,0xe # store status of cpu
+ bc 8,.Lcpu_stored-0b(%r13) # accepted
+ bc 4,.Lnext_cpu-0b(%r13) # status stored: next cpu
+ bc 2,.Lcpu_stopped-0b(%r13) # busy: try again
+ bc 1,.Lnext_cpu-0b(%r13) # not op: next cpu
+.Lcpu_stored:
+ lr %r2,%r7 # zero page (source)
+ bas %r14,_copy_lowcore-0b(%r13)
+.Lnext_cpu:
+ la %r8,1(%r8) # next cpu (r8 +=1)
+ cl %r8,.Llast_cpu-0b(%r13) # is last possible cpu ?
+ bl .Lstatus_loop-0b(%r13) # jump if not last cpu
+.Lstore_status_exit:
+ lm %r6,%r15,120(%r15)
+ br %r14 # return to caller
+.Lcurrent_cpu:
+ .long 0x0
+.Llast_cpu:
+ .long 0x0000ffff
+
+############1###################################################################
+# copy lowcore to prefix page
+# r2: address of source lowcore (input by caller)
+################################################################################
+
+_copy_lowcore:
+ stm %r6,%r15,24(%r15)
+ basr %r13,0 # base register
+0: s %r15,.Lc96-0b(%r13)
+
+ l %r3,0x108(%r2) # get prefix page from lowcore
+
+ ###### check if lowcore address looks valid ######
+
+ cl %r3,.Llinux_start-0b(%r13) # looks valid ?
+ bl .Lcpy_locore_exit-0b(%r13) # if < linux-start addr
+ l %r6,.Lpage_align-0b(%r13) # check page alignment
+ nr %r3,%r6
+ cl %r3,0x108(%r2)
+ bnz .Lcpy_locore_exit-0b(%r13) # if not page aligned
+
+ ###### copy lowcore ######
+
+ # |-----------------------------------------------------------|
+ # | Decimal | Length | Data |
+ # | Address | in Bytes | |
+ # |_________|___________|_____________________________________|
+ # | 212 | 4 | Extended save area address |
+ # | 216 | 8 | CPU timer |
+ # | 224 | 8 | Clock comparator |
+ # | 256 | 8 | Current PSW |
+ # | 264 | 4 | Prefix register |
+ # | 288 | 64 | Access registers 0 through 15 |
+ # | 352 | 32 | Floating-point registers 0 through 6|
+ # | 384 | 64 | General registers 0 through 15 |
+ # | 448 | 64 | Control registers 0 through 15 |
+ # |_________|___________|_____________________________________|
+
+ mvc 212(20,%r3),212(%r2)
+ mvc 256(12,%r3),256(%r2)
+ mvc 288(224,%r3),288(%r2)
+
+.Lcpy_locore_exit:
+ lm %r6,%r15,120(%r15)
+ br %r14 # return to caller
+.Lpage_align:
+ .long -4096
+
+.align 4
+.Ldump_mem: .long _dump_mem # address of function
+
+.Llinux_start:
+ .long 0x10000
+.Lc96: .long 96 # for creating stackframes
+.align 8
+#
+# The Dump header
+#
+.Ldh_dumpheader:
+.Ldh_magic_number:.long S390_DUMP_MAGIC
+.Ldh_version: .long 0x00000001
+.Ldh_header_size: .long HEADER_SIZE
+.Ldh_dump_level: .long 0x00000004 # DUMP_ALL
+.Ldh_page_size: .long PAGE_SIZE
+.Ldh_mem_size: .long 0x00000000,0x00000000
+.Ldh_mem_start: .long 0x00000000,0x00000000
+.Ldh_mem_end: .long 0x00000000,0x00000000
+.Ldh_num_pages: .long 0x00000000
+.Ldh_pad: .long 0x00000000
+.Ldh_time: .long 0x00000000,0x00000000
+.Ldh_cpuid: .long 0x00000000,0x00000000
+.Ldh_arch: .long ARCH_S390
+.Ldh_free: .long 0x00000000
+#
+# Dump End Marker
+#
+.align 8
+.Ld_endmarker: .long DUMP_END_MARKER
+.Ld_end_time: .long 0x00000000,0x00000000
+
+.endm
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/s390/boot/dumpeckd.S linux.20p9/arch/s390/boot/dumpeckd.S
--- linux.vanilla/arch/s390/boot/dumpeckd.S Thu Jan 1 01:00:00 1970
+++ linux.20p9/arch/s390/boot/dumpeckd.S Wed Aug 8 22:14:04 2001
@@ -0,0 +1,548 @@
+/*
+ * Dump boot loader for 3380/3390 DASDs
+ * Copyright (C) 2001 IBM Deutschland Entwicklung GmbH, IBM Corporation
+ * Author(s): Michael Holzheu
+ * Holger Smolinski
+ *
+ * Uses extern functions:
+ * - _panik
+ * - _enable_device
+ * - _take_dump
+ *
+ * Functions:
+ * - _dump_mem
+ */
+
+#include "dumpcommon.S"
+
+/* General defines */
+
+#define IPL_BS 0x1000
+#define BLOCKS_PER_WRITE 64 /* makes 256K with 4K blksize */
+
+#ifdef ZIPL
+
+################################################################################
+# Function entry point at 0x2000 (not used for dump) is called with C linkage
+# %r2-%r3: load descriptor
+# %r3 : device subchannel id
+# %r4 : load address
+################################################################################
+
+ basr %r1,0
+ b _not_implemented-.(%r1)
+ .align 8
+
+#else
+
+#define DUMP_TOOL_START 0x2000
+
+################################################################################
+# one psw and two ccws:
+# Re-Read enough of bootsector to start
+################################################################################
+
+.psw: .long 0x00080000,0x80000000+_start
+.ccw1: .long 0x06000000 + DUMP_TOOL_START,0x00000000 + IPL_BS
+.ccw2: .long 0x00000000,0x00000000
+
+#endif /* ZIPL */
+
+################################################################################
+# Program execution of the second stage boot loader starts at 0x2008
+################################################################################
+
+ .globl _start
+_start: basr %r13,0
+0: l %r15,1f-0b(%r13) # load end of stack address
+ l %r11,IPL_SC # load ipl device subchannel id
+ lr %r2,%r11
+ l %r14,.Lenable_device-0b(%r13)
+ basr %r14,%r14
+ bas %r14,_get_device_characteristics-0b(%r13)
+ l %r5,.Ldev_end_rec-0b(%r13) # endblock (first block = nr 1)
+ st %r5,.Ldev_bpt-0b(%r13)
+ l %r5,.Ldev_blk_size-0b(%r13) # get blocksize
+ stcm %r5,3,.Lwrccw+2-0b(%r13) # store blocksize into wr template
+ stcm %r5,3,.Llodata+14-0b(%r13) # store blocksize into lodata
+ l %r14,.Ltake_dump-0b(%r13)
+ basr %r14,%r14
+1: .long 0x10000-96 # end of stack
+
+#ifdef ZIPL
+
+################################################################################
+# Get the device characteristics:
+#
+# Get device characteristics from zipl parameters (at 0x218)
+# The following parameter format is expected 2x8 byte:
+#
+# Dump Start: CCHH RBBN
+# Dump End: CCHH RBBX
+#
+# - CC: Start/End Cylinder Number
+# - HH: Start/End Head Number
+# - R : Start/End Record Number
+# - BB: Blocksize
+# - N : Number of Heads of DASD
+# - X : Unused
+#
+# Cylinder, Heads are counted starting with 0.
+# Records are counted starting with 1.
+# We assume that the End Record Number is at track boundary.
+# This allows us to determine the number of Blocks Per Track.
+################################################################################
+
+_get_device_characteristics:
+ stm %r6,%r15,24(%r15)
+ basr %r13,0 # base register
+0: s %r15,.Lc96-0b(%r13) # create stack frame
+ la %r12,0 # load base register
+ mvc .Ldev_start_cyl-0b+2(2,%r13),0x218(%r12)
+ mvc .Ldev_start_hd-0b+2(2,%r13),0x21a(%r12)
+ mvc .Ldev_start_rec-0b+3(1,%r13),0x21c(%r12)
+ mvc .Ldev_blk_size-0b+2(2,%r13),0x21d(%r12)
+ mvc .Ldev_nr_hds-0b+3(1,%r13),0x21f(%r12)
+ mvc .Ldev_end_cyl-0b+2(2,%r13),0x220(%r12)
+ mvc .Ldev_end_hd-0b+2(2,%r13),0x222(%r12)
+ mvc .Ldev_end_rec-0b+3(1,%r13),0x224(%r12)
+ lm %r6,%r15,120(%r15)
+ br %r14
+
+#else
+
+################################################################################
+# Get the device characteristics:
+#
+# The following is fix:
+# - blocksize = 4K
+# - start cylinder = 0
+# - start head = 0
+# - start record = 4
+# - end cylinder = unlimited
+# - end head = nr of heads
+# - end record = blocks per track
+#
+# The following is read from the device characteristics
+#
+# - model 3380/90 ==> blocks per track
+# - nr of heads
+#
+################################################################################
+
+_get_device_characteristics:
+ stm %r6,%r15,24(%r15)
+ basr %r13,0 # base register
+0: s %r15,.Lc96-0b(%r13) # create stack frame
+ la %r6,.Lrdcccw-0b(%r13)
+ st %r6,.Lorb+8-0b(%r13) # store cp-address to orb
+ l %r2,IPL_SC
+ la %r3,.Lorb-0b(%r13)
+ la %r4,.Lirb-0b(%r13)
+ la %r5,2
+ bas %r14,_ssch-0b(%r13) # start I/O: Read device characteristic
+
+ # find out blocks per track (bpt)
+
+ la %r6,9
+ clc .Lrdcdata+3-0b(2,%r13),.L9345-0b(%r13)
+ be 1f-0b(%r13)
+ la %r6,10
+ clc .Lrdcdata+3-0b(2,%r13),.L3380-0b(%r13)
+ be 1f-0b(%r13)
+ la %r6,12
+ clc .Lrdcdata+3-0b(2,%r13),.L3390-0b(%r13)
+ be 1f-0b(%r13)
+
+ # not supported device panik
+
+ la %r2,EDEV_INVAL
+ l %r14,.Lpanik-0b(%r13)
+ basr %r14,%r14
+
+1:
+ # store dev characteristic
+
+ st %r6,.Ldev_end_rec-0b(%r13)
+
+ slr %r6,%r6
+ icm %r6,3,.Lrdcdata+14-0b(%r13)
+ st %r6,.Ldev_end_hd-0b(%r13)
+ st %r6,.Ldev_nr_hds-0b(%r13)
+
+ la %r6,0
+ st %r6,.Ldev_start_cyl-0b(%r13)
+ la %r6,0
+ st %r6,.Ldev_start_hd-0b(%r13)
+ la %r6,4
+ st %r6,.Ldev_start_rec-0b(%r13)
+ l %r6,.Lblk_size-0b(%r13)
+ st %r6,.Ldev_blk_size-0b(%r13)
+ l %r6,.Lend_cyl-0b(%r13)
+ st %r6,.Ldev_end_cyl-0b(%r13)
+
+ lm %r6,%r15,120(%r15)
+ br %r14
+.L3390:
+ .word 0x3390
+.L9345:
+ .word 0x9345
+.L3380:
+ .word 0x3380
+.Lend_cyl:
+ .long 0x0000ffff
+.Lblk_size:
+ .long 0x1000
+.align 8
+
+.Lrdcdata:
+ .long 0x00000000,0x00000000
+ .long 0x00000000,0x00000000
+ .long 0x00000000,0x00000000
+ .long 0x00000000,0x00000000
+ .long 0x00000000,0x00000000
+ .long 0x00000000,0x00000000
+ .long 0x00000000,0x00000000
+ .long 0x00000000,0x00000000
+.Lrdcccw:
+ .long 0x64000040,0x00000000+.Lrdcdata # read device characteristics
+
+#endif /* ZIPL */
+
+################################################################################
+# Dump memory
+################################################################################
+
+_dump_mem:
+ stm %r6,%r15,24(%r15)
+ basr %r13,0 # base register
+0: s %r15,.Lc96-0b(%r13) # create stack frame
+
+ # calculate start and end block
+
+ la %r6,0
+ l %r7,.Ldev_start_cyl-0b(%r13)
+ la %r8,0
+ l %r9,.Ldev_start_hd-0b(%r13)
+ l %r10,.Ldev_start_rec-0b(%r13)
+ l %r11,.Ldev_nr_hds-0b(%r13)
+ l %r12,.Ldev_bpt-0b(%r13) # = blocks per track
+
+ # calculate start block
+ #######################
+
+ # cyl * nr_hds * blkptr
+
+ mr %r6,%r11
+ mr %r6,%r12
+
+ # hd * recs
+
+ mr %r8,%r12
+
+ # start block = cyl * nr_hds * bptr + hd * bptr + rec
+
+ ar %r7,%r9
+ ar %r7,%r10
+
+ bctr %r7,0 # decrement, we start counting
+ # beginning with block 0
+
+ st %r7,.Ldev_start_blk-0b(%r13)
+
+
+
+ # calculate end block
+ #######################
+
+ l %r7,.Ldev_end_cyl-0b(%r13)
+ l %r9,.Ldev_end_hd-0b(%r13)
+
+ # cyl * nr_hds * blkptr
+
+ mr %r6,%r11
+ mr %r6,%r12
+
+ # hd * recs
+
+ mr %r8,%r12
+
+ # end block = cyl * nr_hds * bptr + hd * bptr + rec
+
+ ar %r7,%r9
+ ar %r7,%r12
+
+ bctr %r7,0 # decrement, we start counting
+ # beginning with block 0
+
+ st %r7,.Ldev_end_blk-0b(%r13)
+
+ # calculate bytes per write (blksize * blwr)
+
+ l %r11,.Ldev_blk_size-0b(%r13)
+ mh %r11,.Lblocks_per_write-0b(%r13)
+ st %r11,.Lbytes_per_write-0b(%r13)
+
+# write header
+
+.Lheaders: # write dump headers
+ stck .Ldh_time-0b(%r13) # store time
+ stidp .Ldh_cpuid-0b(%r13) # store cpu id
+
+ l %r11,.Ldev_start_blk-0b(%r13) # start block
+
+ lr %r2,%r11
+ la %r3,.Ldh_dumpheader-0b(%r13) # address of dump header
+
+ l %r4,.Lheader_size-0b(%r13)
+ srda %r4,32 # shift ==> 64 bit number
+ l %r6,.Ldev_blk_size-0b(%r13) # get blocksize
+
+ dr %r4,%r6 # nr of blocks for header =
+ # HEADER_SIZE / BLOCKSIZE = r5
+ lr %r4,%r5
+ lr %r12,%r5 # save nr of blocks
+ bas %r14,_writeblock-0b(%r13) # write block to disk
+ ar %r11,%r12 # update block counter
+
+.Lmemory: # write memory
+
+# write memory
+
+ la %r10,0 # start at address 0
+
+.Lmloop:
+ la %r4,BLOCKS_PER_WRITE # write so many blocks at a time
+ lr %r2,%r11 # restore r2
+ lr %r3,%r10 # restore r3
+ bas %r14,_writeblock-0b(%r13) # write block to disk
+ l %r2,.Lbytes_per_write-0b(%r13)
+ ar %r10,%r2 # update data address
+ ah %r11,.Lblocks_per_write-0b(%r13) # skip to next block
+ l %r3,.Ldh_mem_size+4-0b(%r13) # get memsize
+ clr %r10,%r3 # enough ?
+ bl .Lmloop-0b(%r13) # branch if r10 < r3
+
+# write end marker
+
+.lendmarker: # terminate dump file
+ la %r4,1 # write endmaker with one block
+ stck .Ld_end_time-0b(%r13) # store end time
+ lr %r2,%r11 # restore r2
+ la %r3,.Ld_endmarker-0b(%r13) # address of dump end marker
+ la %r4,1 # write 4k at a time
+ bas %r14,_writeblock-0b(%r13) # write block to disk
+
+ lm %r6,%r15,120(%r15)
+ br %r14 # return to caller
+.Lbytes_per_write: .long 0x00000000
+.Lheader_size: .long HEADER_SIZE
+.Lblocks_per_write: .word BLOCKS_PER_WRITE
+
+################################################################################
+# This function writes a block number given in r2 to disk
+# r2: number of first block to write ( input by caller )
+# We start counting with Block Nr 0 !!!
+# r3: address to write data from ( input by caller )
+# r4: number of blocks to write ( input by caller )
+################################################################################
+
+_writeblock:
+ stm %r6,%r15,24(%r15)
+ basr %r13,0 # base register
+0: s %r15,.Lc96-0b(%r13) # create stack frame
+
+ # check if blocks are within range:
+
+ lr %r11,%r2
+ ar %r11,%r4 # End block
+ l %r12,.Ldev_end_blk-0b(%r13)
+ clr %r11,%r12 # End block < dev_end_blk ?
+ bl 1f-0b(%r13) # no
+ la %r2,EMEM # if yes panik
+ l %r14,.Lpanik-0b(%r13)
+ basr %r14,%r14
+
+1: la %r12,.Ldeccw-0b(%r13)
+ st %r12,8+.Lorb-0b(%r13) # store cpaddr to orb
+ la %r12,.Lwrccw-0b(%r13)
+ oi 1(%r12),0x40 # set CC in wr template
+
+ # first setup the write channel program
+
+ lr %r11,%r4 # save number of blocks
+
+ l %r6,.Ldev_bpt-0b(%r13) # load bpt to r6
+ l %r7,.Ldev_nr_hds-0b(%r13) # load heads to r7
+ la %r5,.Lwrloop-0b(%r13)
+ br %r5 /* FIXME */
+
+2: # loop for number of block (nbl) time
+
+ # switch to next write CCW
+
+ l %r5,.Ldev_blk_size-0b(%r13)
+ ar %r3,%r5 # add blksize to destination addr
+ ah %r12,.Lccw_size-0b(%r13) # add sizeof(ccw) to base address
+ mvc 0(8,%r12),.Lwrccw-0b(%r13) # copy template to this ccw
+
+.Lwrloop:
+
+ # build up next write CCW
+
+ st %r3,4(%r12) # store target addr to this ccw
+ bct %r4,2b-0b(%r13) # decrement no of blks still to do
+ ni 1(%r12),0x3f # no command chaining for last ccw
+
+ # write CCWs are setup now
+
+ lr %r4,%r11 # restore number of blocks
+ stcm %r4,3,.Llodata+2-0b(%r13) # store number of blocks to lodata
+
+ # compute end block
+
+ ar %r4,%r2 # r4: ebl = blk + nbl
+ bctr %r4,0 # decrement r4 (last blk touched)
+
+ # compute start track and start block on track
+
+ srda %r2,32 # shift ==> 64 bit number
+ dr %r2,%r6 # trk = blk / bpt, bot = blk % bpt
+ # r3: trk, r2: bot
+ la %r2,1(%r2) # bot++ ( we start counting at 1 )
+ stcm %r2,1,.Llodata+12-0b(%r13) # store bot to lodata
+
+ # compute start cylinder and head
+
+ xr %r2,%r2 # clear bot
+ dr %r2,%r7 # cy=trk / heads, hd=trk % heads
+ # r3: cy, r2: hd
+ sll %r3,16 # combine to CCHH in r3
+ or %r3,%r2
+ st %r3,.Ldedata+8-0b(%r13) # store cchh to dedata
+ st %r3,.Llodata+4-0b(%r13) # store cchh to lodata
+ st %r3,.Llodata+8-0b(%r13) # store cchh to lodata
+
+ # compute end track and end block on track
+
+ lr %r11,%r5 # save r5
+ srda %r4,32 # shift ==> 64 bit number
+ dr %r4,%r6 # tr2 = ebl / bpt
+ # r5: tr2, r4: bot2
+ # compute end cylinder and head
+
+ xr %r4,%r4 # cy2=tr2/heads, hd2=hd2 % heads
+ dr %r4,%r7 # r5: cy2, r4: hd2
+ stcm %r5,3,.Ldedata+12-0b(%r13) # store cy2,hd2 to dedata
+ stcm %r4,3,.Ldedata+14-0b(%r13) # store cy2,hd2 to dedata
+ lr %r5,%r11 # restore r5
+
+ # CCWs are setup now, arent they?
+
+ l %r2,IPL_SC # subchannel id
+ la %r3,.Lorb-0b(%r13)
+ la %r4,.Lirb-0b(%r13)
+ la %r5,10 # initialize retries
+
+ bas %r14,_ssch-0b(%r13) # start I/O
+
+ lm %r6,%r15,120(%r15)
+ br %r14 # return to caller
+.Lccw_size:
+ .word 0x8
+.align 8
+.Lorb:
+ .long 0x0049504c,0x0080ff00 # intparm is " IPL"
+ .long 0x00000000,0x00000000
+.Lirb:
+ .long 0x00000000,0x00000000
+ .long 0x00000000,0x00000000
+ .long 0x00000000,0x00000000
+ .long 0x00000000,0x00000000
+ .long 0x00000000,0x00000000
+ .long 0x00000000,0x00000000
+ .long 0x00000000,0x00000000
+ .long 0x00000000,0x00000000
+.Ldedata:
+ .long 0x80c00000,0x00000000
+ .long 0x00000000,0x00000000
+.Llodata:
+ .long 0x01800001,0x00000000
+ .long 0x00000000,0x03000000
+ .long 0x12345678,0x00000000
+
+################################################################################
+# read function not implemented: return EINVAL
+################################################################################
+
+_not_implemented:
+ la %r2,22 /* EINVAL */
+ lcr %r2,%r2 /* -EINVAL */
+ br %r14
+
+################################################################################
+# expand Macros
+################################################################################
+
+ dump_common_fn
+ device_fn
+ io_subroutines
+
+
+################################################################################
+# DATA
+################################################################################
+
+# extern functions
+
+.Lpanik:
+ .long _panik
+.Lenable_device:
+ .long _enable_device
+.Ltake_dump:
+ .long _take_dump
+
+# device characteristics
+.align 8
+.Ldev_start_cyl:
+ .long 0x00000000
+.Ldev_start_hd:
+ .long 0x00000000
+.Ldev_start_rec:
+ .long 0x00000000
+.Ldev_blk_size:
+ .long 0x00000000
+.Ldev_nr_hds:
+ .long 0x00000000
+.Ldev_end_cyl:
+ .long 0x00000000
+.Ldev_end_hd:
+ .long 0x00000000
+.Ldev_end_rec:
+ .long 0x00000000
+
+
+.Ldev_start_blk:
+ .long 0x00000000
+.Ldev_end_blk:
+ .long 0x00000000
+.Ldev_bpt:
+ .long 0x00000000
+
+
+#
+# CCWs
+#
+
+.align 8
+
+# channel program for one write
+
+.Ldeccw:
+ .long 0x63400010,0x00000000+.Ldedata # define extent
+.Lloccw:
+ .long 0x47400010,0x00000000+.Llodata # locate record
+.Lwrccw:
+ .long 0x8d000000,0x00000000 # update Key & data
+
+.org IPL_BS
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/s390/boot/dumptape.S linux.20p9/arch/s390/boot/dumptape.S
--- linux.vanilla/arch/s390/boot/dumptape.S Thu Jan 1 01:00:00 1970
+++ linux.20p9/arch/s390/boot/dumptape.S Wed Aug 8 22:14:04 2001
@@ -0,0 +1,183 @@
+/*
+ * Dump boot loader for 3480/3490 tape devices
+ * Copyright (C) 1999-2001 IBM Deutschland Entwicklung GmbH, IBM Corporation
+ * Author(s): Michael Holzheu (holzheu@de.ibm.com),
+ * Martin Schwidefsky (schwidefsky@de.ibm.com)
+ *
+ * Uses extern functions:
+ * - _panik
+ * - _enable_device
+ * - _take_dump
+ *
+ * Functions:
+ * - _dump_mem
+ */
+
+#include "dumpcommon.S"
+
+#define IPL_BS 0x1000
+#define BLOCK_SIZE 0x8000 /* 32 KB */
+#define DUMP_TOOL_START 0x2000 /* tool is loaded to this address in order */
+ /* not to overwrite page 0 */
+
+################################################################################
+# The first 24 bytes are loaded by ipl to addresses 0-23. (a PSW and two CCWs)
+################################################################################
+
+ # psw
+ .long 0x00080000,0x80000000+_start
+ # rewind ccw
+ .long 0x07000000,0x60000001
+ # ccw to load dump utility to 0x1000
+ .long 0x02000000+DUMP_TOOL_START ,0x20000000+IPL_BS
+
+.globl _start
+_start: basr %r13,0
+0: l %r15,1f-0b(%r13) # load end of stack address
+ l %r11,IPL_SC # load ipl device subchannel id
+ lr %r2,%r11
+ l %r14,.Lenable_device-0b(%r13)
+ basr %r14,%r14
+ l %r14,.Ltake_dump-0b(%r13)
+ basr %r14,%r14
+1: .long 0x10000-96 # end of stack
+
+################################################################################
+# Dump memory
+################################################################################
+
+_dump_mem:
+ stm %r6,%r15,24(%r15)
+ basr %r13,0 # base register
+0: s %r15,.Lc96-0b(%r13) # create stack frame
+#
+# first write a tape mark
+#
+ bas %r14,_tapemark-0b(%r13)
+#
+# write header
+#
+ stck .Ldh_time-0b(%r13) # store time
+ stidp .Ldh_cpuid-0b(%r13) # store cpu id
+ la %r2,.Ldh_dumpheader-0b(%r13) # start of header
+ l %r3,.Lheader_size-0b(%r13) # size of header
+ lr %r4,%r3 # blocksize
+ bas %r14,_writer-0b(%r13)
+
+#
+# write real storage to tape
+#
+
+ la %r2,0 # start
+ l %r3,.Ldh_mem_size+4-0b(%r13) # length
+ l %r4,.Lblock_size-0b(%r13) # blocksize
+ bas %r14,_writer-0b(%r13) # write page
+#
+# write end marker
+#
+ stck .Ld_end_time-0b(%r13) # store end time
+ la %r2,.Ld_endmarker-0b(%r13) # address of end marker
+ la %r3,END_MARKER_SIZE # size of end marker
+ la %r4,END_MARKER_SIZE # blocksize
+ bas %r14,_writer-0b(%r13)
+#
+# write another tape mark
+#
+ bas %r14,_tapemark-0b(%r13)
+
+ lm %r6,%r15,120(%r15)
+ br %r14 # return to caller
+.Lheader_size: .long HEADER_SIZE
+.Lblock_size: .long BLOCK_SIZE
+
+################################################################################
+# subroutine for writing to tape
+# Parameters:
+# -r2: start address
+# -r3: length
+# -r4: blocksize
+################################################################################
+
+_writer:
+ stm %r6,%r15,24(%r15)
+ basr %r13,0 # base register
+0: s %r15,.Lc96-0b(%r13) # create stack frame
+
+ lr %r10,%r2 # save start address
+ lr %r11,%r3 # save length
+ ar %r11,%r2 # end address
+ lr %r12,%r4 # save blocksize
+
+ st %r10,.Lccwwrite+4-0b(%r13) # initialize CCW data addresses
+ sth %r12,.Lccwwrite+2-0b(%r13) # setup blocksize
+.Lldlp:
+ l %r2,IPL_SC # subchannel id
+ la %r3,.Lorbwrite-0b(%r13) # address of orb
+ la %r4,.Lirb-0b(%r13) # address of irb
+ la %r5,10 # 10 retries
+ bas %r14,_ssch-0b(%r13) # write chunk of PAGE_SIZE bytes
+
+ l %r0,.Lccwwrite+4-0b(%r13) # update CCW data addresses
+ ar %r0,%r12 # add block size
+ st %r0,.Lccwwrite+4-0b(%r13)
+ clr %r0,%r11 # enough ?
+ bl .Lldlp-0b(%r13)
+
+ lm %r6,%r15,120(%r15)
+ br %r14
+
+################################################################################
+# write tapemark
+################################################################################
+
+_tapemark:
+ stm %r6,%r15,24(%r15)
+ basr %r13,0 # base register
+0: s %r15,.Lc96-0b(%r13) # create stack frame
+
+ l %r2,IPL_SC # subchannel id
+ la %r3,.Lorbmark-0b(%r13) # r12 = address of orb
+ la %r4,.Lirb-0b(%r13) # r5 = address of irb
+ la %r5,10 # retries
+ bas %r14,_ssch-0b(%r13) # write a tape mark
+
+ lm %r6,%r15,120(%r15)
+ br %r14 # return to caller
+
+################################################################################
+# expand Macros
+################################################################################
+
+dump_common_fn
+device_fn
+io_subroutines
+
+################################################################################
+# DATA
+################################################################################
+
+# extern functions
+
+.Lpanik:
+ .long _panik
+.Lenable_device:
+ .long _enable_device
+.Ltake_dump:
+ .long _take_dump
+
+# irbs, orbs etc.
+
+ .align 8
+.Lorbwrite:
+ .long 0x00000000,0x0080ff00,.Lccwwrite
+ .align 8
+.Lorbmark:
+ .long 0x00000000,0x0080ff00,.Lccwmark
+ .align 8
+.Lccwwrite:
+ .long 0x01200000,0x00000000
+.Lccwmark:
+ .long 0x1f200001,0x00000000
+
+.Lirb: .long 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+.org IPL_BS
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/s390/boot/ipldump.S linux.20p9/arch/s390/boot/ipldump.S
--- linux.vanilla/arch/s390/boot/ipldump.S Sun Mar 25 17:31:55 2001
+++ linux.20p9/arch/s390/boot/ipldump.S Thu Jan 1 01:00:00 1970
@@ -1,179 +0,0 @@
-/*
- * arch/s390/boot/ipldump.S
- *
- * S390 version
- * Copyright (C) 1999,2000 IBM Deutschland Entwicklung GmbH, IBM Corporation
- * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com),
- *
- * Tape dump ipl record. Put it on a tape and ipl from it and it will
- * write a dump of the real storage after the ipl record on that tape.
- */
-
-#include
-#include
-#include
-
-#define IPL_BS 1024
- .org 0
- .long 0x00080000,0x80000000+_start # The first 24 bytes are loaded
- .long 0x07000000,0x60000001 # by ipl to addresses 0-23.
- .long 0x02000000,0x20000000+IPL_BS # (a PSW and two CCWs).
- .long 0x00000000,0x00000000
- .long 0x00000000,0x00000000 # svc old psw
- .long 0x00000000,0x00000000 # program check old psw
- .long 0x00000000,0x00000000 # machine check old psw
- .long 0x00000000,0x00000000 # io old psw
- .long 0x00000000,0x00000000
- .long 0x00000000,0x00000000
- .long 0x00000000,0x00000000
- .long 0x000a0000,0x00000058 # external new psw
- .long 0x000a0000,0x00000060 # svc new psw
- .long 0x000a0000,0x00000068 # program check new psw
- .long 0x000a0000,0x00000070 # machine check new psw
- .long 0x00080000,0x80000000+.Lioint # io new psw
-
- .org 0x100
- .globl _start
-_start:
- l %r1,0xb8 # load ipl subchannel number
-#
-# find out memory size
-#
- mvc 104(8,0),.Lpcmem0 # setup program check handler
- slr %r3,%r3
- lhi %r2,1
- sll %r2,20
-.Lloop0:
- l %r0,0(%r3) # test page
- ar %r3,%r2 # add 1M
- jnm .Lloop0 # r1 < 0x80000000 -> loop
-.Lchkmem0:
- n %r3,.L4malign0 # align to multiples of 4M
- st %r3,.Lmemsize # store memory size
-.Lmemok:
-
-#
-# first write a tape mark
-#
- bras %r14,.Ltapemark
-#
-# write real storage to tape
-#
- slr %r2,%r2 # start at address 0
- bras %r14,.Lwriter # load ramdisk
-#
-# write another tape mark
-#
- bras %r14,.Ltapemark
-#
-# everything written, stop processor
-#
- lpsw .Lstopped
-#
-# subroutine for writing to tape
-# Paramters:
-# R1 = device number
-# R2 = start address
-# R3 = length
-.Lwriter:
- st %r14,.Lldret
- la %r12,.Lorbread # r12 = address of orb
- la %r5,.Lirb # r5 = address of irb
- st %r2,.Lccwwrite+4 # initialize CCW data addresses
- lctl %c6,%c6,.Lcr6
- slr %r2,%r2
-.Lldlp:
- lhi %r6,3 # 3 retries
-.Lssch:
- ssch 0(%r12) # write chunk of IPL_BS bytes
- jnz .Llderr
-.Lw4end:
- bras %r14,.Lwait4io
- tm 8(%r5),0x82 # do we have a problem ?
- jnz .Lrecov
- l %r0,.Lccwwrite+4 # update CCW data addresses
- ahi %r0,IPL_BS
- st %r0,.Lccwwrite+4
- clr %r0,%r3 # enough ?
- jl .Lldlp
-.Ldone:
- l %r14,.Lldret
- br %r14 # r2 contains the total size
-.Lrecov:
- bras %r14,.Lsense # do the sensing
- brct %r6,.Lssch # dec. retry count & branch
- j .Llderr
-.Ltapemark:
- st %r14,.Lldret
- la %r12,.Lorbmark # r12 = address of orb
- la %r5,.Lirb # r5 = address of irb
- lctl %c6,%c6,.Lcr6
- ssch 0(%r12) # write a tape mark
- jnz .Llderr
- bras %r14,.Lwait4io
- l %r14,.Lldret
- br %r14
-#
-# Sense subroutine
-#
-.Lsense:
- st %r14,.Lsnsret
- la %r7,.Lorbsense
- ssch 0(%r7) # start sense command
- jnz .Llderr
- bras %r14,.Lwait4io
- l %r14,.Lsnsret
- tm 8(%r5),0x82 # do we have a problem ?
- jnz .Llderr
- br %r14
-#
-# Wait for interrupt subroutine
-#
-.Lwait4io:
- lpsw .Lwaitpsw
-.Lioint:
- c %r1,0xb8 # compare subchannel number
- jne .Lwait4io
- tsch 0(%r5)
- slr %r0,%r0
- tm 8(%r5),0x82 # do we have a problem ?
- jnz .Lwtexit
- tm 8(%r5),0x04 # got device end ?
- jz .Lwait4io
-.Lwtexit:
- br %r14
-.Llderr:
- lpsw .Lcrash
-
- .align 8
-.Lorbread:
- .long 0x00000000,0x0080ff00,.Lccwwrite
- .align 8
-.Lorbsense:
- .long 0x00000000,0x0080ff00,.Lccwsense
- .align 8
-.Lorbmark:
- .long 0x00000000,0x0080ff00,.Lccwmark
- .align 8
-.Lccwwrite:
- .long 0x01200000+IPL_BS,0x00000000
-.Lccwsense:
- .long 0x04200001,0x00000000
-.Lccwmark:
- .long 0x1f200001,0x00000000
-.Lwaitpsw:
- .long 0x020a0000,0x80000000+.Lioint
-
-.Lirb: .long 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-.Lcr6: .long 0xff000000
- .align 8
-.Lcrash:.long 0x000a0000,0x00000000
-.Lstopped: .long 0x000a0000,0x00001234
-.Lpcmem0:.long 0x00080000,0x80000000 + .Lchkmem0
-.L4malign0:.long 0xffc00000
-.Lmemsize:.long 0
-.Lldret:.long 0
-.Lsnsret: .long 0
-
- .org IPL_BS
-
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/s390/defconfig linux.20p9/arch/s390/defconfig
--- linux.vanilla/arch/s390/defconfig Sun Mar 25 17:31:55 2001
+++ linux.20p9/arch/s390/defconfig Wed Aug 8 22:14:20 2001
@@ -1,5 +1,5 @@
#
-# Automatically generated by make menuconfig: don't edit
+# Automatically generated make config: don't edit
#
CONFIG_ARCH_S390=y
@@ -7,7 +7,7 @@
# Code maturity level options
#
CONFIG_EXPERIMENTAL=y
-CONFIG_PROCESS_DEBUG=n
+# CONFIG_PROCESS_DEBUG is not set
#
# Processor type and features
@@ -42,11 +42,15 @@
# CONFIG_BLK_DEV_NBD is not set
# CONFIG_BLK_DEV_MD is not set
CONFIG_BLK_DEV_RAM=y
-CONFIG_BLK_DEV_RAM_SIZE=8192
+CONFIG_BLK_DEV_RAM_SIZE=24576
CONFIG_BLK_DEV_INITRD=y
CONFIG_BLK_DEV_XPRAM=m
# CONFIG_MDISK is not set
CONFIG_DASD=y
+
+#
+# DASD disciplines
+#
CONFIG_DASD_ECKD=y
CONFIG_DASD_FBA=y
CONFIG_DASD_MDSK=y
@@ -55,6 +59,10 @@
# S/390 Network device support
#
CONFIG_NETDEVICES=y
+
+#
+# S390 Network devices
+#
CONFIG_CTC=y
CONFIG_IUCV=y
# CONFIG_DUMMY is not set
@@ -68,6 +76,15 @@
CONFIG_3215_CONSOLE=y
CONFIG_HWC=y
CONFIG_HWC_CONSOLE=y
+
+#
+# S/390 character device drivers
+#
+# CONFIG_S390_TAPE is not set
+
+#
+# Character devices
+#
CONFIG_UNIX98_PTYS=y
CONFIG_UNIX98_PTY_COUNT=256
@@ -88,16 +105,26 @@
# CONFIG_IP_ROUTER is not set
# CONFIG_NET_IPIP is not set
# CONFIG_NET_IPGRE is not set
+# CONFIG_IP_MROUTE is not set
# CONFIG_IP_ALIAS is not set
# CONFIG_SYN_COOKIES is not set
+
+#
+# (it is safe to leave these untouched)
+#
# CONFIG_INET_RARP is not set
CONFIG_SKB_LARGE=y
# CONFIG_IPV6 is not set
+
+#
+#
+#
# CONFIG_IPX is not set
# CONFIG_ATALK is not set
# CONFIG_X25 is not set
# CONFIG_LAPB is not set
# CONFIG_BRIDGE is not set
+# CONFIG_NET_DIVERT is not set
# CONFIG_LLC is not set
# CONFIG_ECONET is not set
# CONFIG_WAN_ROUTER is not set
@@ -141,8 +168,10 @@
#
# CONFIG_CODA_FS is not set
CONFIG_NFS_FS=y
+# CONFIG_NFS_V3 is not set
CONFIG_NFSD=y
-# CONFIG_NFSD_SUN is not set
+# CONFIG_NFSD_V3 is not set
+# CONFIG_NFSD_TCP is not set
CONFIG_SUNRPC=y
CONFIG_LOCKD=y
# CONFIG_SMB_FS is not set
@@ -153,6 +182,7 @@
#
# CONFIG_BSD_DISKLABEL is not set
# CONFIG_MAC_PARTITION is not set
+# CONFIG_MINIX_SUBPARTITION is not set
# CONFIG_SMD_DISKLABEL is not set
# CONFIG_SOLARIS_X86_PARTITION is not set
# CONFIG_UNIXWARE_DISKLABEL is not set
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/s390/kernel/entry.S linux.20p9/arch/s390/kernel/entry.S
--- linux.vanilla/arch/s390/kernel/entry.S Sun Mar 25 17:37:30 2001
+++ linux.20p9/arch/s390/kernel/entry.S Wed Aug 8 22:14:11 2001
@@ -657,11 +657,10 @@
lh %r7,__LC_PGM_ILC # load instruction length
pgm_no_sv:
lh %r8,__LC_PGM_INT_CODE # N.B. saved int code used later KEEP it
- stosm 24(%r15),0x03 # reenable interrupts
lr %r3,%r8
la %r0,0x7f
nr %r3,%r0 # clear per-event-bit
- be BASED(pgm_dn) # none of Martins exceptions occured bypass
+ be BASED(pgm_dn) # none of Martins exceptions occurred bypass
l %r9,BASED(.Ljump_table)
sll %r3,2
l %r9,0(%r3,%r9) # load address of handler routine
@@ -672,6 +671,9 @@
l %r5,SP_PSW+4(15) # load psw addr
sr %r5,%r7 # substract ilc from psw
st %r5,SP_PSW+4(15) # store corrected psw addr
+pgm_per:cl %r3,BASED(.Lc20) # pseudo page fault ?
+ be BASED(pgm_go) # if yes then don't reenable interrupts
+ stosm 24(%r15),0x03 # reenable interrupts
pgm_go: basr %r14,%r9 # branch to interrupt-handler
pgm_dn: la %r0,0x80
nr %r8,%r0 # check for per exception
@@ -834,6 +836,7 @@
.Lc_ac: .long 0,0,1
.Lc_ENOSYS: .long -ENOSYS
.Lc4: .long 4
+.Lc20: .long 20
.Lc0x1202: .long 0x1202
.Lc0x1004: .long 0x1004
.Lc0x2401: .long 0x2401
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/s390/kernel/process.c linux.20p9/arch/s390/kernel/process.c
--- linux.vanilla/arch/s390/kernel/process.c Sun Mar 25 17:31:55 2001
+++ linux.20p9/arch/s390/kernel/process.c Wed Jul 4 16:03:53 2001
@@ -404,7 +404,7 @@
error = do_execve(filename, (char **) regs.gprs[3], (char **) regs.gprs[4], ®s);
if (error == 0)
{
- current->flags &= ~PF_DTRACE;
+ current->ptrace &= ~PT_DTRACE;
current->tss.fp_regs.fpc=0;
if(MACHINE_HAS_IEEE)
{
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/s390/kernel/ptrace.c linux.20p9/arch/s390/kernel/ptrace.c
--- linux.vanilla/arch/s390/kernel/ptrace.c Sun Mar 25 17:31:55 2001
+++ linux.20p9/arch/s390/kernel/ptrace.c Wed Jul 4 16:03:53 2001
@@ -435,10 +435,10 @@
if (request == PTRACE_TRACEME)
{
/* are we already being traced? */
- if (current->flags & PF_PTRACED)
+ if (current->ptrace & PT_PTRACED)
goto out;
/* set the ptrace bit in the process flags. */
- current->flags |= PF_PTRACED;
+ current->ptrace |= PT_PTRACED;
ret = 0;
goto out;
}
@@ -459,9 +459,9 @@
(current->gid != child->gid)) && !capable(CAP_SYS_PTRACE))
goto out;
/* the same process cannot be attached many times */
- if (child->flags & PF_PTRACED)
+ if (child->ptrace & PT_PTRACED)
goto out;
- child->flags |= PF_PTRACED;
+ child->ptrace |= PT_PTRACED;
if (child->p_pptr != current)
{
REMOVE_LINKS(child);
@@ -478,7 +478,7 @@
/* ieee_instruction_pointer from the user structure DJB */
if(child!=current)
{
- if (!(child->flags & PF_PTRACED))
+ if (!(child->ptrace & PT_PTRACED))
goto out;
if (child->state != TASK_STOPPED)
{
@@ -524,9 +524,9 @@
if ((unsigned long) data >= _NSIG)
break;
if (request == PTRACE_SYSCALL)
- child->flags |= PF_TRACESYS;
+ child->ptrace |= PT_TRACESYS;
else
- child->flags &= ~PF_TRACESYS;
+ child->ptrace &= ~PT_TRACESYS;
child->exit_code = data;
/* make sure the single step bit is not set. */
clear_single_step(child);
@@ -553,7 +553,7 @@
ret = -EIO;
if ((unsigned long) data >= _NSIG)
break;
- child->flags &= ~PF_TRACESYS;
+ child->ptrace &= ~PT_TRACESYS;
child->exit_code = data;
set_single_step(child);
/* give it a chance to run. */
@@ -565,7 +565,7 @@
ret = -EIO;
if ((unsigned long) data >= _NSIG)
break;
- child->flags &= ~(PF_PTRACED|PF_TRACESYS);
+ child->ptrace &= ~(PT_PTRACED|PT_TRACESYS);
wake_up_process(child);
child->exit_code = data;
REMOVE_LINKS(child);
@@ -593,8 +593,8 @@
asmlinkage void syscall_trace(void)
{
lock_kernel();
- if ((current->flags & (PF_PTRACED|PF_TRACESYS))
- != (PF_PTRACED|PF_TRACESYS))
+ if ((current->ptrace & (PT_PTRACED|PT_TRACESYS))
+ != (PT_PTRACED|PT_TRACESYS))
goto out;
current->exit_code = SIGTRAP;
current->state = TASK_STOPPED;
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/s390/kernel/reipl.S linux.20p9/arch/s390/kernel/reipl.S
--- linux.vanilla/arch/s390/kernel/reipl.S Sun Mar 25 17:37:30 2001
+++ linux.20p9/arch/s390/kernel/reipl.S Wed Aug 8 22:14:20 2001
@@ -55,7 +55,7 @@
.Ldispsw: .long 0x000a0000,0x00000000
.Liplccws: .long 0x02000000,0x60000018
.long 0x08000008,0x20000001
-.Liplorb: .long 0x0049504c,0x0000ff80
+.Liplorb: .long 0x0049504c,0x0040ff80
.long 0x00000000+.Liplccws
.Lschib: .long 0x00000000,0x00000000
.long 0x00000000,0x00000000
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/s390/kernel/s390io.c linux.20p9/arch/s390/kernel/s390io.c
--- linux.vanilla/arch/s390/kernel/s390io.c Sun Mar 25 17:37:30 2001
+++ linux.20p9/arch/s390/kernel/s390io.c Wed Aug 8 22:14:20 2001
@@ -6,6 +6,9 @@
* Copyright (C) 1999, 2000 IBM Deutschland Entwicklung GmbH,
* IBM Corporation
* Author(s): Ingo Adlung (adlung@de.ibm.com)
+ *
+ * ChangeLog : 03/14/2001 Ingo Adlung Save not_oper func pointer prior
+ * to wipe it out
*/
#include
@@ -121,7 +124,10 @@
}
}
-
+/*
+ * Note : internal use of irqflags SA_PROBE for NOT path grouping
+ *
+ */
int s390_request_irq_special( int irq,
io_handler_func_t io_handler,
not_oper_handler_func_t not_oper_handler,
@@ -172,7 +178,8 @@
{
if ( !retval )
{
- s390_DevicePathVerification( irq, 0 );
+ if ( !(irqflags & SA_PROBE))
+ s390_DevicePathVerification( irq, 0 );
}
else
{
@@ -1947,6 +1954,7 @@
int new_irq;
#endif
int use_irq = irq;
+ int cpu = smp_processor_id();
//
// fix me !!!
@@ -1974,6 +1982,7 @@
} /* endif */
+ irq_enter(cpu, use_irq);
s390irq_spin_lock(use_irq);
#ifdef CONFIG_FAST_IRQ
@@ -2012,6 +2021,7 @@
#endif /* CONFIG_FAST_IRQ */
s390irq_spin_unlock(use_irq);
+ irq_exit(cpu, use_irq);
return;
}
@@ -2141,9 +2151,28 @@
* secondary status are presented with different interrupts.
*/
if ( ioinfo[irq]->devstat.ii.irb.scsw.stctl
- & ( SCSW_STCTL_PRIM_STATUS | SCSW_STCTL_INTER_STATUS ) )
- {
- ioinfo[irq]->devstat.rescnt = ioinfo[irq]->devstat.ii.irb.scsw.count;
+ & ( SCSW_STCTL_PRIM_STATUS | SCSW_STCTL_INTER_STATUS ) ) {
+
+ /*
+ * If the subchannel status shows status pending
+ * and we received a check condition, the count
+ * information is not meaningful.
+ */
+
+ if ( !( (dp->ii.irb.scsw.stctl & SCSW_STCTL_STATUS_PEND)
+ && ( dp->ii.irb.scsw.cstat
+ & ( SCHN_STAT_CHN_DATA_CHK
+ | SCHN_STAT_CHN_CTRL_CHK
+ | SCHN_STAT_INTF_CTRL_CHK
+ | SCHN_STAT_PROG_CHECK
+ | SCHN_STAT_PROT_CHECK
+ | SCHN_STAT_CHAIN_CHECK )))) {
+
+ dp->rescnt = dp->ii.irb.scsw.count;
+ } else {
+ dp->rescnt = SENSE_MAX_COUNT;
+ }
+
ioinfo[irq]->devstat.cpa = ioinfo[irq]->devstat.ii.irb.scsw.cpa;
#ifdef CONFIG_DEBUG_IO
@@ -3363,7 +3392,7 @@
{
ret = request_irq( irq,
init_IRQ_handler,
- 0, "RDC", &devstat );
+ SA_PROBE, "RDC", &devstat );
if ( !ret )
{
@@ -3519,7 +3548,7 @@
pdevstat = &devstat;
ret = request_irq( irq,
init_IRQ_handler,
- 0, "RCD", pdevstat );
+ SA_PROBE, "RCD", pdevstat );
if ( !ret )
{
@@ -3961,9 +3990,9 @@
int irq_ret;
devstat_t devstat;
- irq_ret = request_irq( irq,
+ irq_ret = request_irq( irq,
init_IRQ_handler,
- 0,
+ SA_PROBE,
"INIT",
&devstat);
@@ -4028,8 +4057,6 @@
} /* endif */
#endif
- s390_DevicePathVerification( irq, 0 );
-
disable_cpu_sync_isc( irq );
ioinfo[irq]->ui.flags.syncio = 0; // global
@@ -4463,7 +4490,7 @@
* requests and evaluate the devstat area on return therefore
* we don't need a real I/O handler in place.
*/
- irq_ret = request_irq( irq, init_IRQ_handler, 0, "SID", &devstat);
+ irq_ret = request_irq( irq, init_IRQ_handler, SA_PROBE, "SID", &devstat);
if ( irq_ret == 0 )
inlreq = 1;
@@ -4972,6 +4999,7 @@
ccw1_t spid_ccw[2]; /* ccw area for SPID command */
devstat_t devstat; /* required by request_irq() */
devstat_t *pdevstat = &devstat;
+ unsigned long flags;
int irq_ret = 0; /* return code */
int retry = 5; /* retry count */
@@ -5005,7 +5033,7 @@
*/
irq_ret = request_irq( irq,
init_IRQ_handler,
- 0,
+ SA_PROBE,
"SPID",
pdevstat);
@@ -5020,7 +5048,7 @@
if ( irq_ret == 0 )
{
- s390irq_spin_lock( irq);
+ s390irq_spin_lock_irqsave( irq, flags);
spid_ccw[0].cmd_code = 0x5B; /* suspend multipath reconnect */
spid_ccw[0].cda = 0;
@@ -5093,9 +5121,9 @@
} /* endif */
}
-#ifdef CONFIG_DEBUG_IO
else
{
+#ifdef CONFIG_DEBUG_IO
printk( "SPID - device %04X,"
" unit check,"
" retry %d, cnt %02d,"
@@ -5112,9 +5140,10 @@
pdevstat->ii.sense.data[5],
pdevstat->ii.sense.data[6],
pdevstat->ii.sense.data[7]);
-
- } /* endif */
#endif
+ retry--;
+ } /* endif */
+
}
else if ( pdevstat->flag & DEVSTAT_NOT_OPER )
{
@@ -5140,7 +5169,7 @@
} while ( retry > 0 );
- s390irq_spin_unlock( irq);
+ s390irq_spin_unlock_irqrestore( irq, flags);
/*
* If we installed the irq action handler we have to
@@ -5170,6 +5199,7 @@
int irq_ret = 0; /* return code */
int retry = 5; /* retry count */
int inlreq = 0; /* inline request_irq() */
+ unsigned long flags;
if ( (irq > highest_subchannel) || (irq < 0 ) )
{
@@ -5198,7 +5228,7 @@
*/
irq_ret = request_irq( irq,
init_IRQ_handler,
- 0,
+ SA_PROBE,
"SNID",
pdevstat);
@@ -5214,7 +5244,7 @@
if ( irq_ret == 0 )
{
- s390irq_spin_lock( irq);
+ s390irq_spin_lock_irqsave( irq, flags);
snid_ccw.cmd_code = CCW_CMD_SENSE_PGID;
snid_ccw.cda = (__u32)virt_to_phys( pgid );
@@ -5324,7 +5354,7 @@
} while ( retry > 0 );
- s390irq_spin_unlock( irq);
+ s390irq_spin_unlock_irqrestore( irq, flags);
/*
* If we installed the irq action handler we have to
@@ -5372,10 +5402,10 @@
* If the device isn't known yet
* we can't lock it ...
*/
- if ( ioinfo[irq] != INVALID_STORAGE_AREA )
+ if ( ioinfo[irq] != INVALID_STORAGE_AREA )
{
s390irq_spin_lock( irq );
- lock = 1;
+ lock = 1;
dev_oper = ioinfo[irq]->ui.flags.oper;
@@ -5417,20 +5447,21 @@
if ( ioinfo[irq] != INVALID_STORAGE_AREA )
{
+ not_oper_handler_func_t nopfunc = ioinfo[irq]->nopfunc;
+
if ( ioinfo[irq]->ui.flags.oper == 0 )
- {
- /*
- * If the device has gone
- * call not oper handler
- */
- if ( ( dev_oper == 1 )
- && ( ioinfo[irq]->nopfunc != NULL ) )
- {
+ {
+ /*
+ * If the device has gone
+ * call not oper handler
+ */
+ if ( ( dev_oper == 1 )
+ && ( nopfunc != NULL ) ) {
- free_irq( irq,
+ free_irq( irq,
ioinfo[irq]->irq_desc.action->dev_id );
- ioinfo[irq]->nopfunc( irq,
- DEVSTAT_DEVICE_GONE );
+ nopfunc( irq, DEVSTAT_DEVICE_GONE );
+
} /* endif */
}
else
@@ -5466,10 +5497,10 @@
* ... it is and was operational, but
* the devno may have changed
*/
- else if ( ioinfo[irq]->devno != dev_no )
+ else if ( ( ioinfo[irq]->devno != dev_no )
+ && ( nopfunc != NULL ) )
{
- ioinfo[irq]->nopfunc( irq,
- DEVSTAT_REVALIDATE );
+ nopfunc( irq, DEVSTAT_REVALIDATE );
} /* endif */
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/s390/kernel/setup.c linux.20p9/arch/s390/kernel/setup.c
--- linux.vanilla/arch/s390/kernel/setup.c Sun Mar 25 17:37:30 2001
+++ linux.20p9/arch/s390/kernel/setup.c Wed Aug 8 22:14:20 2001
@@ -273,6 +273,8 @@
break;
if (cn == '\n')
cn = ' '; /* replace newlines with space */
+ if (cn == 0x0d)
+ cn = ' '; /* replace 0x0d with space */
if (cn == ' ' && c == ' ')
continue; /* remove additional spaces */
c = cn;
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/s390/kernel/signal.c linux.20p9/arch/s390/kernel/signal.c
--- linux.vanilla/arch/s390/kernel/signal.c Sun Mar 25 17:37:30 2001
+++ linux.20p9/arch/s390/kernel/signal.c Wed Aug 8 22:14:20 2001
@@ -301,6 +301,7 @@
/* Set up registers for signal handler */
regs->gprs[15] = (addr_t)frame;
regs->psw.addr = FIX_PSW(ka->sa.sa_handler);
+ regs->psw.mask = _USER_PSW_MASK;
}
/* Set up to return from userspace. If provided, use a stub
already in userspace. */
@@ -461,7 +462,7 @@
if (!signr)
break;
- if ((current->flags & PF_PTRACED) && signr != SIGKILL) {
+ if ((current->ptrace & PT_PTRACED) && signr != SIGKILL) {
/* Let the debugger run. */
current->exit_code = signr;
current->state = TASK_STOPPED;
@@ -529,12 +530,8 @@
case SIGQUIT: case SIGILL: case SIGTRAP:
case SIGABRT: case SIGFPE: case SIGSEGV:
- lock_kernel();
- if (current->binfmt
- && current->binfmt->core_dump
- && current->binfmt->core_dump(signr, regs))
+ if (do_coredump(signr, regs))
exit_code |= 0x80;
- unlock_kernel();
/* FALLTHRU */
default:
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/s390/kernel/smp.c linux.20p9/arch/s390/kernel/smp.c
--- linux.vanilla/arch/s390/kernel/smp.c Sun Mar 25 17:37:30 2001
+++ linux.20p9/arch/s390/kernel/smp.c Wed Aug 8 22:14:20 2001
@@ -426,7 +426,33 @@
void smp_send_stop(void)
{
- smp_signal_others(sigp_stop_and_store_status, 0, TRUE, NULL);
+ int i;
+ u32 dummy;
+ unsigned long low_core_addr;
+
+ /* write magic number to zero page (absolute 0) */
+
+ get_cpu_lowcore(smp_processor_id()).panic_magic = __PANIC_MAGIC;
+
+ /* stop all processors */
+
+ smp_signal_others(sigp_stop, 0, TRUE, NULL);
+
+ /* store status of all processors in their lowcores (real 0) */
+
+ for (i = 0; i < smp_num_cpus; i++) {
+ if (smp_processor_id() != i) {
+ int ccode;
+ low_core_addr = (unsigned long)&get_cpu_lowcore(i);
+ do {
+ ccode = signal_processor_ps(
+ &dummy,
+ low_core_addr,
+ i,
+ sigp_store_status_at_address);
+ } while(ccode == sigp_busy);
+ }
+ }
}
/*
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/s390/kernel/traps.c linux.20p9/arch/s390/kernel/traps.c
--- linux.vanilla/arch/s390/kernel/traps.c Sun Mar 25 17:31:55 2001
+++ linux.20p9/arch/s390/kernel/traps.c Wed Aug 8 22:14:11 2001
@@ -37,6 +37,8 @@
#include
#endif
+#include "cpcmd.h"
+
/* Called from entry.S only */
extern void handle_per_exception(struct pt_regs *regs);
@@ -44,6 +46,7 @@
pgm_check_handler_t *pgm_check_table[128];
extern pgm_check_handler_t do_page_fault;
+extern pgm_check_handler_t do_pseudo_page_fault;
static inline void console_verbose(void)
{
@@ -94,7 +97,7 @@
{
if(regs->psw.mask&PSW_PROBLEM_STATE)
{
- if(current->flags & PF_PTRACED)
+ if(current->ptrace & PT_PTRACED)
force_sig(signal,current);
else
return(TRUE);
@@ -113,7 +116,7 @@
return(FALSE);
}
-DO_ERROR(SIGSEGV, "Unknown program exception", default_trap_handler);
+DO_ERROR(SIGSEGV, "Unknown program exception", default_trap_handler)
DO_ERROR(SIGILL, "privileged operation", privileged_op)
DO_ERROR(SIGILL, "execute exception", execute_exception)
DO_ERROR(SIGSEGV, "addressing exception", addressing_exception)
@@ -317,18 +320,20 @@
pgm_check_table[1] = &illegal_op;
pgm_check_table[2] = &privileged_op;
pgm_check_table[3] = &execute_exception;
+ pgm_check_table[4] = &do_page_fault;
pgm_check_table[5] = &addressing_exception;
pgm_check_table[6] = &specification_exception;
pgm_check_table[7] = &data_exception;
pgm_check_table[9] = ÷_exception;
+ pgm_check_table[0x10] = &do_page_fault;
+ pgm_check_table[0x11] = &do_page_fault;
pgm_check_table[0x12] = &translation_exception;
pgm_check_table[0x13] = &special_op_exception;
+ pgm_check_table[0x14] = &do_pseudo_page_fault;
pgm_check_table[0x15] = &operand_exception;
- pgm_check_table[4] = &do_page_fault;
- pgm_check_table[0x10] = &do_page_fault;
- pgm_check_table[0x11] = &do_page_fault;
pgm_check_table[0x1C] = &privileged_op;
-
+ if (MACHINE_IS_VM)
+ cpcmd("SET PAGEX ON", NULL, 0);
}
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/s390/mm/fault.c linux.20p9/arch/s390/mm/fault.c
--- linux.vanilla/arch/s390/mm/fault.c Sun Mar 25 17:31:55 2001
+++ linux.20p9/arch/s390/mm/fault.c Wed Aug 8 22:14:11 2001
@@ -20,6 +20,7 @@
#include
#include
#include
+#include
#include
#include
@@ -243,3 +244,123 @@
goto no_context;
}
+typedef struct _pseudo_wait_t {
+ struct _pseudo_wait_t *next;
+ wait_queue_head_t queue;
+ unsigned long address;
+ int resolved;
+} pseudo_wait_t;
+
+static pseudo_wait_t *pseudo_lock_queue = NULL;
+static spinlock_t pseudo_wait_spinlock; /* spinlock to protect lock queue */
+
+/*
+ * This routine handles pseudo page faults.
+ */
+asmlinkage void
+do_pseudo_page_fault(struct pt_regs *regs, unsigned long error_code)
+{
+ DECLARE_WAITQUEUE(wait, current);
+ pseudo_wait_t wait_struct;
+ pseudo_wait_t *ptr, *last, *next;
+ unsigned long psw_mask;
+ unsigned long address;
+ int kernel_address;
+
+ /*
+ * get psw mask of Program old psw to find out,
+ * if user or kernel mode
+ */
+ psw_mask = S390_lowcore.program_old_psw.mask;
+
+ /*
+ * get the failing address
+ * more specific the segment and page table portion of
+ * the address
+ */
+ address = S390_lowcore.trans_exc_code & 0xfffff000;
+
+ if (address & 0x80000000) {
+ /* high bit set -> a page has been swapped in by VM */
+ address &= 0x7fffffff;
+ spin_lock(&pseudo_wait_spinlock);
+ last = NULL;
+ ptr = pseudo_lock_queue;
+ while (ptr != NULL) {
+ next = ptr->next;
+ if (address == ptr->address) {
+ /*
+ * This is one of the processes waiting
+ * for the page. Unchain from the queue.
+ * There can be more than one process
+ * waiting for the same page. VM presents
+ * an initial and a completion interrupt for
+ * every process that tries to access a
+ * page swapped out by VM.
+ */
+ if (last == NULL)
+ pseudo_lock_queue = next;
+ else
+ last->next = next;
+ /* now wake up the process */
+ ptr->resolved = 1;
+ wake_up(&ptr->queue);
+ } else
+ last = ptr;
+ ptr = next;
+ }
+ spin_unlock(&pseudo_wait_spinlock);
+ } else {
+ /* Pseudo page faults in kernel mode is a bad idea */
+ if (!(psw_mask & PSW_PROBLEM_STATE)) {
+ /*
+ * VM presents pseudo page faults if the interrupted
+ * state was not disabled for interrupts. So we can
+ * get pseudo page fault interrupts while running
+ * in kernel mode. We simply access the page here
+ * while we are running disabled. VM will then swap
+ * in the page synchronously.
+ */
+ kernel_address = 0;
+ switch (S390_lowcore.trans_exc_code & 3) {
+ case 0: /* Primary Segment Table Descriptor */
+ kernel_address = 1;
+ break;
+ case 1: /* STD determined via access register */
+ if (S390_lowcore.exc_access_id == 0 ||
+ regs->acrs[S390_lowcore.exc_access_id]==0)
+ kernel_address = 1;
+ break;
+ case 2: /* Secondary Segment Table Descriptor */
+ case 3: /* Home Segment Table Descriptor */
+ break;
+ }
+ if (kernel_address)
+ /* dereference a virtual kernel address */
+ __asm__ __volatile__ (
+ " ic 0,0(%0)"
+ : : "a" (address) : "0");
+ else
+ /* dereference a virtual user address */
+ __asm__ __volatile__ (
+ " la 2,0(%0)\n"
+ " sacf 512\n"
+ " ic 2,0(2)\n"
+ " sacf 0"
+ : : "a" (address) : "2" );
+
+ return;
+ }
+ /* initialize and add element to pseudo_lock_queue */
+ init_waitqueue_head (&wait_struct.queue);
+ wait_struct.address = address;
+ wait_struct.resolved = 0;
+ spin_lock(&pseudo_wait_spinlock);
+ wait_struct.next = pseudo_lock_queue;
+ pseudo_lock_queue = &wait_struct;
+ spin_unlock(&pseudo_wait_spinlock);
+ /* go to sleep */
+ wait_event(wait_struct.queue, wait_struct.resolved);
+ }
+}
+
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/s390/tools/dasdfmt/dasdfmt.c linux.20p9/arch/s390/tools/dasdfmt/dasdfmt.c
--- linux.vanilla/arch/s390/tools/dasdfmt/dasdfmt.c Sun Mar 25 17:37:30 2001
+++ linux.20p9/arch/s390/tools/dasdfmt/dasdfmt.c Wed Jul 4 16:03:53 2001
@@ -479,7 +479,7 @@
rc=stat(dev_name,&stat_buf);
if (rc) {
- ERRMSG_EXIT(EXIT_FAILURE,"%s: error occured during stat: " \
+ ERRMSG_EXIT(EXIT_FAILURE,"%s: error occurred during stat: " \
"%s\n",prog_name,strerror(errno));
} else {
if (!S_ISBLK(stat_buf.st_mode))
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/sparc/kernel/entry.S linux.20p9/arch/sparc/kernel/entry.S
--- linux.vanilla/arch/sparc/kernel/entry.S Sun Mar 25 17:31:46 2001
+++ linux.20p9/arch/sparc/kernel/entry.S Wed Jul 4 16:03:53 2001
@@ -1,4 +1,4 @@
-/* $Id: entry.S,v 1.159.2.8 2000/10/05 04:17:17 anton Exp $
+/* $Id: entry.S,v 1.159.2.9 2001/06/18 12:26:13 davem Exp $
* arch/sparc/kernel/entry.S: Sparc trap low-level entry points.
*
* Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
@@ -1237,8 +1237,8 @@
call C_LABEL(do_ptrace)
add %sp, REGWIN_SZ, %o0
- ld [%curptr + AOFF_task_flags], %l5
- andcc %l5, 0x20, %g0
+ ld [%curptr + AOFF_task_ptrace], %l5
+ andcc %l5, 0x02, %g0
be 1f
nop
@@ -1287,8 +1287,8 @@
call C_LABEL(do_sigpause)
add %sp, REGWIN_SZ, %o1
- ld [%curptr + AOFF_task_flags], %l5
- andcc %l5, 0x20, %g0
+ ld [%curptr + AOFF_task_ptrace], %l5
+ andcc %l5, 0x02, %g0
be 1f
nop
@@ -1305,8 +1305,8 @@
call C_LABEL(do_sigsuspend)
add %sp, REGWIN_SZ, %o0
- ld [%curptr + AOFF_task_flags], %l5
- andcc %l5, 0x20, %g0
+ ld [%curptr + AOFF_task_ptrace], %l5
+ andcc %l5, 0x02, %g0
be 1f
nop
@@ -1324,8 +1324,8 @@
call C_LABEL(do_rt_sigsuspend)
add %sp, REGWIN_SZ, %o2
- ld [%curptr + AOFF_task_flags], %l5
- andcc %l5, 0x20, %g0
+ ld [%curptr + AOFF_task_ptrace], %l5
+ andcc %l5, 0x02, %g0
be 1f
nop
@@ -1342,8 +1342,8 @@
call C_LABEL(do_sigreturn)
add %sp, REGWIN_SZ, %o0
- ld [%curptr + AOFF_task_flags], %l5
- andcc %l5, 0x20, %g0
+ ld [%curptr + AOFF_task_ptrace], %l5
+ andcc %l5, 0x02, %g0
be 1f
nop
@@ -1362,8 +1362,8 @@
call C_LABEL(do_rt_sigreturn)
add %sp, REGWIN_SZ, %o0
- ld [%curptr + AOFF_task_flags], %l5
- andcc %l5, 0x20, %g0
+ ld [%curptr + AOFF_task_ptrace], %l5
+ andcc %l5, 0x02, %g0
be 1f
nop
@@ -1500,9 +1500,9 @@
mov %i1, %o1
mov %i2, %o2
- ld [%curptr + AOFF_task_flags], %l5
+ ld [%curptr + AOFF_task_ptrace], %l5
mov %i3, %o3
- andcc %l5, 0x20, %g0
+ andcc %l5, 0x02, %g0
mov %i4, %o4
bne linux_syscall_trace
mov %i0, %l5
@@ -1514,12 +1514,12 @@
.globl C_LABEL(ret_sys_call)
C_LABEL(ret_sys_call):
- ld [%curptr + AOFF_task_flags], %l6
+ ld [%curptr + AOFF_task_ptrace], %l6
cmp %o0, -ENOIOCTLCMD
ld [%sp + REGWIN_SZ + PT_PSR], %g3
set PSR_C, %g2
bgeu 1f
- andcc %l6, 0x20, %l6
+ andcc %l6, 0x02, %l6
/* System call success, clear Carry condition code. */
andn %g3, %g2, %g3
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/sparc/kernel/ptrace.c linux.20p9/arch/sparc/kernel/ptrace.c
--- linux.vanilla/arch/sparc/kernel/ptrace.c Sun Mar 25 17:31:47 2001
+++ linux.20p9/arch/sparc/kernel/ptrace.c Wed Jul 4 16:03:53 2001
@@ -535,12 +535,12 @@
#endif
if(request == PTRACE_TRACEME) {
/* are we already being traced? */
- if (current->flags & PF_PTRACED) {
+ if (current->ptrace & PT_PTRACED) {
pt_error_return(regs, EPERM);
goto out;
}
/* set the ptrace bit in the process flags. */
- current->flags |= PF_PTRACED;
+ current->ptrace |= PT_PTRACED;
pt_succ_return(regs, 0);
goto out;
}
@@ -578,11 +578,11 @@
goto out;
}
/* the same process cannot be attached many times */
- if (child->flags & PF_PTRACED) {
+ if (child->ptrace & PT_PTRACED) {
pt_error_return(regs, EPERM);
goto out;
}
- child->flags |= PF_PTRACED;
+ child->ptrace |= PT_PTRACED;
write_lock_irqsave(&tasklist_lock, flags);
if(child->p_pptr != current) {
REMOVE_LINKS(child);
@@ -594,7 +594,7 @@
pt_succ_return(regs, 0);
goto out;
}
- if (!(child->flags & PF_PTRACED)
+ if (!(child->ptrace & PT_PTRACED)
&& ((current->personality & PER_BSD) && (request != PTRACE_SUNATTACH))
&& (!(current->personality & PER_BSD) && (request != PTRACE_ATTACH))) {
pt_error_return(regs, ESRCH);
@@ -861,9 +861,9 @@
}
if (request == PTRACE_SYSCALL)
- child->flags |= PF_TRACESYS;
+ child->ptrace |= PT_TRACESYS;
else
- child->flags &= ~PF_TRACESYS;
+ child->ptrace &= ~PT_TRACESYS;
child->exit_code = data;
#ifdef DEBUG_PTRACE
@@ -900,7 +900,7 @@
pt_error_return(regs, EIO);
goto out;
}
- child->flags &= ~(PF_PTRACED|PF_TRACESYS);
+ child->ptrace &= ~(PT_PTRACED|PT_TRACESYS);
wake_up_process(child);
child->exit_code = data;
write_lock_irqsave(&tasklist_lock, flags);
@@ -927,8 +927,8 @@
#ifdef DEBUG_PTRACE
printk("%s [%d]: syscall_trace\n", current->comm, current->pid);
#endif
- if ((current->flags & (PF_PTRACED|PF_TRACESYS))
- != (PF_PTRACED|PF_TRACESYS))
+ if ((current->ptrace & (PT_PTRACED|PT_TRACESYS))
+ != (PT_PTRACED|PT_TRACESYS))
return;
current->exit_code = SIGTRAP;
current->state = TASK_STOPPED;
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/sparc/kernel/signal.c linux.20p9/arch/sparc/kernel/signal.c
--- linux.vanilla/arch/sparc/kernel/signal.c Sun Mar 25 17:31:46 2001
+++ linux.20p9/arch/sparc/kernel/signal.c Thu Jul 26 15:40:16 2001
@@ -1,4 +1,4 @@
-/* $Id: signal.c,v 1.91.2.2 2000/05/28 19:13:21 ecd Exp $
+/* $Id: signal.c,v 1.91.2.4 2001/06/19 16:49:41 davem Exp $
* linux/arch/sparc/kernel/signal.c
*
* Copyright (C) 1991, 1992 Linus Torvalds
@@ -1139,7 +1139,7 @@
if (!signr) break;
- if ((current->flags & PF_PTRACED) && signr != SIGKILL) {
+ if ((current->ptrace & PT_PTRACED) && signr != SIGKILL) {
current->exit_code = signr;
current->state = TASK_STOPPED;
@@ -1203,7 +1203,7 @@
continue;
case SIGSTOP:
- if (current->flags & PF_PTRACED)
+ if (current->ptrace & PT_PTRACED)
continue;
current->state = TASK_STOPPED;
current->exit_code = signr;
@@ -1217,14 +1217,8 @@
case SIGQUIT: case SIGILL: case SIGTRAP:
case SIGABRT: case SIGFPE: case SIGSEGV: case SIGBUS:
- if(current->binfmt && current->binfmt->core_dump) {
- lock_kernel();
- if(current->binfmt &&
- current->binfmt->core_dump &&
- current->binfmt->core_dump(signr, regs))
- exit_code |= 0x80;
- unlock_kernel();
- }
+ if (do_coredump(signr, regs))
+ exit_code |= 0x80;
#ifdef DEBUG_SIGNALS
/* Very useful to debug dynamic linker problems */
printk ("Sig %ld going for %s[%d]...\n", signr, current->comm, current->pid);
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/sparc/lib/memset.S linux.20p9/arch/sparc/lib/memset.S
--- linux.vanilla/arch/sparc/lib/memset.S Sun Mar 25 17:31:47 2001
+++ linux.20p9/arch/sparc/lib/memset.S Wed Jul 4 16:03:53 2001
@@ -185,7 +185,7 @@
b 30f
add %o0, %o1, %o0
30:
-/* %o4 is faulting address, %o5 is %pc where fault occured */
+/* %o4 is faulting address, %o5 is %pc where fault occurred */
save %sp, -104, %sp
mov %i5, %o0
mov %i7, %o1
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/sparc64/kernel/binfmt_aout32.c linux.20p9/arch/sparc64/kernel/binfmt_aout32.c
--- linux.vanilla/arch/sparc64/kernel/binfmt_aout32.c Sun Mar 25 17:31:53 2001
+++ linux.20p9/arch/sparc64/kernel/binfmt_aout32.c Thu Jul 26 15:53:51 2001
@@ -33,13 +33,17 @@
#include
static int load_aout32_binary(struct linux_binprm *, struct pt_regs * regs);
-static int load_aout32_library(int fd);
-static int aout32_core_dump(long signr, struct pt_regs * regs);
+static int load_aout32_library(struct file *file);
+static int aout32_core_dump(long signr, struct pt_regs * regs, struct file *);
extern void dump_thread(struct pt_regs *, struct user *);
static struct linux_binfmt aout32_format = {
- NULL, NULL, load_aout32_binary, load_aout32_library, aout32_core_dump
+ module: THIS_MODULE,
+ load_binary: load_aout32_binary,
+ load_shlib: load_aout32_library,
+ core_dump: aout32_core_dump,
+ min_coredump: PAGE_SIZE,
};
static void set_brk(unsigned long start, unsigned long end)
@@ -87,46 +91,18 @@
* dumping of the process results in another error..
*/
-static inline int
-do_aout32_core_dump(long signr, struct pt_regs * regs)
+static int
+aout32_core_dump(long signr, struct pt_regs * regs, struct file * file)
{
- struct dentry * dentry = NULL;
- struct inode * inode = NULL;
- struct file * file;
mm_segment_t fs;
int has_dumped = 0;
- char corefile[6+sizeof(current->comm)];
unsigned long dump_start, dump_size;
struct user dump;
# define START_DATA(u) (u.u_tsize)
# define START_STACK(u) ((regs->u_regs[UREG_FP]) & ~(PAGE_SIZE - 1))
- if (!current->dumpable || atomic_read(¤t->mm->count) != 1)
- return 0;
- current->dumpable = 0;
-
-/* See if we have enough room to write the upage. */
- if (current->rlim[RLIMIT_CORE].rlim_cur < PAGE_SIZE)
- return 0;
fs = get_fs();
set_fs(KERNEL_DS);
- memcpy(corefile,"core.",5);
-#if 0
- memcpy(corefile+5,current->comm,sizeof(current->comm));
-#else
- corefile[4] = '\0';
-#endif
- file = filp_open(corefile,O_CREAT | 2 | O_TRUNC | O_NOFOLLOW, 0600);
- if (IS_ERR(file))
- goto end_coredump;
- dentry = file->f_dentry;
- inode = dentry->d_inode;
- if (!S_ISREG(inode->i_mode))
- goto close_coredump;
- if (!inode->i_op || !inode->i_op->default_file_ops)
- goto close_coredump;
- if (!file->f_op->write)
- goto close_coredump;
has_dumped = 1;
current->flags |= PF_DUMPCORE;
strncpy(dump.u_comm, current->comm, sizeof(current->comm));
@@ -172,23 +148,10 @@
set_fs(KERNEL_DS);
DUMP_WRITE(current,sizeof(*current));
close_coredump:
- filp_close(file, NULL);
-end_coredump:
set_fs(fs);
return has_dumped;
}
-static int
-aout32_core_dump(long signr, struct pt_regs * regs)
-{
- int retval;
-
- MOD_INC_USE_COUNT;
- retval = do_aout32_core_dump(signr, regs);
- MOD_DEC_USE_COUNT;
- return retval;
-}
-
/*
* create_aout32_tables() parses the env- and arg-strings in new user
* memory and creates the pointer tables from them, and puts their
@@ -242,8 +205,7 @@
* libraries. There is no binary dependent code anywhere else.
*/
-static inline int do_load_aout32_binary(struct linux_binprm * bprm,
- struct pt_regs * regs)
+static int load_aout32_binary(struct linux_binprm * bprm, struct pt_regs * regs)
{
struct exec ex;
struct file * file;
@@ -357,16 +319,12 @@
}
}
beyond_if:
+ set_binfmt(&aout32_format);
if (current->exec_domain && current->exec_domain->module)
__MOD_DEC_USE_COUNT(current->exec_domain->module);
- if (current->binfmt && current->binfmt->module)
- __MOD_DEC_USE_COUNT(current->binfmt->module);
current->exec_domain = lookup_exec_domain(current->personality);
- current->binfmt = &aout32_format;
if (current->exec_domain && current->exec_domain->module)
__MOD_INC_USE_COUNT(current->exec_domain->module);
- if (current->binfmt && current->binfmt->module)
- __MOD_INC_USE_COUNT(current->binfmt->module);
set_brk(current->mm->start_brk, current->mm->brk);
@@ -375,28 +333,14 @@
p = (unsigned long) create_aout32_tables((char *)p, bprm);
current->mm->start_stack = p;
start_thread32(regs, ex.a_entry, p);
- if (current->flags & PF_PTRACED)
+ if (current->ptrace & PT_PTRACED)
send_sig(SIGTRAP, current, 0);
return 0;
}
-
-static int
-load_aout32_binary(struct linux_binprm * bprm, struct pt_regs * regs)
-{
- int retval;
-
- MOD_INC_USE_COUNT;
- retval = do_load_aout32_binary(bprm, regs);
- MOD_DEC_USE_COUNT;
- return retval;
-}
-
/* N.B. Move to .h file and use code in fs/binfmt_aout.c? */
-static inline int
-do_load_aout32_library(int fd)
+static int load_aout32_library(struct file *file)
{
- struct file * file;
struct inode * inode;
unsigned long bss, start_addr, len;
unsigned long error;
@@ -404,12 +348,6 @@
loff_t offset = 0;
struct exec ex;
- retval = -EACCES;
- file = fget(fd);
- if (!file)
- goto out;
- if (!file->f_op)
- goto out_putf;
inode = file->f_dentry->d_inode;
retval = -ENOEXEC;
@@ -463,23 +401,9 @@
retval = 0;
out_putf:
- fput(file);
-out:
- return retval;
-}
-
-static int
-load_aout32_library(int fd)
-{
- int retval;
-
- MOD_INC_USE_COUNT;
- retval = do_load_aout32_library(fd);
- MOD_DEC_USE_COUNT;
return retval;
}
-
__initfunc(int init_aout32_binfmt(void))
{
return register_binfmt(&aout32_format);
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/sparc64/kernel/devices.c linux.20p9/arch/sparc64/kernel/devices.c
--- linux.vanilla/arch/sparc64/kernel/devices.c Sun Mar 25 17:31:53 2001
+++ linux.20p9/arch/sparc64/kernel/devices.c Wed Jul 4 16:03:53 2001
@@ -73,6 +73,15 @@
prom_cpu_nodes[0] = prom_node_cpu;
+#ifndef __SMP__
+ {
+ extern unsigned int up_clock_tick;
+ up_clock_tick = prom_getintdefault(prom_node_cpu,
+ "clock-frequency",
+ 0);
+ }
+#endif
+
mem_start = central_probe(mem_start);
cpu_probe();
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/sparc64/kernel/entry.S linux.20p9/arch/sparc64/kernel/entry.S
--- linux.vanilla/arch/sparc64/kernel/entry.S Sun Mar 25 17:31:53 2001
+++ linux.20p9/arch/sparc64/kernel/entry.S Wed Jul 4 16:03:53 2001
@@ -1,4 +1,4 @@
-/* $Id: entry.S,v 1.103.2.6 2000/09/08 14:00:04 jj Exp $
+/* $Id: entry.S,v 1.103.2.7 2001/06/18 12:26:13 davem Exp $
* arch/sparc64/kernel/entry.S: Sparc64 trap low-level entry points.
*
* Copyright (C) 1995,1997 David S. Miller (davem@caip.rutgers.edu)
@@ -880,8 +880,8 @@
add %o7, 1f-.-4, %o7
nop
.align 32
-1: ldx [%curptr + AOFF_task_flags], %l5
- andcc %l5, 0x20, %g0
+1: ldx [%curptr + AOFF_task_ptrace], %l5
+ andcc %l5, 0x02, %g0
be,pt %icc, rtrap
clr %l6
call syscall_trace
@@ -1015,12 +1015,12 @@
mov %i4, %o4 ! IEU1
lduw [%l7 + %l4], %l7 ! Load
srl %i1, 0, %o1 ! IEU0 Group
- ldx [%curptr + AOFF_task_flags], %l0 ! Load
+ ldx [%curptr + AOFF_task_ptrace], %l0 ! Load
mov %i5, %o5 ! IEU1
srl %i2, 0, %o2 ! IEU0 Group
mov %i0, %l5 ! IEU1
- andcc %l0, 0x20, %g0 ! IEU1 Group
+ andcc %l0, 0x02, %g0 ! IEU1 Group
bne,pn %icc, linux_syscall_trace32 ! CTI
srl %i3, 0, %o3 ! IEU0
call %l7 ! CTI Group brk forced
@@ -1044,11 +1044,11 @@
mov %i1, %o1 ! IEU1
lduw [%l7 + %l4], %l7 ! Load
4: mov %i2, %o2 ! IEU0 Group
- ldx [%curptr + AOFF_task_flags], %l0 ! Load
+ ldx [%curptr + AOFF_task_ptrace], %l0 ! Load
mov %i3, %o3 ! IEU1
mov %i4, %o4 ! IEU0 Group
- andcc %l0, 0x20, %g0 ! IEU1 Group+1 bubble
+ andcc %l0, 0x02, %g0 ! IEU1 Group+1 bubble
bne,pn %icc, linux_syscall_trace ! CTI Group
mov %i0, %l5 ! IEU0
2: call %l7 ! CTI Group brk forced
@@ -1059,14 +1059,14 @@
call syscall_trace_exit
add %sp, STACK_BIAS + REGWIN_SZ, %o1
#endif
- ldx [%curptr + AOFF_task_flags], %l6
+ ldx [%curptr + AOFF_task_ptrace], %l6
sra %o0, 0, %o0
mov %ulo(TSTATE_XCARRY | TSTATE_ICARRY), %g2
ldx [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_TSTATE], %g3
cmp %o0, -ENOIOCTLCMD
sllx %g2, 32, %g2
bgeu,pn %xcc, 1f
- andcc %l6, 0x20, %l6
+ andcc %l6, 0x02, %l6
/* System call success, clear Carry condition code. */
andn %g3, %g2, %g3
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/sparc64/kernel/ioctl32.c linux.20p9/arch/sparc64/kernel/ioctl32.c
--- linux.vanilla/arch/sparc64/kernel/ioctl32.c Sun Mar 25 17:37:30 2001
+++ linux.20p9/arch/sparc64/kernel/ioctl32.c Wed Jul 4 16:03:53 2001
@@ -1,4 +1,4 @@
-/* $Id: ioctl32.c,v 1.62.2.18 2001/01/26 22:26:07 davem Exp $
+/* $Id: ioctl32.c,v 1.62.2.21 2001/06/08 01:34:11 davem Exp $
* ioctl32.c: Conversion between 32bit and 64bit native ioctls.
*
* Copyright (C) 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
@@ -43,6 +43,7 @@
#include
#include
#include
+#include
#include
#include
@@ -492,10 +493,19 @@
}
}
if (!err) {
- if (i <= ifc32.ifc_len)
+ if (ifc32.ifcbuf == 0) {
+ /* Translate from 64-bit structure multiple to
+ * a 32-bit one.
+ */
+ i = ifc.ifc_len;
+ i = ((i / sizeof(struct ifreq)) * sizeof(struct ifreq32));
ifc32.ifc_len = i;
- else
- ifc32.ifc_len = i - sizeof (struct ifreq32);
+ } else {
+ if (i <= ifc32.ifc_len)
+ ifc32.ifc_len = i;
+ else
+ ifc32.ifc_len = i - sizeof (struct ifreq32);
+ }
if (copy_to_user((struct ifconf32 *)arg, &ifc32, sizeof(struct ifconf32)))
err = -EFAULT;
}
@@ -2682,6 +2692,8 @@
case /* STOP_ARRAY */ _IO (MD_MAJOR, 0x32):
case /* STOP_ARRAY_RO */ _IO (MD_MAJOR, 0x33):
case /* RESTART_ARRAY_RW */ _IO (MD_MAJOR, 0x34):
+ case /* PRINT_RAID_DEBUG */ _IO (MD_MAJOR, 0x13):
+ case /* SET_DISK_FAULTY */ _IO (MD_MAJOR, 0x29):
/* Big K */
case PIO_FONT:
@@ -3136,6 +3148,13 @@
case DRM_IOCTL_FINISH:
#endif /* DRM */
+ /* Misc. */
+ case 0x41545900: /* ATYIO_CLKR */
+ case 0x41545901: /* ATYIO_CLKW */
+ case PCIIOC_CONTROLLER:
+ case PCIIOC_MMAP_IS_IO:
+ case PCIIOC_MMAP_IS_MEM:
+ case PCIIOC_WRITE_COMBINE:
error = sys_ioctl (fd, cmd, arg);
goto out;
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/sparc64/kernel/irq.c linux.20p9/arch/sparc64/kernel/irq.c
--- linux.vanilla/arch/sparc64/kernel/irq.c Sun Mar 25 17:31:53 2001
+++ linux.20p9/arch/sparc64/kernel/irq.c Wed Jul 4 16:03:53 2001
@@ -1,4 +1,4 @@
-/* $Id: irq.c,v 1.76.2.3 2000/03/02 02:03:27 davem Exp $
+/* $Id: irq.c,v 1.76.2.4 2001/06/04 06:51:17 ecd Exp $
* irq.c: UltraSparc IRQ handling/init/registry.
*
* Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu)
@@ -1048,6 +1048,8 @@
unsigned char flags = bp->flags;
nbp = __bucket(bp->irq_chain);
+ bp->irq_chain = 0;
+
if((flags & IBF_ACTIVE) != 0) {
if((flags & IBF_MULTI) == 0) {
struct irqaction *ap = bp->irq_info;
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/sparc64/kernel/process.c linux.20p9/arch/sparc64/kernel/process.c
--- linux.vanilla/arch/sparc64/kernel/process.c Sun Mar 25 17:31:52 2001
+++ linux.20p9/arch/sparc64/kernel/process.c Wed Jul 4 16:03:53 2001
@@ -1,4 +1,4 @@
-/* $Id: process.c,v 1.92.2.3 1999/12/05 07:24:38 davem Exp $
+/* $Id: process.c,v 1.92.2.4 2001/06/03 13:41:48 ecd Exp $
* arch/sparc64/kernel/process.c
*
* Copyright (C) 1995, 1996 David S. Miller (davem@caip.rutgers.edu)
@@ -116,6 +116,7 @@
extern void (*prom_palette)(int);
extern int serial_console;
#endif
+extern void (*prom_keyboard)(void);
void machine_halt(void)
{
@@ -126,6 +127,8 @@
if (!serial_console && prom_palette)
prom_palette (1);
#endif
+ if (prom_keyboard)
+ prom_keyboard();
prom_halt();
panic("Halt failed!");
}
@@ -144,6 +147,8 @@
if (!serial_console && prom_palette)
prom_palette (1);
#endif
+ if (prom_keyboard)
+ prom_keyboard();
if (cmd)
prom_reboot(cmd);
if (*reboot_command)
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/sparc64/kernel/psycho.c linux.20p9/arch/sparc64/kernel/psycho.c
--- linux.vanilla/arch/sparc64/kernel/psycho.c Sun Mar 25 17:31:53 2001
+++ linux.20p9/arch/sparc64/kernel/psycho.c Thu Jul 26 15:40:16 2001
@@ -1,4 +1,4 @@
-/* $Id: psycho.c,v 1.85.2.11 2000/10/24 21:00:53 davem Exp $
+/* $Id: psycho.c,v 1.85.2.13 2001/06/28 01:31:12 davem Exp $
* psycho.c: Ultra/AX U2P PCI controller support.
*
* Copyright (C) 1997 David S. Miller (davem@caipfs.rutgers.edu)
@@ -682,12 +682,26 @@
static inline struct pci_vma *pci_vma_alloc(void)
{
- return kmalloc(sizeof(struct pci_vma), GFP_ATOMIC);
+ struct pci_vma *vma = kmalloc(sizeof(struct pci_vma), GFP_ATOMIC);
+
+ if (!vma) {
+ prom_printf("PCI: Critical error, cannot allocate PCI_VMA.\n");
+ prom_halt();
+ }
+
+ return vma;
}
static inline struct pcidev_cookie *pci_devcookie_alloc(void)
{
- return kmalloc(sizeof(struct pcidev_cookie), GFP_ATOMIC);
+ struct pcidev_cookie *cookie = kmalloc(sizeof(struct pcidev_cookie), GFP_ATOMIC);
+
+ if (!cookie) {
+ prom_printf("PCI: Critical error, cannot allocate PCIDEV_COOKIE.\n");
+ prom_halt();
+ }
+
+ return cookie;
}
@@ -804,18 +818,48 @@
}
}
+static void __init pci_fixup_host_bridge_self(struct pci_bus *pbus)
+{
+ struct pci_dev *pdev;
+
+ for (pdev = pbus->devices; pdev; pdev = pdev->sibling) {
+ if (pdev->class >> 8 == PCI_CLASS_BRIDGE_HOST) {
+ pbus->self = pdev;
+ return;
+ }
+ }
+
+ prom_printf("PCI: Critical error, cannot find host bridge PDEV.\n");
+ prom_halt();
+}
+
+static struct pcidev_cookie * __init pci_alloc_hostbridge_cookie(struct linux_pbm_info *pbm)
+{
+ struct pcidev_cookie *cookie = pci_devcookie_alloc();
+
+ memset(cookie, 0, sizeof(*cookie));
+ cookie->pbm = pbm;
+
+ return cookie;
+}
+
static void __init sabre_probe(struct linux_psycho *sabre)
{
struct pci_bus *pbus = sabre->pci_bus;
static unsigned char busno = 0;
+ sabre->pbms_same_domain = 1;
+
pbus->number = pbus->secondary = busno;
pbus->sysdata = sabre;
pbus->subordinate = pci_scan_bus(pbus);
busno = pbus->subordinate + 1;
- for(pbus = pbus->children; pbus; pbus = pbus->next) {
+ pci_fixup_host_bridge_self(pbus);
+ pbus->self->sysdata = pci_alloc_hostbridge_cookie(&sabre->pbm_A);
+
+ for (pbus = pbus->children; pbus; pbus = pbus->next) {
if (pbus->number == sabre->pbm_A.pci_first_busno)
memcpy(&sabre->pbm_A.pci_bus, pbus, sizeof(*pbus));
if (pbus->number == sabre->pbm_B.pci_first_busno)
@@ -845,6 +889,9 @@
pbus->subordinate = pci_scan_bus(pbus);
+ pci_fixup_host_bridge_self(pbus);
+ pbus->self->sysdata = pci_alloc_hostbridge_cookie(pbm);
+
/*
* Set the maximum subordinate bus of this pbm.
*/
@@ -1852,20 +1899,21 @@
/* Slot determination is only slightly complex. Handle
* the easy case first.
+ *
+ * Basically, device number zero on the top-level bus is
+ * always the PCI host controller. Slot 0 is then device 1.
+ * PBM A supports two external slots (0 and 1), and PBM B
+ * supports 4 external slots (0, 1, 2, and 3). On-board PCI
+ * devices are wired to device numbers outside of these
+ * ranges. -DaveM
*/
if(pdev->bus->number == pbm->pci_first_busno) {
- if(pbm == &pbm->parent->pbm_A)
- slot = (pdev->devfn >> 3) - 1;
- else
- slot = (pdev->devfn >> 3) - 2;
+ slot = (pdev->devfn >> 3) - 1;
} else {
/* Underneath a bridge, use slot number of parent
* bridge.
*/
- if(pbm == &pbm->parent->pbm_A)
- slot = (pdev->bus->self->devfn >> 3) - 1;
- else
- slot = (pdev->bus->self->devfn >> 3) - 2;
+ slot = (pdev->bus->self->devfn >> 3) - 1;
/* Use low slot number bits of child as IRQ line. */
line = (pdev->devfn >> 3) & 0x03;
@@ -2082,6 +2130,8 @@
if (apb_present(psycho)) {
sabre_probe(psycho);
} else {
+ psycho->pbms_same_domain = 0;
+
/* Probe busses under PBM B. */
pbm_probe(&psycho->pbm_B);
@@ -2656,4 +2706,148 @@
return str;
}
+/* Platform support for /proc/bus/pci/X/Y mmap()s. */
+
+/* Adjust vm_offset of VMA such that it is the physical page offset corresponding
+ * to the 32-bit pci bus offset for DEV requested by the user.
+ *
+ * Basically, the user finds the base address for his device which he wishes
+ * to mmap. They read the 32-bit value from the config space base register,
+ * add whatever PAGE_SIZE multiple offset they wish, and feed this into the
+ * offset parameter of mmap on /proc/bus/pci/XXX for that device.
+ *
+ * Returns negative error code on failure, zero on success.
+ */
+static __inline__ int __pci_mmap_make_offset(struct pci_dev *dev, struct vm_area_struct *vma,
+ enum pci_mmap_state mmap_state)
+{
+ unsigned long user_offset = vma->vm_offset;
+ unsigned long user32 = user_offset & 0xffffffffUL;
+ unsigned long largest_base, this_base, addr32;
+ int i;
+
+ /* Figure out which base address this is for. */
+ largest_base = 0UL;
+ for (i = 0; i <= 6; i++) {
+ unsigned long base = dev->base_address[i];
+
+ /* Active? */
+ if (!base)
+ continue;
+
+ /* Same type? */
+ if (i == 6) {
+ if (mmap_state != pci_mmap_mem)
+ continue;
+ } else {
+ if ((mmap_state == pci_mmap_io &&
+ (base & PCI_BASE_ADDRESS_SPACE_IO) == 0) ||
+ (mmap_state == pci_mmap_mem &&
+ (base & PCI_BASE_ADDRESS_SPACE_IO) != 0))
+ continue;
+ }
+
+ this_base = base;
+
+ addr32 = (this_base & PAGE_MASK) & 0xffffffffUL;
+
+ if (mmap_state == pci_mmap_io)
+ addr32 &= 0xffffff;
+
+ if (addr32 <= user32 && this_base > largest_base)
+ largest_base = this_base;
+ }
+
+ if (largest_base == 0UL)
+ return -EINVAL;
+
+ largest_base = __pa(largest_base);
+
+ /* Now construct the final physical address. */
+ if (mmap_state == pci_mmap_io)
+ vma->vm_offset = (((largest_base & ~0xffffffUL) | user32) & PAGE_MASK);
+ else
+ vma->vm_offset = (((largest_base & ~0xffffffffUL) | user32) & PAGE_MASK);
+
+ return 0;
+}
+
+/* Set vm_flags of VMA, as appropriate for this architecture, for a pci device
+ * mapping.
+ */
+static __inline__ void __pci_mmap_set_flags(struct pci_dev *dev, struct vm_area_struct *vma,
+ enum pci_mmap_state mmap_state)
+{
+ vma->vm_flags |= (VM_SHM | VM_LOCKED);
+}
+
+/* Set vm_page_prot of VMA, as appropriate for this architecture, for a pci
+ * device mapping.
+ */
+static __inline__ void __pci_mmap_set_pgprot(struct pci_dev *dev, struct vm_area_struct *vma,
+ enum pci_mmap_state mmap_state)
+{
+ /* Our io_remap_page_range takes care of this, do nothing. */
+}
+
+extern int io_remap_page_range(unsigned long from, unsigned long offset,
+ unsigned long size, pgprot_t prot, int space);
+
+/* Perform the actual remap of the pages for a PCI device mapping, as appropriate
+ * for this architecture. The region in the process to map is described by vm_start
+ * and vm_end members of VMA, the base physical address is found in vm_pgoff.
+ * The pci device structure is provided so that architectures may make mapping
+ * decisions on a per-device or per-bus basis.
+ *
+ * Returns a negative error code on failure, zero on success.
+ */
+int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
+ enum pci_mmap_state mmap_state,
+ int write_combine)
+{
+ int ret;
+
+ ret = __pci_mmap_make_offset(dev, vma, mmap_state);
+ if (ret < 0)
+ return ret;
+
+ __pci_mmap_set_flags(dev, vma, mmap_state);
+ __pci_mmap_set_pgprot(dev, vma, mmap_state);
+
+ ret = io_remap_page_range(vma->vm_start,
+ (vma->vm_offset |
+ (write_combine ? 0x1UL : 0x0UL)),
+ vma->vm_end - vma->vm_start, vma->vm_page_prot, 0);
+ if (ret)
+ return ret;
+
+ vma->vm_flags |= VM_IO;
+ return 0;
+}
+
+/* Return the index of the PCI controller for device PDEV. */
+
+int pci_controller_num(struct pci_dev *pdev)
+{
+ struct pcidev_cookie *cookie = pdev->sysdata;
+ int ret;
+
+ if (cookie != NULL) {
+ struct linux_pbm_info *pbm = cookie->pbm;
+
+ if (pbm == NULL || pbm->parent == NULL) {
+ ret = -ENXIO;
+ } else {
+ ret = pbm->parent->index;
+ if (!pbm->parent->pbms_same_domain)
+ ret = ((ret << 1) +
+ ((pbm == &pbm->parent->pbm_B) ? 1 : 0));
+ }
+ } else {
+ ret = -ENXIO;
+ }
+
+ return ret;
+}
+
#endif
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/sparc64/kernel/ptrace.c linux.20p9/arch/sparc64/kernel/ptrace.c
--- linux.vanilla/arch/sparc64/kernel/ptrace.c Sun Mar 25 17:31:53 2001
+++ linux.20p9/arch/sparc64/kernel/ptrace.c Wed Jul 4 16:03:53 2001
@@ -569,12 +569,12 @@
#endif
if(request == PTRACE_TRACEME) {
/* are we already being traced? */
- if (current->flags & PF_PTRACED) {
+ if (current->ptrace & PT_PTRACED) {
pt_error_return(regs, EPERM);
goto out;
}
/* set the ptrace bit in the process flags. */
- current->flags |= PF_PTRACED;
+ current->ptrace |= PT_PTRACED;
pt_succ_return(regs, 0);
goto out;
}
@@ -616,11 +616,11 @@
goto out;
}
/* the same process cannot be attached many times */
- if (child->flags & PF_PTRACED) {
+ if (child->ptrace & PT_PTRACED) {
pt_error_return(regs, EPERM);
goto out;
}
- child->flags |= PF_PTRACED;
+ child->ptrace |= PT_PTRACED;
write_lock_irqsave(&tasklist_lock, flags);
if(child->p_pptr != current) {
REMOVE_LINKS(child);
@@ -632,7 +632,7 @@
pt_succ_return(regs, 0);
goto out;
}
- if (!(child->flags & PF_PTRACED)
+ if (!(child->ptrace & PT_PTRACED)
&& ((current->personality & PER_BSD) && (request != PTRACE_SUNATTACH))
&& (!(current->personality & PER_BSD) && (request != PTRACE_ATTACH))) {
pt_error_return(regs, ESRCH);
@@ -1064,9 +1064,9 @@
}
if (request == PTRACE_SYSCALL)
- child->flags |= PF_TRACESYS;
+ child->ptrace |= PT_TRACESYS;
else
- child->flags &= ~PF_TRACESYS;
+ child->ptrace &= ~PT_TRACESYS;
child->exit_code = data;
#ifdef DEBUG_PTRACE
@@ -1104,7 +1104,7 @@
pt_error_return(regs, EIO);
goto out;
}
- child->flags &= ~(PF_PTRACED|PF_TRACESYS);
+ child->ptrace &= ~(PT_PTRACED|PT_TRACESYS);
child->exit_code = data;
write_lock_irqsave(&tasklist_lock, flags);
@@ -1139,8 +1139,8 @@
#ifdef DEBUG_PTRACE
printk("%s [%d]: syscall_trace\n", current->comm, current->pid);
#endif
- if ((current->flags & (PF_PTRACED|PF_TRACESYS))
- != (PF_PTRACED|PF_TRACESYS))
+ if ((current->ptrace & (PT_PTRACED|PT_TRACESYS))
+ != (PT_PTRACED|PT_TRACESYS))
return;
current->exit_code = SIGTRAP;
current->state = TASK_STOPPED;
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/sparc64/kernel/setup.c linux.20p9/arch/sparc64/kernel/setup.c
--- linux.vanilla/arch/sparc64/kernel/setup.c Sun Mar 25 17:31:53 2001
+++ linux.20p9/arch/sparc64/kernel/setup.c Wed Jul 4 16:03:53 2001
@@ -1,4 +1,4 @@
-/* $Id: setup.c,v 1.43.2.5 2000/10/02 02:05:37 anton Exp $
+/* $Id: setup.c,v 1.43.2.7 2001/06/03 13:41:48 ecd Exp $
* linux/arch/sparc64/kernel/setup.c
*
* Copyright (C) 1995,1996 David S. Miller (davem@caip.rutgers.edu)
@@ -65,6 +65,7 @@
#if CONFIG_SUN_CONSOLE
void (*prom_palette)(int);
#endif
+void (*prom_keyboard)(void);
asmlinkage void sys_sync(void); /* it's really int */
static void
@@ -620,6 +621,10 @@
extern int smp_bogo(char *);
extern int mmu_info(char *);
+#ifndef __SMP__
+unsigned int up_clock_tick;
+#endif
+
int get_cpuinfo(char *buffer)
{
int cpuid=smp_processor_id();
@@ -634,7 +639,8 @@
"ncpus probed\t: %d\n"
"ncpus active\t: %d\n"
#ifndef __SMP__
- "BogoMips\t: %lu.%02lu\n"
+ "Cpu0Bogo\t: %lu.%02lu\n"
+ "Cpu0ClkTck\t: %016lx\n"
#endif
,
sparc_cpu_type[cpuid],
@@ -642,7 +648,8 @@
prom_rev, prom_prev >> 16, (prom_prev >> 8) & 0xff, prom_prev & 0xff,
linux_num_cpus, smp_num_cpus
#ifndef __SMP__
- , loops_per_jiffy/(500000/HZ), (loops_per_jiffy/(5000/HZ)) % 100
+ , loops_per_jiffy/(500000/HZ), (loops_per_jiffy/(5000/HZ)) % 100,
+ (unsigned long) up_clock_tick
#endif
);
#ifdef __SMP__
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/sparc64/kernel/signal.c linux.20p9/arch/sparc64/kernel/signal.c
--- linux.vanilla/arch/sparc64/kernel/signal.c Sun Mar 25 17:31:53 2001
+++ linux.20p9/arch/sparc64/kernel/signal.c Thu Jul 26 15:40:16 2001
@@ -1,4 +1,4 @@
-/* $Id: signal.c,v 1.38.2.1 1999/06/14 00:36:21 davem Exp $
+/* $Id: signal.c,v 1.38.2.3 2001/06/19 16:49:41 davem Exp $
* arch/sparc64/kernel/signal.c
*
* Copyright (C) 1991, 1992 Linus Torvalds
@@ -850,7 +850,7 @@
if (!signr) break;
- if ((current->flags & PF_PTRACED) && signr != SIGKILL) {
+ if ((current->ptrace & PT_PTRACED) && signr != SIGKILL) {
current->exit_code = signr;
current->state = TASK_STOPPED;
notify_parent(current, SIGCHLD);
@@ -906,7 +906,7 @@
continue;
case SIGSTOP:
- if (current->flags & PF_PTRACED)
+ if (current->ptrace & PT_PTRACED)
continue;
current->state = TASK_STOPPED;
current->exit_code = signr;
@@ -918,12 +918,8 @@
case SIGQUIT: case SIGILL: case SIGTRAP:
case SIGABRT: case SIGFPE: case SIGSEGV: case SIGBUS:
- if(current->binfmt && current->binfmt->core_dump) {
- lock_kernel();
- if(current->binfmt->core_dump(signr, regs))
- exit_code |= 0x80;
- unlock_kernel();
- }
+ if (do_coredump(signr, regs))
+ exit_code |= 0x80;
#ifdef DEBUG_SIGNALS
/* Very useful to debug the dynamic linker */
printk ("Sig %d going...\n", (int)signr);
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/sparc64/kernel/signal32.c linux.20p9/arch/sparc64/kernel/signal32.c
--- linux.vanilla/arch/sparc64/kernel/signal32.c Sun Mar 25 17:31:52 2001
+++ linux.20p9/arch/sparc64/kernel/signal32.c Thu Jul 26 15:40:16 2001
@@ -1,4 +1,4 @@
-/* $Id: signal32.c,v 1.47.2.3 1999/12/20 01:14:06 davem Exp $
+/* $Id: signal32.c,v 1.47.2.5 2001/06/19 16:49:42 davem Exp $
* arch/sparc64/kernel/signal32.c
*
* Copyright (C) 1991, 1992 Linus Torvalds
@@ -1279,7 +1279,7 @@
if (!signr) break;
- if ((current->flags & PF_PTRACED) && signr != SIGKILL) {
+ if ((current->ptrace & PT_PTRACED) && signr != SIGKILL) {
current->exit_code = signr;
current->state = TASK_STOPPED;
notify_parent(current, SIGCHLD);
@@ -1335,7 +1335,7 @@
continue;
case SIGSTOP:
- if (current->flags & PF_PTRACED)
+ if (current->ptrace & PT_PTRACED)
continue;
current->state = TASK_STOPPED;
current->exit_code = signr;
@@ -1347,14 +1347,8 @@
case SIGQUIT: case SIGILL: case SIGTRAP:
case SIGABRT: case SIGFPE: case SIGSEGV: case SIGBUS:
- if(current->binfmt && current->binfmt->core_dump) {
- lock_kernel();
- if(current->binfmt &&
- current->binfmt->core_dump &&
- current->binfmt->core_dump(signr, regs))
- exit_code |= 0x80;
- unlock_kernel();
- }
+ if (do_coredump(signr, regs))
+ exit_code |= 0x80;
#ifdef DEBUG_SIGNALS
/* Very useful to debug dynamic linker problems */
printk ("Sig %ld going for %s[%d]...\n", signr, current->comm, current->pid);
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/sparc64/kernel/smp.c linux.20p9/arch/sparc64/kernel/smp.c
--- linux.vanilla/arch/sparc64/kernel/smp.c Sun Mar 25 17:31:53 2001
+++ linux.20p9/arch/sparc64/kernel/smp.c Wed Jul 4 16:03:53 2001
@@ -77,15 +77,17 @@
for (i = 0; i < NR_CPUS; i++)
if(cpu_present_map & (1UL << i))
len += sprintf(buf + len,
- "Cpu%dBogo\t: %lu.%02lu\n",
+ "Cpu%dBogo\t: %lu.%02lu\n"
+ "Cpu%dClkTck\t: %016lx\n",
i, cpu_data[i].udelay_val / (500000/HZ),
- (cpu_data[i].udelay_val / (5000/HZ)) % 100);
+ (cpu_data[i].udelay_val / (5000/HZ)) % 100,
+ i, (unsigned long) cpu_data[i].clock_tick);
return len;
}
__initfunc(void smp_store_cpu_info(int id))
{
- int i;
+ int i, no;
cpu_data[id].irq_count = 0;
cpu_data[id].bh_count = 0;
@@ -93,6 +95,13 @@
smp_setup_percpu_timer() */
cpu_data[id].udelay_val = loops_per_jiffy;
+
+ for (no = 0; no < linux_num_cpus; no++)
+ if (linux_cpus[no].mid == id)
+ break;
+
+ cpu_data[id].clock_tick = prom_getintdefault(linux_cpus[no].prom_node,
+ "clock-frequency", 0);
cpu_data[id].pgcache_size = 0;
cpu_data[id].pte_cache[0] = NULL;
cpu_data[id].pte_cache[1] = NULL;
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/sparc64/kernel/sparc64_ksyms.c linux.20p9/arch/sparc64/kernel/sparc64_ksyms.c
--- linux.vanilla/arch/sparc64/kernel/sparc64_ksyms.c Sun Mar 25 17:37:30 2001
+++ linux.20p9/arch/sparc64/kernel/sparc64_ksyms.c Wed Jul 4 16:03:53 2001
@@ -1,4 +1,4 @@
-/* $Id: sparc64_ksyms.c,v 1.58.2.13 2001/01/03 22:05:54 anton Exp $
+/* $Id: sparc64_ksyms.c,v 1.58.2.14 2001/03/01 00:48:59 davem Exp $
* arch/sparc64/kernel/sparc64_ksyms.c: Sparc64 specific ksyms support.
*
* Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/sparc64/kernel/sys_sparc32.c linux.20p9/arch/sparc64/kernel/sys_sparc32.c
--- linux.vanilla/arch/sparc64/kernel/sys_sparc32.c Sun Mar 25 17:37:30 2001
+++ linux.20p9/arch/sparc64/kernel/sys_sparc32.c Thu Jul 26 15:40:16 2001
@@ -1,4 +1,4 @@
-/* $Id: sys_sparc32.c,v 1.107.2.16 2000/12/20 02:45:00 anton Exp $
+/* $Id: sys_sparc32.c,v 1.107.2.17 2001/07/06 05:04:31 davem Exp $
* sys_sparc32.c: Conversion between 32bit and 64bit native syscalls.
*
* Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
@@ -3002,6 +3002,7 @@
{
struct linux_binprm bprm;
struct dentry * dentry;
+ int was_dumpable;
int retval;
int i;
@@ -3029,6 +3030,9 @@
return bprm.envc;
}
+ was_dumpable = current->dumpable;
+ current->dumpable = 0;
+
retval = prepare_binprm(&bprm);
if(retval>=0) {
@@ -3042,9 +3046,12 @@
if (retval >= 0)
retval = search_binary_handler(&bprm,regs);
- if(retval>=0)
+
+ if (retval >= 0) {
/* execve success */
+ current->dumpable = bprm.dumpable;
return retval;
+ }
/* Something went wrong, return the inode and free the argument pages*/
if(bprm.dentry)
@@ -3052,7 +3059,10 @@
for (i=0 ; idumpable = was_dumpable;
+
+ return retval;
}
/*
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/arch/sparc64/solaris/entry64.S linux.20p9/arch/sparc64/solaris/entry64.S
--- linux.vanilla/arch/sparc64/solaris/entry64.S Sun Mar 25 17:31:53 2001
+++ linux.20p9/arch/sparc64/solaris/entry64.S Wed Jul 4 16:03:53 2001
@@ -1,4 +1,4 @@
-/* $Id: entry64.S,v 1.5 1998/03/26 08:46:15 jj Exp $
+/* $Id: entry64.S,v 1.5.2.1 2001/06/18 12:26:13 davem Exp $
* entry64.S: Solaris syscall emulation entry point.
*
* Copyright (C) 1996,1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
@@ -83,7 +83,7 @@
1: srl %i0, 0, %o0
lduw [%l7 + %l4], %l3
srl %i1, 0, %o1
- ldx [%g6 + AOFF_task_flags], %l5
+ ldx [%g6 + AOFF_task_ptrace], %l5
cmp %l3, NR_SYSCALLS
bleu,a,pn %xcc, linux_syscall_for_solaris
sethi %hi(sys_call_table32), %l6
@@ -93,21 +93,21 @@
10: srl %i2, 0, %o2
mov %i5, %o5
andn %l3, 3, %l7
- andcc %l5, 0x20, %g0
+ andcc %l5, 0x02, %g0
bne,pn %icc, solaris_syscall_trace
mov %i0, %l5
2: call %l7
srl %i3, 0, %o3
ret_from_solaris:
stx %o0, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_I0]
- ldx [%g6 + AOFF_task_flags], %l6
+ ldx [%g6 + AOFF_task_ptrace], %l6
sra %o0, 0, %o0
mov %ulo(TSTATE_XCARRY | TSTATE_ICARRY), %g2
ldx [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_TSTATE], %g3
cmp %o0, -ENOIOCTLCMD
sllx %g2, 32, %g2
bgeu,pn %xcc, 1f
- andcc %l6, 0x20, %l6
+ andcc %l6, 0x02, %l6
/* System call success, clear Carry condition code. */
andn %g3, %g2, %g3
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/Makefile linux.20p9/drivers/Makefile
--- linux.vanilla/drivers/Makefile Sun Mar 25 17:31:34 2001
+++ linux.20p9/drivers/Makefile Wed Aug 8 22:18:17 2001
@@ -54,6 +54,10 @@
else
ifeq ($(CONFIG_USB),m)
MOD_SUB_DIRS += usb
+ else
+ ifdef CONFIG_INPUT_ADBHID
+ SUB_DIRS += usb
+ endif
endif
endif
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/block/Config.in linux.20p9/drivers/block/Config.in
--- linux.vanilla/drivers/block/Config.in Sun Mar 25 17:31:23 2001
+++ linux.20p9/drivers/block/Config.in Wed Jul 4 16:03:53 2001
@@ -140,7 +140,7 @@
tristate 'Compaq SMART2 support' CONFIG_BLK_CPQ_DA
fi
if [ "$CONFIG_PCI" = "y" ]; then
- tristate 'Compaq CISS Array support' CONFIG_BLK_CPQ_CISS_DA
+ tristate 'Compaq Smart Array 5xxx support' CONFIG_BLK_CPQ_CISS_DA
fi
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/block/cciss.c linux.20p9/drivers/block/cciss.c
--- linux.vanilla/drivers/block/cciss.c Sun Mar 25 17:31:24 2001
+++ linux.20p9/drivers/block/cciss.c Wed Jul 4 16:03:53 2001
@@ -42,12 +42,12 @@
#include
#define CCISS_DRIVER_VERSION(maj,min,submin) ((maj<<16)|(min<<8)|(submin))
-#define DRIVER_NAME "Compaq CISS Driver (v 1.0.0)"
-#define DRIVER_VERSION CCISS_DRIVER_VERSION(1,0,0)
+#define DRIVER_NAME "Compaq CISS Driver (v 1.0.4)"
+#define DRIVER_VERSION CCISS_DRIVER_VERSION(1,0,4)
/* Embedded module documentation macros - see modules.h */
MODULE_AUTHOR("Charles M. White III - Compaq Computer Corporation");
-MODULE_DESCRIPTION("Driver for Compaq Smart Array Controller 5300");
+MODULE_DESCRIPTION("Driver for Compaq Smart Array 5xxx Controllers ");
#include "cciss_cmd.h"
#include "cciss.h"
@@ -61,6 +61,8 @@
*/
static struct board_type products[] = {
{ 0x40700E11, "Smart Array 5300", &SA5_access },
+ { 0x40800E11, "Smart Array 5i", &SA5B_access},
+ { 0x40820E11, "Smart Array 532", &SA5B_access},
};
/* How long to wait (in millesconds) for board to go into simple mode */
@@ -135,10 +137,10 @@
ctlr = h->ctlr;
size = sprintf(buffer, "%s: Compaq %s Controller\n"
- " Board ID: %08lx\n"
+ " Board ID: 0x%08lx\n"
" Firmware Version: %c%c%c%c\n"
- " Memory Address: %08lx\n"
- " IRQ: 0x%x\n"
+ " Memory Address: 0x%08lx\n"
+ " IRQ: %d\n"
" Logical drives: %d\n"
" Current Q depth: %d\n"
" Current # commands on controller %d\n"
@@ -416,6 +418,8 @@
put_user(read_ahead[MAJOR(inode->i_rdev)], (int*)arg);
return 0;
case BLKRRPART:
+ if(!capable(CAP_SYS_ADMIN))
+ return -EPERM;
return revalidate_logvol(inode->i_rdev, 1);
case CCISS_GETPCIINFO:
@@ -719,7 +723,7 @@
spin_lock_irqsave(&io_request_lock, flags);
if (hba[ctlr]->drv[target].usage_count > maxusage) {
spin_unlock_irqrestore(&io_request_lock, flags);
- printk(KERN_WARNING "cpqarray: Device busy for "
+ printk(KERN_WARNING "cciss: Device busy for "
"revalidation (usage=%d)\n",
hba[ctlr]->drv[target].usage_count);
return -EBUSY;
@@ -730,7 +734,7 @@
max_p = gdev->max_p;
start = target << gdev->minor_shift;
- for(i=max_p; i>=0; i--) {
+ for(i=max_p-1; i>=0; i--) {
int minor = start+i;
kdev_t devi = MKDEV(MAJOR_NR + ctlr, minor);
struct super_block *sb = get_super(devi);
@@ -1125,7 +1129,7 @@
if (timeout)
status = 0;
if(cmd->err_info->CommandStatus != 0)
- { /* an error has occured */
+ { /* an error has occurred */
switch(cmd->err_info->CommandStatus)
{
case CMD_TARGET_STATUS:
@@ -1369,7 +1373,7 @@
a &= ~3;
if ((c = h->cmpQ) == NULL)
{
- printk(KERN_WARNING "cpqarray: Completion of %08lx ignored\n", (unsigned long)a1);
+ printk(KERN_WARNING "cciss: Completion of %08lx ignored\n", (unsigned long)a1);
continue;
}
while(c->busaddr != a) {
@@ -1437,7 +1441,7 @@
printk(" Heartbeat Counter = 0x%x\n\n\n",
readl(&(tb->HeartBeat)));
}
-#endif /* CCISS_DEBUG */
+#endif /* CCISS_DEBUG */
static int cciss_pci_init(ctlr_info_t *c, unchar bus, unchar device_fn)
{
@@ -1447,7 +1451,9 @@
uint addr[6];
__u32 board_id;
struct pci_dev *pdev;
-
+ int cfg_offset;
+ int cfg_base_addr;
+ int cfg_base_addr_index;
int i;
pdev = pci_find_slot(bus, device_fn);
@@ -1487,15 +1493,36 @@
* Memory base addr is first addr , the second points to the config
* table
*/
- c->paddr = addr[0];
- c->vaddr = remap_pci_mem(c->paddr, 128);
- c->cfgtable = (CfgTable_struct *) remap_pci_mem(addr[1],
- sizeof(CfgTable_struct));
- c->board_id = board_id;
+ c->paddr = addr[0] & 0xfffffff0; /* remove the addressing mode bits */
+#ifdef CCISS_DEBUG
+ printk("address 0 = %x\n", c->paddr);
+#endif /* CCISS_DEBUG */
+ c->vaddr = remap_pci_mem(c->paddr, 200);
+ /* get the address index number */
+ cfg_base_addr = readl(c->vaddr + SA5_CTCFG_OFFSET);
+ /* I am not prepared to deal with a 64 bit address value */
+ cfg_base_addr &= 0xffff;
#ifdef CCISS_DEBUG
- print_cfg_table(c->cfgtable);
+ printk("cfg base address = %x\n", cfg_base_addr);
+#endif /* CCISS_DEBUG */
+ cfg_base_addr_index = (cfg_base_addr - PCI_BASE_ADDRESS_0)/4;
+#ifdef CCISS_DEBUG
+ printk("cfg base address index = %x\n", cfg_base_addr_index);
+#endif /* CCISS_DEBUG */
+
+ cfg_offset = readl(c->vaddr + SA5_CTMEM_OFFSET);
+#ifdef CCISS_DEBUG
+ printk("cfg offset = %x\n", cfg_offset);
#endif /* CCISS_DEBUG */
+ c->cfgtable = (CfgTable_struct *)
+ remap_pci_mem((addr[cfg_base_addr_index] & 0xfffffff0)
+ + cfg_offset, sizeof(CfgTable_struct));
+ c->board_id = board_id;
+
+#ifdef CCISS_DEBUG
+ print_cfg_table(c->cfgtable);
+#endif CCISS_DEBUG
for(i=0; iproduct_name = products[i].product_name;
@@ -1509,6 +1536,14 @@
(unsigned long)board_id);
return -1;
}
+ if ( (readb(&c->cfgtable->Signature[0]) != 'C') ||
+ (readb(&c->cfgtable->Signature[1]) != 'I') ||
+ (readb(&c->cfgtable->Signature[2]) != 'S') ||
+ (readb(&c->cfgtable->Signature[3]) != 'S') )
+ {
+ printk("Does not appear to be a valid CISS config table\n");
+ return -1;
+ }
#ifdef CCISS_DEBUG
printk("Trying to put board into Simple mode\n");
#endif /* CCISS_DEBUG */
@@ -1550,14 +1585,22 @@
int index;
unchar bus=0, dev_fn=0;
-
+
+ #define CCISS_BOARD_TYPES 2
+ static int cciss_device_id[CCISS_BOARD_TYPES] = {
+ PCI_DEVICE_ID_COMPAQ_CISS, PCI_DEVICE_ID_COMPAQ_CISSB};
+ int brdtype;
+
+ /* search for all PCI board types that could be for this driver */
+ for(brdtype=0; brdtypevaddr + SA5_REPLY_INTR_MASK_OFFSET);
+ } else /* Turn them off */
+ {
+ writel( SA5B_INTR_OFF,
+ h->vaddr + SA5_REPLY_INTR_MASK_OFFSET);
+ }
+}
+/*
* Returns true if fifo is full.
*
*/
@@ -183,6 +204,21 @@
return 0 ;
}
+/*
+ * Returns true if an interrupt is pending..
+ */
+static unsigned long SA5B_intr_pending(ctlr_info_t *h)
+{
+ unsigned long register_value =
+ readl(h->vaddr + SA5_INTR_STATUS);
+#ifdef CCISS_DEBUG
+ printk("cciss: intr_pending %lx\n", register_value);
+#endif /* CCISS_DEBUG */
+ if( register_value & SA5B_INTR_PENDING)
+ return 1;
+ return 0 ;
+}
+
static struct access_method SA5_access = {
SA5_submit_command,
@@ -192,6 +228,14 @@
SA5_completed,
};
+static struct access_method SA5B_access = {
+ SA5_submit_command,
+ SA5B_intr_mask,
+ SA5_fifo_full,
+ SA5B_intr_pending,
+ SA5_completed,
+};
+
struct board_type {
__u32 board_id;
char *product_name;
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/block/cciss_cmd.h linux.20p9/drivers/block/cciss_cmd.h
--- linux.vanilla/drivers/block/cciss_cmd.h Sun Mar 25 17:31:24 2001
+++ linux.20p9/drivers/block/cciss_cmd.h Wed Jul 4 16:03:53 2001
@@ -125,20 +125,20 @@
//Command List Structure
typedef union _SCSI3Addr_struct {
struct {
+ BYTE Dev;
BYTE Bus:6;
BYTE Mode:2; // b00
- BYTE Dev;
} PeripDev;
struct {
+ BYTE DevLSB;
BYTE DevMSB:6;
BYTE Mode:2; // b01
- BYTE DevLSB;
} LogDev;
struct {
- BYTE Targ:6;
- BYTE Mode:2; // b10
BYTE Dev:5;
BYTE Bus:3;
+ BYTE Targ:6;
+ BYTE Mode:2; // b10
} LogUnit;
} SCSI3Addr_struct;
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/block/cpqarray.c linux.20p9/drivers/block/cpqarray.c
--- linux.vanilla/drivers/block/cpqarray.c Sun Mar 25 17:31:24 2001
+++ linux.20p9/drivers/block/cpqarray.c Wed Jul 4 16:03:53 2001
@@ -41,8 +41,8 @@
#define SMART2_DRIVER_VERSION(maj,min,submin) ((maj<<16)|(min<<8)|(submin))
-#define DRIVER_NAME "Compaq SMART2 Driver (v 1.0.11)"
-#define DRIVER_VERSION SMART2_DRIVER_VERSION(1,0,11)
+#define DRIVER_NAME "Compaq SMART2 Driver (v 1.0.12)"
+#define DRIVER_VERSION SMART2_DRIVER_VERSION(1,0,12)
/* Embedded module documentation macros - see modules.h */
/* Original author Chris Frantz - Compaq Computer Corporation */
@@ -1167,6 +1167,8 @@
put_user(read_ahead[MAJOR(inode->i_rdev)], (int*)arg);
return 0;
case BLKRRPART:
+ if(!capable(CAP_SYS_ADMIN))
+ return -EPERM;
return revalidate_logvol(inode->i_rdev, 1);
case IDAPASSTHRU:
if (!suser()) return -EPERM;
@@ -1556,7 +1558,7 @@
max_p = gdev->max_p;
start = target << gdev->minor_shift;
- for(i=max_p; i>=0; i--) {
+ for(i=max_p-1; i>=0; i--) {
int minor = start+i;
kdev_t devi = MKDEV(MAJOR_NR + ctlr, minor);
struct super_block *sb = get_super(devi);
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/block/genhd.c linux.20p9/drivers/block/genhd.c
--- linux.vanilla/drivers/block/genhd.c Sun Mar 25 17:37:30 2001
+++ linux.20p9/drivers/block/genhd.c Wed Jul 4 16:03:53 2001
@@ -336,7 +336,8 @@
goto done; /* nothing left to do */
hd->part[current_minor].nr_sects = NR_SECTS(p) * sector_size; /* JSt */
- hd->part[current_minor].start_sect = first_sector + START_SECT(p) * sector_size;
+ hd->part[current_minor].start_sect =
+ first_sector + START_SECT(p) * sector_size;
this_sector = first_sector + START_SECT(p) * sector_size;
dev = MKDEV(hd->major, current_minor);
brelse(bh);
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/block/ide-cd.c linux.20p9/drivers/block/ide-cd.c
--- linux.vanilla/drivers/block/ide-cd.c Sun Mar 25 17:31:23 2001
+++ linux.20p9/drivers/block/ide-cd.c Wed Jul 4 16:03:53 2001
@@ -254,7 +254,7 @@
* They will disappear later when I get the time to
* do it cleanly.
* - Minimize the TOC reading - only do it when we
- * know a media change has occured.
+ * know a media change has occurred.
* - Moved all the CDROMREADx ioctls to the Uniform layer.
* - Heiko Eissfeldt supplied
* some fixes for CDI.
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/block/ide-dma.c linux.20p9/drivers/block/ide-dma.c
--- linux.vanilla/drivers/block/ide-dma.c Sun Mar 25 17:31:24 2001
+++ linux.20p9/drivers/block/ide-dma.c Wed Jul 4 16:03:53 2001
@@ -217,6 +217,20 @@
xcount = bcount & 0xffff;
if (is_trm290_chipset)
xcount = ((xcount >> 2) - 1) << 16;
+ if (xcount == 0x0000) {
+ /*
+ * Most chipsets correctly interpret a length of 0x0000 as 64KB,
+ * but at least one (e.g. CS5530) misinterprets it as zero (!).
+ * So here we break the 64KB entry into two 32KB entries instead.
+ */
+ if (count++ >= PRD_ENTRIES) {
+ printk("%s: DMA table too small\n", drive->name);
+ return 0; /* revert to PIO for this request */
+ }
+ *table++ = cpu_to_le32(0x8000);
+ *table++ = cpu_to_le32(addr + 0x8000);
+ xcount = 0x8000;
+ }
*table++ = cpu_to_le32(xcount);
addr += bcount;
size -= bcount;
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/block/ide-floppy.c linux.20p9/drivers/block/ide-floppy.c
--- linux.vanilla/drivers/block/ide-floppy.c Sun Mar 25 17:31:24 2001
+++ linux.20p9/drivers/block/ide-floppy.c Wed Jul 4 16:03:54 2001
@@ -125,7 +125,7 @@
byte *current_position; /* Pointer into the above buffer */
void (*callback) (ide_drive_t *); /* Called when this packet command is completed */
byte pc_buffer[IDEFLOPPY_PC_BUFFER_SIZE]; /* Temporary buffer */
- unsigned int flags; /* Status/Action bit flags */
+ unsigned long flags; /* Status/Action bit flags */
} idefloppy_pc_t;
/*
@@ -259,7 +259,7 @@
idefloppy_flexible_disk_page_t flexible_disk_page; /* Copy of the flexible disk page */
int wp; /* Write protect */
- unsigned int flags; /* Status/Action flags */
+ unsigned long flags; /* Status/Action flags */
} idefloppy_floppy_t;
/*
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/block/ide-pmac.c linux.20p9/drivers/block/ide-pmac.c
--- linux.vanilla/drivers/block/ide-pmac.c Sun Mar 25 17:37:30 2001
+++ linux.20p9/drivers/block/ide-pmac.c Wed Aug 8 22:17:37 2001
@@ -97,7 +97,7 @@
/* Wait 2s for disk to answer on IDE bus after
* enable operation.
* NOTE: There is at least one case I know of a disk that needs about 10sec
- * before anwering on the bus. I beleive we could add a kernel command
+ * before anwering on the bus. I believe we could add a kernel command
* line arg to override this delay for such cases.
*/
#define IDE_WAKEUP_DELAY_MS 2000
@@ -192,9 +192,10 @@
}
#endif
-/* Setup timings for the selected drive (master/slave). I still need to verify if this
- * is enough, I beleive selectproc will be called whenever an IDE command is started,
- * but... */
+/* Setup timings for the selected drive (master/slave). I still need to
+ * verify if this is enough, I believe selectproc will be called whenever
+ * an IDE command is started, but...
+ */
static void
pmac_ide_selectproc(ide_drive_t *drive)
{
@@ -905,7 +906,7 @@
* Problem: This can schedule. I moved the block device
* wakeup almost late by priority because of that.
*/
- if (DRIVER(drive))
+ if (DRIVER(drive) && DRIVER(drive)->media_change)
DRIVER(drive)->media_change(drive);
/* We kick the VFS too (see fix in ide.c revalidate) */
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/block/ide.c linux.20p9/drivers/block/ide.c
--- linux.vanilla/drivers/block/ide.c Sun Mar 25 17:31:24 2001
+++ linux.20p9/drivers/block/ide.c Wed Jul 4 16:03:54 2001
@@ -1298,9 +1298,10 @@
del_timer(&hwgroup->timer);
if ((handler = hwgroup->handler) == NULL) {
/*
- * Either a marginal timeout occured (got the interrupt just as timer expired),
- * or we were "sleeping" to give other devices a chance. Either way, we don't
- * really want to complain about anything.
+ * Either a marginal timeout occurred (got the interrupt
+ * just as timer expired), or we were "sleeping" to give
+ * other devices a chance. Either way, we don't really
+ * want to complain about anything.
*/
if (hwgroup->sleeping) {
hwgroup->sleeping = 0;
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/block/ll_rw_blk.c linux.20p9/drivers/block/ll_rw_blk.c
--- linux.vanilla/drivers/block/ll_rw_blk.c Sun Mar 25 17:37:30 2001
+++ linux.20p9/drivers/block/ll_rw_blk.c Wed Aug 8 22:14:09 2001
@@ -1063,6 +1063,9 @@
#ifdef CONFIG_DASD
dasd_init();
#endif
+#if defined(CONFIG_S390_TAPE) && defined(CONFIG_S390_TAPE_BLOCK)
+ tapeblock_init();
+#endif
#ifdef CONFIG_BLK_DEV_XPRAM
xpram_init();
#endif
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/block/paride/pt.c linux.20p9/drivers/block/paride/pt.c
--- linux.vanilla/drivers/block/paride/pt.c Sun Mar 25 17:31:24 2001
+++ linux.20p9/drivers/block/paride/pt.c Thu Jul 26 15:04:24 2001
@@ -753,6 +753,10 @@
pt_rewind(unit);
return 0;
+ case MTWEOF:
+ pt_write_fm(unit);
+ return 0;
+
default:
printk("%s: Unimplemented mt_op %d\n",PT.name,
mtop.mt_op);
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/cdrom/cdrom.c linux.20p9/drivers/cdrom/cdrom.c
--- linux.vanilla/drivers/cdrom/cdrom.c Sun Mar 25 18:44:42 2001
+++ linux.20p9/drivers/cdrom/cdrom.c Wed Jul 4 16:03:54 2001
@@ -514,12 +514,12 @@
couldn't close the tray. We only care
that there is no disc in the drive,
since that is the _REAL_ problem here.*/
- ret=-ENOMEDIUM;
+ ret = -ENOMEDIUM;
goto clean_up_and_return;
}
} else {
cdinfo(CD_OPEN, "bummer. this drive can't close the tray.\n");
- ret=-ENOMEDIUM;
+ ret = -ENOMEDIUM;
goto clean_up_and_return;
}
/* Ok, the door should be closed now.. Check again */
@@ -527,7 +527,7 @@
if ((ret == CDS_NO_DISC) || (ret==CDS_TRAY_OPEN)) {
cdinfo(CD_OPEN, "bummer. the tray is still not closed.\n");
cdinfo(CD_OPEN, "tray might not contain a medium.\n");
- ret=-ENOMEDIUM;
+ ret = -ENOMEDIUM;
goto clean_up_and_return;
}
cdinfo(CD_OPEN, "the tray is now closed.\n");
@@ -540,7 +540,7 @@
cdrom_count_tracks(cdi, &tracks);
if (tracks.error == CDS_NO_DISC) {
cdinfo(CD_OPEN, "bummer. no disc.\n");
- ret=-ENOMEDIUM;
+ ret = -ENOMEDIUM;
goto clean_up_and_return;
}
/* CD-Players which don't use O_NONBLOCK, workman
@@ -1952,6 +1952,7 @@
ra.buf += (CD_FRAMESIZE_RAW * frames);
ra.nframes -= frames;
lba += frames;
+ if (frames>ra.nframes) frames=ra.nframes;
}
kfree(cgc.buffer);
return ret;
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/cdrom/sbpcd.c linux.20p9/drivers/cdrom/sbpcd.c
--- linux.vanilla/drivers/cdrom/sbpcd.c Sun Mar 25 17:31:37 2001
+++ linux.20p9/drivers/cdrom/sbpcd.c Thu Jul 26 14:56:04 2001
@@ -4261,7 +4261,7 @@
i=verify_area(VERIFY_READ, (void *) arg, sizeof(struct cdrom_read_audio));
if (i) RETURN_UP(i);
copy_from_user(&read_audio, (void *) arg, sizeof(struct cdrom_read_audio));
- if (read_audio.nframes>D_S[d].sbp_audsiz) RETURN_UP(-EINVAL);
+ if (read_audio.nframes < 0 || read_audio.nframes>D_S[d].sbp_audsiz) RETURN_UP(-EINVAL);
i=verify_area(VERIFY_WRITE, read_audio.buf,
read_audio.nframes*CD_FRAMESIZE_RAW);
if (i) RETURN_UP(i);
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/Config.in linux.20p9/drivers/char/Config.in
--- linux.vanilla/drivers/char/Config.in Sun Mar 25 17:37:30 2001
+++ linux.20p9/drivers/char/Config.in Thu Jul 26 15:39:36 2001
@@ -53,8 +53,8 @@
tristate ' Stallion EasyIO or EC8/32 support' CONFIG_STALLION
tristate ' Stallion EC8/64, ONboard, Brumby support' CONFIG_ISTALLION
fi
- dep_tristate 'Microgate SyncLink card support' CONFIG_SYNCLINK m
- dep_tristate 'HDLC line discipline support' CONFIG_N_HDLC m
+ tristate 'Microgate SyncLink card support' CONFIG_SYNCLINK
+ tristate 'HDLC line discipline support' CONFIG_N_HDLC
fi
bool 'Unix98 PTY support' CONFIG_UNIX98_PTYS
if [ "$CONFIG_UNIX98_PTYS" = "y" ]; then
@@ -102,7 +102,7 @@
tristate ' Acquire SBC Watchdog Timer' CONFIG_ACQUIRE_WDT
tristate ' Advantech SBC Watchdog Timer' CONFIG_ADVANTECH_WDT
tristate ' Berkshire Products PC Watchdog' CONFIG_PCWATCHDOG
- tristate ' Intel i810 TCO timer / Watchdog' CONFIG_I810_TCO
+ tristate ' Intel i810 TCO timer / Watchdog' CONFIG_I810_TCO
tristate ' Mixcom Watchdog' CONFIG_MIXCOMWD
tristate ' SBC-60XX Watchdog Timer' CONFIG_60XX_WDT
tristate ' Software Watchdog' CONFIG_SOFT_WATCHDOG
@@ -114,6 +114,7 @@
fi
fi
tristate ' WDT PCI Watchdog timer' CONFIG_WDTPCI
+ tristate ' ZF MachZ Watchdog' CONFIG_MACHZ_WDT
endmenu
fi
@@ -136,6 +137,7 @@
bool ' AMD Irongate support' CONFIG_AGP_AMD
bool ' Generic SiS support' CONFIG_AGP_SIS
bool ' ALI M1541 support' CONFIG_AGP_ALI
+ bool ' Serverworks LE/HE support' CONFIG_AGP_SWORKS
fi
source drivers/char/drm/Config.in
fi
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/Makefile linux.20p9/drivers/char/Makefile
--- linux.vanilla/drivers/char/Makefile Sun Mar 25 17:37:30 2001
+++ linux.20p9/drivers/char/Makefile Wed Jul 4 16:03:54 2001
@@ -184,12 +184,20 @@
endif
endif
-ifeq ($(CONFIG_SYNCLINK),m)
+ifeq ($(CONFIG_SYNCLINK),y)
+O_OBJS += synclink.o
+else
+ ifeq ($(CONFIG_SYNCLINK),m)
M_OBJS += synclink.o
+ endif
endif
-ifeq ($(CONFIG_N_HDLC),m)
+ifeq ($(CONFIG_N_HDLC),y)
+O_OBJS += n_hdlc.o
+else
+ ifeq ($(CONFIG_N_HDLC),m)
M_OBJS += n_hdlc.o
+ endif
endif
ifeq ($(CONFIG_SPECIALIX),y)
@@ -373,6 +381,14 @@
endif
endif
+ifeq ($(CONFIG_MACHZ_WDT),y)
+O_OBJS += machzwd.o
+else
+ ifeq ($(CONFIG_MACHZ_WDT),m)
+ M_OBJS += machzwd.o
+ endif
+endif
+
ifeq ($(CONFIG_RTC),y)
O_OBJS += rtc.o
endif
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/acquirewdt.c linux.20p9/drivers/char/acquirewdt.c
--- linux.vanilla/drivers/char/acquirewdt.c Sun Mar 25 17:31:26 2001
+++ linux.20p9/drivers/char/acquirewdt.c Thu Jul 26 15:24:25 2001
@@ -107,7 +107,7 @@
break;
default:
- return -ENOIOCTLCMD;
+ return -ENOTTY;
}
return 0;
}
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/advantechwdt.c linux.20p9/drivers/char/advantechwdt.c
--- linux.vanilla/drivers/char/advantechwdt.c Sun Mar 25 17:37:30 2001
+++ linux.20p9/drivers/char/advantechwdt.c Thu Jul 26 15:24:33 2001
@@ -119,7 +119,7 @@
break;
default:
- return -ENOIOCTLCMD;
+ return -ENOTTY;
}
return 0;
}
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/agp/agp.h linux.20p9/drivers/char/agp/agp.h
--- linux.vanilla/drivers/char/agp/agp.h Sun Mar 25 17:31:28 2001
+++ linux.20p9/drivers/char/agp/agp.h Thu Jul 26 18:03:50 2001
@@ -94,7 +94,7 @@
u32 mode;
enum chipset_type type;
enum aper_size_type size_type;
- u32 *key_list;
+ unsigned long *key_list;
atomic_t current_memory_agp;
atomic_t agp_in_use;
int max_memory_agp; /* in number of pages */
@@ -119,15 +119,17 @@
int (*remove_memory) (agp_memory *, off_t, int);
agp_memory *(*alloc_by_type) (size_t, int);
void (*free_by_type) (agp_memory *);
+ unsigned long (*agp_alloc_page) (void);
+ void (*agp_destroy_page) (unsigned long);
};
#define OUTREG32(mmap, addr, val) writel((val),(mmap + (addr)))
#define OUTREG16(mmap, addr, val) writew((val),(mmap + (addr)))
-#define OUTREG8 (mmap, addr, val) writeb((val),(mmap + (addr)))
+#define OUTREG8(mmap, addr, val) writeb((val),(mmap + (addr)))
#define INREG32(mmap, addr) readl(mmap + (addr))
#define INREG16(mmap, addr) readw(mmap + (addr))
-#define INREG8 (mmap, addr) readb(mmap + (addr))
+#define INREG8(mmap, addr) readb(mmap + (addr))
#define CACHE_FLUSH agp_bridge.cache_flush
#define A_SIZE_8(x) ((aper_size_info_8 *) x)
@@ -222,6 +224,24 @@
#ifndef PCI_DEVICE_ID_VIA_8363_0
#define PCI_DEVICE_ID_VIA_8363_0 0x0305
#endif
+#ifndef PCI_DEVICE_ID_AL_M1621_0
+#define PCI_DEVICE_ID_AL_M1621_0 0x1621
+#endif
+#ifndef PCI_DEVICE_ID_AL_M1631_0
+#define PCI_DEVICE_ID_AL_M1631_0 0x1631
+#endif
+#ifndef PCI_DEVICE_ID_AL_M1632_0
+#define PCI_DEVICE_ID_AL_M1632_0 0x1632
+#endif
+#ifndef PCI_DEVICE_ID_AL_M1641_0
+#define PCI_DEVICE_ID_AL_M1641_0 0x1641
+#endif
+#ifndef PCI_DEVICE_ID_AL_M1647_0
+#define PCI_DEVICE_ID_AL_M1647_0 0x1647
+#endif
+#ifndef PCI_DEVICE_ID_AL_M1651_0
+#define PCI_DEVICE_ID_AL_M1651_0 0x1651
+#endif
/* intel register */
@@ -283,5 +303,29 @@
#define ALI_AGPCTRL 0xb8
#define ALI_ATTBASE 0xbc
#define ALI_TLBCTRL 0xc0
+#define ALI_TAGCTRL 0xc4
+#define ALI_CACHE_FLUSH_CTRL 0xD0
+#define ALI_CACHE_FLUSH_ADDR_MASK 0xFFFFF000
+#define ALI_CACHE_FLUSH_EN 0x100
+
+
+/* Serverworks Registers */
+#define SVWRKS_APSIZE 0x10
+#define SVWRKS_SIZE_MASK 0xfe000000
+
+#define SVWRKS_MMBASE 0x14
+#define SVWRKS_CACHING 0x4b
+#define SVWRKS_FEATURE 0x68
+
+/* func 1 registers */
+#define SVWRKS_AGP_ENABLE 0x60
+#define SVWRKS_COMMAND 0x04
+
+/* Memory mapped registers */
+#define SVWRKS_GART_CACHE 0x02
+#define SVWRKS_GATTBASE 0x04
+#define SVWRKS_TLBFLUSH 0x10
+#define SVWRKS_POSTFLUSH 0x14
+#define SVWRKS_DIRFLUSH 0x0c
#endif /* _AGP_BACKEND_PRIV_H */
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/agp/agpgart_be.c linux.20p9/drivers/char/agp/agpgart_be.c
--- linux.vanilla/drivers/char/agp/agpgart_be.c Sun Mar 25 17:37:30 2001
+++ linux.20p9/drivers/char/agp/agpgart_be.c Thu Jul 26 18:02:17 2001
@@ -32,7 +32,7 @@
#include
#include
#include
-#include
+#include
#include
#include
#include
@@ -67,7 +67,7 @@
{
#if defined(__i386__)
asm volatile ("wbinvd":::"memory");
-#elif defined(__alpha__)
+#elif defined(__alpha__) || defined(__ia64__) || defined(__sparc__)
/* ??? I wonder if we'll really need to flush caches, or if the
core logic can manage to keep the system coherent. The ARM
speaks only of using `cflush' to get things in memory in
@@ -125,47 +125,6 @@
}
/*
- * Basic Page Allocation Routines -
- * These routines handle page allocation
- * and by default they reserve the allocated
- * memory. They also handle incrementing the
- * current_memory_agp value, Which is checked
- * against a maximum value.
- */
-
-static unsigned long agp_alloc_page(void)
-{
- void *pt;
-
- pt = (void *) __get_free_page(GFP_KERNEL);
- if (pt == NULL) {
- return 0;
- }
- atomic_inc(&mem_map[MAP_NR(pt)].count);
- set_bit(PG_locked, &mem_map[MAP_NR(pt)].flags);
- atomic_inc(&agp_bridge.current_memory_agp);
- return (unsigned long) pt;
-}
-
-static void agp_destroy_page(unsigned long page)
-{
- void *pt = (void *) page;
-
- if (pt == NULL) {
- return;
- }
- atomic_dec(&mem_map[MAP_NR(pt)].count);
- clear_bit(PG_locked, &mem_map[MAP_NR(pt)].flags);
-#if 0
- wake_up(&mem_map[MAP_NR(pt)].wait);
-#endif
- free_page((unsigned long) pt);
- atomic_dec(&agp_bridge.current_memory_agp);
-}
-
-/* End Basic Page Allocation Routines */
-
-/*
* Generic routines for handling agp_memory structures -
* They use the basic page allocation routines to do the
* brunt of the work.
@@ -239,7 +198,7 @@
if (curr->page_count != 0) {
for (i = 0; i < curr->page_count; i++) {
curr->memory[i] &= ~(0x00000fff);
- agp_destroy_page((unsigned long)
+ agp_bridge.agp_destroy_page((unsigned long)
phys_to_virt(curr->memory[i]));
}
}
@@ -281,7 +240,7 @@
return NULL;
}
for (i = 0; i < page_count; i++) {
- new->memory[i] = agp_alloc_page();
+ new->memory[i] = agp_bridge.agp_alloc_page();
if (new->memory[i] == 0) {
/* Free this structure */
@@ -782,6 +741,44 @@
kfree(curr);
}
+/*
+ * Basic Page Allocation Routines -
+ * These routines handle page allocation
+ * and by default they reserve the allocated
+ * memory. They also handle incrementing the
+ * current_memory_agp value, Which is checked
+ * against a maximum value.
+ */
+
+static unsigned long agp_generic_alloc_page(void)
+{
+ void *pt;
+
+ pt = (void *) __get_free_page(GFP_KERNEL);
+ if (pt == NULL) {
+ return 0;
+ }
+ atomic_inc(&mem_map[MAP_NR(pt)].count);
+ set_bit(PG_locked, &mem_map[MAP_NR(pt)].flags);
+ atomic_inc(&agp_bridge.current_memory_agp);
+ return (unsigned long) pt;
+}
+
+static void agp_generic_destroy_page(unsigned long page)
+{
+ void *pt = (void *) page;
+
+ if (pt == NULL) {
+ return;
+ }
+ atomic_dec(&mem_map[MAP_NR(pt)].count);
+ clear_bit(PG_locked, &mem_map[MAP_NR(pt)].flags);
+ free_page((unsigned long) pt);
+ atomic_dec(&agp_bridge.current_memory_agp);
+}
+
+/* End Basic Page Allocation Routines */
+
void agp_enable(u32 mode)
{
agp_bridge.agp_enable(mode);
@@ -998,7 +995,7 @@
return NULL;
}
MOD_INC_USE_COUNT;
- new->memory[0] = agp_alloc_page();
+ new->memory[0] = agp_bridge.agp_alloc_page();
if (new->memory[0] == 0) {
/* Free this structure */
@@ -1023,7 +1020,7 @@
{
agp_free_key(curr->key);
if(curr->type == AGP_PHYS_MEMORY) {
- agp_destroy_page((unsigned long)
+ agp_bridge.agp_destroy_page((unsigned long)
phys_to_virt(curr->memory[0]));
vfree(curr->memory);
}
@@ -1061,6 +1058,8 @@
agp_bridge.remove_memory = intel_i810_remove_entries;
agp_bridge.alloc_by_type = intel_i810_alloc_by_type;
agp_bridge.free_by_type = intel_i810_free_by_type;
+ agp_bridge.agp_alloc_page = agp_generic_alloc_page;
+ agp_bridge.agp_destroy_page = agp_generic_destroy_page;
return 0;
}
@@ -1247,6 +1246,12 @@
agp_bridge.remove_memory = agp_generic_remove_memory;
agp_bridge.alloc_by_type = agp_generic_alloc_by_type;
agp_bridge.free_by_type = agp_generic_free_by_type;
+ agp_bridge.agp_alloc_page = agp_generic_alloc_page;
+ agp_bridge.agp_destroy_page = agp_generic_destroy_page;
+ agp_bridge.agp_alloc_page = agp_generic_alloc_page;
+ agp_bridge.agp_destroy_page = agp_generic_destroy_page;
+ agp_bridge.agp_alloc_page = agp_generic_alloc_page;
+ agp_bridge.agp_destroy_page = agp_generic_destroy_page;
return 0;
@@ -1360,6 +1365,8 @@
agp_bridge.remove_memory = agp_generic_remove_memory;
agp_bridge.alloc_by_type = agp_generic_alloc_by_type;
agp_bridge.free_by_type = agp_generic_free_by_type;
+ agp_bridge.agp_alloc_page = agp_generic_alloc_page;
+ agp_bridge.agp_destroy_page = agp_generic_destroy_page;
return 0;
@@ -1469,6 +1476,8 @@
agp_bridge.remove_memory = agp_generic_remove_memory;
agp_bridge.alloc_by_type = agp_generic_alloc_by_type;
agp_bridge.free_by_type = agp_generic_free_by_type;
+ agp_bridge.agp_alloc_page = agp_generic_alloc_page;
+ agp_bridge.agp_destroy_page = agp_generic_destroy_page;
return 0;
}
@@ -1830,6 +1839,8 @@
agp_bridge.remove_memory = amd_remove_memory;
agp_bridge.alloc_by_type = agp_generic_alloc_by_type;
agp_bridge.free_by_type = agp_generic_free_by_type;
+ agp_bridge.agp_alloc_page = agp_generic_alloc_page;
+ agp_bridge.agp_destroy_page = agp_generic_destroy_page;
return 0;
@@ -1867,10 +1878,9 @@
u32 temp;
pci_read_config_dword(agp_bridge.dev, ALI_TLBCTRL, &temp);
- pci_write_config_dword(agp_bridge.dev, ALI_TLBCTRL,
- ((temp & 0xffffff00) | 0x00000090));
- pci_write_config_dword(agp_bridge.dev, ALI_TLBCTRL,
- ((temp & 0xffffff00) | 0x00000010));
+// clear tag
+ pci_write_config_dword(agp_bridge.dev, ALI_TAGCTRL,
+ ((temp & 0xfffffff0) | 0x00000001|0x00000002));
}
static void ali_cleanup(void)
@@ -1881,10 +1891,13 @@
previous_size = A_SIZE_32(agp_bridge.previous_size);
pci_read_config_dword(agp_bridge.dev, ALI_TLBCTRL, &temp);
- pci_write_config_dword(agp_bridge.dev, ALI_TLBCTRL,
- ((temp & 0xffffff00) | 0x00000090));
+// clear tag
+ pci_write_config_dword(agp_bridge.dev, ALI_TAGCTRL,
+ ((temp & 0xffffff00) | 0x00000001|0x00000002));
+
+ pci_read_config_dword(agp_bridge.dev, ALI_ATTBASE, &temp);
pci_write_config_dword(agp_bridge.dev, ALI_ATTBASE,
- previous_size->size_value);
+ ((temp & 0x00000ff0) | previous_size->size_value));
}
static int ali_configure(void)
@@ -1895,17 +1908,62 @@
current_size = A_SIZE_32(agp_bridge.current_size);
/* aperture size and gatt addr */
- pci_write_config_dword(agp_bridge.dev, ALI_ATTBASE,
- agp_bridge.gatt_bus_addr | current_size->size_value);
+ pci_read_config_dword(agp_bridge.dev, ALI_ATTBASE, &temp);
+ temp = (((temp & 0x00000ff0) | (agp_bridge.gatt_bus_addr & 0xfffff000))
+ | (current_size->size_value & 0xf));
+ pci_write_config_dword(agp_bridge.dev, ALI_ATTBASE, temp);
/* tlb control */
- pci_read_config_dword(agp_bridge.dev, ALI_TLBCTRL, &temp);
- pci_write_config_dword(agp_bridge.dev, ALI_TLBCTRL,
- ((temp & 0xffffff00) | 0x00000010));
+
+ /*
+ * Question: Jeff, ALi's patch deletes this:
+ *
+ * pci_read_config_dword(agp_bridge.dev, ALI_TLBCTRL, &temp);
+ * pci_write_config_dword(agp_bridge.dev, ALI_TLBCTRL,
+ * ((temp & 0xffffff00) | 0x00000010));
+ *
+ * and replaces it with the following, which seems to duplicate the
+ * next couple of lines below it. I suspect this was an oversight,
+ * but you might want to check up on this?
+ */
+
+ pci_read_config_dword(agp_bridge.dev, ALI_APBASE, &temp);
+ agp_bridge.gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK);
/* address to map to */
pci_read_config_dword(agp_bridge.dev, ALI_APBASE, &temp);
agp_bridge.gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK);
+
+#if 0
+ if (agp_bridge.type == ALI_M1541) {
+ u32 nlvm_addr = 0;
+
+ switch (current_size->size_value) {
+ case 0: break;
+ case 1: nlvm_addr = 0x100000;break;
+ case 2: nlvm_addr = 0x200000;break;
+ case 3: nlvm_addr = 0x400000;break;
+ case 4: nlvm_addr = 0x800000;break;
+ case 6: nlvm_addr = 0x1000000;break;
+ case 7: nlvm_addr = 0x2000000;break;
+ case 8: nlvm_addr = 0x4000000;break;
+ case 9: nlvm_addr = 0x8000000;break;
+ case 10: nlvm_addr = 0x10000000;break;
+ default: break;
+ }
+ nlvm_addr--;
+ nlvm_addr&=0xfff00000;
+
+ nlvm_addr+= agp_bridge.gart_bus_addr;
+ nlvm_addr|=(agp_bridge.gart_bus_addr>>12);
+ printk(KERN_INFO PFX "nlvm top &base = %8x\n",nlvm_addr);
+ }
+#endif
+
+ pci_read_config_dword(agp_bridge.dev, ALI_TLBCTRL, &temp);
+ temp &= 0xffffff7f; //enable TLB
+ pci_write_config_dword(agp_bridge.dev, ALI_TLBCTRL, temp);
+
return 0;
}
@@ -1916,6 +1974,73 @@
return addr | agp_bridge.masks[0].mask;
}
+static void ali_cache_flush(void)
+{
+ global_cache_flush();
+
+ if (agp_bridge.type == ALI_M1541) {
+ int i, page_count;
+ u32 temp;
+
+ page_count = 1 << A_SIZE_32(agp_bridge.current_size)->page_order;
+ for (i = 0; i < PAGE_SIZE * page_count; i += PAGE_SIZE) {
+ pci_read_config_dword(agp_bridge.dev, ALI_CACHE_FLUSH_CTRL, &temp);
+ pci_write_config_dword(agp_bridge.dev, ALI_CACHE_FLUSH_CTRL,
+ (((temp & ALI_CACHE_FLUSH_ADDR_MASK) |
+ (agp_bridge.gatt_bus_addr + i)) |
+ ALI_CACHE_FLUSH_EN));
+ }
+ }
+}
+
+static unsigned long ali_alloc_page(void)
+{
+ void *pt;
+ u32 temp;
+
+ pt = (void *) __get_free_page(GFP_KERNEL);
+ if (pt == NULL)
+ return 0;
+
+ atomic_inc(&mem_map[MAP_NR(pt)].count);
+ set_bit(PG_locked, &mem_map[MAP_NR(pt)].flags);
+ atomic_inc(&agp_bridge.current_memory_agp);
+
+ global_cache_flush();
+
+ if (agp_bridge.type == ALI_M1541) {
+ pci_read_config_dword(agp_bridge.dev, ALI_CACHE_FLUSH_CTRL, &temp);
+ pci_write_config_dword(agp_bridge.dev, ALI_CACHE_FLUSH_CTRL,
+ (((temp & ALI_CACHE_FLUSH_ADDR_MASK) |
+ virt_to_phys((void *)pt)) |
+ ALI_CACHE_FLUSH_EN ));
+ }
+ return (unsigned long) pt;
+}
+
+static void ali_destroy_page(unsigned long page)
+{
+ u32 temp;
+ void *pt = (void *) page;
+
+ if (pt == NULL)
+ return;
+
+ global_cache_flush();
+
+ if (agp_bridge.type == ALI_M1541) {
+ pci_read_config_dword(agp_bridge.dev, ALI_CACHE_FLUSH_CTRL, &temp);
+ pci_write_config_dword(agp_bridge.dev, ALI_CACHE_FLUSH_CTRL,
+ (((temp & ALI_CACHE_FLUSH_ADDR_MASK) |
+ virt_to_phys((void *)pt)) |
+ ALI_CACHE_FLUSH_EN));
+ }
+
+ atomic_dec(&mem_map[MAP_NR(pt)].count);
+ clear_bit(PG_locked, &mem_map[MAP_NR(pt)].flags);
+ free_page((unsigned long) pt);
+ atomic_dec(&agp_bridge.current_memory_agp);
+}
/* Setup function */
static gatt_mask ali_generic_masks[] =
@@ -1949,13 +2074,15 @@
agp_bridge.tlb_flush = ali_tlbflush;
agp_bridge.mask_memory = ali_mask_memory;
agp_bridge.agp_enable = agp_generic_agp_enable;
- agp_bridge.cache_flush = global_cache_flush;
+ agp_bridge.cache_flush = ali_cache_flush;
agp_bridge.create_gatt_table = agp_generic_create_gatt_table;
agp_bridge.free_gatt_table = agp_generic_free_gatt_table;
agp_bridge.insert_memory = agp_generic_insert_memory;
agp_bridge.remove_memory = agp_generic_remove_memory;
agp_bridge.alloc_by_type = agp_generic_alloc_by_type;
agp_bridge.free_by_type = agp_generic_free_by_type;
+ agp_bridge.agp_alloc_page = ali_alloc_page;
+ agp_bridge.agp_destroy_page = ali_destroy_page;
return 0;
@@ -1964,122 +2091,773 @@
#endif /* CONFIG_AGP_ALI */
+#ifdef CONFIG_AGP_SWORKS
+typedef struct _serverworks_page_map {
+ unsigned long *real;
+ unsigned long *remapped;
+} serverworks_page_map;
-/* per-chipset initialization data.
- * note -- all chipsets for a single vendor MUST be grouped together
- */
-static struct {
- unsigned short device_id; /* first, to make table easier to read */
- unsigned short vendor_id;
- enum chipset_type chipset;
- const char *vendor_name;
- const char *chipset_name;
- int (*chipset_setup) (struct pci_dev *pdev);
-} agp_bridge_info[] __initdata = {
+static struct _serverworks_private {
+ struct pci_dev *svrwrks_dev; /* device one */
+ volatile u8 *registers;
+ serverworks_page_map **gatt_pages;
+ int num_tables;
+ serverworks_page_map scratch_dir;
-#ifdef CONFIG_AGP_ALI
- { PCI_DEVICE_ID_AL_M1541_0,
- PCI_VENDOR_ID_AL,
- ALI_M1541,
- "Ali",
- "M1541",
- ali_generic_setup },
- { 0,
- PCI_VENDOR_ID_AL,
- ALI_GENERIC,
- "Ali",
- "Generic",
- ali_generic_setup },
-#endif /* CONFIG_AGP_ALI */
+ int gart_addr_ofs;
+ int mm_addr_ofs;
+} serverworks_private;
-#ifdef CONFIG_AGP_AMD
- { PCI_DEVICE_ID_AMD_IRONGATE_0,
- PCI_VENDOR_ID_AMD,
- AMD_IRONGATE,
- "AMD",
- "Irongate",
- amd_irongate_setup },
- { 0,
- PCI_VENDOR_ID_AMD,
- AMD_GENERIC,
- "AMD",
- "Generic",
- amd_irongate_setup },
-#endif /* CONFIG_AGP_AMD */
+static int serverworks_create_page_map(serverworks_page_map *page_map)
+{
+ int i;
-#ifdef CONFIG_AGP_INTEL
- { PCI_DEVICE_ID_INTEL_82443LX_0,
- PCI_VENDOR_ID_INTEL,
- INTEL_LX,
- "Intel",
- "440LX",
- intel_generic_setup },
- { PCI_DEVICE_ID_INTEL_82443BX_0,
- PCI_VENDOR_ID_INTEL,
- INTEL_BX,
- "Intel",
- "440BX",
- intel_generic_setup },
- { PCI_DEVICE_ID_INTEL_82443GX_0,
- PCI_VENDOR_ID_INTEL,
- INTEL_GX,
- "Intel",
- "440GX",
- intel_generic_setup },
- /* could we add support for PCI_DEVICE_ID_INTEL_815_1 too ? */
- { PCI_DEVICE_ID_INTEL_815_0,
- PCI_VENDOR_ID_INTEL,
- INTEL_I815,
- "Intel",
- "i815",
- intel_generic_setup },
- { PCI_DEVICE_ID_INTEL_840_0,
- PCI_VENDOR_ID_INTEL,
- INTEL_I840,
- "Intel",
- "i840",
- intel_840_setup },
- { 0,
- PCI_VENDOR_ID_INTEL,
- INTEL_GENERIC,
- "Intel",
- "Generic",
- intel_generic_setup },
-#endif /* CONFIG_AGP_INTEL */
+ page_map->real = (unsigned long *) __get_free_page(GFP_KERNEL);
+ if (page_map->real == NULL) {
+ return -ENOMEM;
+ }
+ set_bit(PG_reserved, &mem_map[MAP_NR(page_map->real)].flags);
+ CACHE_FLUSH();
+ page_map->remapped = ioremap_nocache(virt_to_phys(page_map->real),
+ PAGE_SIZE);
+ if (page_map->remapped == NULL) {
+ clear_bit(PG_reserved,
+ &mem_map[MAP_NR(page_map->real)].flags);
+ free_page((unsigned long) page_map->real);
+ page_map->real = NULL;
+ return -ENOMEM;
+ }
+ CACHE_FLUSH();
-#ifdef CONFIG_AGP_SIS
- { PCI_DEVICE_ID_SI_630,
- PCI_VENDOR_ID_SI,
- SIS_GENERIC,
- "SiS",
- "630",
- sis_generic_setup },
- { PCI_DEVICE_ID_SI_540,
- PCI_VENDOR_ID_SI,
- SIS_GENERIC,
- "SiS",
- "540",
- sis_generic_setup },
- { PCI_DEVICE_ID_SI_620,
- PCI_VENDOR_ID_SI,
- SIS_GENERIC,
- "SiS",
- "620",
- sis_generic_setup },
- { PCI_DEVICE_ID_SI_530,
- PCI_VENDOR_ID_SI,
- SIS_GENERIC,
- "SiS",
- "530",
- sis_generic_setup },
- { PCI_DEVICE_ID_SI_630,
- PCI_VENDOR_ID_SI,
- SIS_GENERIC,
- "SiS",
- "Generic",
- sis_generic_setup },
- { PCI_DEVICE_ID_SI_540,
- PCI_VENDOR_ID_SI,
+ for(i = 0; i < PAGE_SIZE / sizeof(unsigned long); i++) {
+ page_map->remapped[i] = agp_bridge.scratch_page;
+ }
+
+ return 0;
+}
+
+static void serverworks_free_page_map(serverworks_page_map *page_map)
+{
+ iounmap(page_map->remapped);
+ clear_bit(PG_reserved,
+ &mem_map[MAP_NR(page_map->real)].flags);
+ free_page((unsigned long) page_map->real);
+}
+
+static void serverworks_free_gatt_pages(void)
+{
+ int i;
+ serverworks_page_map **tables;
+ serverworks_page_map *entry;
+
+ tables = serverworks_private.gatt_pages;
+ for(i = 0; i < serverworks_private.num_tables; i++) {
+ entry = tables[i];
+ if (entry != NULL) {
+ if (entry->real != NULL) {
+ serverworks_free_page_map(entry);
+ }
+ kfree(entry);
+ }
+ }
+ kfree(tables);
+}
+
+static int serverworks_create_gatt_pages(int nr_tables)
+{
+ serverworks_page_map **tables;
+ serverworks_page_map *entry;
+ int retval = 0;
+ int i;
+
+ tables = kmalloc((nr_tables + 1) * sizeof(serverworks_page_map *),
+ GFP_KERNEL);
+ if (tables == NULL) {
+ return -ENOMEM;
+ }
+ memset(tables, 0, sizeof(serverworks_page_map *) * (nr_tables + 1));
+ for (i = 0; i < nr_tables; i++) {
+ entry = kmalloc(sizeof(serverworks_page_map), GFP_KERNEL);
+ if (entry == NULL) {
+ retval = -ENOMEM;
+ break;
+ }
+ memset(entry, 0, sizeof(serverworks_page_map));
+ tables[i] = entry;
+ retval = serverworks_create_page_map(entry);
+ if (retval != 0) break;
+ }
+ serverworks_private.num_tables = nr_tables;
+ serverworks_private.gatt_pages = tables;
+
+ if (retval != 0) serverworks_free_gatt_pages();
+
+ return retval;
+}
+
+#define SVRWRKS_GET_GATT(addr) (serverworks_private.gatt_pages[\
+ GET_PAGE_DIR_IDX(addr)]->remapped)
+
+#ifndef GET_PAGE_DIR_OFF
+#define GET_PAGE_DIR_OFF(addr) (addr >> 22)
+#endif
+
+#ifndef GET_PAGE_DIR_IDX
+#define GET_PAGE_DIR_IDX(addr) (GET_PAGE_DIR_OFF(addr) - \
+ GET_PAGE_DIR_OFF(agp_bridge.gart_bus_addr))
+#endif
+
+#ifndef GET_GATT_OFF
+#define GET_GATT_OFF(addr) ((addr & 0x003ff000) >> 12)
+#endif
+
+static int serverworks_create_gatt_table(void)
+{
+ aper_size_info_lvl2 *value;
+ serverworks_page_map page_dir;
+ int retval;
+ u32 temp;
+ int i;
+
+ value = A_SIZE_LVL2(agp_bridge.current_size);
+ retval = serverworks_create_page_map(&page_dir);
+ if (retval != 0) {
+ return retval;
+ }
+ retval = serverworks_create_page_map(&serverworks_private.scratch_dir);
+ if (retval != 0) {
+ serverworks_free_page_map(&page_dir);
+ return retval;
+ }
+ /* Create a fake scratch directory */
+ for(i = 0; i < 1024; i++) {
+ serverworks_private.scratch_dir.remapped[i] = (unsigned long) agp_bridge.scratch_page;
+ page_dir.remapped[i] =
+ virt_to_bus(serverworks_private.scratch_dir.real);
+ page_dir.remapped[i] |= 0x00000001;
+ }
+
+ retval = serverworks_create_gatt_pages(value->num_entries / 1024);
+ if (retval != 0) {
+ serverworks_free_page_map(&page_dir);
+ return retval;
+ }
+
+ agp_bridge.gatt_table_real = page_dir.real;
+ agp_bridge.gatt_table = page_dir.remapped;
+ agp_bridge.gatt_bus_addr = virt_to_bus(page_dir.real);
+
+ /* Get the address for the gart region.
+ * This is a bus address even on the alpha, b/c its
+ * used to program the agp master not the cpu
+ */
+
+ pci_read_config_dword(agp_bridge.dev,
+ serverworks_private.gart_addr_ofs,
+ &temp);
+ agp_bridge.gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK);
+
+ /* Calculate the agp offset */
+
+ for(i = 0; i < value->num_entries / 1024; i++) {
+ page_dir.remapped[i] =
+ virt_to_bus(serverworks_private.gatt_pages[i]->real);
+ page_dir.remapped[i] |= 0x00000001;
+ }
+
+ return 0;
+}
+
+static int serverworks_free_gatt_table(void)
+{
+ serverworks_page_map page_dir;
+
+ page_dir.real = agp_bridge.gatt_table_real;
+ page_dir.remapped = agp_bridge.gatt_table;
+
+ serverworks_free_gatt_pages();
+ serverworks_free_page_map(&page_dir);
+ return 0;
+}
+
+static int serverworks_fetch_size(void)
+{
+ int i;
+ u32 temp;
+ u32 temp2;
+ aper_size_info_lvl2 *values;
+
+ values = A_SIZE_LVL2(agp_bridge.aperture_sizes);
+ pci_read_config_dword(agp_bridge.dev,
+ serverworks_private.gart_addr_ofs,
+ &temp);
+ pci_write_config_dword(agp_bridge.dev,
+ serverworks_private.gart_addr_ofs,
+ 0xfe000000);
+ pci_read_config_dword(agp_bridge.dev,
+ serverworks_private.gart_addr_ofs,
+ &temp2);
+ pci_write_config_dword(agp_bridge.dev,
+ serverworks_private.gart_addr_ofs,
+ temp);
+ temp2 &= SVWRKS_SIZE_MASK;
+
+ for (i = 0; i < agp_bridge.num_aperture_sizes; i++) {
+ if (temp2 == values[i].size_value) {
+ agp_bridge.previous_size =
+ agp_bridge.current_size = (void *) (values + i);
+
+ agp_bridge.aperture_size_idx = i;
+ return values[i].size;
+ }
+ }
+
+ return 0;
+}
+
+static int serverworks_configure(void)
+{
+ aper_size_info_lvl2 *current_size;
+ u32 temp;
+ u8 enable_reg;
+ u8 cap_ptr;
+ u32 cap_id;
+ u16 cap_reg;
+
+ current_size = A_SIZE_LVL2(agp_bridge.current_size);
+
+ /* Get the memory mapped registers */
+ pci_read_config_dword(agp_bridge.dev,
+ serverworks_private.mm_addr_ofs,
+ &temp);
+ temp = (temp & PCI_BASE_ADDRESS_MEM_MASK);
+ serverworks_private.registers = (volatile u8 *) ioremap(temp, 4096);
+
+ OUTREG8(serverworks_private.registers, SVWRKS_GART_CACHE, 0x0a);
+
+ OUTREG32(serverworks_private.registers, SVWRKS_GATTBASE,
+ agp_bridge.gatt_bus_addr);
+
+ cap_reg = INREG16(serverworks_private.registers, SVWRKS_COMMAND);
+ cap_reg &= ~0x0007;
+ cap_reg |= 0x4;
+ OUTREG16(serverworks_private.registers, SVWRKS_COMMAND, cap_reg);
+
+ pci_read_config_byte(serverworks_private.svrwrks_dev,
+ SVWRKS_AGP_ENABLE, &enable_reg);
+ enable_reg |= 0x1; /* Agp Enable bit */
+ pci_write_config_byte(serverworks_private.svrwrks_dev,
+ SVWRKS_AGP_ENABLE, enable_reg);
+ agp_bridge.tlb_flush(NULL);
+
+ pci_read_config_byte(serverworks_private.svrwrks_dev, 0x34, &cap_ptr);
+ if (cap_ptr != 0x00) {
+ do {
+ pci_read_config_dword(serverworks_private.svrwrks_dev,
+ cap_ptr, &cap_id);
+
+ if ((cap_id & 0xff) != 0x02)
+ cap_ptr = (cap_id >> 8) & 0xff;
+ }
+ while (((cap_id & 0xff) != 0x02) && (cap_ptr != 0x00));
+ }
+ agp_bridge.capndx = cap_ptr;
+
+ /* Fill in the mode register */
+ pci_read_config_dword(serverworks_private.svrwrks_dev,
+ agp_bridge.capndx + 4,
+ &agp_bridge.mode);
+
+ pci_read_config_byte(agp_bridge.dev,
+ SVWRKS_CACHING,
+ &enable_reg);
+ enable_reg &= ~0x3;
+ pci_write_config_byte(agp_bridge.dev,
+ SVWRKS_CACHING,
+ enable_reg);
+
+ pci_read_config_byte(agp_bridge.dev,
+ SVWRKS_FEATURE,
+ &enable_reg);
+ enable_reg |= (1<<6);
+ pci_write_config_byte(agp_bridge.dev,
+ SVWRKS_FEATURE,
+ enable_reg);
+
+ return 0;
+}
+
+static void serverworks_cleanup(void)
+{
+ iounmap((void *) serverworks_private.registers);
+}
+
+/*
+ * This routine could be implemented by taking the addresses
+ * written to the GATT, and flushing them individually. However
+ * currently it just flushes the whole table. Which is probably
+ * more efficent, since agp_memory blocks can be a large number of
+ * entries.
+ */
+
+static void serverworks_tlbflush(agp_memory * temp)
+{
+ unsigned long end;
+
+ OUTREG8(serverworks_private.registers, SVWRKS_POSTFLUSH, 0x01);
+ end = jiffies + 3*HZ;
+ while(INREG8(serverworks_private.registers,
+ SVWRKS_POSTFLUSH) == 0x01) {
+ if((signed)(end - jiffies) <= 0) {
+ printk(KERN_ERR "Posted write buffer flush took more"
+ "then 3 seconds\n");
+ }
+ }
+ OUTREG32(serverworks_private.registers, SVWRKS_DIRFLUSH, 0x00000001);
+ end = jiffies + 3*HZ;
+ while(INREG32(serverworks_private.registers,
+ SVWRKS_DIRFLUSH) == 0x00000001) {
+ if((signed)(end - jiffies) <= 0) {
+ printk(KERN_ERR "TLB flush took more"
+ "then 3 seconds\n");
+ }
+ }
+}
+
+static unsigned long serverworks_mask_memory(unsigned long addr, int type)
+{
+ /* Only type 0 is supported by the serverworks chipsets */
+
+ return addr | agp_bridge.masks[0].mask;
+}
+
+static int serverworks_insert_memory(agp_memory * mem,
+ off_t pg_start, int type)
+{
+ int i, j, num_entries;
+ unsigned long *cur_gatt;
+ unsigned long addr;
+
+ num_entries = A_SIZE_LVL2(agp_bridge.current_size)->num_entries;
+
+ if (type != 0 || mem->type != 0) {
+ return -EINVAL;
+ }
+ if ((pg_start + mem->page_count) > num_entries) {
+ return -EINVAL;
+ }
+
+ j = pg_start;
+ while (j < (pg_start + mem->page_count)) {
+ addr = (j * PAGE_SIZE) + agp_bridge.gart_bus_addr;
+ cur_gatt = SVRWRKS_GET_GATT(addr);
+ if (!PGE_EMPTY(cur_gatt[GET_GATT_OFF(addr)])) {
+ return -EBUSY;
+ }
+ j++;
+ }
+
+ if (mem->is_flushed == FALSE) {
+ CACHE_FLUSH();
+ mem->is_flushed = TRUE;
+ }
+
+ for (i = 0, j = pg_start; i < mem->page_count; i++, j++) {
+ addr = (j * PAGE_SIZE) + agp_bridge.gart_bus_addr;
+ cur_gatt = SVRWRKS_GET_GATT(addr);
+ cur_gatt[GET_GATT_OFF(addr)] = mem->memory[i];
+ }
+ agp_bridge.tlb_flush(mem);
+ return 0;
+}
+
+static int serverworks_remove_memory(agp_memory * mem, off_t pg_start,
+ int type)
+{
+ int i;
+ unsigned long *cur_gatt;
+ unsigned long addr;
+
+ if (type != 0 || mem->type != 0) {
+ return -EINVAL;
+ }
+
+ CACHE_FLUSH();
+ agp_bridge.tlb_flush(mem);
+
+ for (i = pg_start; i < (mem->page_count + pg_start); i++) {
+ addr = (i * PAGE_SIZE) + agp_bridge.gart_bus_addr;
+ cur_gatt = SVRWRKS_GET_GATT(addr);
+ cur_gatt[GET_GATT_OFF(addr)] =
+ (unsigned long) agp_bridge.scratch_page;
+ }
+
+ agp_bridge.tlb_flush(mem);
+ return 0;
+}
+
+static gatt_mask serverworks_masks[] =
+{
+ {0x00000001, 0}
+};
+
+static aper_size_info_lvl2 serverworks_sizes[7] =
+{
+ {2048, 524288, 0x80000000},
+ {1024, 262144, 0xc0000000},
+ {512, 131072, 0xe0000000},
+ {256, 65536, 0xf0000000},
+ {128, 32768, 0xf8000000},
+ {64, 16384, 0xfc000000},
+ {32, 8192, 0xfe000000}
+};
+
+static void serverworks_agp_enable(u32 mode)
+{
+ struct pci_dev *device = NULL;
+ u32 command, scratch, cap_id;
+ u8 cap_ptr;
+
+ pci_read_config_dword(serverworks_private.svrwrks_dev,
+ agp_bridge.capndx + 4,
+ &command);
+
+ /*
+ * PASS1: go throu all devices that claim to be
+ * AGP devices and collect their data.
+ */
+
+ while ((device = pci_find_class(PCI_CLASS_DISPLAY_VGA << 8,
+ device)) != NULL) {
+ pci_read_config_dword(device, 0x04, &scratch);
+
+ if (!(scratch & 0x00100000))
+ continue;
+
+ pci_read_config_byte(device, 0x34, &cap_ptr);
+
+ if (cap_ptr != 0x00) {
+ do {
+ pci_read_config_dword(device,
+ cap_ptr, &cap_id);
+
+ if ((cap_id & 0xff) != 0x02)
+ cap_ptr = (cap_id >> 8) & 0xff;
+ }
+ while (((cap_id & 0xff) != 0x02) && (cap_ptr != 0x00));
+ }
+ if (cap_ptr != 0x00) {
+ /*
+ * Ok, here we have a AGP device. Disable impossible
+ * settings, and adjust the readqueue to the minimum.
+ */
+
+ pci_read_config_dword(device, cap_ptr + 4, &scratch);
+
+ /* adjust RQ depth */
+ command =
+ ((command & ~0xff000000) |
+ min((mode & 0xff000000),
+ min((command & 0xff000000),
+ (scratch & 0xff000000))));
+
+ /* disable SBA if it's not supported */
+ if (!((command & 0x00000200) &&
+ (scratch & 0x00000200) &&
+ (mode & 0x00000200)))
+ command &= ~0x00000200;
+
+ /* disable FW */
+ command &= ~0x00000010;
+
+ command &= ~0x00000008;
+
+ if (!((command & 4) &&
+ (scratch & 4) &&
+ (mode & 4)))
+ command &= ~0x00000004;
+
+ if (!((command & 2) &&
+ (scratch & 2) &&
+ (mode & 2)))
+ command &= ~0x00000002;
+
+ if (!((command & 1) &&
+ (scratch & 1) &&
+ (mode & 1)))
+ command &= ~0x00000001;
+ }
+ }
+ /*
+ * PASS2: Figure out the 4X/2X/1X setting and enable the
+ * target (our motherboard chipset).
+ */
+
+ if (command & 4) {
+ command &= ~3; /* 4X */
+ }
+ if (command & 2) {
+ command &= ~5; /* 2X */
+ }
+ if (command & 1) {
+ command &= ~6; /* 1X */
+ }
+ command |= 0x00000100;
+
+ pci_write_config_dword(serverworks_private.svrwrks_dev,
+ agp_bridge.capndx + 8,
+ command);
+
+ /*
+ * PASS3: Go throu all AGP devices and update the
+ * command registers.
+ */
+
+ while ((device = pci_find_class(PCI_CLASS_DISPLAY_VGA << 8,
+ device)) != NULL) {
+ pci_read_config_dword(device, 0x04, &scratch);
+
+ if (!(scratch & 0x00100000))
+ continue;
+
+ pci_read_config_byte(device, 0x34, &cap_ptr);
+
+ if (cap_ptr != 0x00) {
+ do {
+ pci_read_config_dword(device,
+ cap_ptr, &cap_id);
+
+ if ((cap_id & 0xff) != 0x02)
+ cap_ptr = (cap_id >> 8) & 0xff;
+ }
+ while (((cap_id & 0xff) != 0x02) && (cap_ptr != 0x00));
+ }
+ if (cap_ptr != 0x00)
+ pci_write_config_dword(device, cap_ptr + 8, command);
+ }
+}
+
+static int __init serverworks_setup (struct pci_dev *pdev)
+{
+ u32 temp;
+ u32 temp2;
+
+ serverworks_private.svrwrks_dev = pdev;
+
+ agp_bridge.masks = serverworks_masks;
+ agp_bridge.num_of_masks = 1;
+ agp_bridge.aperture_sizes = (void *) serverworks_sizes;
+ agp_bridge.size_type = LVL2_APER_SIZE;
+ agp_bridge.num_aperture_sizes = 7;
+ agp_bridge.dev_private_data = (void *) &serverworks_private;
+ agp_bridge.needs_scratch_page = TRUE;
+ agp_bridge.configure = serverworks_configure;
+ agp_bridge.fetch_size = serverworks_fetch_size;
+ agp_bridge.cleanup = serverworks_cleanup;
+ agp_bridge.tlb_flush = serverworks_tlbflush;
+ agp_bridge.mask_memory = serverworks_mask_memory;
+ agp_bridge.agp_enable = serverworks_agp_enable;
+ agp_bridge.cache_flush = global_cache_flush;
+ agp_bridge.create_gatt_table = serverworks_create_gatt_table;
+ agp_bridge.free_gatt_table = serverworks_free_gatt_table;
+ agp_bridge.insert_memory = serverworks_insert_memory;
+ agp_bridge.remove_memory = serverworks_remove_memory;
+ agp_bridge.alloc_by_type = agp_generic_alloc_by_type;
+ agp_bridge.free_by_type = agp_generic_free_by_type;
+ agp_bridge.agp_alloc_page = agp_generic_alloc_page;
+ agp_bridge.agp_destroy_page = agp_generic_destroy_page;
+
+ pci_read_config_dword(agp_bridge.dev,
+ SVWRKS_APSIZE,
+ &temp);
+
+ serverworks_private.gart_addr_ofs = 0x10;
+
+ if(temp & PCI_BASE_ADDRESS_MEM_TYPE_64) {
+ pci_read_config_dword(agp_bridge.dev,
+ SVWRKS_APSIZE + 4,
+ &temp2);
+ if(temp2 != 0) {
+ printk("Detected 64 bit aperture address, but top "
+ "bits are not zero. Disabling agp\n");
+ return -ENODEV;
+ }
+ serverworks_private.mm_addr_ofs = 0x18;
+ } else {
+ serverworks_private.mm_addr_ofs = 0x14;
+ }
+
+ pci_read_config_dword(agp_bridge.dev,
+ serverworks_private.mm_addr_ofs,
+ &temp);
+ if(temp & PCI_BASE_ADDRESS_MEM_TYPE_64) {
+ pci_read_config_dword(agp_bridge.dev,
+ serverworks_private.mm_addr_ofs + 4,
+ &temp2);
+ if(temp2 != 0) {
+ printk("Detected 64 bit MMIO address, but top "
+ "bits are not zero. Disabling agp\n");
+ return -ENODEV;
+ }
+ }
+
+ return 0;
+}
+
+#endif /* CONFIG_AGP_SWORKS */
+
+
+/* per-chipset initialization data.
+ * note -- all chipsets for a single vendor MUST be grouped together
+ */
+static struct {
+ unsigned short device_id; /* first, to make table easier to read */
+ unsigned short vendor_id;
+ enum chipset_type chipset;
+ const char *vendor_name;
+ const char *chipset_name;
+ int (*chipset_setup) (struct pci_dev *pdev);
+} agp_bridge_info[] __initdata = {
+
+#ifdef CONFIG_AGP_ALI
+ { PCI_DEVICE_ID_AL_M1541_0,
+ PCI_VENDOR_ID_AL,
+ ALI_M1541,
+ "Ali",
+ "M1541",
+ ali_generic_setup },
+ { PCI_DEVICE_ID_AL_M1621_0,
+ PCI_VENDOR_ID_AL,
+ ALI_M1621,
+ "Ali",
+ "M1621",
+ ali_generic_setup },
+ { PCI_DEVICE_ID_AL_M1631_0,
+ PCI_VENDOR_ID_AL,
+ ALI_M1631,
+ "Ali",
+ "M1631",
+ ali_generic_setup },
+ { PCI_DEVICE_ID_AL_M1632_0,
+ PCI_VENDOR_ID_AL,
+ ALI_M1632,
+ "Ali",
+ "M1632",
+ ali_generic_setup },
+ { PCI_DEVICE_ID_AL_M1641_0,
+ PCI_VENDOR_ID_AL,
+ ALI_M1641,
+ "Ali",
+ "M1641",
+ ali_generic_setup },
+ { PCI_DEVICE_ID_AL_M1647_0,
+ PCI_VENDOR_ID_AL,
+ ALI_M1647,
+ "Ali",
+ "M1647",
+ ali_generic_setup },
+ { PCI_DEVICE_ID_AL_M1651_0,
+ PCI_VENDOR_ID_AL,
+ ALI_M1651,
+ "Ali",
+ "M1651",
+ ali_generic_setup },
+ { 0,
+ PCI_VENDOR_ID_AL,
+ ALI_GENERIC,
+ "Ali",
+ "Generic",
+ ali_generic_setup },
+#endif /* CONFIG_AGP_ALI */
+
+#ifdef CONFIG_AGP_AMD
+ { PCI_DEVICE_ID_AMD_IRONGATE_0,
+ PCI_VENDOR_ID_AMD,
+ AMD_IRONGATE,
+ "AMD",
+ "Irongate",
+ amd_irongate_setup },
+ { 0,
+ PCI_VENDOR_ID_AMD,
+ AMD_GENERIC,
+ "AMD",
+ "Generic",
+ amd_irongate_setup },
+#endif /* CONFIG_AGP_AMD */
+
+#ifdef CONFIG_AGP_INTEL
+ { PCI_DEVICE_ID_INTEL_82443LX_0,
+ PCI_VENDOR_ID_INTEL,
+ INTEL_LX,
+ "Intel",
+ "440LX",
+ intel_generic_setup },
+ { PCI_DEVICE_ID_INTEL_82443BX_0,
+ PCI_VENDOR_ID_INTEL,
+ INTEL_BX,
+ "Intel",
+ "440BX",
+ intel_generic_setup },
+ { PCI_DEVICE_ID_INTEL_82443GX_0,
+ PCI_VENDOR_ID_INTEL,
+ INTEL_GX,
+ "Intel",
+ "440GX",
+ intel_generic_setup },
+ /* could we add support for PCI_DEVICE_ID_INTEL_815_1 too ? */
+ { PCI_DEVICE_ID_INTEL_815_0,
+ PCI_VENDOR_ID_INTEL,
+ INTEL_I815,
+ "Intel",
+ "i815",
+ intel_generic_setup },
+ { PCI_DEVICE_ID_INTEL_840_0,
+ PCI_VENDOR_ID_INTEL,
+ INTEL_I840,
+ "Intel",
+ "i840",
+ intel_840_setup },
+ { 0,
+ PCI_VENDOR_ID_INTEL,
+ INTEL_GENERIC,
+ "Intel",
+ "Generic",
+ intel_generic_setup },
+#endif /* CONFIG_AGP_INTEL */
+
+#ifdef CONFIG_AGP_SIS
+ { PCI_DEVICE_ID_SI_630,
+ PCI_VENDOR_ID_SI,
+ SIS_GENERIC,
+ "SiS",
+ "630",
+ sis_generic_setup },
+ { PCI_DEVICE_ID_SI_540,
+ PCI_VENDOR_ID_SI,
+ SIS_GENERIC,
+ "SiS",
+ "540",
+ sis_generic_setup },
+ { PCI_DEVICE_ID_SI_620,
+ PCI_VENDOR_ID_SI,
+ SIS_GENERIC,
+ "SiS",
+ "620",
+ sis_generic_setup },
+ { PCI_DEVICE_ID_SI_530,
+ PCI_VENDOR_ID_SI,
+ SIS_GENERIC,
+ "SiS",
+ "530",
+ sis_generic_setup },
+ { PCI_DEVICE_ID_SI_630,
+ PCI_VENDOR_ID_SI,
+ SIS_GENERIC,
+ "SiS",
+ "Generic",
+ sis_generic_setup },
+ { PCI_DEVICE_ID_SI_540,
+ PCI_VENDOR_ID_SI,
SIS_GENERIC,
"SiS",
"Generic",
@@ -2170,6 +2948,35 @@
while ((i < arraysize (agp_bridge_info)) &&
(agp_bridge_info[i].vendor_id == pdev->vendor)) {
if (pdev->device == agp_bridge_info[i].device_id) {
+#ifdef CONFIG_AGP_ALI
+ if (pdev->device == PCI_DEVICE_ID_AL_M1621_0) {
+ u8 hidden_1621_id;
+
+ pci_read_config_byte(pdev, 0xFB, &hidden_1621_id);
+ switch (hidden_1621_id) {
+ case 0x31:
+ agp_bridge_info[i].chipset_name="M1631";
+ break;
+ case 0x32:
+ agp_bridge_info[i].chipset_name="M1632";
+ break;
+ case 0x41:
+ agp_bridge_info[i].chipset_name="M1641";
+ break;
+ case 0x43:
+ break;
+ case 0x47:
+ agp_bridge_info[i].chipset_name="M1647";
+ break;
+ case 0x51:
+ agp_bridge_info[i].chipset_name="M1651";
+ break;
+ default:
+ break;
+ }
+ }
+#endif
+
printk (KERN_INFO PFX "Detected %s %s chipset\n",
agp_bridge_info[i].vendor_name,
agp_bridge_info[i].chipset_name);
@@ -2275,7 +3082,8 @@
if (i810_dev == NULL) {
printk(KERN_ERR PFX "agpgart: Detected an "
"Intel i815, but could not find the"
- " secondary device.\n");
+ " secondary device. Assuming a "
+ "non-integrated video card.\n");
agp_bridge.type = NOT_SUPPORTED;
return -ENODEV;
}
@@ -2290,6 +3098,41 @@
}
#endif /* CONFIG_AGP_I810 */
+#ifdef CONFIG_AGP_SWORKS
+ /* Everything is on func 1 here so we are hardcoding function one */
+ if (dev->vendor == PCI_VENDOR_ID_SERVERWORKS) {
+ struct pci_dev *bridge_dev;
+
+ bridge_dev = pci_find_slot ((unsigned int)dev->bus->number,
+ PCI_DEVFN(0, 1));
+ if(bridge_dev == NULL) {
+ printk(KERN_INFO PFX "agpgart: Detected a Serverworks "
+ "Chipset, but could not find the secondary "
+ "device.\n");
+ return -ENODEV;
+ }
+
+ switch (dev->device) {
+ case PCI_DEVICE_ID_SERVERWORKS_HE:
+ agp_bridge.type = SVWRKS_HE;
+ return serverworks_setup(bridge_dev);
+
+ case PCI_DEVICE_ID_SERVERWORKS_LE:
+ case 0x0007:
+ agp_bridge.type = SVWRKS_LE;
+ return serverworks_setup(bridge_dev);
+
+ default:
+ if(agp_try_unsupported) {
+ agp_bridge.type = SVWRKS_GENERIC;
+ return serverworks_setup(bridge_dev);
+ }
+ break;
+ }
+ }
+
+#endif /* CONFIG_AGP_SWORKS */
+
/* find capndx */
pci_read_config_dword(dev, 0x04, &scratch);
if (!(scratch & 0x00100000))
@@ -2385,7 +3228,7 @@
}
if (agp_bridge.needs_scratch_page == TRUE) {
- agp_bridge.scratch_page = agp_alloc_page();
+ agp_bridge.scratch_page = agp_bridge.agp_alloc_page();
if (agp_bridge.scratch_page == 0) {
printk(KERN_ERR PFX "unable to get memory for "
@@ -2438,7 +3281,7 @@
err_out:
if (agp_bridge.needs_scratch_page == TRUE) {
agp_bridge.scratch_page &= ~(0x00000fff);
- agp_destroy_page((unsigned long)
+ agp_bridge.agp_destroy_page((unsigned long)
phys_to_virt(agp_bridge.scratch_page));
}
if (got_gatt)
@@ -2458,7 +3301,7 @@
if (agp_bridge.needs_scratch_page == TRUE) {
agp_bridge.scratch_page &= ~(0x00000fff);
- agp_destroy_page((unsigned long)
+ agp_bridge.agp_destroy_page((unsigned long)
phys_to_virt(agp_bridge.scratch_page));
}
}
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/agp/agpgart_fe.c linux.20p9/drivers/char/agp/agpgart_fe.c
--- linux.vanilla/drivers/char/agp/agpgart_fe.c Sun Mar 25 17:31:28 2001
+++ linux.20p9/drivers/char/agp/agpgart_fe.c Thu Jul 26 15:24:33 2001
@@ -840,6 +840,9 @@
if (copy_from_user(&reserve, (void *) arg, sizeof(agp_region))) {
return -EFAULT;
}
+ if ((unsigned) reserve.seg_count >= ~0U/sizeof(agp_segment))
+ return -EFAULT;
+
client = agp_find_client_by_pid(reserve.pid);
if (reserve.seg_count == 0) {
@@ -860,6 +863,9 @@
} else {
agp_segment *segment;
+ if (reserve.seg_count >= 16384)
+ return -EINVAL;
+
segment = kmalloc((sizeof(agp_segment) * reserve.seg_count),
GFP_KERNEL);
@@ -867,7 +873,7 @@
return -ENOMEM;
}
if (copy_from_user(segment, (void *) reserve.seg_list,
- GFP_KERNEL)) {
+ sizeof(agp_segment) * reserve.seg_count)) {
kfree(segment);
return -EFAULT;
}
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/atari_SCC.README linux.20p9/drivers/char/atari_SCC.README
--- linux.vanilla/drivers/char/atari_SCC.README Sun Mar 25 17:31:28 2001
+++ linux.20p9/drivers/char/atari_SCC.README Wed Jul 4 16:03:54 2001
@@ -96,7 +96,7 @@
If you should see a message like:
-Sep 26 10:39:32 zaphod kernel: SCC-A: DMA-INT occured, data lost!
+Sep 26 10:39:32 zaphod kernel: SCC-A: DMA-INT occurred, data lost!
that means that the timer routine itself has been delayed so long that the DMA
counter went to zero already. There's not very much to do about this, because
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/atari_SCC.c linux.20p9/drivers/char/atari_SCC.c
--- linux.vanilla/drivers/char/atari_SCC.c Sun Mar 25 17:31:28 2001
+++ linux.20p9/drivers/char/atari_SCC.c Wed Jul 4 16:03:54 2001
@@ -1453,11 +1453,11 @@
}
-/* DMA finished before timer occured?
+/* DMA finished before timer occurred?
*/
static void SCC_dma_int (int irq, void *data, struct pt_regs *fp)
{
- printk ("SCC-A: DMA-INT occured, data lost!\n");
+ printk ("SCC-A: DMA-INT occurred, data lost!\n");
#if 0
/* is there any reason why we should call this? if the timer INT was
* delayed so long that this happened then this INT was delayed too, so
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/bttv.c linux.20p9/drivers/char/bttv.c
--- linux.vanilla/drivers/char/bttv.c Sun Mar 25 17:31:25 2001
+++ linux.20p9/drivers/char/bttv.c Thu Jul 26 14:59:52 2001
@@ -1979,7 +1979,9 @@
vfree(vcp);
return -EFAULT;
}
- } else if (vw.clipcount) {
+ } else if (vw.clipcount > 2048)
+ return -ENOMEM;
+ else {
if((vcp=vmalloc(sizeof(struct video_clip)*
(vw.clipcount))) == NULL)
return -ENOMEM;
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/cyclades.c linux.20p9/drivers/char/cyclades.c
--- linux.vanilla/drivers/char/cyclades.c Sun Mar 25 17:31:25 2001
+++ linux.20p9/drivers/char/cyclades.c Wed Jul 4 16:03:54 2001
@@ -149,7 +149,7 @@
* Revision 2.2.1.4 1998/08/04 11:02:50 ivan
* /proc/cyclades implementation with great collaboration of
* Marc Lewis ;
- * cyy_interrupt was changed to avoid occurence of kernel oopses
+ * cyy_interrupt was changed to avoid occurrence of kernel oopses
* during PPP operation.
*
* Revision 2.2.1.3 1998/06/01 12:09:10 ivan
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/drm/agpsupport.c linux.20p9/drivers/char/drm/agpsupport.c
--- linux.vanilla/drivers/char/drm/agpsupport.c Sun Mar 25 17:31:28 2001
+++ linux.20p9/drivers/char/drm/agpsupport.c Thu Jul 26 18:06:00 2001
@@ -319,6 +319,16 @@
case ALI_GENERIC: head->chipset = "ALi"; break;
case ALI_M1541: head->chipset = "ALi M1541"; break;
+ case ALI_M1621: head->chipset = "ALi M1621"; break;
+ case ALI_M1631: head->chipset = "ALi M1631"; break;
+ case ALI_M1632: head->chipset = "ALi M1632"; break;
+ case ALI_M1641: head->chipset = "ALi M1641"; break;
+ case ALI_M1647: head->chipset = "ALi M1647"; break;
+ case ALI_M1651: head->chipset = "ALi M1651"; break;
+ case SVWRKS_GENERIC: head->chipset = "Serverworks Generic";
+ break;
+ case SVWRKS_HE: head->chipset = "Serverworks HE"; break;
+ case SVWRKS_LE: head->chipset = "Serverworks LE"; break;
default: head->chipset = "Unknown"; break;
}
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/drm/bufs.c linux.20p9/drivers/char/drm/bufs.c
--- linux.vanilla/drivers/char/drm/bufs.c Sun Mar 25 17:31:28 2001
+++ linux.20p9/drivers/char/drm/bufs.c Thu Jul 26 14:51:37 2001
@@ -201,6 +201,12 @@
return -ENOMEM; /* May only call once for each order */
}
+ if(count < 0 || count > 4096)
+ {
+ up(&dev->struct_sem);
+ return -EINVAL;
+ }
+
entry->buflist = drm_alloc(count * sizeof(*entry->buflist),
DRM_MEM_BUFS);
if (!entry->buflist) {
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/drm/context.c linux.20p9/drivers/char/drm/context.c
--- linux.vanilla/drivers/char/drm/context.c Sun Mar 25 17:31:28 2001
+++ linux.20p9/drivers/char/drm/context.c Thu Jul 26 15:11:00 2001
@@ -91,10 +91,13 @@
atomic_dec(&dev->queuelist[i]->use_count);
}
/* Allocate a new queue */
- down(&dev->struct_sem);
queue = drm_alloc(sizeof(*queue), DRM_MEM_QUEUES);
+ if(queue == NULL)
+ return -ENOMEM;
+
memset(queue, 0, sizeof(*queue));
+ down(&dev->struct_sem);
atomic_set(&queue->use_count, 1);
++dev->queue_count;
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/drm/dma.c linux.20p9/drivers/char/drm/dma.c
--- linux.vanilla/drivers/char/drm/dma.c Sun Mar 25 17:31:28 2001
+++ linux.20p9/drivers/char/drm/dma.c Thu Jul 26 15:11:05 2001
@@ -38,7 +38,10 @@
{
int i;
- dev->dma = drm_alloc(sizeof(*dev->dma), DRM_MEM_DRIVER);
+ if (!(dev->dma = drm_alloc(sizeof(*dev->dma), DRM_MEM_DRIVER))) {
+ printk(KERN_ERR "drm_dma_setup: can't drm_alloc dev->dma");
+ return;
+ }
memset(dev->dma, 0, sizeof(*dev->dma));
for (i = 0; i <= DRM_MAX_ORDER; i++)
memset(&dev->dma->bufs[i], 0, sizeof(dev->dma->bufs[0]));
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/drm/fops.c linux.20p9/drivers/char/drm/fops.c
--- linux.vanilla/drivers/char/drm/fops.c Sun Mar 25 17:31:28 2001
+++ linux.20p9/drivers/char/drm/fops.c Thu Jul 26 15:24:45 2001
@@ -47,7 +47,10 @@
DRM_DEBUG("pid = %d, minor = %d\n", current->pid, minor);
priv = drm_alloc(sizeof(*priv), DRM_MEM_FILES);
+ if(priv == NULL)
+ return -ENOMEM;
memset(priv, 0, sizeof(*priv));
+
filp->private_data = priv;
priv->uid = current->euid;
priv->pid = current->pid;
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/drm/i810_bufs.c linux.20p9/drivers/char/drm/i810_bufs.c
--- linux.vanilla/drivers/char/drm/i810_bufs.c Sun Mar 25 17:31:28 2001
+++ linux.20p9/drivers/char/drm/i810_bufs.c Thu Jul 26 14:51:37 2001
@@ -87,7 +87,14 @@
atomic_dec(&dev->buf_alloc);
return -ENOMEM; /* May only call once for each order */
}
-
+
+ if(count < 0 || count > 4096)
+ {
+ up(&dev->struct_sem);
+ atomic_dec(&dev->buf_alloc);
+ return -EINVAL;
+ }
+
entry->buflist = drm_alloc(count * sizeof(*entry->buflist),
DRM_MEM_BUFS);
if (!entry->buflist) {
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/drm/i810_dma.c linux.20p9/drivers/char/drm/i810_dma.c
--- linux.vanilla/drivers/char/drm/i810_dma.c Sun Mar 25 17:31:28 2001
+++ linux.20p9/drivers/char/drm/i810_dma.c Thu Jul 26 14:53:07 2001
@@ -1402,6 +1402,11 @@
buf_priv = buf->dev_private;
if (buf_priv->currently_mapped != I810_BUF_MAPPED) return -EPERM;
+ /* Stopping end users copying their data to the entire kernel
+ is good.. */
+ if (d.used < 0 || d.used > buf->total)
+ return -EINVAL;
+
copy_from_user_ret(buf_priv->virtual, d.address, d.used, -EFAULT);
sarea_priv->last_dispatch = (int) hw_status[5];
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/drm/ioctl.c linux.20p9/drivers/char/drm/ioctl.c
--- linux.vanilla/drivers/char/drm/ioctl.c Sun Mar 25 17:31:28 2001
+++ linux.20p9/drivers/char/drm/ioctl.c Thu Jul 26 14:53:45 2001
@@ -75,7 +75,7 @@
if (dev->unique_len || dev->unique) return -EBUSY;
copy_from_user_ret(&u, (drm_unique_t *)arg, sizeof(u), -EFAULT);
- if (!u.unique_len) return -EINVAL;
+ if (!u.unique_len || u.unique_len > 1024)
dev->unique_len = u.unique_len;
dev->unique = drm_alloc(u.unique_len + 1, DRM_MEM_DRIVER);
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/drm/mga_bufs.c linux.20p9/drivers/char/drm/mga_bufs.c
--- linux.vanilla/drivers/char/drm/mga_bufs.c Sun Mar 25 17:31:28 2001
+++ linux.20p9/drivers/char/drm/mga_bufs.c Thu Jul 26 14:51:37 2001
@@ -97,7 +97,17 @@
atomic_dec(&dev->buf_alloc);
return -ENOMEM; /* May only call once for each order */
}
-
+
+ /* This isnt neccessarily a good limit, but we have to stop a dumb
+ 32 bit overflow problem below */
+
+ if ( count < 0 || count > 4096)
+ {
+ up(&dev->struct_sem);
+ atomic_dec(&dev->buf_alloc);
+ return -EINVAL;
+ }
+
entry->buflist = drm_alloc(count * sizeof(*entry->buflist),
DRM_MEM_BUFS);
if (!entry->buflist) {
@@ -254,6 +264,13 @@
return -ENOMEM; /* May only call once for each order */
}
+ if(count < 0 || count > 4096)
+ {
+ up(&dev->struct_sem);
+ atomic_dec(&dev->buf_alloc);
+ return -EINVAL;
+ }
+
entry->buflist = drm_alloc(count * sizeof(*entry->buflist),
DRM_MEM_BUFS);
if (!entry->buflist) {
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/drm/r128_bufs.c linux.20p9/drivers/char/drm/r128_bufs.c
--- linux.vanilla/drivers/char/drm/r128_bufs.c Sun Mar 25 17:31:28 2001
+++ linux.20p9/drivers/char/drm/r128_bufs.c Thu Jul 26 14:54:27 2001
@@ -102,7 +102,17 @@
atomic_dec(&dev->buf_alloc);
return -ENOMEM; /* May only call once for each order */
}
-
+
+ /* Might be a poor limit, but take that up with XFree86
+ if its a problem */
+
+ if(count < 0 || count > 4096)
+ {
+ up(&dev->struct_sem);
+ atomic_dec(&dev->buf_alloc);
+ return -EINVAL;
+ }
+
entry->buflist = drm_alloc(count * sizeof(*entry->buflist),
DRM_MEM_BUFS);
if (!entry->buflist) {
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/epca.c linux.20p9/drivers/char/epca.c
--- linux.vanilla/drivers/char/epca.c Sun Mar 25 17:31:26 2001
+++ linux.20p9/drivers/char/epca.c Thu Jul 26 15:24:52 2001
@@ -928,6 +928,9 @@
/* First we read the data in from the file system into a temp buffer */
+ memoff(ch);
+ restore_flags(flags);
+
if (bytesAvailable)
{ /* Begin bytesAvailable */
@@ -953,7 +956,7 @@
Remember copy_from_user WILL generate a page fault if the
user memory being accessed has been swapped out. This can
cause this routine to temporarily sleep while this page
- fault is occuring.
+ fault is occurring.
----------------------------------------------------------------- */
@@ -968,8 +971,6 @@
post_fep_init.
--------------------------------------------------------------------- */
buf = ch->tmp_buf;
- memoff(ch);
- restore_flags(flags);
} /* End from_user */
@@ -3601,7 +3602,7 @@
/* ------------------------------------------------------------------
The below routines pc_throttle and pc_unthrottle are used
to slow (And resume) the receipt of data into the kernels
- receive buffers. The exact occurence of this depends on the
+ receive buffers. The exact occurrence of this depends on the
size of the kernels receive buffer and what the 'watermarks'
are set to for that buffer. See the n_ttys.c file for more
details.
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/hfmodem/refclock.c linux.20p9/drivers/char/hfmodem/refclock.c
--- linux.vanilla/drivers/char/hfmodem/refclock.c Sun Mar 25 17:31:26 2001
+++ linux.20p9/drivers/char/hfmodem/refclock.c Wed Jul 4 16:03:54 2001
@@ -133,7 +133,7 @@
"subl %2,%%eax\n\t"
"sbbl %3,%%edx\n\t" : "=&a" (tmp0), "=&d" (tmp1)
: "m" (dev->clk.starttime_lo), "m" (dev->clk.starttime_hi));
- __asm__("mull %2" : "=d" (tmp2), "=a" (tmp4) : "m" (scale_rdtsc), "1" (tmp0) : "ax");
+ __asm__("mull %2" : "=d" (tmp2), "=a" (tmp4) : "m" (scale_rdtsc), "1" (tmp0));
__asm__("mull %1" : "=a" (tmp3) : "m" (scale_rdtsc), "a" (tmp1) : "dx");
curtime = tmp2 + tmp3;
goto time_known;
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/hfmodem/tables.h linux.20p9/drivers/char/hfmodem/tables.h
--- linux.vanilla/drivers/char/hfmodem/tables.h Thu Jan 1 01:00:00 1970
+++ linux.20p9/drivers/char/hfmodem/tables.h Wed Jul 4 16:17:17 2001
@@ -0,0 +1,90 @@
+/*
+ * This file is automatically generated by ./gentbl, DO NOT EDIT!
+*/
+
+#define SINTABBITS 9
+#define SINTABSIZE (1<
+ Copyright 2000,2001 Jeff Garzik
+ Copyright 2000,2001 Philipp Rumpf
- Driver Web site: http://gtf.org/garzik/drivers/i810_rng/
+ Driver Web site: http://sourceforge.net/projects/gkernel/
-
-
- Based on:
- Intel 82802AB/82802AC Firmware Hub (FWH) Datasheet
- May 1999 Order Number: 290658-002 R
-
- Intel 82802 Firmware Hub: Random Number Generator
- Programmer's Reference Manual
- December 1999 Order Number: 298029-001 R
-
- Intel 82802 Firmware HUB Random Number Generator Driver
- Copyright (c) 2000 Matt Sottek
-
- Special thanks to Matt Sottek. I did the "guts", he
- did the "brains" and all the testing. (Anybody wanna send
- me an i810 or i820?)
+ Please read Documentation/i810_rng.txt for details on use.
----------------------------------------------------------
This software may be used and distributed according to the terms
- of the GNU Public License, incorporated herein by reference.
-
- ----------------------------------------------------------
-
- From the firmware hub datasheet:
-
- The Firmware Hub integrates a Random Number Generator (RNG)
- using thermal noise generated from inherently random quantum
- mechanical properties of silicon. When not generating new random
- bits the RNG circuitry will enter a low power state. Intel will
- provide a binary software driver to give third party software
- access to our RNG for use as a security feature. At this time,
- the RNG is only to be used with a system in an OS-present state.
-
- ----------------------------------------------------------
-
- Theory of operation:
-
- Character driver. Using the standard open()
- and read() system calls, you can read random data from
- the i810 RNG device. This data is NOT CHECKED by any
- fitness tests, and could potentially be bogus (if the
- hardware is faulty or has been tampered with).
-
- /dev/intel_rng is char device major 10, minor 183.
-
-
- ----------------------------------------------------------
-
- Driver notes:
-
- * In order to unload the i810_rng module, you must first
- make sure all users of the character device have closed
-
- * FIXME: Currently only one open() of the character device is allowed.
- If another user tries to open() the device, they will get an
- -EBUSY error. Instead, this really should either support
- multiple simultaneous users of the character device (not hard),
- or simply block open() until the current user of the chrdev
- calls close().
-
- * FIXME: support poll()
-
- * FIXME: should we be crazy and support mmap()?
-
- ----------------------------------------------------------
+ of the GNU General Public License, incorporated herein by reference.
*/
@@ -80,20 +21,19 @@
#include
#include
#include
-#include
#include
-#include
#include
#include
#include
#include
+#include
/*
* core module and version information
*/
-#define RNG_VERSION "0.6.2-2.2.x"
+#define RNG_VERSION "0.9.6-2.2"
#define RNG_MODULE_NAME "i810_rng"
#define RNG_DRIVER_NAME RNG_MODULE_NAME " hardware driver " RNG_VERSION
#define PFX RNG_MODULE_NAME ": "
@@ -102,7 +42,7 @@
/*
* debugging macros
*/
-#undef RNG_DEBUG /* define to 1 to enable copious debugging info */
+#undef RNG_DEBUG /* define to enable copious debugging info */
#ifdef RNG_DEBUG
/* note: prints function name for you */
@@ -111,8 +51,8 @@
#define DPRINTK(fmt, args...)
#endif
-#define RNG_NDEBUG 0 /* define to 1 to disable lightweight runtime checks */
-#if RNG_NDEBUG
+#undef RNG_NDEBUG /* define to disable lightweight runtime checks */
+#ifdef RNG_NDEBUG
#define assert(expr)
#else
#define assert(expr) \
@@ -124,12 +64,6 @@
/*
- * misc helper macros
- */
-#define arraysize(x) (sizeof(x)/sizeof(*(x)))
-
-
-/*
* RNG registers (offsets from rng_mem)
*/
#define RNG_HW_STATUS 0
@@ -139,22 +73,21 @@
#define RNG_DATA_PRESENT 0x01
#define RNG_DATA 2
+/*
+ * Magic address at which Intel PCI bridges locate the RNG
+ */
#define RNG_ADDR 0xFFBC015F
#define RNG_ADDR_LEN 3
#define RNG_MISCDEV_MINOR 183 /* official */
-
/*
* various RNG status variables. they are globals
* as we only support a single RNG device
*/
-static int rng_allocated; /* is someone using the RNG region? */
-static int rng_hw_enabled; /* is the RNG h/w enabled? */
-static int rng_use_count; /* number of times RNG has been enabled */
static void *rng_mem; /* token to our ioremap'd RNG register area */
-static spinlock_t rng_lock = SPIN_LOCK_UNLOCKED; /* hardware lock */
-static int rng_open; /* boolean, 0 (false) if chrdev is closed, 1 (true) if open */
+static struct semaphore rng_open_sem; /* Semaphore for serializing rng_open/release */
+
/*
* inlined helper functions for accessing RNG registers
@@ -165,18 +98,17 @@
return readb (rng_mem + RNG_HW_STATUS);
}
-
-static inline void rng_hwstatus_set (u8 hw_status)
+static inline u8 rng_hwstatus_set (u8 hw_status)
{
assert (rng_mem != NULL);
writeb (hw_status, rng_mem + RNG_HW_STATUS);
+ return rng_hwstatus ();
}
static inline int rng_data_present (void)
{
assert (rng_mem != NULL);
- assert (rng_hw_enabled == 1);
return (readb (rng_mem + RNG_STATUS) & RNG_DATA_PRESENT) ? 1 : 0;
}
@@ -185,176 +117,157 @@
static inline int rng_data_read (void)
{
assert (rng_mem != NULL);
- assert (rng_hw_enabled == 1);
return readb (rng_mem + RNG_DATA);
}
-
/*
- * rng_enable - enable or disable the RNG hardware
+ * rng_enable - enable the RNG hardware
*/
-static int rng_enable (int enable)
+
+static int rng_enable (void)
{
int rc = 0;
- u8 hw_status;
+ u8 hw_status, new_status;
DPRINTK ("ENTER\n");
- spin_lock (&rng_lock);
-
hw_status = rng_hwstatus ();
- if (enable) {
- rng_hw_enabled = 1;
- rng_use_count++;
- MOD_INC_USE_COUNT;
- } else {
- rng_use_count--;
- if (rng_use_count == 0)
- rng_hw_enabled = 0;
- MOD_DEC_USE_COUNT;
- }
+ if ((hw_status & RNG_ENABLED) == 0) {
+ new_status = rng_hwstatus_set (hw_status | RNG_ENABLED);
- if (rng_hw_enabled && ((hw_status & RNG_ENABLED) == 0)) {
- rng_hwstatus_set (hw_status | RNG_ENABLED);
- printk (KERN_INFO PFX "RNG h/w enabled\n");
+ if (new_status & RNG_ENABLED)
+ printk (KERN_INFO PFX "RNG h/w enabled\n");
+ else {
+ printk (KERN_ERR PFX "Unable to enable the RNG\n");
+ rc = -EIO;
+ }
}
- else if (!rng_hw_enabled && (hw_status & RNG_ENABLED)) {
- rng_hwstatus_set (hw_status & ~RNG_ENABLED);
- printk (KERN_INFO PFX "RNG h/w disabled\n");
- }
+ DPRINTK ("EXIT, returning %d\n", rc);
+ return rc;
+}
+
+/*
+ * rng_disable - disable the RNG hardware
+ */
- spin_unlock (&rng_lock);
+static void rng_disable(void)
+{
+ u8 hw_status, new_status;
+
+ DPRINTK ("ENTER\n");
+
+ hw_status = rng_hwstatus ();
- if ((!!enable) != (!!(rng_hwstatus () & RNG_ENABLED))) {
- printk (KERN_ERR PFX "Unable to %sable the RNG\n",
- enable ? "en" : "dis");
- rc = -EIO;
+ if (hw_status & RNG_ENABLED) {
+ new_status = rng_hwstatus_set (hw_status & ~RNG_ENABLED);
+
+ if ((new_status & RNG_ENABLED) == 0)
+ printk (KERN_INFO PFX "RNG h/w disabled\n");
+ else {
+ printk (KERN_ERR PFX "Unable to disable the RNG\n");
+ }
}
- DPRINTK ("EXIT, returning %d\n", rc);
- return rc;
+ DPRINTK ("EXIT\n");
}
-
static int rng_dev_open (struct inode *inode, struct file *filp)
{
- int rc = -EINVAL;
-
- MOD_INC_USE_COUNT;
+ int rc;
if ((filp->f_mode & FMODE_READ) == 0)
- goto err_out;
+ return -EINVAL;
if (filp->f_mode & FMODE_WRITE)
- goto err_out;
-
- spin_lock (&rng_lock);
+ return -EINVAL;
- /* only allow one open of this device, exit with -EBUSY if already open */
- /* FIXME: we should sleep on a semaphore here, unless O_NONBLOCK */
- if (rng_open) {
- spin_unlock (&rng_lock);
- rc = -EBUSY;
- goto err_out;
+ /* wait for device to become free */
+ if (filp->f_flags & O_NONBLOCK) {
+ if (down_trylock (&rng_open_sem))
+ return -EAGAIN;
+ } else {
+ if (down_interruptible (&rng_open_sem))
+ return -ERESTARTSYS;
}
- rng_open = 1;
-
- spin_unlock (&rng_lock);
-
- if (rng_enable(1) != 0) {
- spin_lock (&rng_lock);
- rng_open = 0;
- spin_unlock (&rng_lock);
- rc = -EIO;
- goto err_out;
+ rc = rng_enable ();
+ if (rc) {
+ up (&rng_open_sem);
+ return rc;
}
+ MOD_INC_USE_COUNT;
return 0;
-
-err_out:
- MOD_DEC_USE_COUNT;
- return rc;
}
static int rng_dev_release (struct inode *inode, struct file *filp)
{
-
- if (rng_enable(0) != 0)
- return -EIO;
-
- spin_lock (&rng_lock);
- rng_open = 0;
- spin_unlock (&rng_lock);
-
+ rng_disable ();
+ up (&rng_open_sem);
MOD_DEC_USE_COUNT;
return 0;
}
-static ssize_t rng_dev_read (struct file *filp, char * buf, size_t size,
- loff_t *offp)
+static ssize_t rng_dev_read (struct file *filp, char *buf, size_t size,
+ loff_t * offp)
{
- int have_data, copied = 0;
- u8 data=0;
- u8 *page;
-
- if (size < 1)
- return 0;
-
- page = (unsigned char *) get_free_page (GFP_KERNEL);
- if (!page)
- return -ENOMEM;
-
-read_loop:
- /* using the fact that read() can return >0 but
- * less than the requested amount, we simply
- * read up to PAGE_SIZE or buffer size, whichever
- * is smaller, and return that data.
- */
- if ((copied == size) || (copied == PAGE_SIZE)) {
- size_t tmpsize = (copied == size) ? size : PAGE_SIZE;
- int rc = copy_to_user (buf, page, tmpsize);
- free_page ((long)page);
- if (rc) return rc;
- return tmpsize;
- }
+ static spinlock_t rng_lock = SPIN_LOCK_UNLOCKED;
+ int have_data;
+ u8 data = 0;
+ ssize_t ret = 0;
- spin_lock (&rng_lock);
+ while (size) {
+ spin_lock (&rng_lock);
- have_data = 0;
- if (rng_data_present ()) {
- data = rng_data_read ();
- have_data = 1;
- }
+ have_data = 0;
+ if (rng_data_present ()) {
+ data = rng_data_read ();
+ have_data = 1;
+ }
- spin_unlock (&rng_lock);
+ spin_unlock (&rng_lock);
- if (have_data) {
- page[copied] = data;
- copied++;
- } else {
- if (filp->f_flags & O_NONBLOCK) {
- free_page ((long)page);
- return -EAGAIN;
+ if (have_data) {
+ if (put_user (data, buf++)) {
+ ret = ret ? : -EFAULT;
+ break;
+ }
+ size--;
+ ret++;
}
- }
- if (current->need_resched)
- schedule ();
+ if (filp->f_flags & O_NONBLOCK)
+ return ret ? : -EAGAIN;
+
+ current->state = TASK_INTERRUPTIBLE;
+ schedule_timeout(1);
- if (signal_pending (current)) {
- free_page ((long)page);
- return -ERESTARTSYS;
+ if (signal_pending (current))
+ return ret ? : -ERESTARTSYS;
}
- goto read_loop;
+ return ret;
}
+static struct file_operations rng_chrdev_ops = {
+ open: rng_dev_open,
+ release: rng_dev_release,
+ read: rng_dev_read,
+};
+
+
+static struct miscdevice rng_miscdev = {
+ RNG_MISCDEV_MINOR,
+ RNG_MODULE_NAME,
+ &rng_chrdev_ops,
+};
+
+
/*
* rng_init_one - look for and attempt to init a single RNG
*/
@@ -365,10 +278,11 @@
DPRINTK ("ENTER\n");
- if (rng_allocated) {
- printk (KERN_ERR PFX "this driver only supports one RNG\n");
- DPRINTK ("EXIT, returning -EBUSY\n");
- return -EBUSY;
+ rc = misc_register (&rng_miscdev);
+ if (rc) {
+ printk (KERN_ERR PFX "cannot register misc device\n");
+ DPRINTK ("EXIT, returning %d\n", rc);
+ goto err_out;
}
rng_mem = ioremap (RNG_ADDR, RNG_ADDR_LEN);
@@ -376,7 +290,7 @@
printk (KERN_ERR PFX "cannot ioremap RNG Memory\n");
DPRINTK ("EXIT, returning -EBUSY\n");
rc = -EBUSY;
- goto err_out;
+ goto err_out_free_miscdev;
}
/* Check for Intel 82802 */
@@ -385,80 +299,59 @@
printk (KERN_ERR PFX "RNG not detected\n");
DPRINTK ("EXIT, returning -ENODEV\n");
rc = -ENODEV;
- goto err_out;
+ goto err_out_free_map;
}
- rng_allocated = 1;
-
- rc = rng_enable (0);
- if (rc) {
+ /* turn RNG h/w off, if it's on */
+ if (hw_status & RNG_ENABLED)
+ hw_status = rng_hwstatus_set (hw_status & ~RNG_ENABLED);
+ if (hw_status & RNG_ENABLED) {
printk (KERN_ERR PFX "cannot disable RNG, aborting\n");
- goto err_out;
+ goto err_out_free_map;
}
DPRINTK ("EXIT, returning 0\n");
return 0;
+err_out_free_map:
+ iounmap (rng_mem);
+err_out_free_miscdev:
+ misc_deregister (&rng_miscdev);
err_out:
- if (rng_mem)
- iounmap (rng_mem);
return rc;
}
-/*
- * Data for PCI driver interface
- */
-
-MODULE_AUTHOR("Jeff Garzik, Matt Sottek");
+MODULE_AUTHOR("Jeff Garzik, Philipp Rumpf, Matt Sottek");
MODULE_DESCRIPTION("Intel i8xx chipset Random Number Generator (RNG) driver");
-static struct file_operations rng_chrdev_ops = {
- open: rng_dev_open,
- release: rng_dev_release,
- read: rng_dev_read,
-};
-
-
-static struct miscdevice rng_miscdev = {
- RNG_MISCDEV_MINOR,
- RNG_MODULE_NAME,
- &rng_chrdev_ops,
-};
-
-
/*
* rng_init - initialize RNG module
*/
-int __init rng_init (void)
+static int __init rng_init (void)
{
int rc;
struct pci_dev *pdev;
-
- pdev = pci_find_device (0x8086, 0x2418, NULL);
- if (!pdev)
- pdev = pci_find_device (0x8086, 0x2428, NULL);
- if (!pdev)
- pdev = pci_find_device (0x8086, 0x1130, NULL);
- if (!pdev)
- return -ENODEV;
DPRINTK ("ENTER\n");
- rc = rng_init_one(pdev);
- if (rc) {
- DPRINTK ("EXIT, returning -ENODEV\n");
- return rc;
- }
+ init_MUTEX (&rng_open_sem);
- rc = misc_register (&rng_miscdev);
- if (rc) {
- if (rng_mem)
- iounmap (rng_mem);
- DPRINTK ("EXIT, returning %d\n", rc);
+ pdev = pci_find_device (0x8086, 0x2418, NULL);
+ if (pdev) goto match;
+ pdev = pci_find_device (0x8086, 0x2428, NULL);
+ if (pdev) goto match;
+ pdev = pci_find_device (0x8086, 0x1130, NULL);
+ if (pdev) goto match;
+
+ DPRINTK ("EXIT, returning -ENODEV\n");
+ return -ENODEV;
+
+match:
+ rc = rng_init_one (pdev);
+ if (rc)
return rc;
- }
printk (KERN_INFO RNG_DRIVER_NAME " loaded\n");
@@ -466,24 +359,21 @@
return 0;
}
-#ifdef MODULE
-
-int init_module (void) { return rng_init (); }
/*
* rng_init - shutdown RNG module
*/
-void cleanup_module (void)
+static void rng_cleanup (void)
{
DPRINTK ("ENTER\n");
-
- iounmap (rng_mem);
-
- rng_hwstatus_set (rng_hwstatus() & ~RNG_ENABLED);
misc_deregister (&rng_miscdev);
+ iounmap (rng_mem);
+
DPRINTK ("EXIT\n");
}
-#endif /* MODULE */
+
+module_init (rng_init);
+module_exit (rng_cleanup);
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/lp.c linux.20p9/drivers/char/lp.c
--- linux.vanilla/drivers/char/lp.c Sun Mar 25 17:37:31 2001
+++ linux.20p9/drivers/char/lp.c Wed Jul 4 16:03:54 2001
@@ -306,7 +306,7 @@
}
/*
* NOTE: if you run with irqs you _must_ use
- * `tunelp /dev/lp? -c 1' to be rasonable efficient!
+ * `tunelp /dev/lp? -c 1' to be reasonably efficient!
*
* ..but beware that data corruption can happen that way. -Tim
*/
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla/drivers/char/machzwd.c linux.20p9/drivers/char/machzwd.c
--- linux.vanilla/drivers/char/machzwd.c Thu Jan 1 01:00:00 1970
+++ linux.20p9/drivers/char/machzwd.c Thu Jul 26 15:25:50 2001
@@ -0,0 +1,545 @@
+/*
+ * MachZ ZF-Logic Watchdog Timer driver for Linux
+ *
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ *
+ * The author does NOT admit liability nor provide warranty for
+ * any of this software. This material is provided "AS-IS" in
+ * the hope that it may be useful for others.
+ *
+ * Author: Fernando Fuganti
+ *
+ * Based on sbc60xxwdt.c by Jakob Oestergaard
+ *
+ *
+ * We have two timers (wd#1, wd#2) driven by a 32 KHz clock with the
+ * following periods:
+ * wd#1 - 2 seconds;
+ * wd#2 - 7.2 ms;
+ * After the expiration of wd#1, it can generate a NMI, SCI, SMI, or
+ * a system RESET and it starts wd#2 that unconditionaly will RESET
+ * the system when the counter reaches zero.
+ *
+ */
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+
+/* ports */
+#define ZF_IOBASE 0x218
+#define INDEX 0x218
+#define DATA_B 0x219
+#define DATA_W 0x21A
+#define DATA_D 0x21A
+
+/* indexes */ /* size */
+#define ZFL_VERSION 0x02 /* 16 */
+#define CONTROL 0x10 /* 16 */
+#define STATUS 0x12 /* 8 */
+#define COUNTER_1 0x0C /* 16 */
+#define COUNTER_2 0x0E /* 8 */
+#define PULSE_LEN 0x0F /* 8 */
+
+/* controls */
+#define ENABLE_WD1 0x0001
+#define ENABLE_WD2 0x0002
+#define RESET_WD1 0x0010
+#define RESET_WD2 0x0020
+#define GEN_SCI 0x0100
+#define GEN_NMI 0x0200
+#define GEN_SMI 0x0400
+#define GEN_RESET 0x0800
+
+
+/* utilities */
+
+#define WD1 0
+#define WD2 1
+
+#define zf_writew(port, data) { outb(port, INDEX); outw(data, DATA_W); }
+#define zf_writeb(port, data) { outb(port, INDEX); outb(data, DATA_B); }
+#define zf_get_ZFL_version() zf_readw(ZFL_VERSION)
+
+
+static unsigned short zf_readw(unsigned char port)
+{
+ outb(port, INDEX);
+ return inw(DATA_W);
+}
+
+static unsigned short zf_readb(unsigned char port)
+{
+ outb(port, INDEX);
+ return inb(DATA_B);
+}
+
+
+MODULE_AUTHOR("Fernando Fuganti |