Commit Graph

68979 Commits

Author SHA1 Message Date
thorpej 4605c26b7a De-__P 2003-12-30 20:43:46 +00:00
thorpej 7e958083b1 Consistently use ANSI-style function decls. 2003-12-30 20:40:39 +00:00
thorpej abf619ebfb Simplify setting up the channel queue a little. 2003-12-30 20:20:21 +00:00
thorpej 683cebe2c8 No longer need to include <dev/ic/wdcreg.h> 2003-12-30 19:30:39 +00:00
thorpej 3787a92812 Move the register definitions for ATA Task File registers to atareg.h;
they are also used by controllers that do not map the registers into the
system address space, and are thus distinct from the "controller" registers.
2003-12-30 19:30:13 +00:00
oster 01635d963b Make function declarations consistent a) with each other and b) with
KNF.   Clean up comments.
2003-12-30 19:28:26 +00:00
thorpej 3695c4271b SMART info is logically part of the register set; move it from atavar.h
to atareg.h
2003-12-30 19:12:24 +00:00
thorpej 6a833751e0 Remove allocsys(); nothing uses it anymore. 2003-12-30 18:29:43 +00:00
augustss 044205cf85 Alphabetize IDE controllers 2003-12-30 18:09:50 +00:00
oster 34ad01b703 Fix slight bogon from row removal. 'r' would have been 0 here, not 1,
which means r*raidPtr->numCol would have always been 0, not raidPtr->numCol.
2003-12-30 17:46:59 +00:00
oster ed1155b792 access_tracebuf is declared, allocated, and freed. No freeloading
datastructures allowed!  Punt.

accessTraceBufCount, rf_accessTraceBufSize, and
rf_stopCollectingTraces are similarly declared, initialized, and then
never changed.  Punt.

rf_ShutdownAccessTrace() now does nothing.  Remove it, and the
callback setup stuff from rf_ConfigureAccessTrace().
2003-12-30 17:29:41 +00:00
thorpej ed96a1cec2 Move the drive probing code out of atabusconfig() and into a new
wdc_drvprobe() function.  wdc_drvprobe() is used if the controller
does not specify a custom one prior to calling wdcattach().  The
WDC_CAPABILITY_DRVPROBE bit is gone.
2003-12-30 17:18:11 +00:00
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
oster c0a4bb0ea1 init_rad() and clean_rad() really do..... very little.. and only serve
to make things look far more complicated than they really are.  It was
also impossible for any of the mutex/cond initializations in
init_rad() to actually fail, making the "error detection code"
unneeded.  Collapse the little work done by init_rad into
rf_AllocRaidAccDesc(), and nuke init_rad() and clean_rad().  Save
another 0.25K in GENERIC.

