Commit Graph

78317 Commits

Author SHA1 Message Date
yamt 8ab7495c2d make scheduler work better when a system has many runnable processes
by making p_estcpu fixpt_t.  PR/31542.

1. schedcpu() decreases p_estcpu of all processes
   every seconds, by at least 1 regardless of load average.
2. schedclock() increases p_estcpu of curproc by 1,
   at about 16 hz.

in the consequence, if a system has >16 processes
with runnable lwps, their p_estcpu are not likely increased.

by making p_estcpu fixpt_t, we can decay it more slowly
when loadavg is high.  (ie. solve #1.)

i left kinfo_proc2::p_estcpu (ie. ps -O cpu) scaled because i have
no idea about its absolute value's usage other than debugging,
for which raw values are more valuable.
2005-11-01 09:07:53 +00:00
manu b7ba0ebc16 Fix pipe linux emulation on amd64 2005-10-31 18:00:30 +00:00
manu 5d2a593dcd build fix 2005-10-31 17:58:07 +00:00
yamt 8217506e75 fix ioctl problems after the recent physio changes
in some drivers including wd and scsi.

- physio: if a caller provided a buf, stick to use it
  because some drivers use it as an identifier.
- sprinkle simple_locks.
- scsistrategy: rather than issueing an async request and
  waiting for its completion, simply issue a sync request.
  the way to wait for the completion had an assumption that
  B_CALL is never used.  it isn't the case after the recent
  physio() changes.

pointed/analyzed/tested by Martin Husemann.
2005-10-31 14:36:41 +00:00
thorpej f243f4debb Fix paste-o in the NFSV3SATTRTIME_TOSERVER case of mtime handing (need
to set va_mtime, not va_atime).
2005-10-31 14:21:35 +00:00
christos fae23817af back out the lwp portion of the previous commit which is not ready yet to
be committed.
2005-10-31 04:39:41 +00:00
christos cd2a437026 Don't clear unconditionally P_SUGID when we exec. Clear it only when the
real and effective user and group ids match. From Tavis Ormandy.
2005-10-31 04:31:58 +00:00
simonb ad6779af8d Don't install <sys/systm.h>. 2005-10-30 23:35:17 +00:00
simonb ad33b0d825 We don't need <sys/systm.h> here. 2005-10-30 23:34:34 +00:00
simonb 1d1300cd80 Only include <sys/systm.h> if _KERNEL is defined. 2005-10-30 23:34:04 +00:00
yamt a9894b0f08 - localize some definitions.
- use PPQ macro where appropriate.
2005-10-30 20:28:56 +00:00
chs d17f6e14bc add support for the linux PROT_GROWS{DOWN,UP} mprotect() flags.
fixes PR 30008.
2005-10-30 16:25:50 +00:00
chs df1287ee8b fix crash dumps on m68k platforms, cpu_kcore_hdr_t is larger than
512 bytes now so we need a bigger buffer.  PR 26958.
2005-10-30 15:49:39 +00:00
yamt 94ce3d822f don't include uvm_*_i.h unless needed,
to reduce bogus header dependencies.
2005-10-30 11:56:51 +00:00
yamt eae67f894f physio: comment out IPL_BIO because it's not available for some ports.
(it isn't used in the current implementation anyway.)
2005-10-30 09:17:02 +00:00
tsutsui 5797e5013d DELAY() is done (though the implementation is MIPS3 dependent). 2005-10-30 07:55:46 +00:00
tsutsui bdf356473e Use new delay(9) for DELAY(9). 2005-10-30 07:53:16 +00:00
sekiya bfa9ff2e95 sparc needs mostly the same compilation flags for standalone build as does
sparc64.  Move them out of the sparc64 conditional.

Okayed by martin@
2005-10-30 07:50:31 +00:00
tsutsui bc7a643d4f Use mips3_cp0_count_read() for precise microtime(9).
XXX microtime(9) function should be moved from machdep.c to timer.c?
2005-10-30 05:27:14 +00:00
tsutsui 2f451ddebd Use #define<space> for consistency. 2005-10-30 04:40:43 +00:00
tsutsui 48c586e2b6 According to the new mips3_cp0_count_read() based delay(9),
NEC-JC94 seems to have 200MHz clock, not 150MHz.
2005-10-30 04:35:49 +00:00
tsutsui 49b8c2626d - use mips3_cp0_count_read() for delay(9).
- delay(9) should take unsigned int, not int.
2005-10-30 04:34:03 +00:00
tsutsui c0caafab2b Set up ci_cpu_freq, ci_cycles_per_hz and ci_divisor_delay in curcpu()
from platform->clock.
2005-10-30 04:31:22 +00:00
jdc 14eb3fca0f Don't drop to ddb in the default case if ddb.onpanic is 0.
OK'd by martin@.
2005-10-29 21:18:28 +00:00
jmcneill 4b8daa06de Wow, this is clearly wrong (found in esa_set_params):
if (p->channels < 1 && p->channels > 2)
		return EINVAL;
Change the 'and' to an 'or' so the check actually does something.
2005-10-29 17:44:34 +00:00
rpaulo 2b6672222b regen 2005-10-29 17:18:40 +00:00
rpaulo b2880bdd35 Add Creative Labs's Notebook Optical Mouse. 2005-10-29 17:18:08 +00:00
christos 44545da4e2 Fix more debug const fallout from Hauke Fath. 2005-10-29 16:34:19 +00:00
yamt 9a01903be3 correct SADB_X_MIGRATE. pointed by Francis Dupont. 2005-10-29 15:05:13 +00:00
yamt fd96f3e9ea pull splraiseipl() from newlock branch. 2005-10-29 14:38:51 +00:00
yamt 0c66e9687c fix kmem grovellers. 2005-10-29 14:16:45 +00:00
yamt b9269a5f4f don't reset interface on rx overrun because it makes
the situation worse, if the overrun is merely a symptom of heavy load.
increament if_ierrors instead.  PR/29831.
2005-10-29 13:24:41 +00:00
yamt dd80ddaf14 just use ltsleep rather than lockmgr + PCATCH with horrible timeout dance. 2005-10-29 12:31:07 +00:00
yamt c14bdacc17 MALLOC/FREE -> malloc/free where appropriate. 2005-10-29 12:26:37 +00:00
scw 9877d180a5 Re-arrange a bitfield according to host byte-order. 2005-10-29 12:03:44 +00:00
yamt 59246ac4e1 fix compilation problem in the previous when !defined(DIAGNOSTIC).
pointed by xtraeme@.
2005-10-29 11:49:01 +00:00
yamt 428a59477a physio: make requests with large buffers faster,
by queueing more i/o simultaneously.
2005-10-29 11:23:19 +00:00
yamt 8d3549ebb0 add something like pthread_once(). 2005-10-29 11:13:21 +00:00
yamt 54f971f435 add a simple "do it in thread context" framework. 2005-10-29 11:10:37 +00:00
yamt 0416d5be24 add splraiseipl(). 2005-10-29 11:07:45 +00:00
scw aee1af1ef4 Expunge an extraneous bus_dmamap_sync() call in iwi_frame_intr(). The entire
frame has already been sync'd by iwi_rx_intr().
2005-10-29 11:00:17 +00:00
scw b6845ed55f - Use the DMA map size when calling bus_dmamap_sync(), instead of
blindly assuming MCLBYTES will DTRT.
- Use bus_dmamap_load_mbuf() instead of bus_dmamap_load() where
  appropriate.
- If we have to coalesce a Tx mbuf chain comprised of more than IWI_MAX_NSEG
  segments, allocate a cluster iff the payload won't fit in the header.
2005-10-29 10:48:02 +00:00
skrll 22049753c1 Don't byte swap unnecessarily in iwi_read_prom_word. Fix the user instead. 2005-10-29 08:44:28 +00:00
scw 842139fe29 Support big-endian hosts:
- Always byte-swap data read from EEPROM.
- Byte-swap firmware image when host is big-endian.

In iwi_tx_start():
- Fix descriptor initialisation bogon (only problematic on big-endian hosts).
- Fix bus_dmamap_sync() 'len' parameter..
2005-10-29 08:10:38 +00:00
christos 57e242fa1e PR/31942: Hauke Fath: -current DEBUG kernel build fails because of gcc whining 2005-10-28 21:54:52 +00:00
christos daf2726a5c - delete ugly debugging crap.
- remove bogus multicast handling [pointed out by thorpej]
  and don't reset the chip on ENETRESET; ENETRESET is a sign
  that only the multicast filter needs changing.
2005-10-28 20:56:13 +00:00
christos e30fd207ff use ap->a_flags instead of fl->f_type; pointed out by: Devon H. O'Dell 2005-10-28 15:37:23 +00:00
christos 17f31a8395 forgot to commit this. 2005-10-28 14:36:15 +00:00
christos ffd31cc9b5 According to thorpej, we don't need to stop when we attach. But then again
we don't detach yet...
2005-10-28 13:20:55 +00:00
yamt 54007a40c0 remove duplicated spllpt(). 2005-10-28 10:34:18 +00:00
christos dd3b850e80 From FreeBSD:
- make a few functions static
- introduce gem_bitwait() to factor out some of the register wait code.
- add gem_stop() in attach
- some DEBUG should be GEM_DEBUG
- handle underrun, packet too long, and overflow errors by resetting the chip
- add handler in ioctl for add/del multi
- fix typo
Also:
- add a shadow sc_if_flags member so that we don't reset the chip if we
  don't need to.
2005-10-28 00:01:53 +00:00
martin eb8540417a Follow the lead of the sparc port:
- move md_flags back to mdproc, because we only have per-proc flags
   currently
 - implement cpu_proc_fork() to init p_md.md_flags on fork
2005-10-27 20:43:30 +00:00
uwe a0b356b644 Document pmc_get_counter_type and pmc_process_exit. 2005-10-27 01:25:09 +00:00
uwe bf5bead380 We need to init p_md.md_flags on fork, so implement cpu_proc_fork(). 2005-10-27 00:36:16 +00:00
uwe 3fe7beb89b DIAGNOSTIC code should not whine about software traps 0x90..0x9f that will
never be specified and thus are free for ABI conforming programs to use.
2005-10-27 00:04:55 +00:00
uwe 05fa81f9b0 Report T_RANGECHECK as ILL_ILLOPN. 2005-10-26 23:41:56 +00:00
uwe ab5d782da8 Move md_flags back to mdproc. MDP_FIXALIGN, the only flag we have, is
per-process, not per-lwp.  We don't have per-lwp flags currently.
2005-10-26 23:21:47 +00:00
uwe 060dedbbf7 Comment change: Clarify meaning of some user traps. 2005-10-26 22:37:18 +00:00
uwe 29511150ab Add missing extern to make the definition of softnet_cookie into a declaration. 2005-10-26 21:11:05 +00:00
uwe 7781633361 Cosmetic. Kill __P. Remove few remaining paramter names in
prototypes.  CONSTCOND in while (0).  Move wcopy/wzero declarations
with the rest of machdep.c.  Add some blank lines for readability.
2005-10-26 20:52:33 +00:00
rpaulo 89c0260a2e s/SYNAPTICS_DEBUG/SYNAPTICSDEBUG/ to keep consistency. 2005-10-26 17:20:19 +00:00
chs 0a185981ab in sa_switch(), if after we set up the LWP with cpu_setfunc(), we decide that
we can't do an SA context switch after all, we need to clear the sau from
the LWP's arg.  sa_switch() frees the sau in this case, but if we don't
reset the LWP's state and the process exits, then the exiting LWP will
try to free the sau again.

also, change the sadebug printf stuff to use printf_nolog(), since
otherwise we deadlock because we're already holding sched_lock and
the normal printf() will try to wakeup the log reader.
2005-10-26 06:24:04 +00:00
uwe 5c38a3d254 sigcode is needed only for COMPAT_16. 2005-10-26 01:30:20 +00:00
uwe 0e0096c441 Compute c_totalsize for split caches correctly: it's max, not sum (and
we even have that documented in cache.h).  Initialize c_nlines for
split caches.

This should fix srmmu cache flush routines for split I/D caches that
has been broken since cache.c revision 1.79 started using c_nlines.
2005-10-25 22:12:07 +00:00
uwe c2ec5cfaef Sync c_linesize and c_nlines comments with reality. 2005-10-25 22:03:43 +00:00
martin 3e4f7c877a Add missing <sys/device.h> include.
XXX - this is handled inconsistently accross the ath* files, maybe we
should move it to ath_netbsd.h and be done?
2005-10-25 19:59:02 +00:00
drochner afcc05d0fe finally nuke the useless cardbus "dev" locator 2005-10-25 16:37:50 +00:00
yamt 78e012015b add some #if 0'ed out SADB_X_* definitions found in kame tree
to avoid conflicting numbers.
2005-10-25 06:12:49 +00:00
jdolecek bb7b3655f0 constify 2005-10-24 16:31:54 +00:00
cube 75d561e358 Move prototypes for siginfo32 to/from siginfo converters at the right
place.
2005-10-24 15:28:09 +00:00
hannken 366a53ff0c Run all i/o from or to backing store through fss_bs_io().
Replace VOP_BMAP()/VOP_BALLOC() by vn_rdwr()/VOP_PUTPAGES().

Inspired by discussion on tech-kern@
2005-10-24 14:25:06 +00:00
simonb 0dc198a64d Add a "/* !_SYS_TIMEVAR_H_ */" comment to the #endif at the bottom
of this file.
2005-10-24 13:43:27 +00:00
christos 6f981830a9 PR/31905: Wolfgang Stukenbrock: Termios ioctls TIOCMBIC and TIOCMBIS missing
in linux emulation code
2005-10-24 12:58:34 +00:00
chs da3f825c26 remove the assertion in uvm_swapout_threads() about LSONPROC lwps
not running on the same CPU as the swapper.  l_stat is protected by
sched_lock, which isn't held here, so we can race with that lwp
starting to run and see its l_cpu not updated yet, as in PR 31870.
we check l_stat again in uvm_swapout() while holding sched_lock,
so the race itself is harmless.
2005-10-24 00:26:37 +00:00
christos 8f370e24ef The previous change (to use bus_space_read_2), was broken because it was
reading from an odd offset. From Robert Elz
2005-10-23 20:03:04 +00:00
christos a751ffb4fe Adjust for icmp_error signature. 2005-10-23 19:40:20 +00:00
christos ff7f1eddad No need to pass an interface when only the mtu is needed. From OpenBSD via
Liam Foy.
2005-10-23 18:38:53 +00:00
kochi 1b13c5e5de revive a piece of code for workaround for buggy BIOSes.
this code was accidentally dropped when the last merge of ACPI-CA.
(this code is one of NetBSD-local changes against original ACPI-CA)
2005-10-23 16:39:29 +00:00
peter 1c9957b31e - Remove options PORTMASTER (not used any code).
- Add (commented out) options DEBUG.
- Add "pseudo-device ksyms".
2005-10-23 15:34:19 +00:00
peter 70417e76a9 Make this compile when DEBUG is defined. 2005-10-23 15:30:02 +00:00
peter 5280269a8f Add a dummy WSKBDIO_GETLEDS, to make "wsconsctl -ka" work. 2005-10-23 15:27:06 +00:00
peter 61eb4528fc Remove the DEBUG define, this should be set in the config file. 2005-10-23 15:21:08 +00:00
peter 8a5e924b94 - Use ANSI function decls.
- KNF.
2005-10-23 15:19:58 +00:00
peter fcadfb2052 - Use ANSI function decls.
- Add static, KNF.
- Print a newline in the attach routine for pretty dmesg output.
2005-10-23 15:18:54 +00:00
peter d62e20c6c5 Minor KNF. 2005-10-23 15:15:39 +00:00
peter 14b26643ea - Merge Interrupt/SPL related stuff from hpcarm/hpcarm/stubs.c.
PR/17346 from Kevin Lo.  ok by ichiro@
- Remove __P.
- Use ANSI functions decls.
- Minor KNF.
2005-10-23 15:15:09 +00:00
peter 83a03b3e58 Use arm/arm32/stubs.c instead of hpcarm/hpcarm/stubs.c to reduce
duplicated code. PR/17346 from Kevin Lo.  ok by ichiro@
2005-10-23 15:14:39 +00:00
peter 70500cd708 - Remove __P.
- Use ANSI function decls.
- Put some debug information into #ifdef DEBUG.
2005-10-23 15:08:18 +00:00
peter ab405b2010 - Remove __P.
- Use ANSI function decls.
- Tweak some comments.
- Fix a few typos.
- KNF.
2005-10-23 15:06:35 +00:00
peter 545de90bdb Fix some typos. 2005-10-23 15:04:43 +00:00
peter 6a6d8015e0 Fix a typo. 2005-10-23 15:02:48 +00:00
peter f2afca5030 - Remove __P.
- Remove var names in function declaration.
2005-10-23 15:02:30 +00:00
jmcneill f18dd07571 If the temperature sensors are disabled, enable them rather than giving up. 2005-10-23 14:01:36 +00:00
cube c42d7a0c74 Only include sys/systm.h under _KERNEL, otherwise it needlessly pollutes
namespace, as shown by libkvm failing to compile for shadowing one of the
variables listed in sys/systm.h.  Reported by xtraeme@.
2005-10-23 11:41:08 +00:00
christos f229ea7f53 make debugging code compile after 64 bit inode changes. 2005-10-23 04:28:53 +00:00
cube fc1218444f Regen (kqueue, kevent). 2005-10-23 01:34:33 +00:00
cube 97e4d77453 - Split sys_kevent into kevent1 so that it can be used by COMPAT_NETBSD32
code.

- To achieve COMPAT_NETBSD32 compatibility, introduce a parameter to
  kevent1 that points to functions that do the actual copyin/copyout
  operations.  This is similar to what was done in FreeBSD by Paul Saab.

- Add the COMPAT_NETBSD32 definitions and hooks.
2005-10-23 01:33:32 +00:00
cube 388b97e039 Implement a few changes needed to properly resolve PR#30924, as
discussed in the PR.

- introduce sys/timevar.h to hold kernel-specific stuff relevant to
  sys/time.h.  Ideally, timevar.h would contain all (or almost) of the
  #ifdef _KERNEL part of time.h, but that's a pretty big and tedious
  change to make.  For now, it will contain only the prototypes I
  introduced when working on COMPAT_NETBSD32.

- split copyinout_t into copyin_t and copyout_t, it makes prototypes more
  explicit about the meaning of a given argument.  Suggested by yamt@.

- move copyinout_t definition in sys/time.h to systm.h as copyin_t and
  copyout_t

- make everything uses the new types and include the proper headers at
  the proper places.
2005-10-23 00:09:14 +00:00
nonaka 2f7c0c1f96 fix EMODE instruction cache range index op. 2005-10-22 15:13:38 +00:00
nonaka 4fa7623be8 Use I2C_OP_{READ,WRITE}_WITH_STOP instead of I2C_OP_{READ,WRITE}. 2005-10-22 15:12:28 +00:00
he d13dea3067 Make it possible to use <sys/disklabel.h> from assembly source by
introducing OMIT_DKTYPENUMS and OMIT_FSTYPENUMS, which omits the
declaration of the enums.  Use this in the vax boot code to make
it build again.  Also use __CONCAT() instead of ##.
2005-10-21 21:10:45 +00:00
bouyer e148e671d8 mif6table is used by netstat, so don't declare it static. Fix netstat -g
on Xen, whose ELF loader doesn't load local symbols in the symbol table.
2005-10-21 18:00:45 +00:00
nathanw e890293bf2 Check the argument to SO_LINGER. 2005-10-21 17:40:03 +00:00
dbj 37e4b2f6aa decrement nscreens in vga_free_screen
this cleans up a crash on failed allocation, although
vga_free_screen may still be leaking resources
2005-10-21 14:44:08 +00:00
dbj 237f025382 strip arm mapping symbols for ddb using STRIPFLAGS instead of SYSTEM_LD_TAIL
this works even for kernels compiled with -g and doesn't interfere with gdb
2005-10-21 14:40:03 +00:00
dyoung 6a1be27c11 Switch to John Bicket's SampleRate algorithm for bitrate adaptation
on Atheros cards.
2005-10-21 04:07:48 +00:00
christos 78063c9188 regen. 2005-10-20 15:35:42 +00:00
christos 0270612ce7 Conditionalize the sigreturn syscall inclusion; from Patrick Welche 2005-10-20 15:35:25 +00:00
itohy a2f0c58dbb If an unknown endpoint is found, ignore it, rather than abort attach.
This change allows to use HID-like devices with additional functions.
2005-10-20 13:09:18 +00:00
dsl f4737f1020 Use preprocessor magic to get all the info for each DKTYPE and FSTYPE into
a single line.
2005-10-19 21:06:38 +00:00
bouyer b3b0d23068 In icmp6_redirect_output(), sip6 is initialised to point to the data area of
m0. But m0 may be freed later, so trying to use sip6 at the end of this
function is wrong. My guess is that we want to reference the data area
of m (the mbuf about to be send) instead at this point.
Fix a panic on Xen (where a data area of a mbuf may be unmapped when the
mbuf is freed), and probably potential data/pool corruption in other cases.
2005-10-19 20:42:54 +00:00
joerg 35b726a534 Fix a kernel segfault when a RX interrupt can't allocate a new mbuf.
The change adopts the idea of fxp to drop the incoming packet and panic
if the old mbuf cannot be reloaded. Since the bus_dmamap is allocated
during attach, this is not supposed to happen. Since a lot of code moves
anyway, factor out the allocation of RX ring elements, which is shared
between the init path and the RX interrupt path.

XXX A better fix might be to borrow the mbuf from the logic end of the
XXX ring buffer, but that needs more involved driver changes.

Reviewed by dyoung@ and nick@
2005-10-19 20:18:00 +00:00
hamajima 0f9691137b Fix write sequence to PHY.
I write a data first, but I wrote a command first.
2005-10-19 14:01:49 +00:00
dyoung 2a007394bf For clarify, use the name opt_athhal.h instead of opt_ah.h for the
file where Atheros HAL options go.
2005-10-19 09:04:23 +00:00
dyoung e0b6419887 Define AH_REGOPS_FUNC because the macppc HAL uses the register
read/write functions to access the hardware.
2005-10-19 09:02:52 +00:00
dyoung fde2c4b7ca No need to create opt_ah.h in these makefiles, config(8) takes care
of it.
2005-10-19 09:01:27 +00:00
christos e780c5edaf regen 2005-10-18 19:52:07 +00:00
christos 8fc452caf8 add the missing %% that confused joerg and the parser. 2005-10-18 19:51:47 +00:00
joerg 5e74202601 Regen. 2005-10-18 19:08:51 +00:00
joerg 39fcee12fe sys_uselib is needed by COMPAT_LINUX for EXEC_AOUT. Since it doesn't get
build when EXEC_AOUT is not defined, the syscalls.master entry has to be
conditionalized. Alpha did so already, so let the other archs catch up
with it.

Go-on: christos
2005-10-18 18:37:44 +00:00
joerg 397ada6330 Both iwi and ipw need arp. 2005-10-18 17:53:14 +00:00
tsutsui c264961875 TAB/space cleanup. 2005-10-18 11:31:12 +00:00
tsutsui c68fe159b9 Pass proper values to MI wsmouse_input(9):
http://mail-index.netbsd.org/port-sgimips/2005/10/18/0000.html

Ok'ed by Steve Rumble.
2005-10-18 11:20:48 +00:00
sekiya 8c83f7b667 Restore missing call to r5k_enable_sdcache(). Its' removal was a thinko
on my part -- the COP0 SC presence test fails on r5k IP22, but
r5k_enable_sdcache() will DTRT regardless.

Pointed out by tsutsui@
2005-10-18 00:47:07 +00:00
yamt 464cf44f6c dksubr: do b_blkno -> b_rawblkno translation earlier so that bufq can uses it. 2005-10-18 00:14:43 +00:00
christos 30756e31a3 small list macro cleanup:
- remove duplicate LIST_FIRST (Liam Foy)
- change to use LIST_FOREACH or for () instead of while () for consistency
2005-10-17 19:51:24 +00:00
rpaulo 8f596fb842 If we recieve a PIM register message when IPv6 PIM-SM routing is
enabled avoid a crash when forwarding the packet to outgoing interfaces.

Taken from FreeBSD which obtained it from KAME.
2005-10-17 15:56:43 +00:00
yamt 450531ecb3 bufq_alloc: fix BUFQ_STRAT_ANY. pointed by Juan RP. 2005-10-17 12:28:21 +00:00
yamt e7bb12271d sysctl_kern_bufq_strategies:
- handle too small buffer.
- handle the case that no bufq is configured.
2005-10-17 12:25:15 +00:00
simonb 94e3e9f7f5 Spinkle some KNF. 2005-10-17 03:08:24 +00:00
tls 389883922e From Gilles Roy <groy@qnx.com>: don't increment buffer pointer twice
(once before callback, once *in* callback) for MAC transforms.  How did
this driver ever work at all without this?
2005-10-16 20:26:47 +00:00
he dffb25a969 Complete the renaming gpio -> ppcgpio for evbppc, to make room for
the MI gpio.  Internal static functions in gpio_opb.c are not
renamed here, but the softc type is renamed together with the attach
declaration data.
2005-10-16 16:35:44 +00:00
uwe b388366e8f Shave off one instruction in _syscall. 2005-10-16 16:34:17 +00:00
uwe d0155fac59 Trim trailing whitespace. 2005-10-16 14:36:28 +00:00
yamt d6c1668a16 sysctl_kern_bufq_strategies:
- don't assign size_t value to error number.
- remove an unnecessary assignment.
2005-10-16 08:30:37 +00:00
yamt 707ea62186 sysctl_kern_bufq_strategies: skip a dummy strategy correctly. 2005-10-16 08:27:51 +00:00
yamt 42504f126e fix BUFQ_PEEK, which i broke in rev.1.4. 2005-10-16 08:01:08 +00:00
christos c4dfab8cf0 Make the grouplist invalidate function take a grouplist instead of a group.
Suggested by yamt.
2005-10-16 02:55:18 +00:00
christos 762d3ada2a This is why I hate gotos: My previous change had different semantics than
the original code since if fullgroups was empty and partgroups wasn't, we
would not clean up partgroups (pointed out by yamt). Well, this one has
different semantics from the original, they are the correct ones I think..
2005-10-16 02:21:40 +00:00
yamt 9f4759ccce add some bufq helper functions.
#if 0'ed out as there is no user currently.
2005-10-16 02:02:23 +00:00
yamt 4c9b2e4a8f whitespace. 2005-10-16 00:30:03 +00:00
yamt 834e69f6e0 fix rcsid. 2005-10-16 00:28:32 +00:00
christos 1e976481fe avoid a goto. 2005-10-16 00:28:04 +00:00
tls 240f327f5b HAVE_CRYPTO_LZS, not HAVE_CRYPTO_LSZ (worse, it was inconsistently used) 2005-10-16 00:14:22 +00:00
tls c4b950020a Don't use rnd_extract_data to set up IVs for new sessions; it is very
expensive, and pointless.  As elsewhere in the kernel (and as approved
under FIPS-140-2 by multiple test labs, incidentally) we use arc4 to
generate IVs here; there is no benefit to their being cryptographically
strong so long as there is a sufficient Hamming distance between them.
2005-10-16 00:12:42 +00:00
xtraeme 40b7fffb63 Add a sysctl function that will print all buffer queue strategies
built in the kernel:

$ sysctl kern.bufq.strategies
kern.bufq.strategies = disksort fcfs priocscan readprio
$
2005-10-15 22:36:18 +00:00
chs 528fa60e43 in pool_do_cache_invalidate(), make sure to process both full and partial
group lists even if the first one we look at is empty.  fix ddb print routine.
2005-10-15 21:22:46 +00:00
elad e47c05bf2b copystr and copyinstr return int, not void. 2005-10-15 21:18:54 +00:00
xtraeme 2228b00dd4 This needs <sys/bufq_impl.h> 2005-10-15 19:57:24 +00:00
jdolecek 91669fdaa7 use VLAN_OUTPUT_TAG() 2005-10-15 19:32:36 +00:00
yamt 6a53e94d49 bump to 3.99.10. bufq interface change. 2005-10-15 17:41:19 +00:00
yamt aec75b1cc6 - change the way to specify a bufq strategy. (by string rather than by number)
- rather than embedding bufq_state in driver softc,
  have a pointer to the former.
- move bufq related functions from kern/subr_disk.c to kern/subr_bufq.c.
- rename method to strategy for consistency.
- move some definitions which don't need to be exposed to the rest of kernel
  from sys/bufq.h to sys/bufq_impl.h.
  (is it better to move it to kern/ or somewhere?)
- fix some obvious breakage in dev/qbus/ts.c.  (not tested)
2005-10-15 17:29:10 +00:00
itohy 9a9aac9079 pwr_sw_ctrl(): do not panic() if panic has already happened
to avoid infinite panic recursion (this is called by cpu_reboot()).
2005-10-15 16:16:38 +00:00
macallan 4188757b69 Add a multiple include guard. 2005-10-15 15:41:22 +00:00
itohy d1e6cc9002 Add code to parse device name specified in the boot prompt.
Update boot version to 1.3.
2005-10-15 11:34:17 +00:00
itohy f1b7dcd6f3 When read from a disk partition, add the partition offset properly.
Do not use NULL address for disklabel buffer (wow).
2005-10-15 10:58:06 +00:00
tls eb5ea4a10b Add support for the hardware random number generator on the Hifn 7811
and 795x.  This was present in the driver before, but disabled due to
problems with the actual randomness of generated numbers on the
ubiquitious 7900-series parts.  The code here is far, far more
conservative than anyone else's driver for this RNG is -- but I
believe that conservatism is called for, because the 79xx RNG
design is missing a number of pieces from Hifn's "reference" 6500
RNG, and thus the numbers it generates must be treated with some
care.

Support for the 7811 RNG (which is a full-fledged 6500 type
generator) is pretty much the same here as in other variants of
this driver, except that it uses Hifn's "worst case" estimate of
actual entropy per output bit, so it will accumulate bits much
more slowly.  The 7811 support is untested.
2005-10-15 08:58:15 +00:00
tls 15cb9441e1 From OpenBSD hifn7751.c revision 1.149: enable the command-wait interrupt
even if there's only one request in the queue.  Sometimes we seem to miss
multiple interrupts, and command-wait saves us.
2005-10-15 04:31:20 +00:00
tsutsui 61d9372a28 All of FIREPOWER_ES, FIREPOWER_MX and FIREPOWER_LX require
the same platinit function, so don't check them separately.
2005-10-15 02:17:48 +00:00
xtraeme b0a4f3e4be Added support for Winbond 83627THF, from OpenBSD. 2005-10-15 00:41:48 +00:00
xtraeme 46b58a0a77 Enable atu(4). Requested by Martijn van Buul via PR pkg/30243. 2005-10-14 23:26:10 +00:00
heas bfceed8072 Add major for twe(4), so that management applications have a /dev entry to use. 2005-10-14 22:02:42 +00:00
riz 2feefaad21 Move a little more under #if NGPIO > 0 2005-10-14 19:21:07 +00:00
christos f31d6316f6 No need for __UNCONST in previous commit; factor out the function call. 2005-10-14 17:18:59 +00:00
elad 8fa0fa95d8 Copy the path to a kernel buffer before using it from ndp, as it may be a
pointer to userspace.
2005-10-14 12:47:04 +00:00
gdt d3aeb92bcb When bringing an interface up, and thus perhaps having just powered it
on (e.g. cardbus), write the wep keys to the card.  Fixes problem of
receiving gibberish if one has set wep keys before bringing the
interface up, and also after ifconfig ath0 down; ifconfig ath0 up.

(Tested with current from 20050926 with local mods, and discussed with
sam@ and dyoung@.  This is not 100% right, but significantly better
than before.  Really we should have an interator in net80211 to repush
all key state, include per-node keys.)
2005-10-14 00:26:45 +00:00
jmc a64b99061e Rename gpio to ppcgpio to resolve naming conflicts w. gpio framework 2005-10-13 21:38:11 +00:00
christos 0d55f64fcb - lock the tty when playing with the kqueue list.
- don't return 1, when we expect to return errno [EPERM is kind of stupid
  in this case :-)]
