Commit Graph

1105 Commits

Author SHA1 Message Date
Jake Burkholder
ef73ae4b0c Use PCPU_GET, PCPU_PTR and PCPU_SET to access all per-cpu variables
other then curproc.
2001-01-10 04:43:51 +00:00
Matt Jacob
f0cab81245 The alpha architecture is 64 bits, so bus_addr_t && bus_size_t should really
be 64 bits wide. The largest known current actual physical implementation
is 40 bits, so BUS_SPACE_MAXADDR should reflect this. It also seems to
me that BUS_SPACE_UNRESTRICTED should b ~0UL, not ~0.
2001-01-09 18:17:48 +00:00
David E. O'Brien
eaca6822a9 Put VCS ids in a consistent place and form. 2001-01-08 06:24:08 +00:00
David E. O'Brien
2590b31beb Remove seconds types we don't use that came in thru the NetBSD heiratage. 2001-01-08 06:17:11 +00:00
Jake Burkholder
f8761e53a7 Implement accessors for per-cpu variables which don't depend on the
symbols in globals.s.

	PCPU_GET(name) returns the value of the per-cpu variable
	PCPU_PTR(name) returns a pointer to the per-cpu variable
	PCPU_SET(name, val) sets the value of the per-cpu variable

In general these are not yet used, compatibility macros remain.

Unifdef SMP struct globaldata, this makes variables such as cpuid
available for UP as well.

Rebuilding modules is probably a good idea, but I believe old
modules will still work, as most of the old infrastructure
remains.
2001-01-06 19:55:42 +00:00
David E. O'Brien
e91cf05816 Sort some of the _BSD_* types. 2001-01-01 22:26:56 +00:00
Matt Jacob
32f73b1c3e Add a dopey makefile to do the tags dance, which is probably not perfect
but is better than nothing by a good deal.
2000-12-31 23:26:34 +00:00
David E. O'Brien
ca1d6e0610 Move all VCS ids to a consistent location. 2000-12-28 18:21:32 +00:00
David E. O'Brien
ebf7598b4d Add multiple inclusion protection.
PR:		23902
Submitted by:	Christian Weisgerber <naddy@mips.inka.de>
2000-12-28 18:18:23 +00:00
Jake Burkholder
98f03f9030 Protect proc.p_pptr and proc.p_children/p_sibling with the
proctree_lock.

linprocfs not locked pending response from informal maintainer.