[To be accurate/complete, init_rad() and clean_rad() *ARE* used in the
simulator version of RAIDframe.  But we're so far removed from that
now that there is no point pretending otherwise.]
2003-12-29 04:00:17 +00:00
oster f3e27c676e General format/comment cleanups. No functional changes. 2003-12-29 03:43:07 +00:00
oster 91c64aa051 Remove rf_freelist.h. Its contents are no longer needed. 2003-12-29 03:37:14 +00:00
oster ee19b085aa - first kick at a major reworking of RAIDframe's memory allocation code:
- all freelists converted to pools
  - initialization of structure members in certain cases where
	code was relying on specific allocation and usage properties
	to keep structures in a "known state" (that doesn't work with
	pools!).
  - make most pool_get() be "PR_WAITOK" until they can be analyzed
	further, and/or have proper error handling added.
  - all RF_Mallocs zero the space returned, so there is no difference
	between RF_Calloc and RF_Malloc.  In fact, all the RF_Calloc()'s
	do is tend to do is get things horribly confused.
	Make RF_Malloc() the "general memory allocator", with
	RF_MallocAndAdd() the "general memory allocator with
	allocation list".
  - some of these RF_Malloc's et al. are destined to disappear.
  - remove rf_rdp_freelist entirely (it's not used anywhere!)
  - remove: #include "rf_freelist.h"
  - to the files that were relying on the above, add: #include "rf_general.h"
  - add: #include "rf_debugMem.h" to rf_shutdown.h to make it happy
	about the loss of: #include "rf_freelist.h".

This shrinks an i386 GENERIC kernel by approx 5K.  RAIDframe now
weighs in at about 162K on i386.
2003-12-29 03:33:47 +00:00
oster 10f077a0fb [Having received a definite lack of strenuous objection, a small amount
of strenuous agreement, and some general agreement, this commit is
going ahead because it's now starting to block some other changes I
wish to make.]

Remove most of the support for the concept of "rows" from RAIDframe.
While the "row" interface has been exported to the world, RAIDframe
internals have really only supported a single row, even though they
have feigned support of multiple rows.

Nothing changes in configuration land -- config files still need to
specify a single row, etc.  All auto-config structures remain fully
forward/backwards compatible.

The only visible difference to the average user should be a
reduction in the size of a GENERIC kernel (i386) by 4.5K.  For those
of us trolling through RAIDframe kernel code, a lot of the driver
configuration code has become a LOT easier to read.
2003-12-29 02:38:17 +00:00
manu 5c83b03a81 Added DARWIN_IOFBSETGAMMATABLE
In DARWIN_IOFBSETCLUTWITHENTRIES, split big tables into 128 items chunks
so that they fit in the stackgap (currently 512 bytes)
2003-12-29 01:34:02 +00:00
manu 7ab97b2c76 Added Mach services (no real implementation, just empty shells to make
userland happy)
processor_set_default, host_processor_set_priv, and thread_set_policy
2003-12-29 01:30:27 +00:00
manu 31b3c2a056 Added the semaphore_wait_signal_trap Mach system call (untested) 2003-12-28 23:00:36 +00:00
atatat b1c111a62a Sysctl functions called for "generic" nodes should forward "query"
requests (where possible), rather than returning errors.
2003-12-28 22:36:37 +00:00
atatat 0f7550bbf8 Adjust error returns in kern.cp_time when a specific processor is
being requested so that (1) the uniprocessor case and the
multiprocessor case are more similar and (2) so that we return ENOENT
when a non-existent processor is requested (which is both more
sensible and follows the general order of things anyway).
2003-12-28 22:24:12 +00:00
atatat c703d9821f Rename sysctl_kern_hostname() to sysctl_setlen() and use it also for
domainname.  Note that there's no need to copy rnode since we're not
changing any of it, nor protecting anything from change.

Thanks to martin for initial work.
2003-12-28 22:19:59 +00:00
atatat 8e0c1f1594 RCSid police 2003-12-28 22:12:00 +00:00
augustss f3abb712c4 Regen. 2003-12-28 17:12:00 +00:00
augustss 7ddfb31781 Add a couple of devices. 2003-12-28 17:11:14 +00:00
martin c22fd25c47 After changing hostname, adjust hostnamelen.
This closes PR kern/23907.
2003-12-28 14:39:36 +00:00
manu 2c772b20d9 When the catcher of an exception dies before releasing the thread that
raised the exception, don't release the lock, this causes a crash (the lock
shall be released by the process that took it). Wakeup the thread instead,
it will release the lock itself.
2003-12-28 13:28:39 +00:00
kent a92ed9fb69 ICH4/ICH5:
When native i/o mapping fails, try compatible i/o mapping.
2003-12-28 12:31:30 +00:00
itohy 148136c88f Add support for RATOC REX-9530.
Not fully tested, though.
2003-12-28 06:50:42 +00:00
itohy a4a5409e3a Regen from pcmciadevs rev 1.191. 2003-12-28 06:47:23 +00:00
itohy 10e7771b7d - RATOC System Inc. uses the same product ID for many different cards,
so do not define product ID for REX-R280.  Use CIS instead.
- Add definition for REX-9530 and REX-CFU1.
- White space police.
2003-12-28 06:46:23 +00:00
christos 1b57662119 make the printf statements on chip_io_map complete lines. 2003-12-28 01:21:37 +00:00
christos a438c6286d make the printf statement a complete line. 2003-12-28 01:20:23 +00:00
dbj cd998638bc use symbolic V_SAVE instead of value 1 when invoking vinvalbuf 2003-12-28 00:36:33 +00:00
christos de8661ee74 Don't print an empty "wi0:\n" line. Join a couple of lines. 2003-12-27 23:57:24 +00:00
manu 48d72491a9 The VRAM offset seems to be the offset of the framebuffer within the VRAM.
Until we really map the whole VRAM, this is 0.
Two missing files in the last commit
2003-12-27 22:06:19 +00:00
mjl df0cb86d0d Add some casts to printf() args to make it compile w/ DEBUG set. 2003-12-27 13:35:52 +00:00
mjl 054d8c4946 Initialize some auto vars to appaise gcc3. 2003-12-27 13:34:36 +00:00
shin cb18d8058e fix indentation. 2003-12-27 07:36:06 +00:00
shin 17435165fa Add MobilePro 880 (MC/R730A), MC/R730 support for USB/"pci".
Addresses PR/23654.
2003-12-27 07:34:21 +00:00
shin 26ccb9c6d2 Add MC/R700A, MC/R730, and MC/R730A vrc4172pwm flags.
Addresses PR/23653.
2003-12-27 07:29:56 +00:00
shin 1316c9944d Add MobilePro 880 (MC/R730A) to stylus calibration table.
Addresses PR/23652.
2003-12-27 07:28:21 +00:00
shin 88d334ff8f Add MobilePro 880 (MC/R730A) to hpcbatterytable.h.
Addresses PR/23651.
2003-12-27 07:27:22 +00:00
takemura a09206fd99 Initialized variables and added error handling in mq200_pllparam(). 2003-12-27 05:47:54 +00:00
grant 9427a0c717 add support for the Keywest I2C and snapper audio device, as found on
some iBook and PowerBook models.

this driver was written by Tsubai Masanari and further hacked on by
Jared D. McNeill to work on his iBook.

the driver is limited (master volume control only, and I haven't
tested recording) but has been functioning perfectly on my PowerBook
g4 DVI (ivory) for some time.

ok'd by matt.
2003-12-27 02:19:34 +00:00
martin be59b63fe2 Make kern.rtc_offset writable at securelevel <= 0.
This allows boot-time adjustment when a machine runs other OSes with
RTC == localtime.
2003-12-26 23:49:39 +00:00
martin d59fb7b8a3 Add a new ioctl SPPPGETSTATUSNCP to query the PPP phase and check wether
any NCP is UP.
2003-12-26 23:39:23 +00:00
manu afc357e66b Correctly return the VRAM offset in IOFBGETVRAMMAPOFFSET connect method.
With this, WindowServer blanks hals of my screen before crashing the kernel.
That's sweet.
2003-12-26 20:34:34 +00:00
aymeric 341f54debe revert previous. -fwritable-strings is not needed now that the ld script
does TRT.
2003-12-26 20:01:15 +00:00