2005-10-13 16:18:43 +00:00
abs 90eafdf511 Make receiver lock-up workaround conditional on setting link1, as we have
too many false positives - should address PR/30505
2005-10-12 19:26:10 +00:00
tron b0a88753d6 Make build of ISO9660 boot loader work if no object directories are used. 2005-10-12 15:27:39 +00:00
simonb 30ab8089df Update the mod and access times directly from ptyfs_read() and
ptyfs_write() rather than setting a flag and updating these times
through ptyfs_itimes() at some indeterminate time in the future.
However, just use the "time" variable to set the times instead of
using a potentially expensive call to nanotime().  A HZ resolution
on these timestamps is more than enough.

(Possibly incomplete) fix for PR kern/31430.
OK'd be christos@.
2005-10-12 15:23:33 +00:00
elad d4a8a9ec63 Debug nits from Brett Lymn:
- The fingerprint should be printed before we increment the pointer.
  - Add missing index increment.
2005-10-12 14:26:47 +00:00
christos 9435516e6b More Dothan entries from OpenBSD. 2005-10-12 04:20:59 +00:00
elad 5068eab154 - Don't pass NULL to free().
Fixes local crash reported by Matthew Sporleder.

- %ld -> PRIu64 for inodes.
2005-10-11 23:59:40 +00:00
jdolecek 16ceb2f222 put back joystick enabling code, lost in Audigy support merge 2005-10-11 19:36:48 +00:00
drochner dbbdf74175 -kill gba_name in attach arg
-use constants from locators.h
2005-10-11 16:01:03 +00:00
drochner e8d3f46495 kill gba_name in attach arg, specify interface attribute 2005-10-11 15:59:16 +00:00
drochner 69f432c06d -put gpio stuff inside #if NGPIO > 0
-kill gba_name in attach arg, specify interface attribute
2005-10-11 15:58:37 +00:00
cube 0e6cb1fa09 Add __KERNEL_RCSID. 2005-10-11 09:56:51 +00:00
christos 22239aa432 handle MMX faults as floating exceptions. Tested by Hauke Fath; matlab
passes all its regression suite without panicking the kernel.
2005-10-10 21:08:01 +00:00
christos d2f0c36e85 Add defines for the control and status bits of the 80387. 2005-10-10 21:07:17 +00:00
christos eb3977b72c Don't get confused if T_USER is set; instead print the correct trap. 2005-10-10 18:13:39 +00:00
elad 95d7879011 Style changes, lots of input from blymn@. 2005-10-10 17:36:29 +00:00
dsl 76ed960bec Add sk ethernet as found on ASUS A8V.
Increase ramdisk to 5MB, costs virtually nothing.
2005-10-10 17:24:38 +00:00
chs 9307d68e6a stop converting async msync() to sync.
this hasn't been needed for years (if it ever was).
2005-10-10 15:53:28 +00:00
dsl 3e17d26fb5 include "INSTALL" then modify it - so we get the same device 2005-10-10 15:40:37 +00:00
pooka 6c4ca17312 foreach NOTEACHED make the comment say NOTREACHED 2005-10-10 09:58:54 +00:00
tsutsui 73d1e286b2 Define MIPS3_PG_SIZE_MASK_TO_SIZE() macro in the MI mips header. 2005-10-10 02:14:43 +00:00
hubertf 2d4a7ba907 Find second qe interface, taken from the INSTALL file.
Reported by someone on IRCnet #NetBSD.
2005-10-10 01:06:24 +00:00
sekiya 2dac3b071c Match ELECOM UC-SGT0. 2005-10-09 02:16:35 +00:00
bouyer 65679198a8 Also remove pkt_next now that packets are not recorded in a per-page list. 2005-10-08 20:23:59 +00:00
bouyer 0e12d49f1c If a domain has more than one interface, a page can hold packets for different
xennetback instances. To support this, more fields from xni_page to xni_pkt.
This would also have the effect to move more code into the
while (!SLIST_EMPTY(&pkt_page->xni_pkt_head)) loop in xennetback_tx_free().
By passing xni_pkt instead of xni_page to xennetback_tx_free we can
avoid the loop, and the xni_pkt_head list completely. There is even a sligh
performance increase if the domU deals with xni_txring->event properly.

