CVS commit: [netbsd-5] src/sys/arch/amiga/include

2011-01-16 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Jan 16 12:45:30 UTC 2011

Modified Files:
src/sys/arch/amiga/include [netbsd-5]: vmparam.h

Log Message:
Pull up following revision(s) (requested by mhitch in ticket #1518):
sys/arch/amiga/include/vmparam.h: revision 1.41
Raise address of user stack to the highest safe (for 68040 mmu) address,
which increases available user address space by 256MB.  One file in
pkgsrc/lang/php53 was too large for the amiga.  Also remove an old
presumably outdated comment.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.36.30.1 src/sys/arch/amiga/include/vmparam.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/amiga/include/vmparam.h
diff -u src/sys/arch/amiga/include/vmparam.h:1.36 src/sys/arch/amiga/include/vmparam.h:1.36.30.1
--- src/sys/arch/amiga/include/vmparam.h:1.36	Wed Oct 17 19:53:26 2007
+++ src/sys/arch/amiga/include/vmparam.h	Sun Jan 16 12:45:30 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.36 2007/10/17 19:53:26 garbled Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.36.30.1 2011/01/16 12:45:30 bouyer Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1990 The Regents of the University of California.
@@ -98,9 +98,8 @@
  * These are a mixture of i386, sun3 and hp settings.. 
  */
 
-/* Sun settings. Still hope, that I might get sun3 binaries to work... */
 #ifndef USRSTACK
-#define	USRSTACK	0x0E00
+#define	USRSTACK	0x1E00
 #endif
 #define KUSER_AREA	(-UPAGES*PAGE_SIZE)
 /*



CVS commit: [netbsd-5] src/sys/arch/amiga

2010-07-16 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Fri Jul 16 18:26:13 UTC 2010

Modified Files:
src/sys/arch/amiga/amiga [netbsd-5]: amiga_init.c locore.s
src/sys/arch/amiga/dev [netbsd-5]: clock.c kbd.c

Log Message:
Pull up following revision(s) (requested by phx in ticket #1412):
sys/arch/amiga/dev/clock.c: revision 1.51
sys/arch/amiga/amiga/locore.s: revision 1.149 via patch
sys/arch/amiga/dev/kbd.c: revision 1.53
sys/arch/amiga/amiga/amiga_init.c: revision 1.118
Reverted the CIA-timer based delay() to the pre-5.0 method of a calibrated
delay loop.
This fixes keyboard handshaking problems with some A1200 models since 5.0
and restores the precision for short delays on DraCo systems (the QuickLogic
timer has only a seventh of the CIA precision).
Changed the keyboard handshaking delay from 2000 back to 200ms, although
even the recommended 85ms were successfully tested on the most problematic
A1200 keyboards.
All those changes were tested on an A3000 and A1200 with 68060/50 CPU, and
previously discussed on the port-amiga ML.


To generate a diff of this commit:
cvs rdiff -u -r1.99 -r1.99.20.1 src/sys/arch/amiga/amiga/amiga_init.c
cvs rdiff -u -r1.145 -r1.145.20.1 src/sys/arch/amiga/amiga/locore.s
cvs rdiff -u -r1.47.20.3 -r1.47.20.4 src/sys/arch/amiga/dev/clock.c
cvs rdiff -u -r1.50 -r1.50.20.1 src/sys/arch/amiga/dev/kbd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/amiga/amiga/amiga_init.c
diff -u src/sys/arch/amiga/amiga/amiga_init.c:1.99 src/sys/arch/amiga/amiga/amiga_init.c:1.99.20.1
--- src/sys/arch/amiga/amiga/amiga_init.c:1.99	Sun Jan  6 18:50:29 2008
+++ src/sys/arch/amiga/amiga/amiga_init.c	Fri Jul 16 18:26:13 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: amiga_init.c,v 1.99 2008/01/06 18:50:29 mhitch Exp $	*/
+/*	$NetBSD: amiga_init.c,v 1.99.20.1 2010/07/16 18:26:13 riz Exp $	*/
 
 /*
  * Copyright (c) 1994 Michael L. Hitch
@@ -36,7 +36,7 @@
 #include "opt_devreload.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: amiga_init.c,v 1.99 2008/01/06 18:50:29 mhitch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amiga_init.c,v 1.99.20.1 2010/07/16 18:26:13 riz Exp $");
 
 #include 
 #include 
@@ -765,6 +765,7 @@
 void
 start_c_finish()
 {
+	extern u_int32_t delaydivisor;
 #ifdef	P5PPC68KBOARD
 struct cfdev *cdp, *ecdp;
 #endif
@@ -900,6 +901,21 @@
 			}
 }
 #endif
+	/*
+	 * preliminary delay divisor value
+	 */
+
+	if (machineid & AMIGA_68060)
+		delaydivisor = (1024 * 1) / 80;	/* 80 MHz 68060 w. BTC */
+
+	else if (machineid & AMIGA_68040)
+		delaydivisor = (1024 * 3) / 40;	/* 40 MHz 68040 */
+
+	else if (machineid & AMIGA_68030)
+		delaydivisor = (1024 * 8) / 50;	/* 50 MHz 68030 */
+
+	else
+		delaydivisor = (1024 * 8) / 33; /* 33 MHz 68020 */
 }
 
 void

