Commit Graph

68917 Commits

Author SHA1 Message Date
thorpej 68f89cabfe Use ANSI function decls. 2003-12-30 16:40:12 +00:00
thorpej 0ad3db4759 Move most of the atabus layer into ata.c. 2003-12-30 16:28:37 +00:00
pk 90c49c51c7 When powering down, first ask the PROM to do it for us. 2003-12-30 14:29:30 +00:00
pk 70f20a1217 Replace the traditional buffer memory management -- based on fixed per buffer
virtual memory reservation and a private pool of memory pages -- by a scheme
based on memory pools.

This allows better utilization of memory because buffers can now be allocated
with a granularity finer than the system's native page size (useful for
filesystems with e.g. 1k or 2k fragment sizes).  It also avoids fragmentation
of virtual to physical memory mappings (due to the former fixed virtual
address reservation) resulting in better utilization of MMU resources on some
platforms.  Finally, the scheme is more flexible by allowing run-time decisions
on the amount of memory to be used for buffers.

On the other hand, the effectiveness of the LRU queue for buffer recycling
may be somewhat reduced compared to the traditional method since, due to the
nature of the pool based memory allocation, the actual least recently used
buffer may release its memory to a pool different from the one needed by a
newly allocated buffer. However, this effect will kick in only if the
system is under memory pressure.
2003-12-30 12:33:13 +00:00
manu fe7a5ddf22 Fix PowerPC ports build with KGDB. 2003-12-30 11:23:20 +00:00
simonb c1d14e3852 Try to spell "NetBSD" correctly... 2003-12-30 07:08:08 +00:00
atatat fb4d990f63 Fix example lkms. The misc/example one was never converted to the new
lkm stuff, and syscall/example was never told that we use lwp now, and
not proc.
2003-12-30 06:53:26 +00:00
yamt 8a7df6a14b (MULTIPROCESSOR version of) need_resched:
- nothing needs to be done if ci_want_resched is already set.
- if the cpu isn't running any lwp, send a no-op ipi to it
  so that it can resume immediately from halting in idle loop
  without having to wait until the next clock tick.
some advices from Stephan Uphoff.
2003-12-30 03:57:19 +00:00
yamt 26db734594 fixes and optimizations from Stephan Uphoff.
- pmap_enter: zap PTE and read attributes atomically to
  eliminate a race window which could cause lost of attributes.
- reduce number of TLB shootdown by using some assumptions
  about PTE handling.

for more details, see "SMP improvements for pmap" thread on port-i386@
around May 2003.
2003-12-30 03:55:01 +00:00
shin 755c62af21 initialize sc_epoch and RTC properly when reboot/resume.
Addresses PR/20091.
2003-12-30 03:54:35 +00:00
yamt 4cd02fe3d9 g/c unused x86_ipisend. 2003-12-30 03:52:01 +00:00
dbj dbba662bc8 fix bugs in ffs_cg_swap for FS_42POSTBLFMT 2003-12-30 03:30:43 +00:00
thorpej 962cc4da4a Tweak function names in debug messages. 2003-12-30 00:43:31 +00:00
manu d1845c906c - Rework the Mach semaphore code to handle threads instead of processes
- Add 2 system calls: semaphore_signal_thread and sempaphore_signal_all (the
latter being untested)
- semaphore_signal_thread arguments list was wrong
2003-12-30 00:15:46 +00:00
manu 1a96ea0da6 In DPRINTF? replace uprintf, so that we get debug output for daemons too. 2003-12-30 00:14:20 +00:00
martin 44b17951f2 Avoid using m_clget() on a mbuf already in use, especially when we
need the data in the mbuf later and m_clget() changes some fields
overlaid to regular mbuf data. Instead, rearange code a bit, create
data into a new allocated buffer and and use MEXTADD to attach it to
the mbuf, if the mbuf internal space is not sufficient.

This fixes a crash on sparc64 (and probably all other archs where
sizeof(int) != sizeof(struct file *)) when running
regress/sys/kern/unfdpass.