Based on comments from YAMAMOTO Takashi.
2005-10-08 20:22:05 +00:00
yamt 2db36492c6 sa_switch: remove cpu hand-off in "Case 2".
it causes severe unfairness in some cases.
eg. when a process has many lwps doing poll.

no objections on tech-kern@.
2005-10-08 06:37:12 +00:00
yamt c610dbbdc2 sysctl_kern_proc_args: don't assume that the process is
resident while we are sleeping.
2005-10-08 06:35:56 +00:00
skrll 69c3b1813e Use the new scan command for monitor mode as well. 2005-10-08 06:19:46 +00:00
isaki a658e0cd29 regen. 2005-10-08 06:15:30 +00:00
chs 6c50e54c82 avoid the need for a bogus initializer. 2005-10-08 03:21:17 +00:00
chs 20b89dd47f default to simple_lock_debugger=1 with LOCKDEBUG. 2005-10-08 03:18:25 +00:00
uwe a8930f8104 Sync with GENERIC (1.180). 2005-10-08 01:49:40 +00:00
macallan 33f4e6b2f0 Fixes the following bug:
Framebuffer drivers use their own minor device number to find their device entry
in fbdriver methods ( like cgsix uses cgsix_cd[minor] ) but fb passed the fb
device's unit number which works only as long as all registered fb devices use
the same underlying driver. With different fb drivers, like a cgsix and an ffb, both will be (native) unit number 0 so with the old code /dev/fb1 would be
unusable.
2005-10-08 00:46:44 +00:00
macallan c2b05b7fce Check for 'i2c-bus' child and if found look for i2c devices there instead of
directly under the ki2c node.
Needed for newer ( 2005? ) OpenFirmware.
2005-10-07 23:53:11 +00:00
christos d63acabb28 vadvise was not declared anywhere. 2005-10-07 19:33:19 +00:00
elad a61a2074a3 Remove Veriexec bits from genfs, don't #if 0 them. 2005-10-07 18:19:14 +00:00
elad 2de72bfe34 Various fixes from blymn@ and myself.
Also, put genfs changes under #if 0, and don't do per-page fingerprints
until this is properly discussed, as requested by yamt@.
2005-10-07 18:07:46 +00:00
tsutsui e9882e57f5 Sync with GENERIC:
- add options P1003_1B_SEMAPHORE
- add #file-system TMPFS
- add #options UFS_DIRHASH
- add #options ALTQ*
- enable pseudo-device fss
- add #pseudo-device pf*
- options<space><tab>
2005-10-07 18:04:51 +00:00
tsutsui fcfdd9abaa options<space><tab> 2005-10-07 18:01:39 +00:00
tsutsui eed1fcb469 Regen from GENERIC.in rev 1.44:
> Add (commented out) file-system TMPFS in a proper file.

