Commit Graph

58264 Commits

Author SHA1 Message Date
scw 693ffb8185 Catch the case where a synchronous exception occurs during the critical
section of another exception. This is likely to happen if the kernel
stack is misaligned, has dropped off the bottom of the PCB, or has
otherwise gone into orbit.

In this case, switch to a safe stack, save as much of the machine
state as possible and dump it to the console.
2002-09-02 14:00:25 +00:00
scw f9fe8e4707 Go to splhigh() before enterring ddb(9). 2002-09-02 13:55:03 +00:00
onoe efcfc3e1c8 Add experimental support of Host-AP mode for awi driver.
It works also with WEP enabled.
But aging the associated clients is not implemented yet, so that the number
of clients may increase unlimitedly..
2002-09-02 13:37:35 +00:00
aymeric 4bbf4d2f6f remove one comment; warp some lines. 2002-09-02 12:54:40 +00:00
leo 449ee49a3d Decrease the vertical frequency. 2002-09-02 12:14:34 +00:00
leo 45501e0df2 Regen. 2002-09-02 12:13:35 +00:00
leo 89532d8b32 Introduce NO_PHYS_NETWORK as a define in the FALCON kernel. This define is
used to turn off the vlan, bridge and pppoe pseudo devices and the NETATALK
protocol.
2002-09-02 12:10:46 +00:00
aymeric 84ccd9ee4b call grfcc_probe() and viewprobe(), even when we are not the console.
This fixes a panic when using a serial console and wsconscfg.
(The monitors list wouldn't be initialized in grfabs.c)
2002-09-02 11:09:48 +00:00
scw 2a7a3cc2f8 In the _EXCEPTION_EXIT macro, don't use r24 until we've finished
accessing the kernel stack, since a TLB miss on the kernel stack
will result in r24 being trashed.
Also clear the ES_CRITICAL flag just before returning to the
previous context.
2002-09-02 08:41:56 +00:00
jdolecek ed2badbd21 make vers.c depend on ${SOURCES} and remove .PHONY tag for it, so that it
would only be regenerated if any of the input files changed
2002-09-02 07:33:11 +00:00
manu 9d459610ba When the serial port was not checked in hpcboot on hpcarm, writing to
/dev/ttyS0 crashed the kernel. This is because sacom_filltx uses some
uninitialized static variables. Pulling the salues from softc instead
fixes the problem (this is what was done before the drver was moved
from /sys/arch/hpcarm to /sys/arch/arm, anyway).
2002-09-02 05:27:39 +00:00
thorpej 556a752996 Build a .gdbinit in the kernel build directory. The new .gdbinit
will source all of the system-provided gdb scrips in sys/gdbscripts,
as well as any files specified by the user in the GDBINIT make var.
2002-09-01 23:04:47 +00:00
scw b02c328efd Track adjacent movi/shori instructions with the same destination register
so we can print the accumulated value.

Print symbols, if possible, when decoding "pta" branch targets, and
"movi"/"shori" accumulated values.
2002-09-01 22:39:56 +00:00
mjacob e2f3e02af9 Do not enable interrupt driven mailbox commands for non-FC scsi. 2002-09-01 22:30:09 +00:00
martin 1caaa903fa If the peer did not answer LCP echo requests in-time, but we got user
data through within the last LCP keepalive interval, do not count this
as a keepalive failure.

Addresses parts of kern/17723.
2002-09-01 18:54:12 +00:00
martin adb5933cbb Apply patch from Todd Vierling in PR kern/17665:
remove a test that has been obsoleted by the authentication failure
counter - enter slow retry mode always, not only if we already transfered
data successfully (the test was designed to disable retries when the
initial authentication setting was not correct, the auth failure counter
does this job better).
2002-09-01 18:06:59 +00:00
martin ac83580ea9 Add an option PPPOE_TERM_UNKNOWN_SESSIONS to forcefully disconnect sessions
we don't know anything about with a PADT packet.

Use with care, this is pretty dangerous and will kill all userland PPPoE
implementations. Therefore it is not enabled by default nor added as
a commented out option to GENERIC kernels.

But it is highly usefull if you have a fixed IP, an ISP that does not use
LCP echo requests for link monitoring and you want to recover quickly after
a crash or otherwise ungracefull disconnect.
2002-09-01 17:21:40 +00:00
itohy f89823c1f8 Save 1-4 instructions on all cases except for the ret=0 case.
This is probably the last version from me. :)
You are welcome to speed it up, of course. :)

Here's a benchmark on SH-4 200MHz.
9.2% faster if all the cases occur evenly.