Idea for solution from Matt Thomas, with additional input from YAMAMOTO
Takashi.
2003-12-29 22:08:02 +00:00
oster 5c71699f0b Clean up comments, and generally make more readable. No functional changes. 2003-12-29 17:13:36 +00:00
oster f7e3fe7a56 Clean up code/comments. No functional changes. Just a lot easier to read now. 2003-12-29 16:57:35 +00:00
bjh21 8907f89465 speaker_ctl() is optional, and vidcaudio_speaker_ctl() did nothing, so kill it. 2003-12-29 16:49:31 +00:00
bjh21 0a64302931 Control debugging with VIDCAUDIO_DEBUG rather that DEBUG, to avoid confusion
with the global kernel macro called DEBUG.
2003-12-29 16:45:58 +00:00
bjh21 1b64799344 Minor KNF. 2003-12-29 16:41:22 +00:00
bjh21 32cf38df51 Fix a DEBUG printf. 2003-12-29 16:36:48 +00:00
bjh21 87bcc196e1 Use NULL rather than 0 to initialise unused function pointers. 2003-12-29 16:25:30 +00:00
pk 20ad8911d9 hpfinish: pass correct buffer to diskerr(); 2003-12-29 16:23:58 +00:00
bjh21 8dcadd2b7c KNF. 2003-12-29 16:20:46 +00:00
bjh21 b64c13c96f ANSIfy, un-__P(). 2003-12-29 16:11:38 +00:00
yamt 192843ffc2 pool_prime_page: initialize ph_time to mono_time instead of zero
as it's a mono_time relative value.
2003-12-29 16:04:58 +00:00
igy 758273ce95 throw error status when erase command timed out 2003-12-29 12:59:54 +00:00
igy 34a32ca09b using compile option "-G 0" (default) 2003-12-29 12:51:48 +00:00
igy bd3a594116 make sure variables initialized 2003-12-29 12:31:48 +00:00
igy 1a4bd745a6 remove unused functions to make compile 2003-12-29 12:28:14 +00:00
toshii 05069ebd4d Use the correct wValue to get hub desriptors.
Also, make wValue checks of root hub codes less strict.
2003-12-29 08:17:10 +00:00
oster 86c2a9ed65 The ugly wonderment of appropriately placed ASCII characters
formerly known as rf_threadstuff.c is no more.
2003-12-29 06:37:47 +00:00
sekiya bc5774497e Fixes to HPC abstraction layer from Steve Rumble:
- hpc1_hdd_{ctl,bufptr} and hpc3_hdd_{ctl,bufptr} are
          established in hpcreg.h. All references to these fields
          are updated with the exception of if_sq: (haltwo,
          hpcdma). This makes reading the code and spotting bugs
          easier.
        - hpcdma.c was applying EOCHAIN to the wrong descriptor
          word for the hpc1 case.
        - I added scsi_max_xfer to the abstraction layer, and it
          allows some crusty #defines in wdsc.c to be removed.
          hpc1 now doesn't waste descriptors as it once did.
        - hpcreg.h was updated to reflect the lack of XMITDONE
          bit in hpc1. HPC1_REV15 added for a test in hpc.c
        - hpc.c now verifies HPC1 revisions (1.0 vs 1.5) and
          prints the output a little prettier ;)
        - power interrupts shouldn't establish on non-IP22
          platforms.
2003-12-29 06:33:57 +00:00
oster ee0afdc3dc rf_lkmgr_mutex_init() is only called from one spot, and it really
can't fail.  Simplify life in rf_BootRaidframe(), and then nuke
rf_lkmgr_mutex_init().  Cleanup rf_threadstuff.h a bit more too.
rf_threadstuff.c is about to Go Away.
2003-12-29 06:30:42 +00:00
sekiya 8a08952e14 Fix typo ("ARCBIOS_MEM_ExecptionBlock"). From Steve Rumble. 2003-12-29 06:26:41 +00:00
oster e276d553e6 Garbage-collect a whole mess of this RF_THREADGROUP_* stuff that isn't
being used.  Then, nuke rf_init_managed_threadgroup() and all
descendants and relations.
2003-12-29 06:19:28 +00:00
oster 8b09b35f45 Let's see... raidPtr->recon_done_procs is never set to anything
(other than NULL when raidPtr is initialized).  That means
SignalReconDone() never does anything useful.  Bye-bye!