XXX: It seems `INSTALL_CONFIGURATION' in GENERIC.in should be reorganaized.
2005-10-07 17:51:07 +00:00
tsutsui 2c0da89986 Add (commented out) file-system TMPFS in a proper file. 2005-10-07 17:46:33 +00:00
riz 4b5421222c Add support for the gpio(4) framework to the elansc(4) system controller.
From Alexander Yurchenko (grange@openbsd), via OpenBSD.
Approved by jmcneill.
2005-10-07 15:59:49 +00:00
chs ffd3aa297e make the previous apply only to x86_64. 2005-10-07 14:46:04 +00:00
chs 26a2ca0397 add __attribute__((packed)) to struct netbsd32_stat13. the alignment of
64-bit values is annoying in the x86 world:  they require 64-bit alignment
in 64-bit mode but only 32-bit alignment in 32-bit mode.
2005-10-07 14:40:06 +00:00
simonb 4beb6d8640 Add a hack to deal with MIPS relocatable shared-linker problem on
COMPAT_16 and earlier that results in a current shared linker running at
address 0 (and thus allows NULL pointer derefs to work).

As noted by Matthias Drochner, this "fix" just checks the first psection
and not the first loadable psection.  This isn't a problem with the
binutils up to now, but might be in the future.
2005-10-07 08:33:10 +00:00
abs 9644b9239b At least ASUS also put the ITE8712F at 0xc00 - noted by Juan RP 2005-10-07 08:18:13 +00:00
dyoung fef03960e4 Ensure we don't build the libraries twice: move the .WAIT after
the first subdirectory that uses the libraries.  That subdirectory
is bootxx_ffsv1, not bootxx_cd9660.
2005-10-06 21:39:41 +00:00
jdc 0dbca227cf Change memoff to bus_size_t (like all other PCMCIA devices).
Now compiles on sparc too.
2005-10-06 20:54:31 +00:00
kleink 705c504051 pk_accton(): `path' actually points into kernel space. 2005-10-06 16:32:14 +00:00
tsutsui 777c677da8 Sync with GENERIC:
- add indent
- add commented out file-system TMPFS
- enable PFIL_HOOLS
- space cosmetics
2005-10-06 15:13:26 +00:00
tsutsui 57c9eba3ac cosmetics. 2005-10-06 15:12:01 +00:00
tsutsui e955c959e4 Add (commented out) file-system TMPFS. 2005-10-06 14:59:13 +00:00
yamt 793a63d824 - remove a ufs dependency.
- bump readdir block size to 1024.  (the same value as userland DIRBLKSIZ)
2005-10-06 10:23:01 +00:00
yamt e10443f324 nfs_bioread: handle file truncation on the server a little more gracefully. 2005-10-06 10:20:58 +00:00
dyoung 00d2915456 Build and install /usr/mdec/bootxx_cd9660, a primary boot loader
for ISO9660 filesystems.
2005-10-06 08:22:58 +00:00
dyoung 310a1a8dcf Change the layout of cdboot to meet installboot(8)'s expectations:
MBR+NetBSD disklabel+boot parameters.  Invoke the secondary boot
loader with a pointer to the boot parameters.
2005-10-06 08:19:46 +00:00
yamt 2975f576b9 uninline scheduler hooks. 2005-10-06 07:02:13 +00:00
simonb 5c33a825aa KNF. 2005-10-06 02:23:51 +00:00
elad 314759431d Don't forget to unmap memory once we're done with it.
Pointed out by yamt@.
2005-10-05 16:21:46 +00:00
elad 4daa338c1a Don't use static variables here.
Pointed out by yamt@.
2005-10-05 15:59:31 +00:00
yamt d6d16da423 remove a redundant assignment in the previous. 2005-10-05 15:46:00 +00:00
cube b82dcdacf5 tap doesn't expose any locator... It's just a trick to get a cfdriver
structure.
2005-10-05 14:16:46 +00:00
elad 8fc0d7a9c3 Introduce per-page fingerprints in Veriexec.
This closes a hole pointed out by Thor Lancelot Simon on tech-kern ~3
years ago.