Reviewed by:	jhb, -smp@
2000-12-23 19:43:10 +00:00
Matt Jacob
38e147e106 Fix ypo in essage about isabling EISA nterrupt ector
(tip 'o the tired cap to Bernd Walter <ticso@cicely5.cicely.de>)
2000-12-15 23:09:05 +00:00
John Baldwin
5f38ca907c Remove the "machine dependent" KTR trace buffer ddb commands. The code was
exactly the same on all platforms.
2000-12-14 23:57:30 +00:00
Matt Jacob
6cd8749dbf Add route interrupt method. 2000-12-13 09:07:16 +00:00
David E. O'Brien
c81f693089 Sync with i386/GENERIC rev 1.294 removing "COMPAT_OLDPCI".
This fixed the broken kernel build on the Alpha.
2000-12-13 07:34:47 +00:00
Jake Burkholder
c0c2557090 - Change the allproc_lock to use a macro, ALLPROC_LOCK(how), instead
of explicit calls to lockmgr.  Also provides macros for the flags
  pased to specify shared, exclusive or release which map to the
  lockmgr flags.  This is so that the use of lockmgr can be easily
  replaced with optimized reader-writer locks.
- Add some locking that I missed the first time.
2000-12-13 00:17:05 +00:00
Andrew Gallatin
be5182cc4d enable the proper cascade irq on as1000a
tested by: wilko
2000-12-12 01:39:17 +00:00
Andrew Gallatin
f4aea0e88a fix AS1000/AS1000A support. It turns out the that iobus depends on the
CPU version (apecs:ev4::cia:ev5) and the irq hardware depends on the systype
previously, only ev4 AS1000s and ev5 AS1000a's would have worked.

tested by: wilko (in its -stable form)
noticed by: daniel
2000-12-12 01:36:26 +00:00
Andrew Gallatin
1b771c9281 fix various compiler warnings generated by previous commit 2000-12-12 01:32:36 +00:00
Jake Burkholder
92cf772d8d - Add code to detect if a system call returns with locks other than Giant
held and panic if so (conditional on witness).
- Change witness_list to return the number of locks held so this is easier.
- Add kern/syscalls.c to the kernel build if witness is defined so that the
  panic message can contain the name of the offending system call.
- Add assertions that Giant and sched_lock are not held when returning from
  a system call, which were missing for alpha and ia64.
2000-12-12 01:14:32 +00:00
Matt Jacob
25b53bb41f Store in globaldata our CPU ID#. Provide a lock for panics - only one
CPU can panic at a time.
Obtained from:Andrew Gallatin <gallatin@cs.duke.edu>
2000-12-09 20:52:42 +00:00
Mike Smith
bb0d0a8efc Next phase in the PCI subsystem cleanup.
- Move PCI core code to dev/pci.
 - Split bridge code out into separate modules.
 - Remove the descriptive strings from the bridge drivers.  If you
   want to know what a device is, use pciconf.  Add support for
   broadly identifying devices based on class/subclass, and for
   parsing a preloaded device identification database so that if
   you want to waste the memory, you can identify *anything* we know
   about.
 - Remove machine-dependant code from the core PCI code.  APIC interrupt
   mapping is performed by shadowing the intline register in machine-
   dependant code.
 - Bring interrupt routing support to the Alpha
   (although many platforms don't yet support routing or mapping
   interrupts entirely correctly).  This resulted in spamming
   <sys/bus.h> into more places than it really should have gone.
 - Put sys/dev on the kernel/modules include path.  This avoids
   having to change *all* the pci*.h includes.
2000-12-08 22:11:23 +00:00
Andrew Gallatin
313231657d Partially re-write T2 chipset support based on Tru64 platform support
files which Compaq open-sourced (with a BSD license).

This commit adds support for proper PCI interrupt mapping and much
better support for swizzling between "standard" isa IRQs and the stdio
irqs used by the t2.  This also adds enabling/disabling/eoi support
for AlphaServer 2100A machines.  The 2100A (or lynx) interrupt
hardware is is very different (and much nicer) than the 2100.
Previously, only AS2100 and AS2000 machines worked.

This commits also lays the groundwork for supporting ExtIO modules.
These modules are essentially a second hose.  This work is left
unfinished pending testing on real hardware.  Wilko tells me that
ExtIO modules are quite rare, and may not actually exist in the wild.

Obtained from: Tru64
Tested by: wilko
2000-12-07 01:06:19 +00:00
Marcel Moolenaar
e5f2ced1ee Minor cleanups:
o  remove unused prototypes,
o  remove unused extern declarations,
o  move prototypes up.
2000-12-05 09:06:41 +00:00
Marcel Moolenaar
ec79304f0f Make osendsig global. It's used by the Linuxulator. 2000-12-05 09:04:25 +00:00
Jake Burkholder
1eb44f0270 Remove the last of the MD netisr code. It is now all MI. Remove
spending, which was unused now that all software interrupts have
their own thread.  Make the legacy schednetisr use an atomic op
for setting bits in the netisr mask.

Reviewed by:	jhb
2000-12-05 00:36:00 +00:00
Matt Jacob
b741a1c581 Fix for vanilla PC164 systems to use a slightly different PALcode magic
tweak to enable/disable interrupt sources. Seems to work. It is unclear
how many of the PC164 models actually might needs this, and whether or
not there are other hidden issues.

Obtained from:Bernd Walter <ticso@cicely8.cicely.de>
2000-12-04 17:21:46 +00:00
Matt Jacob
bd1c746647 Comment out debug printfs about enable/disable ints.
Current now appears to work at least fitfully on one Rawhide.
2000-12-04 01:33:44 +00:00
David Malone
ea8b5a9ae9 More M_ZERO patches.
Submitted by:	josh@zipperup.org
Submitted by:	Robert Drehmel <robd@gmx.net>
Approved by:	mjacob
2000-12-03 20:46:54 +00:00
Marcel Moolenaar
b4c6727a3a Don't auto-generate the syscalls. 2000-12-03 01:30:31 +00:00
Marcel Moolenaar
a7e693e3a0 Don't auto-generate syscalls. 2000-12-03 01:28:51 +00:00
Andrew Gallatin
6e4708aa12 exec_osf1_imgact() should return -1 for non OSF1/ECOFF binaries, it should
not return ENOEXEC.  This is because image activators should return -1 if they
don't claim an image. They should return ENOEXEC if they do claim it,
but cannot load it due to sime problem with the image.   This bug was
preventing static compilation of the osf/1 module.  I'm surprised it
did not cause more problems.
2000-12-02 04:15:17 +00:00
Andrew Gallatin
6e01adb67f Alter isa interrupt behaviour on alpha. Rather than send a non-specific
EOI after the ithread runs, send the EOI when we get the interrupt and
disable the source.  After the ithread is run, the source is renabled.
Also, add isa_handle_fast_intr() which handles fast interrupts by sending
an EOI after the handler is run.

This fixes the chronic missing interrupt problems under heavy NFS load
on my UP1000 and should result in greater stability for alphas which
route all irqs through an isa pic.

Discussed with: jhb, bde (sending non-specific EOIs early was bde's idea)
2000-12-01 22:28:04 +00:00
Andrew Gallatin
4c0b7a9327 acquire/release Giant in vm_page_zero_idle(), like on i386
Discused with: jhb
2000-12-01 18:55:58 +00:00
Andrew Gallatin
689634a3ea Convert the pcib_{read,write}_config args from signed to unsigned,
like the args to the config space accessors these functions replaced.

This reduces the likelyhood of overflow when the args are used in
macros on the alpha.  This prevents memory management faults when
probing the pci bus on sables, multias and nonames.

Approved by: dfr
Tested by: Bernd Walter <ticso@cicely8.cicely.de>
2000-12-01 15:27:48 +00:00
Alfred Perlstein
82625cf321 remove unneded sys/ucred.h includes 2000-11-30 18:52:32 +00:00
Marcel Moolenaar
d034d459da Don't use p->p_sigstk.ss_flags to keep state of whether the
process is on the alternate stack or not. For compatibility
with sigstack(2) state is being updated if such is needed.

We now determine whether the process is on the alternate
stack by looking at its stack pointer. This allows a process
to siglongjmp from a signal handler on the alternate stack
to the place of the sigsetjmp on the normal stack. When
maintaining state, this would have invalidated the state
information and causing a subsequent signal to be delivered
on the normal stack instead of the alternate stack.

PR: 22286
2000-11-30 05:23:49 +00:00
Jonathan Lemon
9528be94e8 Add 'mpsafe' parameter to callout_init() in MD bits.
Reminded by:  jake
2000-11-26 13:52:17 +00:00
Marcel Moolenaar
466b14d758 Don't unregister the ioctl handlers before we verified we
can unload. Doing so leaves the linuxulator in a crippled
state (no ioctl support) when Linux binaries are run at
unload time.

While here, consistently spell ELF in capitals and perform
some minor style improvements.

ELF spelling submitted by: asmodai
2000-11-23 03:21:58 +00:00
Jake Burkholder
553629ebc9 Protect the following with a lockmgr lock:
allproc
	zombproc
	pidhashtbl
	proc.p_list
	proc.p_hash
	nextpid

Reviewed by:	jhb
Obtained from:	BSD/OS and netbsd
2000-11-22 07:42:04 +00:00
Doug Rabson
8707b6f032 Protect the bounce page list with a mutex instead of using splhigh(). 2000-11-22 07:16:51 +00:00
Mark Murray
5855006767 Add a consistent API to a feature that most modern CPUs have; a fast
counter register in-CPU.

This is to be used as a fast "timer", where linearity is more important
than time, and multiple lines in the linearity caused by multiple CPUs
in an SMP machine is not a problem.

This adds no code whatsoever to the FreeBSD kernel until it is actually
used, and then as a single-instruction inline routine (except for the
80386 and 80486 where it is some more inline code around nanotime(9).

Reviewed by:	bde, kris, jhb
2000-11-21 19:55:21 +00:00
Andrew Gallatin
c75fa7f70c fix isa DMA on pyxis based machines:
- move the call to cia_init_sgmap() to after we've determined if we're a pyxis
- convert needed splhigh() in cia_sgmap_invalidate_pyxis() to disable_intr()

Previously, any isa DMA on a pyxis based machine would cause a panic
in cia_sgmap_invalidate_pyxis() because the pyxis workaround was never
setup.

- while i'm at it, convert needed splhigh() in cia_swiz_set_hae_mem to
disable_intr()
2000-11-21 03:25:31 +00:00
Poul-Henning Kamp
d7450ce6d5 Make programs which still #include <machine/{mouse,console}.h> fail
at compiletime, with an explanatory error message.  Previously they
would only get a warning.

These files will be finally removed 2001-01-15
2000-11-20 22:00:25 +00:00
Doug Rabson
35cd89e7e5 Convert various calls to splhigh() to disable_intr() since splhigh() is
now a no-op.
2000-11-19 12:28:42 +00:00
Doug Rabson
bcc542cb4e We don't need <stddef.h> for offsetof() any more. 2000-11-19 12:26:14 +00:00
Jake Burkholder
fa2fbc3dac - Protect the callout wheel with a separate spin mutex, callout_lock.
- Use the mutex in hardclock to ensure no races between it and
  softclock.
- Make softclock be INTR_MPSAFE and provide a flag,
  CALLOUT_MPSAFE, which specifies that a callout handler does not
  need giant.  There is still no way to set this flag when
  regstering a callout.

Reviewed by:	-smp@, jlemon
2000-11-19 06:02:32 +00:00
Jake Burkholder
7da6f97772 - Split the run queue and sleep queue linkage, so that a process
may block on a mutex while on the sleep queue without corrupting
it.
- Move dropping of Giant to after the acquire of sched_lock.

Tested by:	John Hay <jhay@icomtek.csir.co.za>
		jhb
2000-11-17 18:09:18 +00:00
John Baldwin
20cdcc5b73 Don't release and acquire Giant in mi_switch(). Instead, release and
acquire Giant as needed in functions that call mi_switch().  The releases
need to be done outside of the sched_lock to avoid potential deadlocks
from trying to acquire Giant while interrupts are disabled.

Submitted by:	witness
2000-11-16 02:16:44 +00:00
Andrew Gallatin
930a65fe47 Use the linux_connect() on alpha rather than passing directly through
to our native connect().  This is required to deal with the differences
in the way linux handles connects on non-blocking sockets.

This gets the private beta of the Compaq Linux/alpha JDK working
on FreeBSD/alpha

Approved by: marcel
2000-11-16 01:05:53 +00:00
Andrew Gallatin
e652fd8417 make the fcntl() flags match what the linux/alpha port uses, not
what linux/i386 uses
2000-11-16 00:58:07 +00:00