Commit Graph

1152 Commits

Author SHA1 Message Date
Peter Wemm
acbecce3e1 Conditionalize the alpha interrupt preemption for now to buy us some
time to sort out the quirks.  Add 'options PREEMPTION' to test it on
the Alpha.

Reviewed by: jhb
2001-02-03 03:26:39 +00:00
Doug Rabson
294156a7ff * Move exception_return to exception.s which is a more logical home for it.
* Optimise the return path for syscalls so that they only restore a minimal
  set of registers instead of performing a full exception_return.

A new flag in the trapframe indicates that the frame only holds partial
state. When it is necessary to perform a full state restore (e.g. after an
execve or signal), the flag is cleared to force a full restore.
2001-02-02 10:20:30 +00:00
Peter Wemm
ed4f8196d0 Argh, I missed some #include "sio.h". I was looking primarily for NSIO
when I did my sweeps.

Submitted by: mjacob
2001-02-02 01:48:40 +00:00
Matt Jacob
6f7809f526 Remove inclusion of now vanished sio.h. 2001-02-01 21:59:00 +00:00
Matt Jacob
b91d22ca89 Guess that this is what Doug *intended* to commit.... 2001-02-01 21:58:34 +00:00
Jake Burkholder
05f6ee66ea Implement preemptive scheduling of hardware interrupt threads.
- If possible, context switch to the thread directly in sched_ithd(),
  rather than triggering a delayed ast reschedule.

- Disable interrupts while restoring fpu state in the trap handler,
  in order to ensure that we are not preempted in the middle, which
  could cause migration to another cpu.

Reviewed by:	peter
Tested by:	peter (alpha)
2001-02-01 03:34:20 +00:00
Doug Rabson
c586bc8e57 * Move exception_return to exception.s which is a more logical home for it.
* Optimise the return path for syscalls so that they only restore a minimal
  set of registers instead of performing a full exception_return.