The problem was with running binaries from remote storage, where our
kernel (and Veriexec) has no control over any changes to files.

An attacker could, after the fingerprint has been verified and
program loaded to memory, inject malicious code into the backing
store on the remote storage, followed by a forced flush, causing
a page-in of the malicious data from backing store, bypassing
integrity checks.

Initial implementation by Brett Lymn.
2005-10-05 13:48:48 +00:00
christos 9152d0e109 PR/31478: YOMURA Masanori: Inconsistent default value of net.inet.ipsec.dfbit
Changed to match netinet6 (0->2)
2005-10-05 12:59:24 +00:00
jonathan 0f632be919 Regen with PCI ids for Intel pro/1000 PT pci-e gigabit ethernet. 2005-10-05 00:46:00 +00:00
jonathan 14da49c8be Add PCI ids for Intel Pro/1000 PT PCI-Express gigabit ethernet controllers:
82571EB 2-port, 82572EI single-port, both in copper, fibre, and SERDES versions,
and 82573 embedded chip.
2005-10-05 00:43:58 +00:00
christos a9c3ad6f5c PR/31455: Robert Elz: ex (905[BC]) cards can hang in -current kernels
- fix bus_space_read_1 -> bus_space_read_2 since revision 1.27 changed
  the bit defines to assume 2 byte reads.