Say good-bye to recon_done_procs and recon_done_procs_mutex (and its
initializer) as well.
2003-12-29 05:58:34 +00:00
oster 6a080d56e0 IO_BUF_ERR really doesn't need to be a macro. Replace the macro. 2003-12-29 05:52:58 +00:00
oster fc5966383f _rf_create_managed_cond() is now left doing nothing. Convert callers.
Mash DO_RAID_COND in rf_driver.c out of existance.

- Nuke (already #if 0'ed) _rf_create_managed_lkmgr_mutex() while we're
busy here.

simplify DO_INIT in rf_engine.c
2003-12-29 05:48:13 +00:00
oster 2f4066f82e cond_destroyer joins mutex_destroyer in the "nothing useful is done
here" department.

remove _rf_init_threadgroup() and rf_destroy_threadgroup() which were
already #if 0'ed.

rf_cond_destroy() does nothing.  Nuke it, and all callers.

rf_cond_init() doesn't deserve to be a separate function any more.
Fix up the remaining 3 callers, and nuke rf_cond_init().

Another 0.4K goes "poof", but still no functionality lost!
2003-12-29 05:36:19 +00:00
oster c629932636 _rf_create_managed_mutex() is doing just a simple:
rf_mutex_init(m)

now.  The rest of the fluff is no longer needed.
It also cannot fail, so error checking on rf_create_managed_mutex()
is just wasting space.

Nuke the #define's associated with rf_create_managed_mutex().
Convert rf_create_managed_mutex(listp,m) to just rf_mutex_init(m).
Remove wasteful "error checking" and simplify all instances where this
is called.  (another 0.3K saved in the binary, but the real savings
is in code readability!)
2003-12-29 05:22:16 +00:00
oster f7db986b43 mutex_destroyer() has been reduced to nothing. Turf it.
That means there is no point in having any of the shutdown stuff call
mutex_destroyer() on any of the mutexes.  Nuke related code.
2003-12-29 05:09:08 +00:00
oster 9a5cad32eb Since rf_mutex_destroy() is effectively a NOP now, nuke it. 2003-12-29 05:01:14 +00:00
oster b2b6428115 Simplify defn's of rf_mutex_init() and rf_mutex_destroy(). Since
neither of these ever fail, no need to have a return value.  That
makes all the "error detection" on these functions completely
unneeded.  But since we're here, if we don't have a return value, then
why not make these macros?  My.. look how things keep shrinking, with
no loss in functionality!
2003-12-29 04:56:26 +00:00
oster 99a9acd89d Reduce uses of rf_mutex_init() and rf_cond_init(). Streamlines code,
removes useless error detection, and generally makes things easier to follow.
2003-12-29 04:39:29 +00:00
oster c439c8a2c0 Tidy up a comment. 2003-12-29 04:34:36 +00:00
oster 46dd44132d init_mcpair() and clean_mcpair() are much like init_rad() and
clean_rad() were -- these days they only serve to clutter things up.
Remove the functions, and put the 2 lines of actual useful initialization
into rf_AllocMCPair().
2003-12-29 04:33:31 +00:00
atatat 1cab3635c2 Avoid dereferencing l in sysctl_lookup(), because it can be NULL.
Note one point where a possibility of a fault exists.
2003-12-29 04:19:28 +00:00
atatat 74dad84b6e Remove two uses of uvm_kernacc(), which wasn't quite getting the job
done anyway.  On a related change, use kcopy() instead of memcpy() for
kernel-to-kernel copying so that the same service warranty can be
given.
2003-12-29 04:16:25 +00:00