A new flag in the trapframe indicates that the frame only holds partial
state. When it is necessary to perform a full state restore (e.g. after an
execve or signal), the flag is cleared to force a full restore.
2001-01-31 11:17:00 +00:00
Peter Wemm
8ab109d131 Remove count for NSIO. The only places it was used it were incorrect.
(alpha-gdbstub.c got sync'ed up a bit with the i386 version)
2001-01-31 10:54:45 +00:00
John Baldwin
7ad1d369bb Remove unnecessary locking to protect the p_upages_obj and p_addr
pointers.
2001-01-30 00:35:35 +00:00
Peter Wemm
03927d3c33 Send "#if NISA > 0" to the bit-bucket and replace it with an option.
These were compile-time "is the isa code present?" tests and not
'how many isa busses' tests.
2001-01-29 09:38:39 +00:00
Andrew Gallatin
28c039e747 The API UP1100 is close enough to a UP1000 that FreeBSD just works on it, so
document that fact.

Thanks to Peter Petrakis <ppetrakis@alphalinux.org> for doing a test boot.
2001-01-27 20:56:00 +00:00
John Baldwin
cf0be84ff5 Turn on DEVFS by default for the alpha. Aside from vinum as mentioned by
phk it should work fine.  If you need vinum, then don't add this to your
kernel config until vinum catches up to DEVFS.
2001-01-27 08:34:58 +00:00
John Baldwin
a0346459f1 Update some comments, s0 in the pcb of a child returning from fork1() is
now passed in as a0 to fork_exit() and and s2 is passed in as a1.
2001-01-26 23:32:38 +00:00
Andrew Gallatin
97e32dadb4 The osfulator needs sysvipc to work. Thanks to DES's commit to
the i386 linulator for pointing this out.

The alpha linulator doesn't need a dependancy, as it already
depends on the osfulator.
2001-01-26 17:12:30 +00:00
John Baldwin
7b1bec368f Back out over-aggressive locking of p->p_cred.
Requested by:	alfred
2001-01-25 01:09:44 +00:00
John Baldwin
29d3cf45a7 Remove prototype for child_return(). 2001-01-24 22:00:13 +00:00
John Baldwin
2a36ec35ae - Change fork_exit() to take a pointer to a trapframe as its 3rd argument
instead of a trapframe directly.  (Requested by bde.)
- Convert the alpha switch_trampoline to call fork_exit() and use the MI
  fork_return() instead of child_return().
- Axe child_return().
2001-01-24 21:59:25 +00:00
John Baldwin
77e9b2790e - Remove some unused and unneeded atomic operations sitting in mp_machdep.c
that are already implemented in atomic.h.
- Fix SMP kernel builds.
2001-01-24 19:49:13 +00:00
John Baldwin
c2e9063250 Oops, when converting if (foo) panic() to a KASSERT(), you have to invert
the test case.

Spotted by:	peter, jasone
2001-01-24 13:10:17 +00:00
Jason Evans
1b367556b5 Convert all simplelocks to mutexes and remove the simplelock implementations. 2001-01-24 12:35:55 +00:00
John Baldwin
60bb997eb3 Proc locking. 2001-01-24 10:27:11 +00:00
John Baldwin
ee7a93c9ab Use queue macros. 2001-01-24 10:26:51 +00:00
John Baldwin
fb8d5b0534 Add a prototype for isa_irq_mask() to quiet a warning. 2001-01-24 10:25:44 +00:00
John Baldwin
fc15ff1a64 Wrap the IPI definitions and function prototypes in #ifdef SMP. 2001-01-24 10:25:09 +00:00
John Baldwin
c6f6b7292b - Rename the gd_cpuno member of struct globaldata to gd_cpuid.
- Add a globaldata_register() prototype in the SMP case.
2001-01-24 10:24:49 +00:00
John Baldwin
e62be0bfe7 - Proc locking.
- P_OWEUPC -> PS_OWEUPC.
2001-01-24 10:23:54 +00:00
John Baldwin
a92ac5b9ae - Change userret() to take a struct trapframe * as its second argument and
to extract the PC from that to send to addupc_task() so that it can be
  called from MI code.
- Remove all traces of have_giant with extreme prejudice and use
  mtx_owned(&Giant) instead where appropriate.
- Proc locking.
- P_FOO -> PS_FOO.
- Don't grab Giant just to look in curproc's p_addr during a trap since we
  may choose to immediately exit.  Instead, delay grabbing Giant a bit
  until we actually need it.
- Don't reset 'p' to 'curproc' in syscall() to handle the case of a child
  returning from fork1() since children don't return via syscall().
- Remove an XXX comment in ast() that questions the correctness of the
  userland check.  The code is correct.
2001-01-24 10:23:21 +00:00
John Baldwin
1d64ccdcbb - Proc locking.
- P_INMEM -> PS_INMEM.
2001-01-24 10:16:23 +00:00
John Baldwin
0a8ec7a3bd - Proc locking.
- Don't send IPIs for pmap_invalidate_page() or pmap_invalidate_all()
  in the UP case.
- Catch up to cpuno -> cpuid.
- Convert some sanity checks that were #ifdef DIAGNOSTIC to KASSERT()'s.
2001-01-24 10:16:01 +00:00
John Baldwin
21f31719b6 - Adjust some whitespace to reduce diffs with the i386 version.
- Rename the per-CPU variable 'cpuno' to 'cpuid'.  This was done so that
  there is one consistent name across all architectures for a logical
  CPU id.
- Remove all traces of IRQ forwarding.
- Add globaldata_register() hook called by globaldata_init() to register
  globaldata structures in the cpuid_to_globaldata array.
- Catch up to P_FOO -> PS_FOO.
- Bring across some fixes for forwarded_statclock() from the i386 version
  to handle ithreads and idleproc properly.
- Rename addugd_intr_forwarded() to addupc_intr_forwarded() so that it is
  the same name on all architectures.
- Set flags in p_sflag instead of calling psignal() from
  forward_hardclock().
- Proc locking.
- When we handle an IPI, turn off its bit in the mask of IPI's we are
  currently handling so that an IPI doesn't send a CPU into an infinite
  loop.
2001-01-24 10:13:13 +00:00
John Baldwin
caf46c8d44 - Initialize curproc, proc0.p_heldmtx, and proc0.p_contested earlier so
that mutex operations work.
- Enter Giant earlier so we hold it during boot.
- Proc locking.
- Move globaldata_init() into here from mp_machdep.c so that UP kernels
  don't depend on mp_machdep.c.  Use a callout in the SMP case to register
  the boot processor's globaldata in the cpuid_to_globaldata array.
2001-01-24 10:07:42 +00:00
John Baldwin
8929eb2c88 - Wrap the IPI interrupt handler in #ifdef SMP.
- Catch up to cpuno -> cpuid change.
- Add parens around a subexpression to quiet a warning.
2001-01-24 10:05:24 +00:00
John Baldwin
35d14e0f54 cpuno -> cpuid. 2001-01-24 10:04:32 +00:00
John Baldwin
30a62a81e3 Don't import the nonexistent astpending variable. 2001-01-24 10:03:05 +00:00
John Baldwin
e4fb2bca29 Wrap the startup code used by secondary processors in #ifdef SMP. 2001-01-24 10:01:53 +00:00
Jason Evans
0cde2e34af Move most of sys/mutex.h into kern/kern_mutex.c, thereby making the mutex
inline functions non-inlined.  Hide parts of the mutex implementation that
should not be exposed.

Make sure that WITNESS code is not executed during boot until the mutexes
are fully initialized by SI_SUB_MUTEX (the original motivation for this
commit).

Submitted by:	peter
2001-01-21 22:34:43 +00:00
Dag-Erling Smørgrav
a3ea6d41b9 First step towards an MP-safe zone allocator:
- have zalloc() and zfree() always lock the vm_zone.
 - remove zalloci() and zfreei(), which are now redundant.

Reviewed by:	bmilekic, jasone
2001-01-21 22:23:11 +00:00
Jake Burkholder
a448b62ac9 Make intr_nesting_level per-process, rather than per-cpu. Setup
interrupt threads to run with it always >= 1, so that malloc can
detect M_WAITOK from "interrupt" context.  This is also necessary
in order to context switch from sched_ithd() directly.

Reviewed By:	peter
2001-01-21 19:25:07 +00:00
Jason Evans
d1c1b8413e Remove MUTEX_DECLARE() and MTX_COLD. Instead, postpone full mutex
initialization until after malloc() is safe to call, then iterate through
all mutexes and complete their initialization.

This change is necessary in order to avoid some circular bootstrapping
dependencies.
2001-01-21 07:52:20 +00:00
Peter Wemm
80d739b4ec This conf file seems to have rotted quite a bit.. 2001-01-19 13:03:41 +00:00
Peter Wemm
a496358e30 Remove the now-empty ipl_funcs.c file on all platforms. 2001-01-19 09:59:56 +00:00
Peter Wemm
198c5b0891 Remove the static splXXX functions and replace them by static __inline
stubs.  Remove the xxx_imask variables which have been all but gone for
a while.
2001-01-19 09:57:29 +00:00
Bosko Milekic
08812b3925 Implement MTX_RECURSE flag for mtx_init().
All calls to mtx_init() for mutexes that recurse must now include
the MTX_RECURSE bit in the flag argument variable. This change is in
preparation for an upcoming (further) mutex API cleanup.
The witness code will call panic() if a lock is found to recurse but
the MTX_RECURSE bit was not set during the lock's initialization.

The old MTX_RECURSE "state" bit (in mtx_lock) has been renamed to
MTX_RECURSED, which is more appropriate given its meaning.

The following locks have been made "recursive," thus far:
eventhandler, Giant, callout, sched_lock, possibly some others declared
in the architecture-specific code, all of the network card driver locks
in pci/, as well as some other locks in dev/ stuff that I've found to
be recursive.

Reviewed by: jhb
2001-01-19 01:59:14 +00:00
Poul-Henning Kamp
02e5c5513c These files have been on deathrow for a couple of months, no appeal. 2001-01-16 10:01:56 +00:00
Mark Murray
b79ad7e642 Remove NOBLOCKRANDOM as a compile-time option. Instead, provide
exactly the same functionality via a sysctl, making this feature
a run-time option.

The default is 1(ON), which means that /dev/random device will
NOT block at startup.

setting kern.random.sys.seeded to 0(OFF) will cause /dev/random
to block until the next reseed, at which stage the sysctl
will be changed back to 1(ON).

While I'm here, clean up the sysctls, and make them dynamic.
Reviewed by:		des
Tested on Alpha by:	obrien
2001-01-14 17:50:15 +00:00
Jake Burkholder
7586909279 Remove unused per-cpu variables inside_intr and ss_eflags. 2001-01-12 07:47:54 +00:00
Jake Burkholder
df729d6f00 - Remove compatibility macros for accessing per-cpu variables.
__FreeBSD_version 500015 can be used to detect their disappearance.
- Move the symbols for SMP_prvspace and lapic from globals.s to
  locore.s.
- Remove globals.s with extreme prejudice.
2001-01-11 14:46:26 +00:00
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