- Increment oerrors in case of collisions
- Clamp success counter to 100, instead of letting rotate freely.
2005-10-04 17:37:26 +00:00
tsutsui 17b2c3c86e On converting sgimips disklabel into BSD disklabel, don't take
dp_secbytes in the SGI volume header because the ARCS firmware ignores it.
Instead, leave the hardware default value set by each driver and
adjust offset values in the SGI volhdr according to the real sector size.

Fixes "resource shortage" messages on mounting a bootable CD-ROM image
which has the SGI volhdr. See posts on port-sgimips for details:
http://mail-index.netbsd.org/port-sgimips/2005/09/12/0000.html
http://mail-index.netbsd.org/port-sgimips/2005/09/12/0001.html
http://mail-index.netbsd.org/port-sgimips/2005/09/14/0000.html
2005-10-04 14:47:50 +00:00
bouyer 181bca1deb Fix problem pointed out by YAMAMOTO Takashi:
In theory mbufs can have an infinite life time and could block the transmit
ring (as slots are released when the mbuf external storage is freed). To
avoid this, when we're processing the last slot of the ring copy the buffer
and release the slot immediatly.
2005-10-03 22:15:44 +00:00
bouyer 056ae51459 Comment out options MCLSHIFT, YAMAMOTO Takashi says this will cause
"suboptimal flowcontrol" in the socket code. Still worth it in a
routing/bridging setup, though.
2005-10-03 20:50:25 +00:00
jmmv ab7e099bbc Follow symlinks during lookup (i.e., don't stop too early) so that symlinks
to directories work as expected.  Diagnosed by Greg Oster.
2005-10-03 19:36:42 +00:00
manu bc210edac8 Fix COMPAT_DARWIN build. This closes PR#31336 2005-10-03 17:11:25 +00:00
manu a02c0f01ca Make sure that the port numbers are set to 0 in SAD and SPD when NAT-T
is not enabled. While we are here, add some safety tests on PFKEY
messages

This fixes the problem described in bin/30437
2005-10-03 13:14:38 +00:00
macallan 91cf1be5bf Build mach64_get_mode only on SPARC and PowerPC to shut up a compiler warning. 2005-10-03 11:22:06 +00:00
macallan 22da510a75 Cleanup, remove some duplicate code, behave better with more than one instance present. ( for machfb.c 1.34+ ) 2005-10-03 10:26:24 +00:00
mrg 8b78edeb42 fix a bug pointed out by der mouse on tech-kern: in F_GETOWN, use a
pointer to a temporary "int" variable to pass to fo_ioctl(TIOCGPGRP), not
a register_t pointer.  (how did F_GETOWN ever work on sparc64 before?)
2005-10-03 02:06:00 +00:00
bouyer 24accead84 Add
options         MCLSHIFT=12
in order to avoid a copy when a mbuf cluster has to be sent to a domU
(which is the common case when the packet comes from a physical network
interface).
2005-10-02 21:53:16 +00:00
bouyer 213d74cfef Major improvements to the network backend, leading to a 0-copy transmit and
receive system:
- on the receive side, attach the mapped buffer as external storage
  instead of copying it. As a mapped buffer may not live much longer, we
  have to deal with the fact that one page of buffer may containt several
  packets, and it's not possible to map them several times. Use a hashed list
  to keep track of mapped pages, and use reference counters.
- on the transmit side, when MCLBYTES == PAGE_SIZE, give away the mbuf
  cluster page when possible instead of copying it. Keep a pool of physical
  pages to map in place of the page we give away. When copying, use a
  pool_cache(9) to manage copy buffers (use mclpool_cache when
  MCLBYTES == PAGE_SIZE, otherwise use a private pool/pool_cache) instead
  of a local list. This should reduce the number of hypercalls and MMU
  operations in the copy case as well.
2005-10-02 21:49:23 +00:00
bouyer 8b47a87eb6 Have xennet_start() schedule a software interrupt to defer processing of the
send queue. This give upper layer an opportunity to queue up all available
packets before starting to process them. This reduce the number of interrupt
generated on the backend, and the time spent doing hypercalls in a significant
way.
2005-10-02 21:39:41 +00:00
chs 8eaf597e57 typo. 2005-10-02 17:53:23 +00:00
chs 7c02feca68 avoid calling into the pool code while holding sched_lock
since both pool_get() and pool_put() can call wakeup().
instead, allocate the struct sadata_upcall before taking
sched_lock in mi_switch() and free it after releasing sched_lock.

clean up some modularity warts by adding a callback to
struct sadata_upcall for freeing sa_arg.
2005-10-02 17:51:27 +00:00
chs 9c47d944e4 optimize pool_caches similarly to how I optimized pools before:
split the single list of pool cache groups into three lists:
completely full, partially full, and completely empty.
use LIST instead of TAILQ where appropriate.
2005-10-02 17:29:31 +00:00
chs 67ca114699 add QUEUEDEBUG for CIRCLEQ. 2005-10-02 15:34:42 +00:00