return value	C version	previous vers	this version	speed ratio
of ffs()	(ns/call) *1	(ns/call)	(ns/call) *2	(*1/*2)
------------	------------	-------------	------------	-----------
 0		  86		 81		 81		1.06
 1		 110		106		 91		1.21
 2		 132		106		 92		1.43
 3		 165		117		 96		1.72
 4		 201		116		 95		2.12
 5		 237		107		 99		2.39
 6		 271		106		101		2.68
 7		 307		116		107		2.87
 8		 342		116		105		3.26
 9		 376		126		111		3.39
10		 410		127		110		3.73
11		 446		136		115		3.88
12		 483		134		116		4.16
13		 518		125		119		4.35
14		 551		126		120		4.59
15		 587		135		127		4.62
16		 624		136		126		4.95
17		 658		139		126		5.22
18		 694		140		126		5.51
19		 727		148		131		5.55
20		 764		150		131		5.83
21		 799		141		135		5.92
22		 834		142		135		6.18
23		 868		152		140		6.20
24		 903		153		142		6.36
25		 939		140		127		7.39
26		 974		141		126		7.73
27		1009		152		131		7.70
28		1044		148		130		8.03
29		1080		141		136		7.94
30		1115		141		136		8.20
31		1151		151		141		8.16
32		1185		151		140		8.46
2002-09-01 13:14:53 +00:00
scw f387921c31 Move registers r10-r13 over to the Caller-saved set, at least as far
as intrframe and trapframe are concerned.

According to the ABI, only the low 32-bits of these registers are
guaranteed to be preserved by the callee. Therefore, we need to
preserve all 64-bits of them in the interrupt trampoline.
2002-09-01 11:40:54 +00:00
takemura 6a286a4f2a BUGFIX: WSDISPLAYIO_SVIDEO and WSDISPLAYIO_GVIDEO don't work. 2002-09-01 11:38:29 +00:00
takemura e00064b3e0 Fixed again. Rev 1.7 was incomplete and this device did't work for long time. 2002-09-01 10:45:38 +00:00
bouyer 3a7aeb79ca nfs_doio(): handle the case where nfs_writerpc() returned error != 0.
Fix kern/18125. OK'd by thorpej and chs.
2002-09-01 10:39:38 +00:00
scw 75c81c5275 Blah, some of the larger operands could overflow the "opstr" buffer.
Bump the size of all of them to be on the safe side.
2002-09-01 10:07:25 +00:00
scw d73a178b6b Output a new-line character after disassembling the opcode. 2002-09-01 09:18:52 +00:00
scw 5938c04bbe Yay, single-step now works.
Also do a wee bit tidying up.
2002-09-01 09:01:33 +00:00
scw 1398cd2898 Verify that the lowest 4 bits of the opcode are zero before disassembling.
According to the docs, opcode 0x6ff4fff0 is gauranteed to generate
a RESINST exception on all implementations, so disassemble it as "illegal".
2002-09-01 09:00:35 +00:00
uwe e724974d54 Add quirks for Neodio ND5010. 2002-08-31 22:51:16 +00:00
scw 4c7d945594 A full SHmedia disassembler for ddb(9).
ToDo:
 - Symbol support (can't test as yet, due to lack of symbols),
 - Take notice of adjacent "movi/shori" instructions in order to display
   the resulting 32/64-bit value, with symbol lookup if possible.
2002-08-31 22:21:39 +00:00
sommerfeld 782a77d899 Initialize proc0.p_raslock to avoid a lock assertion on the first fork(). 2002-08-31 20:02:09 +00:00
gehenna 848d04ae8d G. not F. 2002-08-31 17:08:49 +00:00
drochner 77944bfa08 call cpu_dumpconf() after dumpdev change, so that
the global dumpsize/dumplo get updated
2002-08-31 17:07:59 +00:00
scw 63fee282ed Always panic in the default/dopanic case, even if kdb_trap() returns. 2002-08-31 09:41:05 +00:00
scw 9c10dc5c22 If DEBUG is defined, enable Cayman's NMI button. 2002-08-31 09:30:02 +00:00
scw da6c509ffa Pick a better T_NMI code. The previous one clashed with T_AST|T_USER. 2002-08-31 09:25:53 +00:00
scw c2aa4b74c8 Don't use "Branch Likely" for the NMI case. 2002-08-31 09:25:24 +00:00
scw 9a6575c7df Add T_NMI. 2002-08-31 09:12:59 +00:00
scw d7dbb0862d Deal with NMIs by jumping through the normal trap() code path.
At the very least, this will dump the machine state. At best,
we get into ddb().

This provides a useful way to regain control using an NMI button
if the cpu decides to spin at a high ipl.
2002-08-31 09:11:56 +00:00
scw 17746914f0 Small simplification to the splx() code path when dealing with soft
interrupts, and fix a couple of nits in the generic soft interrupt code.

Soft interrupts now work.
2002-08-31 08:42:00 +00:00
ad e7ab6ca550 Nuke incorrect mailbox length defines and just use 13 everywhere. May help
with PR/14266.
2002-08-31 05:18:03 +00:00
thorpej 212cb9f78d Add machine-dependent bits of RAS for arm32. 2002-08-31 03:07:32 +00:00
tsutsui cda9af7bb6 Adapt arc to recent cpu_sysctl() changes on mips ports:
> Merge cpu_sysctl() for all mips ports, based on powerpc and m68k precedent.
>
> For now, only pmax implements CPU_BOOTED_KERNEL.  Need to revisit.
2002-08-30 23:49:27 +00:00
abs f951ddc019 Fix AHC_NO_TAGS to actually disable tagged queuing, and document. 2002-08-30 21:54:10 +00:00
thorpej d1523404bb Fix missing error check in sparc_bus_map(). Pointed out by uwe. 2002-08-30 20:38:31 +00:00
hannken d6d89cb6c6 Protect struct bufq_state from userland. 2002-08-30 19:21:14 +00:00
hannken 815491c0b3 Remove the old device buffer queue interface.
Approved by: Jason R. Thorpe <thorpej@wasabisystems.com>
2002-08-30 15:43:36 +00:00
scw 60bff6ed9c Make sure to sign-extend PTEH/PTEL values before writing to the TLBs.
Make sure to zero-extend PTEH/PTEL values before comparing with TLB entries.
Don't use the two LSBs of CTC when choosing a "random" TLB entry to replace;
seems like these bits are always zero on this CPU.
2002-08-30 13:54:16 +00:00
scw 7da5ef1b84 Delete the CPU_CTB1 option; it was never used.
Add the SH5_INTC_IRL_MODE_INDEP option, to correctly configure
the interrupt controller for Cayman.
2002-08-30 11:25:09 +00:00
scw 877f6b7143 Add some options:
- SH5_SIM, as we're targetting the simulator.
 - KERNEL_IPT_SIZE, as we want to reduce startup time.
 - DDB. Yes, DDB inside a debugger/simulator. :)
2002-08-30 11:23:12 +00:00
scw aaa2f7e5ca When running on the simulator, assume there is 16MB of "RAM". This
greatly reduces startup time.
2002-08-30 11:06:03 +00:00
scw 1fd693d5b5 In the IRL1 interrupt handler, you need to read the Interrupt
Source Register#0, Steve. Not the Board Operating Mode register. Duh.
2002-08-30 11:03:25 +00:00
scw de63e7f1e4 Swap the IRL numbers for FEMI and SUPERIO, after reading the Cayman
docs a bit more closely...
2002-08-30 10:59:39 +00:00
scw 5cc4fe3194 Slight tweak to how the sm(4) driver attaches to superio. Also, just
use the regular bus tag for sm(4) instead of superio's "special" ISA
bus tag.
2002-08-30 10:57:05 +00:00
scw ec32f137a2 Add byte_swap.h 2002-08-30 10:50:55 +00:00
scw 5bb390ef0d Re-arrange the endian/byteswap headers a bit by splitting off the
byte swap code into a separate file and renaming them.
Fix a typo which prevented ntohX and htonX macros DTRT for
little-endian mode.
2002-08-30 10:50:06 +00:00
scw 7958409b89 If running on the simulator, use a much lower buzz-loop count when
waiting for ACKs from the DTF host, otherwise the simulator waits
way too long for the initial open-ACK (which never seems to arrive,
even though things work fine afterwards).
2002-08-30 10:45:31 +00:00
scw 986af15320 Setup the IRL[0-3] mode according to what the kernel config file specifies. 2002-08-30 10:41:24 +00:00
scw 14b4efaf64 If running on the simulator, skip the pbridge probe. 2002-08-30 10:39:26 +00:00
scw f8f7664ef6 Defflag/param some options for:
- selecting Simulator/ST50 Debugger targets,
  - hard-coding the cpu speed instead of using the speed detection code,
  - changing the default kernel IPT size,
  - selecting the IRL[0-3] mode to configure in the interrupt controller.
2002-08-30 10:29:35 +00:00
ross 839099aa7b regen 2002-08-30 00:34:09 +00:00
ross b2703dc568 fix typo 2002-08-30 00:33:15 +00:00
bouyer 3d187bd055 The 1010 will generate a scsi gross error if a RAM entry is read before being
written (i.e. is used uninitialised). The esiop SCRIPT may do this in some
circonstances (and it is safe) so bus_space_set_region_4() the RAM in
reset routine.
Problem reported and fix tested by Allen Briggs.
2002-08-29 18:23:52 +00:00
scw 873939f14a Fix a typo which resulted in a bus_space_write_stream_4() where it
should have been bus_space_write_stream_2().

The sm(4) driver gets a bit further now.

While I'm here, g/c a debug printf accidentally commited last time around.
2002-08-29 18:11:07 +00:00
briggs 37019d791a Use generic_bs_sr_4 for bus_space_set_region_4. 2002-08-29 17:29:34 +00:00
briggs 043080912d Add generic_bs_sr_4 2002-08-29 17:27:48 +00:00
augustss 186b9996e7 Regen. 2002-08-29 16:46:36 +00:00
augustss d498b930ff Add two devices. 2002-08-29 16:46:15 +00:00
bouyer f86eed6ce2 Add definitions for the AIP control registers (1010 only). 2002-08-29 16:43:23 +00:00
scw 1256340461 Add the frame pointer (r14) to the list of registers to save in
the pcb during a context switch.
2002-08-29 16:04:10 +00:00
bouyer b13c46b64c Fix typo in comment. 2002-08-29 15:42:49 +00:00
martin 95617c00d7 Experimentation shows the hme chip is SIMPLEX if used in full-duplex
mode, but not otherwise.

This fixes PR 17523.
2002-08-29 14:33:03 +00:00
hannken ffd7a8c585 Convert to new device buffer queue interface.
Tested with help from Hauke Fath <hauke@Espresso.Rhein-Neckar.DE>
on Performa 600 and Quadra 700.
2002-08-29 14:15:37 +00:00
martin 5eee9e2b47 Adapt to recent exec changes. 2002-08-29 14:02:50 +00:00
christos 9cf6437e8f Fix internal copyargs too. 2002-08-29 14:01:08 +00:00
christos ff79c1e140 adjust copyargs signature to pass struct proc. 2002-08-29 13:59:23 +00:00
christos f2d5bd5133 s/au_/a_/g noticed by martin 2002-08-29 13:48:42 +00:00
hannken 6243846e46 Get rid of error -66 (sector not found).
From Hauke Fath <hauke@Espresso.Rhein-Neckar.DE>
2002-08-29 09:26:23 +00:00
leo eeb4fd145c defopt SERCONSOLE 2002-08-29 08:28:58 +00:00
simonb 284c3f4875 It's the gt64120, not the gt62140. 2002-08-29 08:02:35 +00:00
chs 2f11784ca7 only create a vmcmd for the BSS if there is any BSS. fixes PR 17834. 2002-08-29 06:31:21 +00:00
chs d510857ed4 be sure that the page we allocate to break a loan is put on a paging queue.
fixes PR 18037.
2002-08-29 05:03:30 +00:00
chs d6988a7eb6 Add `audio* at uaudio?' so that uaudio is actually useful. PR 15610. 2002-08-29 04:54:47 +00:00
chs d8a392f619 wrap Debugger() in #ifdef DDB. fixes PR 15881. 2002-08-29 04:43:43 +00:00
thorpej d9374670ba Put PERFCTRS under "Development and Debugging options". 2002-08-29 02:25:22 +00:00
thorpej 12f448527a Don't need SOSEND_LOAN here anymore. 2002-08-29 02:22:46 +00:00
scw 9af86f9bf3 Oops, got the source operands for an "andc" reversed.
This gets the hardware interrupt event handler working.
2002-08-28 21:05:25 +00:00
matt e25f13dfbe From OpenBSD:
- Fix one typo (instead of two disable_rx, one disable_rx and one disable_tx)
[The other bug fix isn't appropriate since the was OACTIVE is dealt with
has been changed in NetBSD.]
2002-08-28 17:46:58 +00:00
itohy fa5465079f Slightly improved version of ffs(3).
Partially from SHIMIZU Ryo <ryo@iij.ad.jp>.  Thanks.
Some cases are slower, but other most cases are faster.

Here's a benchmark on SH-4 200MHz.

return value	C version	previous vers	this version	speed ratio
of ffs()	(ns/call) *1	(ns/call)	(ns/call) *2	(*1/*2)
------------	------------	-------------	------------	-----------
 0		  86		 86		 81		1.06
 1		 110		 86		106 *(slower)	1.04
 2		 132		 86		106 *		1.25
 3		 165		105		117 *		1.41
 4		 201		104		116 *		1.73
 5		 237		111		107		2.21
 6		 271		111		106		2.56
 7		 307		126		116		2.65
 8		 342		125		116		2.95
 9		 376		122		126 *		2.98
10		 410		121		127 *		3.23
11		 446		139		136		3.28
12		 483		140		134		3.60
13		 518		146		125		4.14
14		 551		146		126		4.37
15		 587		161		135		4.35
16		 624		162		136		4.59
17		 658		141		139		4.73
18		 694		142		140		4.96
19		 727		160		148		4.91
20		 764		161		150		5.09
21		 799		167		141		5.67
22		 834		167		142		5.87
23		 868		181		152		5.71
24		 903		181		153		5.90
25		 939		146		140		6.71
26		 974		146		141		6.91
27		1009		166		152		6.64
28		1044		165		148		7.05
29		1080		171		141		7.66
30		1115		171		141		7.91
31		1151		185		151		7.62
32		1185		186		151		7.85
2002-08-28 15:34:35 +00:00
dsainty 278bea1a2b Fix playback at 48kHz sample rate (integer overflow bug introduced in 1.18) 2002-08-28 10:51:03 +00:00
gmcgarry 14b302311d RAS support for i386. 2002-08-28 09:47:15 +00:00
onoe fd9daca7ea Attach another DLTs for bpf: DLT_IEEE802_11 to capture raw 802.11 frame. 2002-08-28 09:38:08 +00:00
onoe 5d6bb1fbc3 Define new kernel interface bpfattach2() to register another data link
type for the driver, which will be used for 802.11 drivers.
Also add 2 APIs to get a list of available DLTs and use one for them.
	BIOCGDLTLIST (struct bpf_dltlist)
	BIOCSDLT (u_int)
2002-08-28 09:34:57 +00:00
onoe b4c41e0480 Define new DLT: DLT_IEEE802_11, DLT_PRISM_HEADER, and DLT_AIRONET_HEADER
from tcpdump.org
2002-08-28 09:31:20 +00:00
gmcgarry d6109af7cb RAS support for m68k. 2002-08-28 08:56:59 +00:00
gmcgarry 1a8058823b RAS support for MIPS. Tested on R3000. 2002-08-28 08:34:06 +00:00
gmcgarry a5c84b7617 Bump version for rasctl syscall. 2002-08-28 07:28:53 +00:00
gmcgarry 366dfb04d7 Attempt to protect restartable atomic sequences of a traced process
being written to.  Breakpoints aren't good in a RAS.  This test isn't
infallible, since we can't protect memory which will be registered
as a RAS in the future.

Also, set the PC before attempting to single-step, so we can backout
from single-stepping.  Just in case we try to single-step into a RAS.
2002-08-28 07:27:14 +00:00
gmcgarry fcdb569acb add kern_ras.c 2002-08-28 07:19:58 +00:00
gmcgarry 14e30716d8 Regenerate: rasctl 2002-08-28 07:18:50 +00:00
gmcgarry 5bcbbd40bf MI kernel support for user-level Restartable Atomic Sequences (RAS). 2002-08-28 07:16:33 +00:00
matt 05980fc1da Move bufpages to top of kernel vm space. allocate dead zone after buf
pages so that it go larger than > 256MB.
2002-08-28 06:27:20 +00:00
toshii e2d964c3ec Remove a superfluous interrupt request bit in yuvpack_prog,
which confuses the state machine in common_bktr_intr.
This makes "mplayer -tv ..." work (but only with NTSC).
2002-08-28 06:06:10 +00:00
itojun 6e85b03958 reduce diff w/ openbsd 2002-08-28 03:40:54 +00:00
simonb b888bfcc0e Remove some commented-out include files. 2002-08-28 02:27:11 +00:00
thorpej ec09d2df2a Fix a problem introduced in rev 1.103, where we recycle a TIME_WAIT
TCPCB .. the fields need to be converted back to net-order, because
the packet is checksummed after the TCPCB lookup happens.

From YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>.
2002-08-28 02:23:57 +00:00
simonb 993a94e6bc Add the Toshiba TX4927 CPU. 2002-08-28 02:09:29 +00:00
manu f9889ab068 Correctly map altgr on a french keyboard 2002-08-27 17:54:30 +00:00
thorpej 70b58c9c1e In bounds_check_with_label(), look for the label sector in RAW_PART,
not "a".
2002-08-27 17:30:02 +00:00
christos 0bd5494ee5 make this compile again (thanks mrg) 2002-08-27 14:18:41 +00:00
scw 5cff5c076e Don't need <machine/walnut.h> here. 2002-08-27 12:23:06 +00:00
uwe 082c4cf032 Make sun ports use common keyboard/firm events related includes
from dev/sun.
2002-08-27 09:47:41 +00:00
lukem fb7bc8541e arch/*/stand stuff should be LDSTATIC=-static and not LDSTATIC?=-static.
It doesn't make sense to have standalone stuff dynamically linked just
because an end-user uses LDSTATIC="".
2002-08-27 08:53:14 +00:00
thorpej d8e650d53a * The Netgear GA-621 is a 64-bit card, so add it to the 64-bit
quirk table.
* We want to hardwire BMSR_EXTSTAT, not BMSR_EXTCAP, when reading
  the TBI BMSR.
* Fetch the GPIO bits from the GPIOR register after an auto-load,
  rather than reading from the EEPROM directly.
2002-08-26 22:52:02 +00:00
fredb 750d298cb0 Follow AMD's recommendations for programming the uncachable/write-combine
bits of the K6 cache-control-register: disable the cache; flush the cache;
set the bits; re-enable the cache (all much like programming the pentium
mtrr's). See reference posted to tech-kern; also review there by thorpej.
2002-08-26 22:36:24 +00:00
uwe ee45afec36 Add no strings quirk for Neodio ND5010. 2002-08-26 21:34:28 +00:00
christos 9f2867a05c - pass struct proc to copyargs
- rename aux vector entries AT_{R,E}{U,G}ID from AT_SYUN_{R,}P{U,G}ID
- update new aux vector size.
2002-08-26 21:09:02 +00:00
christos fea7af3bbe - Implement passing AT_{R,E}{U,G}ID in the elf aux vector.
- Pass struct proc to copyargs
- fix svr4_copyargs functions
2002-08-26 21:07:38 +00:00
christos 830c5c171a Implement passing AT_{E,R}{U,G}ID in the elf aux vector, like solaris.
- pass struct proc to copyargs.
- eliminate svr4_copyargs, since it is the same as ours now.
2002-08-26 21:05:59 +00:00
uwe 6504ec382d Regen for Neodio/ND5010. 2002-08-26 20:25:06 +00:00
uwe fd02e2f63b Add Neodio and their nd5010 multi-format flash controller. 2002-08-26 20:18:56 +00:00
ad 35c2b89513 Add an ioctl to retrieve basic controller information. 2002-08-26 17:02:15 +00:00
martin d797b29d85 Give arrays in the softc indexed by channel number the right size
and define a symbolic name for the number of channels.
2002-08-26 17:00:42 +00:00
ad fba11cbab8 Handle aincent firmware as found on EISA/MCA boards. Untested. 2002-08-26 15:27:12 +00:00
itojun c7b00b4ce4 pass proc * to in6_pcbsetport. PR 18073 2002-08-26 14:25:00 +00:00
chris e660a1b7e6 Add byte_swap.h for cats, this creates the /usr/include/machine/byte_swap.h 2002-08-26 13:35:16 +00:00
augustss 731d1eccf2 Get rid of sysctl for setting BCM2033 firmware path. It doesn't work
for ports that don't include files.usb, and it's also not done quite
the way it should.
2002-08-26 13:09:39 +00:00
scw f7982b5823 Another item on the TODO list:
Add support for cpus where sizeof(register_t) is not necessarily
	the same as sizeof(void *). This is the case on SH5 using the
	ILP32 ABI. On this cpu db_expr_t is, necessarily, 64-bits.
	Unfortunately, in ILP32 mode, ddb will only display the low 32-bits
	of any expression, including registers...
2002-08-26 11:35:22 +00:00
scw a82718b34d Casting from a pointer, to a db_expr_t, has to go via an intptr_t.
(db_expr_t == int64_t on sh5, for example).
2002-08-26 11:34:27 +00:00
scw 41e5042829 Pointers must be cast to {,u}intptr_t before they can be cast to register_t,
at least on sh5, where sizeof(register_t) != sizeof(void *) in ILP32 mode.
2002-08-26 11:26:09 +00:00
scw 2ccf86d7da Re-sync with current reality.
Add options DDB.
Add debug makeoptions.
G/C some unnecessary stuff.
2002-08-26 11:16:02 +00:00
scw ce2ec9e63e Add support for the SMsC LAN83C183 PHY, which actually probes as a
Seeq 84220.

Also add an 84220-specific work-around for some braindamage (at least
in the PHY I'm working with) where the PHY always comes out of reset
isolated, regardless of the previous state of the BMCR_ISO bit. This
happens even if the PHY has address zero, which is contrary to the
part's datasheet...

The work-around is only applied if we notice BMCR_ISO is set when it
should be clear following reset. The fix is to wait 30mS and clear
it manually. (The change doesn't stick if it's cleared sooner than this)
2002-08-26 11:13:13 +00:00
scw 9bcd736b9d Attach sm(4) at superio, instead of the previous isa bus attachment.
The latter's probe doesn't pick up the ethernet controller, and the
attach function needs to set MIIF_NOISOLATE.
We attach it at superio mainly because they share the same region of
address space, and the ethernet controller's interrupt is routed
through the superio.
2002-08-26 11:04:44 +00:00
scw fe7de4db3f Need <machine/db_machdep.h> 2002-08-26 10:58:38 +00:00
scw a1fda8f587 Call ddb_init() right after initialising the console.
We have no symbols at this time (due to lack of a bootloader)
so just hardcode symbol length to zero for now.
2002-08-26 10:55:39 +00:00
scw 0eb22d79b4 Try to preserve more bits in the status register (e.g. trace/watch).
Bump the (currently hardcoded) size of onboard RAM to match the Cayman.
2002-08-26 10:52:13 +00:00
scw f6e3925495 Set the appropriate Timer Start bit after setting it all up. 2002-08-26 10:48:17 +00:00
scw aba39b410c Don't forget to initialise 'sc' on entry to the attach function ... 2002-08-26 10:45:55 +00:00
scw a1ed033a09 Hardcode FEMI base and top addresses, at least until I figure out
how to interpet VCR.MB_TOP and VCR.MB_BOT in some reasonable way.
2002-08-26 10:43:44 +00:00
scw 3ad3b8c856 Add MD ddb(4) files. 2002-08-26 10:39:43 +00:00
scw a57d38854c Save SSR and SPC while in the critical section of an exception. The
previous behaviour of storing them with SR.BL clear was in breach
of the SH5 documentation.

Make an effort to catch PANIC traps and dump machine state to the console.
2002-08-26 10:38:52 +00:00
scw 40f78dcc13 Use pmap_map_device() to map device registers. 2002-08-26 10:35:40 +00:00
scw 8bd3eb387d Don't block exceptions in the initial SR value. 2002-08-26 10:34:43 +00:00
scw 10ce1fc51b s/pmap_bootstrap_mapping/pmap_map_device/ 2002-08-26 10:33:33 +00:00
scw abc568b5e1 In cpu_fork(), if p1 == curproc, call sh5_savectx() to ensure the
pcb contains valid state before copying it to p2's pcb.
Previously, we just lazy-sync the fpu state. This wasn't quite good
enough if p1 had not previously slept.
2002-08-26 10:32:55 +00:00
scw 0a00df79a0 Initialise to zero the memory allocated for interrupt handles. 2002-08-26 10:26:28 +00:00
scw d2c90421b8 Enable h/w interrupts before returning from cpu_configure(). 2002-08-26 10:24:57 +00:00
scw bc8042954a - Add a debug check for SR.BL being set on entry to cpu_switch().
- Add sh5_savectx()
- Fix a branch target register botch in sh5_fpsave() and sh5_fprestore().
2002-08-26 10:23:56 +00:00
scw 7bd8b94a66 Wrap dump_kipt() in #ifdef DDB. 2002-08-26 10:21:54 +00:00
scw d8f6a57b15 Re-work pmap_bootstrap_mapping() to pmap_map_device() to provide a
way for bus_space(9) to efficiently map device memory. (Although at
the moment, it doesn't quite work as efficiently as it will down
the line ...)

Fix a pool_init() botch.

Add a debug aid: dump_kipt(). This can be called from ddb(4) in order
to (partially) dump the contents of the kernel IPT.
2002-08-26 10:21:04 +00:00
scw 2774f9d77b Basic ddb(4) support.
Still to do:
 - disassembly
 - breakpoints
 - single-step
 - stack trace
2002-08-26 10:16:44 +00:00
scw 16ba45622a - Drop to ddb(4) on kernel traps.
- Dump more machine state on kernel traps (for when ddb isn't an option).
- Add rudimentary support for PANIC exceptions.
2002-08-26 10:14:02 +00:00
scw d454acf190 Disable the checks for unsupported hz values for now. At least until I
can fix the peripheral bridge's PLL1 clock ratio.
2002-08-26 10:10:22 +00:00
scw b5273356dc - Invalidate insn/operand caches before setting up the mmu for the first time.
- Clear SR.FD to enable the FPU. Seems like it starts up disabled. If the
  core has no FPU, this is a nop.

- Preserve the debug bits (step/watch) in an attempt to appease the debugger.
2002-08-26 10:08:02 +00:00
scw 911776caaf Impose a limit on the time we spin waiting for the DTF host to ack
our packet. Seems like the ack for the initial posix console "open"
packet never arrives, even though it completes successfully.
2002-08-26 10:04:05 +00:00
ragge 9ed570274c Remove old dmf/dmz definitions. 2002-08-26 08:14:53 +00:00
ragge 217df25ecc Include DMF32/DMZ32 files. The actual device drivers will be checked in when
the licensing of the 4.4BSD encumbered files are solved.
2002-08-26 08:08:06 +00:00
itojun 9287c3fbb9 need to set wantinit variable 2002-08-26 07:38:34 +00:00
itojun 3931bcf3a3 suppress some of debugging output (IFF_DEBUG will re-enable it). PR 18069 2002-08-26 07:37:26 +00:00
petrov a413e88543 Accept WDTR from device(based on John Heasley patch for SCSI3 drive).
Do not define NCR53C9X_DEBUG.
2002-08-26 06:23:32 +00:00
petrov 3a67429963 Start SYNC/WIDE renegotiating in controller reset, rearrange debug output. 2002-08-26 05:17:48 +00:00
petrov 584ece2d73 Dispose unused tinfo flags. 2002-08-26 05:14:47 +00:00
thorpej 83b3b86fd6 Fix a signed/unsigned comparison warning from GCC 3.3. 2002-08-26 01:42:28 +00:00
thorpej f3420f21a5 Fix some signed/unsigned comparison warnings from GCC 3.3. 2002-08-26 01:39:39 +00:00
thorpej 2371f92317 Fix signed/unsigned comparison warnings from GCC 3.3. 2002-08-26 01:36:37 +00:00
thorpej 3767580d1a Fix a signed/unsigned comparison warning from GCC 3.3. 2002-08-26 01:26:29 +00:00
thorpej 79111bb802 Fix signed/unsigned comparison warnings from GCC 3.3. 2002-08-26 01:21:58 +00:00
thorpej d2f6f092f9 Avoid signed/unsigned comparison warnings from GCC 3.3. 2002-08-26 01:17:18 +00:00
thorpej c92f7f0abb Force CBSIZE to act like an "int" by casting the sizeof() used
within the expression.
2002-08-26 01:16:43 +00:00
thorpej fde1164ef5 Fix some signed/unsigned comparison warnings from GCC 3.3. 2002-08-25 23:23:22 +00:00
thorpej 88e741999d Fix signed/unsigned comparison warnings from GCC 3.3. 2002-08-25 23:16:39 +00:00
thorpej 4d94adc849 Fix some signed/unsigned comparison warnings from GCC 3.3. 2002-08-25 23:15:21 +00:00
thorpej 4bec56201d Fix signed/unsigned comparison warnings from GCC 3.3. 2002-08-25 22:51:05 +00:00
thorpej 556e3c90c4 Fix a signed/unsigned comparison warning from GCC 3.3. 2002-08-25 22:32:02 +00:00
thorpej c57c6b52cb Make uiomove()'s count argument a size_t rather than an int. 2002-08-25 22:28:40 +00:00
thorpej f1e8d159b0 Fix signed/unsigned conditional expression warning from GCC 3.3. 2002-08-25 21:47:50 +00:00
thorpej cc84cfd836 Fix signed/unsigned comparison warning from GCC 3.3. 2002-08-25 21:44:13 +00:00
thorpej 7055457a98 Fix some signed/unsigned comparison warnings from GCC 3.3. 2002-08-25 21:30:40 +00:00
thorpej 5f7ccd1634 Fix a signed/unsigned comparison warning from GCC 3.3. 2002-08-25 21:19:41 +00:00
thorpej cf013daeb3 Fix some signed/unsigned comparison warnings from GCC 3.3. 2002-08-25 21:18:15 +00:00
thorpej 181f0a9b54 Tweak the previous change so that a prototype is always provided. 2002-08-25 21:09:45 +00:00
thorpej 139cdc3125 Make nbuf, nswbuf, and bufpages unsigned. Make all operations on these
variables unsigned, and update places where their values are printed.
2002-08-25 20:21:33 +00:00
fredette 94791afd65 No longer use BTLB entries to map the entire address spaces of I/O subsystems,
since BTLB entries can be scarce and very little of an I/O subsystem normally
needs to be mapped.

Instead, the pmap now allows mappings of I/O space to be entered with
pmap_kenter_pa.  bus_space mappings for small amounts of I/O space (as for
virtually all devices) are made this way, with BTLB entries still used for
large mappings for things like framebuffers.

This has led to more and cleaned-up uses of bus_space(9) and has caused
some autoconf cleanup.  Also, kgdb is now attached and connected before
autoconfiguration, which is much earlier than before.
2002-08-25 20:19:59 +00:00
thorpej f02cb5ee27 Make hashinit() use unsigned quantities throughout. 2002-08-25 20:01:12 +00:00
tron 56999645f0 Fix typo in a comment. 2002-08-25 19:21:47 +00:00
thorpej d4a2567abe Fix a signed/unsigned comparison warning from GCC 3.3. 2002-08-25 19:13:08 +00:00
thorpej f066e17960 Fix some signed/unsigned comparison warnings from GCC 3.3. 2002-08-25 19:11:16 +00:00
manu 652fe89179 - add locks to structures used by the /dev/usema driver and the
usync_cntl() system calls.

- when usync_cntl is used and the process is aborted (eg: by kill -9)
libc does not call usync_cntl() to unblock things. We have to cleanup
data allocated in the kernel. This is now done through the emulation
specific exit hook

- IRIX initialize some data in the system part of the PRDA: the pid and
a prid (PRDA ID?). We initialize both to pid.

- Move back struct irix_share_group from irix_exec.h to irix_prctl.h, it
is more revelant here.

- fix a few typos
2002-08-25 19:03:12 +00:00
thorpej c47fa45915 Make this compile without KTRACE or SYSTRACE. 2002-08-25 18:39:40 +00:00
thorpej 88d1869bb4 No need for two copies of the i8253 register definitions. Remove the
i386-specific copy, and adjust its users to add in the timer i/o base
as necessary.
2002-08-25 18:10:32 +00:00
thorpej a9f285b0ac Put a bus's ranges in the bus space tag, and make sparc_bus_map()
perform the translation and recursion if t->ranges != NULL.  Make
sbus, cpuunit, and bootbus inherit the parent's map/mmap routines,
and delete the now-unused mapping functions.  Update all places where
bus space tags are statically allocated.
2002-08-25 17:54:57 +00:00
bouyer 9ca1f94f72 Support Ultra/133 on promise controllers that can do it. 2002-08-25 17:26:58 +00:00
bouyer a9d165fd6a Correct setup for Ultra133 capable VIA chipsets, From Matthias Drochner
on current-users, with cross-check and some improvement from linux-2.4.19
and FreeBSD-current.
Also don't set the APO_UDMA_CLK66 bit for Ultra/100 capable chipset, and
support Ultra/133 for the VT8233A.
2002-08-25 17:25:33 +00:00
bouyer 7e6804d723 Add support for Ultra/133 (ultra-DMA6) in wdc_probe_caps(). 2002-08-25 17:22:38 +00:00
thorpej 067a64da4d Split the timer code up into Sun4/Sun4c, Sun4m, and MS-IIep bits, mostly
to make it more readable.
2002-08-25 16:10:35 +00:00
thorpej 0570742a0b Add a generic function to translate a device address using a
parent's "ranges" property, and use it.
2002-08-25 16:05:41 +00:00
thorpej 51b546d0bb Move the DMA tag and DVMA map into the iommu_softc, and pass the
iommu_softc in the DMA tag cookie.  This gives us a chance of supporting
systems (such as the Sun4d) which have multiple iommus.
2002-08-25 16:02:53 +00:00
martin f54ddc3c17 Add a function to lookup bridge members by struct ifnet * and use
it at all call sites that have such a pointer readily available.
This avoids unnecessary strcmp()s in critical paths, and removes
some XXX comments.
2002-08-24 19:00:31 +00:00
augustss bd028c470a Fix a name I forgot. 2002-08-24 17:58:15 +00:00
augustss ffc3083503 Attach Bluetooth host controller driver (which has not been written) to
ubt device.
2002-08-24 17:31:19 +00:00
augustss 7db70d7d18 Add some placeholders for Bluetooth code. 2002-08-24 17:30:13 +00:00
augustss 0f0102e2cd Add btbus, an attribute for Bluetooth. 2002-08-24 17:28:58 +00:00
augustss 4e63b2ebe1 Add needs-flag for ubtbcmfw. 2002-08-24 17:27:53 +00:00
thorpej d476292c05 Add Sun4d cpu-unit ASIs. 2002-08-24 17:27:21 +00:00
augustss cdbff56c90 Add sysctl support for hw.dev.ubtbcmfw (so I can set the firmware
path for my BCM2033).
2002-08-24 17:27:01 +00:00
augustss 36e33c869d Add sysctl support to firmware loader. 2002-08-24 17:24:04 +00:00
fredette c7d356a55e Clean up how the ROM is mapped. If the ROM falls in the large mapping
we enter for the memory, use a subregion of that, else map it by itself.
2002-08-24 16:43:31 +00:00
ragge 2c43ae582f Must set correct HW unibus number so that disk autodetection on other
Unibuses than the first work.
2002-08-24 10:48:10 +00:00
itohy 6736303e13 Use assembly version of ffs(3). 2002-08-24 06:39:48 +00:00
itohy 85ce1de27f Oops, SYSLIBC_SCCS -> LIBC_SCCS 2002-08-24 06:37:24 +00:00
itohy 70b5675025 Assembly version of ffs(3).
Confirmed to return the same value as that of the C version.

The results of a simple benchmark on SH-4 200MHz, is shown below.
I think this shows acceptable performance.

return value	C version	this version	speed
of ffs()	(ns/call)	(ns/call)	ratio
------------	---------	------------	-----
 0		  86		 86		1.00
 1		 110		 86		1.27
 2		 132		 86		1.53
 3		 165		105		1.57
 4		 201		104		1.93
 5		 237		111		2.13
 6		 271		111		2.44
 7		 307		126		2.43
 8		 342		125		2.73
 9		 376		122		3.08
10		 410		121		3.38
11		 446		139		3.20
12		 483		140		3.45
13		 518		146		3.54
14		 551		146		3.77
15		 587		161		3.64
16		 624		162		3.85
17		 658		141		4.66
18		 694		142		4.88
19		 727		160		4.54
20		 764		161		4.74
21		 799		167		4.78
22		 834		167		4.99
23		 868		181		4.79
24		 903		181		4.98
25		 939		146		6.43
26		 974		146		6.67
27		1009		166		6.07
28		1044		165		6.32
29		1080		171		6.31
30		1115		171		6.52
31		1151		185		6.22
32		1185		186		6.37
2002-08-24 06:30:34 +00:00
thorpej 41c25cb648 Add autoconfiguration support for the Sun4d "bootbus". Add a
zs @ bootbus attachment.
2002-08-24 05:26:56 +00:00
mhitch 89fd7196ed Add missing PMAP_TLB_SHOOTDOWN() after PMAP_INVALIDATE_TLB() in
pmap_page_protect().  Closes NetBSD Problem Report #18045.
2002-08-24 03:10:52 +00:00
thorpej ffdedb6d80 In pmap_map_in_l1() and pmap_unmap_in_l1(), make sure that the VA
that is passed in is already aligned to a 4M super-section.
2002-08-24 03:10:40 +00:00
thorpej d158b3a37a When we allocate a PTP, make sure the offset we specify is for
the 4M super-section that the PTP will map, not some random 1M
chunk of it.  This gives the PTP hint code a much better chance
to working properly, and allows us to tidy up the code that
flushes a PTP from the cache in pmap_destroy().
2002-08-24 02:50:53 +00:00
thorpej aafe6e006c Define macros describing the 4M super-sections that our pmap
actually uses (since we allocate PT pages in 4K chunks, rather
than 1K chunks).
2002-08-24 02:48:50 +00:00
thorpej 77a6866508 Enable caching on kernel and user page tables. This saves having
to do uncached memory access during VM operations (which can be
quite expensive on some CPUs).

We currently write-back PTEs as soon as they're modified; there is
some room for optimization (to write them back in larger chunks).
For PTEs in the APTE space (i.e. PTEs for pmaps that describe another
process's address space), PTEs must also be evicted from the cache
complete (PTEs in PTE space will be evicted durint a context switch).
2002-08-24 02:16:30 +00:00
lukem 141ac20efe only print "init: trying /some/init" if RB_ASKNAME or if it's not the first
path we're trying.  (the intent but not the behaviour of the previous rev.)
2002-08-24 00:47:17 +00:00
thorpej bb0558df3e Oops, don't need a DMA tag. 2002-08-23 21:49:13 +00:00
matt 2d290eb699 Use the qtype_FOREACH macros. Print out address of hook that could not
be disestablished.
2002-08-23 20:50:25 +00:00
thorpej a71473b576 Add autoconfiguration glue for the Sun4d "cpu-unit". Each processor
board has 2 CPU units (one for each processor), one of which also has
a "bootbus", to which the serial ports, etc. are attached.

We can now probe/attach CPUs on a SPARCserver 1000.
2002-08-23 18:00:46 +00:00
itojun a8b4aa9a72 #if 0 out call to rnd_add_uint32() in interrupt logic until thorpej
measures performance differences.
2002-08-23 16:30:10 +00:00
bouyer 0d17a940f8 Add support for HPT372. From sdegler@kashmir.degler.net in kern/17908,
with some improvement from me, and from FreeBSD.
2002-08-23 16:24:54 +00:00
matt ffdea2c266 Only do the dssall if cpu_altivec is set. 2002-08-23 16:08:10 +00:00
bouyer 1a7bae9619 Add support for Promise Ultra133TX2 and Ultra133TX2v2, from FreeBSD and
stephen@degler.net in kern/17509.
2002-08-23 16:02:32 +00:00
bouyer ea9862cb62 Regen: Add Promise Ultra133TX2 and Ultra133TX2v2 PCI ID 2002-08-23 15:57:04 +00:00
bouyer f49156d31c Add Promise Ultra133TX2 and Ultra133TX2v2 PCI ID. 2002-08-23 15:56:30 +00:00
scw b3e086e0ce Attach the ECC driver instead of the previous "eccirq" property hack. 2002-08-23 15:03:33 +00:00
scw 5b79fdfaf7 Add "ecc at plb" device.
Add an "irq" locator to the plb device.
This gets rid of the original hack where ecc support was wedged into
the cpu driver.
2002-08-23 15:01:07 +00:00
simonb 3502025a54 Show the IRQ we attach the ECC handler to. 2002-08-23 13:43:18 +00:00
simonb a9560f7ab2 Don't pass PROP_CONST to board_info_set() for variables that are on
the stack; we want to copy the property into the database.
2002-08-23 13:41:55 +00:00
scw 3a0067a42a Comment out wscons-related options until port-specific code is written. 2002-08-23 13:16:23 +00:00
scw 9ba60b4297 Install the ECC error interrupt handler at the level specified by
a "4xx-ecc-irq" property.
If the property isn't defined, assume the hardware has no ECC support.
This should, ideally, be a config file option.
2002-08-23 12:46:49 +00:00
scw c4fdfebd38 Allow port-specific Makefiles to override the name and location
of locore.[So].
This is in preparation for arch/evbppc.
2002-08-23 12:01:58 +00:00
scw a0d58bf2f5 Remove an extra trailing bracket in a DEBUG printf. 2002-08-23 11:59:40 +00:00
scw f384fe8ba7 Don't assume all com ports run at "COM_FREQ", or a multiple thereof.
Use a board-specific property instead.
2002-08-23 11:42:13 +00:00
scw 19c988633d Don't frob cpu-specific DCR registers in common code. 2002-08-23 11:40:07 +00:00
scw 4968573654 Split off common 4xx locore code so it can be re-used by other 4xx ports. 2002-08-23 11:37:53 +00:00
ragge 3f5fba68de Do not try to use "__builtin_ffs" on vax, ffs is an instruction already.
Maybe possible to teach gcc to use it?
2002-08-23 08:45:27 +00:00
itojun e68a39d27b attach random number source. 2002-08-23 07:45:39 +00:00
lukem 76f5313c64 in start_init(), if RB_ASKNAME is set in boothowto, ask for the path
name to start up as init (rather than just cycling thru initpaths[]
and panicing when out of options).  if RB_ASKNAME isn't set, the old
behaviour remains.  inspired by changes in der Mouse's patchtree.
resolves [kern/18027] from me.
2002-08-23 06:17:08 +00:00
enami 691598efd0 s/FREE/PNBUF_PUT/ 2002-08-23 05:38:51 +00:00
thorpej 90817e313c Use the structures defined in bsd_openprom.h for "reg", "range",
and "intr" properties, rather than having identical-except-for-names
sbus_* and iommu_* versions.
2002-08-23 02:53:10 +00:00
thorpej e92b96b3c4 CPU_ISSUN4OR4C -> CPU_ISSUN4 || CPU_ISSUN4C 2002-08-23 02:46:37 +00:00
thorpej 8b7cc1c1d2 Protect against multiple inclusion. 2002-08-23 02:45:44 +00:00
thorpej de6a644cea * Refine the comment describing openprom_addr.
* Add openprom_range and openprom_intr structures.
2002-08-23 01:08:45 +00:00
augustss 6add8c3d67 Remove some debugging crap. 2002-08-23 00:58:58 +00:00
augustss fb1033e35b Add firmware downloader for BCM2033 (no firmware yet; waiting for OK
from Broadcom).
2002-08-23 00:55:20 +00:00
augustss 19801c46c9 Regen. 2002-08-23 00:53:58 +00:00
augustss 70dfad754f Use separate ids for BCM2033 before and after firmware download. 2002-08-23 00:52:45 +00:00
matt 78581fe411 In amap_ref, only increment the amap's refcnt after we have established
the ppref array.  Otherwise, the newly ref'ed pages will be doubly
counted and thus never freed because the pprefcnt can't fall to 0.
2002-08-22 23:39:37 +00:00
wrstuden e85eb3093d Enable memory for cards with 64-bit memory mappings in addition to
32-bit memory mappings. Makes Intel GigE card work in my Beige G3.

Patch from thorpej
2002-08-22 22:47:35 +00:00