Index: src/sys/arch/amiga/amiga/locore.s
diff -u src/sys/arch/amiga/amiga/locore.s:1.145 src/sys/arch/amiga/amiga/locore.s:1.145.20.1
--- src/sys/arch/amiga/amiga/locore.s:1.145	Sun Jan  6 18:50:30 2008
+++ src/sys/arch/amiga/amiga/locore.s	Fri Jul 16 18:26:12 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.145 2008/01/06 18:50:30 mhitch Exp $	*/
+/*	$NetBSD: locore.s,v 1.145.20.1 2010/07/16 18:26:12 riz Exp $	*/
 
 /*
  * Copyright (c) 1980, 1990 The Regents of the University of California.
@@ -1577,6 +1577,16 @@
 	.align 2
 #endif
 	nop
+ENTRY_NOPROFILE(delay)
+ENTRY_NOPROFILE(DELAY)
+	movql #10,%d1		| 2 +2
+	movl %sp@(4),%d0	| 4 +4
+	lsll %d1,%d0		| 8 +2
+	movl _C_LABEL(delaydivisor),%d1	| A +6
+Ldelay:| longword aligned again.
+	subl %d1,%d0
+	jcc Ldelay
+	rts
 
 #ifdef M68060
 ENTRY_NOPROFILE(intemu60)
@@ -1607,6 +1617,11 @@
 	.long	FPU_NONE
 GLOBAL(protorp)
 	.long	0x8002,0	| prototype root pointer
+GLOBAL(delaydivisor)
+	.long	12		| should be enough for 80 MHz 68060
+| will be adapted to other CPUs in
+| start_c_cleanup and calibrated
+| at clock attach time.
 
 GLOBAL(proc0paddr)
 	.long	0		| KVA of proc0 u-area

Index: src/sys/arch/amiga/dev/clock.c
diff -u src/sys/arch/amiga/dev/clock.c:1.47.20.3 src/sys/arch/amiga/dev/clock.c:1.47.20.4
--- src/sys/arch/amiga/dev/clock.c:1.47.20.3	Sat Oct  3 23:37:31 2009
+++ src/sys/arch/amiga/dev/clock.c	Fri Jul 16 18:26:12 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: clock.c,v 1.47.20.3 2009/10/03 23:37:31 snj Exp $ */
+/*	$NetBSD: clock.c,v 1.47.20.4 2010/07/16 18:26:12 riz Exp $ */
 
 /*
  * Copyright (c) 1982, 1990 The Regents of the University of California.
@@ -77,7 +77,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.47.20.3 2009/10/03 23:37:31 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.47.20.4 2010/07/16 18:26:12 riz Exp $");
 
 #include 
 #include 
@@ -100,26 +100,6 @@
 #include 
 #endif
 
-/* the clocks run at NTSC: 715.909kHz or PAL: 709.379kHz.
-   We're using a 100 Hz clock. */
-int amiga_clk_interval;
-int eclockfreq;
-unsigned int fast_delay_limit;
-struct CIA *clockcia;
-
-static u_int clk_getcounter(struct

CVS commit: [netbsd-5] src/sys/arch/amiga/amiga

2009-12-01 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Dec  1 19:40:10 UTC 2009

Modified Files:
src/sys/arch/amiga/amiga [netbsd-5]: machdep.c

Log Message:
Pull up following revision(s) (requested by mhitch in ticket #1166):
sys/arch/amiga/amiga/machdep.c: revision 1.222
Remove old legacy IPL_* settings in ipl2spl_table - they are redundant
and in the case of IPL_AUDIO, results in IPL_VM blocking all interrupts.
[IPL_AUDIO is now the same as IPL_VM, and was setting the IPL_VM entry
to PSL_IPL6.  IPL_SERIAL had a duplicate entry for some reason, and
serial drivers that check and modify IPL_SERIAL now shouldn't be affected
since IPL_SERIAL is now the same as IPL_HIGH.  I'm hoping this will fix
or at least help the problem of serial interrupts being blocked too long.


To generate a diff of this commit:
cvs rdiff -u -r1.209.6.1 -r1.209.6.2 src/sys/arch/amiga/amiga/machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/amiga/amiga/machdep.c
diff -u src/sys/arch/amiga/amiga/machdep.c:1.209.6.1 src/sys/arch/amiga/amiga/machdep.c:1.209.6.2
--- src/sys/arch/amiga/amiga/machdep.c:1.209.6.1	Mon Feb  2 03:30:32 2009
+++ src/sys/arch/amiga/amiga/machdep.c	Tue Dec  1 19:40:09 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.209.6.1 2009/02/02 03:30:32 snj Exp $	*/
+/*	$NetBSD: machdep.c,v 1.209.6.2 2009/12/01 19:40:09 snj Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1990 The Regents of the University of California.
@@ -85,7 +85,7 @@
 #include "opt_panicbutton.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.209.6.1 2009/02/02 03:30:32 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.209.6.2 2009/12/01 19:40:09 snj Exp $");
 
 #include 
 #include 
@@ -1497,19 +1497,12 @@
 int ipl2spl_table[_NIPL] = {
 	[IPL_NONE] = PSL_IPL0|PSL_S,
 	[IPL_SOFTCLOCK] = PSL_IPL1|PSL_S,
-	[IPL_BIO] = PSL_IPL3|PSL_S,
-	[IPL_NET] = PSL_IPL3|PSL_S,
-	[IPL_TTY] = PSL_IPL4|PSL_S,
-	[IPL_SERIAL] = PSL_IPL5|PSL_S,
 	[IPL_VM] = PSL_IPL4|PSL_S,
-	[IPL_SERIAL] = PSL_IPL4|PSL_S,	/* patched by some devices at attach
-	   time (currently, only the coms) */
-	[IPL_AUDIO] = PSL_IPL6|PSL_S,
 #if defined(LEV6_DEFER)
-	[IPL_CLOCK] = PSL_IPL4|PSL_S,
+	[IPL_SCHED] = PSL_IPL4|PSL_S,
 	[IPL_HIGH] = PSL_IPL4|PSL_S,
 #else /* defined(LEV6_DEFER) */
-	[IPL_CLOCK] = PSL_IPL6|PSL_S,
+	[IPL_SCHED] = PSL_IPL6|PSL_S,
 	[IPL_HIGH] = PSL_IPL7|PSL_S,
 #endif /* defined(LEV6_DEFER) */
 };



CVS commit: [netbsd-5] src/sys/arch/amiga/dev

2009-10-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Oct  3 23:37:31 UTC 2009

Modified Files:
src/sys/arch/amiga/dev [netbsd-5]: clock.c

Log Message:
Pull up following revision(s) (requested by mhitch in ticket #1049):
sys/arch/amiga/dev/clock.c: revision 1.49
Reverted last change after discussion with the author, Michael L. Hitch:
http://mail-index.netbsd.org/port-amiga/2009/08/14/msg007164.html
We have a full 32-bit counter, so the masking is not needed.


To generate a diff of this commit:
cvs rdiff -u -r1.47.20.2 -r1.47.20.3 src/sys/arch/amiga/dev/clock.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/amiga/dev/clock.c
diff -u src/sys/arch/amiga/dev/clock.c:1.47.20.2 src/sys/arch/amiga/dev/clock.c:1.47.20.3
--- src/sys/arch/amiga/dev/clock.c:1.47.20.2	Sat Sep 26 18:44:59 2009
+++ src/sys/arch/amiga/dev/clock.c	Sat Oct  3 23:37:31 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: clock.c,v 1.47.20.2 2009/09/26 18:44:59 snj Exp $ */
+/*	$NetBSD: clock.c,v 1.47.20.3 2009/10/03 23:37:31 snj Exp $ */
 
 /*
  * Copyright (c) 1982, 1990 The Regents of the University of California.
@@ -77,7 +77,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.47.20.2 2009/09/26 18:44:59 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.47.20.3 2009/10/03 23:37:31 snj Exp $");
 
 #include 
 #include 
@@ -112,7 +112,7 @@
 static struct timecounter clk_timecounter = {
 	clk_getcounter,	/* get_timecount */
 	0,		/* no poll_pps */
-	0x0fffu,	/* counter_mask */
+	~0u,		/* counter_mask */
 	0,		/* frequency */
 	"clock",	/* name, overriden later */
 	100,		/* quality */
@@ -159,7 +159,6 @@
 clockattach(struct device *pdp, struct device *dp, void *auxp)
 {
 	const char *clockchip;
-	u_int counter_mask;
 	unsigned short interval;
 #ifdef DRACO
 	u_char dracorev;
@@ -189,14 +188,8 @@
 
 	amiga_clk_interval = (eclockfreq / hz);
 
-	counter_mask = 0x8000;
-	while (counter_mask != 0 && (counter_mask & amiga_clk_interval) == 0)
-		counter_mask >>= 1;
-	counter_mask -= 1;
-
 	clk_timecounter.tc_name = clockchip;
 	clk_timecounter.tc_frequency = eclockfreq;
-	clk_timecounter.tc_counter_mask = counter_mask;
 
 	fast_delay_limit = UINT_MAX / amiga_clk_interval;
 



CVS commit: [netbsd-5] src/sys/arch/amiga/dev

2009-09-26 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Sep 26 18:44:59 UTC 2009

Modified Files:
src/sys/arch/amiga/dev [netbsd-5]: clock.c

Log Message:
Pull up following revision(s) (requested by phx in ticket #1011):
sys/arch/amiga/dev/clock.c: revision 1.50
Handle the situation of a wrapped interval counter, while the hardclock()
interrupt was not yet executed to update the hardclock_ticks variable.


To generate a diff of this commit:
cvs rdiff -u -r1.47.20.1 -r1.47.20.2 src/sys/arch/amiga/dev/clock.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/amiga/dev/clock.c
diff -u src/sys/arch/amiga/dev/clock.c:1.47.20.1 src/sys/arch/amiga/dev/clock.c:1.47.20.2
--- src/sys/arch/amiga/dev/clock.c:1.47.20.1	Wed Dec 10 22:06:42 2008
+++ src/sys/arch/amiga/dev/clock.c	Sat Sep 26 18:44:59 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: clock.c,v 1.47.20.1 2008/12/10 22:06:42 snj Exp $ */
+/*	$NetBSD: clock.c,v 1.47.20.2 2009/09/26 18:44:59 snj Exp $ */
 
 /*
  * Copyright (c) 1982, 1990 The Regents of the University of California.
@@ -77,7 +77,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.47.20.1 2008/12/10 22:06:42 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.47.20.2 2009/09/26 18:44:59 snj Exp $");
 
 #include 
 #include 
@@ -333,6 +333,8 @@
 static u_int
 clk_getcounter(struct timecounter *tc)
 {
+	static int last_hardclock_ticks;
+	static u_int last_clock_tick = 0;
 	int old_hardclock_ticks;
 	u_int clock_tick;
 
@@ -341,6 +343,19 @@
 		clock_tick = clk_gettick();
 	} while (old_hardclock_ticks != hardclock_ticks);
 
+	/*
+	 * Handle the situation of a wrapped interval counter, while
+	 * the hardclock() interrupt was not yet executed to update
+	 * hardclock_ticks.
+	 */
+	if (last_hardclock_ticks > old_hardclock_ticks)
+		old_hardclock_ticks = last_hardclock_ticks;
+	if (clock_tick < last_clock_tick &&
+	old_hardclock_ticks == last_hardclock_ticks)
+		old_hardclock_ticks++;
+	last_hardclock_ticks = old_hardclock_ticks;
+	last_clock_tick = clock_tick;
+
 	return old_hardclock_ticks * amiga_clk_interval + clock_tick;
 }
 



CVS commit: [netbsd-5] src/sys/arch/amiga/conf

2009-09-15 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Sep 16 04:53:21 UTC 2009

Modified Files:
src/sys/arch/amiga/conf [netbsd-5]: files.amiga

Log Message:
Pull up following revision(s) (requested by mhitch in ticket #956):
sys/arch/amiga/conf/files.amiga: revision 1.141
Switch the amiga to the common m68k/m68k/pmap_motorola.c (Finally!!).


To generate a diff of this commit:
cvs rdiff -u -r1.140 -r1.140.20.1 src/sys/arch/amiga/conf/files.amiga

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/amiga/conf/files.amiga
diff -u src/sys/arch/amiga/conf/files.amiga:1.140 src/sys/arch/amiga/conf/files.amiga:1.140.20.1
--- src/sys/arch/amiga/conf/files.amiga:1.140	Wed Feb 20 21:43:33 2008
+++ src/sys/arch/amiga/conf/files.amiga	Wed Sep 16 04:53:20 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: files.amiga,v 1.140 2008/02/20 21:43:33 drochner Exp $
+#	$NetBSD: files.amiga,v 1.140.20.1 2009/09/16 04:53:20 snj Exp $
 
 # maxpartitions must be first item in files.${ARCH}.newconf
 maxpartitions 16			# NOTE THAT AMIGA IS SPECIAL!
@@ -435,14 +435,14 @@
 file	arch/amiga/amiga/dkbad.c
 file	arch/amiga/amiga/machdep.c
 file	arch/amiga/amiga/mem.c
-file	arch/amiga/amiga/pmap.c
+#file	arch/amiga/amiga/pmap.c
 file	arch/amiga/amiga/pmap_bootstrap.c
 file	arch/amiga/amiga/trap.c
 file	arch/amiga/amiga/cc.c
 file	dev/md_root.c			memory_disk_hooks
 file	arch/m68k/m68k/cacheops.c
 file	arch/m68k/m68k/db_memrw.c	ddb
-#file	arch/m68k/m68k/pmap_motorola.c
+file	arch/m68k/m68k/pmap_motorola.c
 file	arch/m68k/m68k/procfs_machdep.c	procfs
 file	arch/m68k/m68k/sys_machdep.c
 file	arch/m68k/m68k/vm_machdep.c