Commit Graph

1317 Commits

Author SHA1 Message Date
jmcneill 23526fe3a9 Add pseudo audio device driver. With this pseudo-device, audio played back
via the standard audio interfaces is redirected back to userland as raw
PCM data on /dev/padN.

One example usage is to stream audio to an AirTunes compatible device using
rtunes (http://www.nazgul.ch/dev_rtunes.html), ie:

	$ rtunes - < /dev/pad0
	$ mpg123 -a /dev/sound1 blah.mp3

Another option is to capture audio output from eg. Real Player, by simply
instructing Real Player to output to /dev/sound1, and running:

	$ cat /dev/pad0 > blah.pcm
2007-11-11 17:37:45 +00:00
pooka db2e7d6a05 include putter only if it's actually defined 2007-11-11 16:58:02 +00:00
pooka f2031ea28b Part 2/n of extensive changes to request transport to/from userspace:
Rip the transport code completely out of puffs and generalize it
into an independent module which will be used for multiple purposes
in the future.  This module is called the Pass-to-Userspace
Transporter (known as "putter" among friends).

This is very much work-in-progress and one dependency with puffs
remains: the request framing format.

The device name is still /dev/puffs, but that will change soon.

Users of puffs need the following in their kernel configs now:
pseudo-device   putter
2007-11-10 21:45:04 +00:00
pooka 735dd21e07 Split I/O-related routines (getpages, putpages, etc.) which are heavily
tied to uvm out of genfs_vnops into genfs_io.c
2007-10-17 16:45:00 +00:00
rmind a21233e46b Import of SCHED_M2 - the implementation of new scheduler, which is based
on the original approach of SVR4 with some inspirations about balancing
and migration from Solaris.  It implements per-CPU runqueues, provides a
real-time (RT) and time-sharing (TS) queues, ready to support a POSIX
real-time extensions, and also prepared for the support of CPU affinity.

The following lines in the kernel config enables the SCHED_M2:

no options SCHED_4BSD
options SCHED_M2

The scheduler seems to be stable.  Further work will come soon.

http://mail-index.netbsd.org/tech-kern/2007/10/04/0001.html
http://www.netbsd.org/~rmind/m2/mysql_bench_ro_4x_local.png
Thanks <ad> for the benchmarks!
2007-10-09 19:00:13 +00:00
tls 0a012aa1c5 Fix accidental USE_SSP -> USE_FORT: now USE_SSP works as intended for
kernel builds.  Thanks to xtraeme for pointing this out.
2007-10-08 21:25:35 +00:00
ad 342d5fc94f Add stubs that provide new soft interrupt API from the vmlocking branch.
For now these just pass through to the current softintr code.

(The naming is different to allow softint/softintr to co-exist for a while.
I'm hoping that should make it easier to transition.)
2007-10-08 15:51:02 +00:00
ad 451aacda90 Merge file descriptor locking, cwdi locking and cross-call changes
from the vmlocking branch.
2007-10-08 15:12:05 +00:00
dogcow 360a5fad96 since ip_gre.c is gone, it's unhelpful to have dependencies on it. 2007-10-05 07:28:24 +00:00
dyoung 97d392d2c5 Always build & link net/link_proto.c, since net/if.c needs it. 2007-09-28 22:52:13 +00:00
pooka 82a2fc0cce ufs is ssp clean 2007-09-25 15:16:05 +00:00
christos 2d6848b0e4 alpha can do notes. 2007-09-21 15:37:17 +00:00
plunky c212c4900f move the HID processing defs to a higher context, since it is used by
bluetooth and USB code.
2007-09-07 20:17:37 +00:00
rmind 2cecf9bbe9 Implementation of POSIX message queues.
Reviewed by: <ad>, <tech-kern>
2007-09-07 18:56:02 +00:00
ad 399122feeb subr_prf_bitmask.c -> subr_prf2.c 2007-08-15 20:34:48 +00:00
ad 63c4506184 Changes to make ktrace LKM friendly and reduce ifdef KTRACE. Proposed
on tech-kern.
2007-08-15 12:07:23 +00:00
kiyohara 44c89c7646 Replace to Matthew Orgass's slhci(4).
http://mail-index.netbsd.org/tech-kern/2007/06/26/0001.html
2007-08-15 03:53:08 +00:00
pooka 5fbd525b19 Shuffle routines which just roll values around from kern_clock.c
and kern_time.c to subr_time.c.
2007-08-09 07:36:18 +00:00
ad 18af8ee9bd Add cpuctl(8). For now this is not much more than a toy for debugging and
benchmarking that allows taking CPUs online/offline.
2007-08-04 11:02:56 +00:00
pooka 59f0f4532f Split vfs_subr.c into routines which need much of the kernel
infrastructure (vfs_subr.c) and routines which need little or none
of the kernel infra (vfs_subr2.c).
2007-07-29 14:44:08 +00:00
pooka e97d926940 Move bitmask_snprintf() from subr_prf.c to subr_prf_bitmask.c to permit
standalone compilation.  No functional change.
2007-07-29 09:38:01 +00:00
pooka 0a0815b77e Move hashinit() & hashdone() from kern_subr.c to subr_hash.c to
permit standalone compilation.  No functional change.
2007-07-28 12:53:52 +00:00
dyoung 6fcbbbc853 Take steps to hide the radix_node implementation of the forwarding table
from the forwarding table's users:

        Introduce rt_walktree() for walking the routing table and
        applying a function to each rtentry.  Replace most
        rn_walktree() calls with it.

        Use rt_getkey()/rt_setkey() to get/set a route's destination.
        Keep a pointer to the sockaddr key in the rtentry, so that
        rtentry users do not have to grovel in the radix_node for
        the key.

        Add a RTM_GET method to rtrequest.  Use that instead of
        radix_node lookups in, e.g., carp(4).

Add sys/net/link_proto.c, which supplies sockaddr routines for
link-layer socket addresses (sockaddr_dl).

Cosmetic:

        Constify.  KNF.  Stop open-coding LIST_FOREACH, TAILQ_FOREACH,
        et cetera.  Use NULL instead of 0 for null pointers.  Use
        __arraycount().  Reduce gratuitous parenthesization.

        Stop using variadic arguments for rip6_output(), it is
        unnecessary.

        Remove the unnecessary rtentry member rt_genmask and the
        code to maintain it, since nothing actually used it.

        Make rt_maskedcopy() easier to read by using meaningful variable
        names.

        Extract a subroutine intern_netmask() for looking up a netmask in
        the masks table.

        Start converting backslash-ridden IPv6 macros in
        sys/netinet6/in6_var.h into inline subroutines that one
        can read without special eyeglasses.

One functional change: when the kernel serves an RTM_GET, RTM_LOCK,
or RTM_CHANGE request, it applies the netmask (if supplied) to a
destination before searching for it in the forwarding table.

I have changed sys/netinet/ip_carp.c, carp_setroute(), to remove
the unlawful radix_node knowledge.

Apart from the changes to carp(4), netiso, ATM, and strip(4), I
have run the changes on three nodes in my wireless routing testbed,
which involves IPv4 + IPv6 dynamic routing acrobatics, and it's
working beautifully so far.
2007-07-19 20:48:50 +00:00
he 971b1c1aaf After the recent mount changes, COMPAT_AOUT_M68K now depends on COMPAT_40. 2007-07-18 06:29:26 +00:00
dsl 9a71120654 Default MEMORY_DISK_SERVER to 1 instead of using 'undefined' to mean 1. 2007-07-15 08:40:22 +00:00
ad 52d4ecbef8 kcont was removed. 2007-07-14 10:52:14 +00:00
ad 73ebbed2a1 Remove kcont:
- There are no users in tree.
- Its functionality has largely been replaced by workqueues and generic
  soft interrupts.
- It's not MP friendly.
2007-07-09 10:05:26 +00:00
rumble 6912898dc8 Add read-only support for SGI's Extent File System.
Reviewed by pooka@.
2007-06-29 23:30:16 +00:00
christos 20bfd9898e Add a sockaddr_storage member to "struct ifreq" maintaining backwards
compatibility with the older ioctls. This avoids stack smashing and
abuse of "struct sockaddr" when ioctls placed "struct sockaddr_foo's" that
were longer than "struct sockaddr".
XXX: Some of the emulations might be broken; I tried to add code for
them but I did not test them.
2007-05-29 21:32:27 +00:00
tls 4147a3c54a Add new Makefile knob, USE_FORT, which extends USE_SSP by turning on the
FORTIFY_SOURCE feature of libssp, thus checking the size of arguments to
various string and memory copy and set functions (as well as a few system
calls and other miscellany) where known at function entry.  RedHat has
evidently built all "core system packages" with this option for some time.

This option should be used at the top of Makefiles (or Makefile.inc where
this is used for subdirectories) but after any setting of LIB.

This is only useful for userland code, and cannot be used in libc or in
any code which includes the libc internals, because it overrides certain
libc functions with macros.  Some effort has been made to make USE_FORT=yes
work correctly for a full-system build by having the bsd.sys.mk logic
disable the feature where it should not be used (libc, libssp iteself,
the kernel) but no attempt has been made to build the entire system with
USE_FORT and doing so will doubtless expose numerous bugs and misfeatures.

Adjust the system build so that all programs and libraries that are setuid,
directly handle network data (including serial comm data), perform
authentication, or appear likely to have (or have a history of having)
data-driven bugs (e.g. file(1)) are built with USE_FORT=yes by default,
with the exception of libc, which cannot use USE_FORT and thus uses
only USE_SSP by default.  Tested on i386 with no ill results; USE_FORT=no
per-directory or in a system build will disable if desired.
2007-05-28 12:06:17 +00:00
mjacob f0b57d5f54 Major update to isp(4) driver to bring it in line with external sources.
The major changes are:

 + 4Gb (24XX) card support
 + Rewritten fabric and loop evaluation code
 + New f/w sets

The 4Gb changes required major rototilling, which caused a rewrite of
fabric and loop eval code. The latter can now be set up to tune for
dynamic device arrival/departure if the framework is set up for it,
or to be firm about waiting for devices.

Testing has been principally on amd64, i386 and sparc64 and seems to
not have broken things for me.
2007-05-24 21:30:41 +00:00
yamt f03010953f merge yamt-idlelwp branch. asked by core@. some ports still needs work.
from doc/BRANCHES:

	idle lwp, and some changes depending on it.

	1. separate context switching and thread scheduling.
	   (cf. gmcgarry_ctxsw)
	2. implement idle lwp.
	3. clean up related MD/MI interfaces.
	4. make scheduler(s) modular.
2007-05-17 14:51:11 +00:00
christos 058554bbc4 amd64 kern.ldscript can handle notes now 2007-05-12 21:00:00 +00:00
bouyer 920d7a6afe Split the ahcisata driver in pci front-end and bus-independant back-end. 2007-05-12 11:04:58 +00:00
xtraeme ff1c414804 Split the ug(4) driver in three components:
* dev/ic/ug.c (main code shared by the attachments)
	* dev/isa/ug_isa.c (isa attachment)
	* dev/acpi/ug_acpi.c (acpi attachment)

That means that ug(4) can now be attached via ACPI.

Thanks to Mihai Chelaru for the good work.
2007-05-08 16:48:37 +00:00
manu 31b57f40ff Add the TFTPROOT kernel option for TFTP'ing root RAMdisk at root mount time.
This allows working around situations where a kernel with embedded RAMdisk
cannot be booted by the bootloader because the RAMdisk is too big.
2007-05-08 06:10:27 +00:00
rmind 10c3d35ca0 Rename vfs_aio.c to sys_aio.c as decided in <tech-kern>.
Please note, that <tech-kern> people should note about
file names before commit. Otherwise, function may fail
with errno set to EDIRTY, and return -1. ;)
2007-05-07 22:22:20 +00:00
dyoung 72f0a6dfb0 Eliminate address family-specific route caches (struct route, struct
route_in6, struct route_iso), replacing all caches with a struct
route.

The principle benefit of this change is that all of the protocol
families can benefit from route cache-invalidation, which is
necessary for correct routing.  Route-cache invalidation fixes an
ancient PR, kern/3508, at long last; it fixes various other PRs,
also.

Discussions with and ideas from Joerg Sonnenberger influenced this
work tremendously.  Of course, all design oversights and bugs are
mine.

DETAILS

1 I added to each address family a pool of sockaddrs.  I have
  introduced routines for allocating, copying, and duplicating,
  and freeing sockaddrs:

        struct sockaddr *sockaddr_alloc(sa_family_t af, int flags);
        struct sockaddr *sockaddr_copy(struct sockaddr *dst,
                                       const struct sockaddr *src);
        struct sockaddr *sockaddr_dup(const struct sockaddr *src, int flags);
        void sockaddr_free(struct sockaddr *sa);

  sockaddr_alloc() returns either a sockaddr from the pool belonging
  to the specified family, or NULL if the pool is exhausted.  The
  returned sockaddr has the right size for that family; sa_family
  and sa_len fields are initialized to the family and sockaddr
  length---e.g., sa_family = AF_INET and sa_len = sizeof(struct
  sockaddr_in).  sockaddr_free() puts the given sockaddr back into
  its family's pool.

  sockaddr_dup() and sockaddr_copy() work analogously to strdup()
  and strcpy(), respectively.  sockaddr_copy() KASSERTs that the
  family of the destination and source sockaddrs are alike.

  The 'flags' argumet for sockaddr_alloc() and sockaddr_dup() is
  passed directly to pool_get(9).

2 I added routines for initializing sockaddrs in each address
  family, sockaddr_in_init(), sockaddr_in6_init(), sockaddr_iso_init(),
  etc.  They are fairly self-explanatory.

3 structs route_in6 and route_iso are no more.  All protocol families
  use struct route.  I have changed the route cache, 'struct route',
  so that it does not contain storage space for a sockaddr.  Instead,
  struct route points to a sockaddr coming from the pool the sockaddr
  belongs to.  I added a new method to struct route, rtcache_setdst(),
  for setting the cache destination:

        int rtcache_setdst(struct route *, const struct sockaddr *);

  rtcache_setdst() returns 0 on success, or ENOMEM if no memory is
  available to create the sockaddr storage.

  It is now possible for rtcache_getdst() to return NULL if, say,
  rtcache_setdst() failed.  I check the return value for NULL
  everywhere in the kernel.

4 Each routing domain (struct domain) has a list of live route
  caches, dom_rtcache.  rtflushall(sa_family_t af) looks up the
  domain indicated by 'af', walks the domain's list of route caches
  and invalidates each one.
2007-05-02 20:40:22 +00:00
bouyer 982bad256f Add bio(4) and associated bioctl(8) from OpenBSD, a driver control block
device controllers, and more specifically raid controllers.
Add a new sensor type, ENVSYS_DRIVE, to report drive status. From OpenBSD.
Add bio and sysmon support to mfi(4). This allow userland to query
status for drives and logical volumes attached to a mfi(4) controller. While
there fix some debug printfs in mfi so they compile.
Add bio(4) to amd64 and i386 GENERIC.
2007-05-01 17:18:52 +00:00
rmind 67d703cf25 Import of POSIX Asynchronous I/O.
Seems to be quite stable. Some work still left to do.

Please note, that syscalls are not yet MP-safe, because
of the file and vnode subsystems.

Reviewed by: <tech-kern>, <ad>
2007-04-30 14:44:28 +00:00
tnn b2079804d3 Add envctrl(4): Sun Ultra Enterprise 450 environmental monitoring driver.
Also add accompanying i2c controller driver, pcf8584.
Both written by me. Some cosmetic improvements from Iain Hibbert.
ok <martin>
2007-04-14 19:33:27 +00:00
drochner 2d9e04fc35 Import DRM drivers, brought into shape by Yorick Hardy, posted to tech-x11.
Minor modifications by me:
-use an mi device major number
-(coarsly) divided into pci card specific and less specific parts, moved
 the latter to dev/drm
-renamed autoconf attributes to reflect this
Todo:
-adapt all card frontends but i915 to drm include file location
-review the mtrr change
-make the change to agp_i810.c coexist with the fix for buggy VESA
 BIOSes which is commented out temporarily
-RCS IDs etc style stuff
-LKM support (rescan support for vga)
-test
2007-03-20 18:05:25 +00:00
drochner a6fee167b2 allocate chracter dev major #180 for drm 2007-03-20 16:37:12 +00:00
dyoung 4888b33c86 Let config(1) know that #define ATADEBUG goes in opt_ata.h. In
dev/ic/wdc.c and in dev/ata/ata.c, #include "opt_ata.h", and make
both the files compile with or *without* ATADEBUG.  Do not compile
with ATADEBUG by default.
2007-03-17 06:41:35 +00:00
jmmv 465d2fa6dc Add the ability for platform-specific Makefiles to indicate which kernel
images to install into / (which might be more than just "netbsd").

Addresses PR port-shark/17569.
2007-03-12 15:09:01 +00:00
njoly 90b3c9e789 High Precision Event Timer driver, following Intel specifications.
Allow attachement at both ACPI (hpet@acpi) and AMD8111 LPC Controller
(hpet@amdpcib).

Requested by xtraeme, and tested by a few users.
2007-03-08 14:26:26 +00:00
dillo 56c3e41252 Complete rename of hfsp to hfs, requested by thorpej. 2007-03-06 11:28:44 +00:00
dillo 9274a5c0f1 Integrate apmlabel and HFS+ file system. 2007-03-05 23:18:01 +00:00
tsutsui 4f4391e397 Move mkldscript.sh, which is used to create ldscript dynamically to
merge link_set_* sections into the text section for a.out kernels,
from sys/arch/arm/conf/ to sys/conf/ since there is no ARM specific
stuff in it and other ports would share it.
2007-03-04 02:35:49 +00:00
ad 7fba50c03c A quick hack to get things building again: put back the SA system calls
with no arguments, and alias them to sys_nosys. To be revisited.
2007-02-10 11:55:23 +00:00
ad b07ec3fc38 Merge newlock2 to head. 2007-02-09 21:55:00 +00:00
ober 5c470843ae Updates to allow Zaurus screen to rotate 90 degrees to a usable state with the keyboard. Patch from peter@ copied from OpenBSD. Feedback and OK from matt@ 2007-02-02 02:10:24 +00:00
christos d68432cc82 We don't need to include kern_exit43.c to the list of files that we cannot
use SSP on now that zero sized arrays are treated properly in gcc.
2007-01-27 01:37:57 +00:00
ad 965759e2d5 Remove long unused 'ncallout'. 2007-01-20 20:00:13 +00:00
hannken 1b9c6382e3 New file system suspension API to replace vn_start_write and vn_finished_write.
The suspension helpers are now put into file system specific operations.
This means every file system not supporting these helpers cannot be suspended
and therefore snapshots are no longer possible.

Implemented for file systems of type ffs.

The new API is enabled on a kernel option NEWVNGATE.  This option is
not enabled by default in any kernel config.

Presented and discussed on tech-kern with much input from
Bill Studenmund <wrstuden@netbsd.org> and YAMAMOTO Takashi <yamt@netbsd.org>.

Welcome to 4.99.9 (new vfs op vfs_suspendctl).
2007-01-19 14:49:08 +00:00
ad 606e323b3e Add sched_yield(). 2007-01-16 05:28:45 +00:00
mouse 8fb29141e0 Hook srt into the rest of the kernel build machinery, so it works to
just uncomment the pseudo-device line (which arguably should go into
other ports' GENERICs too, and at some point may).

OKed by perry.
2007-01-11 05:36:29 +00:00
cube bff757a269 Remove netiso/if_cons.c. It depends on x25 stuff that was removed a while
ago.

Obsolete option "TPCONS".
2007-01-11 00:00:41 +00:00
cube ecacf90d2f Remove stale config(5) entries for unexistent wl(4).
Ok'd by matt@.
2007-01-09 19:19:09 +00:00
cube ea085d876a Disable daic(4). The driver is not finished.
Ok'd by martin@.
2007-01-09 15:34:59 +00:00
cube 8c668f60b4 Add a lint-only value of "/dev/null" for ACPI_DSDT_FILE.
Bump required config(1) version.  Yes, it implies everybody will have to
rebuild config(1).  I can live with people hating me.
2007-01-09 13:41:30 +00:00
wiz ce3a98793f Welcome to 2007.
Don't forget to update copyright notices when you add new code.
2007-01-01 04:26:16 +00:00
tls aa99a9cd13 Add --param ssp-buffer-size=1 if USE_SSP as for userspace.
Add kern_exit_43.c to VARSTACK -- it isn't, really, but it causes an error
because it has a 0-element array on the stack and SSP always emits the
error that it is not protecting such a small array (ssp-buffer-size=0 is
not supported, so, really, it should not emit this error!).
2006-12-18 22:37:36 +00:00
bouyer 462dc620e3 Add mfi(4), a driver for LSI Logic & Dell MegaRAID SAS RAID controller.
Ported from OpenBSD, tested on i386 and amd64.
2006-12-17 22:57:14 +00:00
christos 64c377519a use -fstack-protector instead of -fstack-protector-all since this breaks
on amd64 (it works on sparc64).
2006-12-12 21:31:58 +00:00
martin bc950f0b4a Note section for m68k 2006-12-11 19:46:56 +00:00
yamt b0a14e5934 - remove a static configuration, FILEASSOC_NHOOKS. do it dynamically instead.
- make fileassoc_t a pointer and remove FILEASSOC_INVAL.
- clean up kern_fileassoc.c.  unify duplicated code.
- unexport fileassoc_init using RUN_ONCE(9).
- plug memory leaks in fileassoc_file_delete and fileassoc_table_delete.
- always call callbacks, regardless of the value of the associated data.

ok'ed by elad.
2006-12-11 15:24:27 +00:00
christos 3526467a3d there is no stack-protector for gcc3 2006-12-10 23:09:31 +00:00
macallan f2ee53a3d8 Enable the .note.netbsd section for macppc 2006-12-05 20:41:46 +00:00
skrll 7e7373acc9 Enable the .note.netbsd section for hppa. 2006-12-05 16:58:11 +00:00
martin 884e5dfbd6 Properly mark the .note.netbsd.ident section as ELF NOTE section.
While there, enable the mark for sparc64.
2006-12-05 16:15:53 +00:00
tls 53786c9e89 Add arch/xen/i386/gdt.c to list of kernel files that do variable-size
allocations on the stack.  This allocation could potentially be quite
large -- I am not sure how to best fix that.

Fixes USE_SSP i386 build.sh failure.
2006-12-03 01:45:57 +00:00
christos 5d02b2963e Enable NetBSD note on i386. Portmasters, please fix your ldscripts :-) 2006-12-02 04:48:34 +00:00
wiz 6919c6578c s/independant/independent/, from Zafer. 2006-11-24 22:04:21 +00:00
rpaulo 5423539f94 New EtherIP driver based on tap(4) and gif(4) by Hans Rosenfeld.
Notable changes:
	* Fixes PR 34268.
	* Separates the code from gif(4) (which is more cleaner).
	* Allows the usage of STP (Spanning Tree Protocol).
	* Removed EtherIP implementation from gif(4)/tap(4).

Some input from Christos.
2006-11-23 04:07:07 +00:00
elad a84fee7faf Initial implementation of PaX Segvguard (this is still work-in-progress,
it's just to get it out of my local tree).
2006-11-22 02:02:51 +00:00
christos 02b04bf496 add aic97xx.c to the varstack list. from shannonjr. 2006-11-15 23:09:53 +00:00
jnemeth daa80ec43e add another file to the VARSTACK list 2006-11-11 08:40:42 +00:00
christos a62de02966 Add SSP support.
XXX: This is broken for me right now, because my kernel resets after fxp0
is probed, but it could be some bug in the driver/compiler.
2006-11-11 02:12:53 +00:00
garbled bcb7c3b253 Add -Wextra -Wno-unused for prep. 2006-10-30 17:56:30 +00:00
christos 31a62606ea Merge kernel and userland rmd160 and sha2 implementation.
XXX: We still install rmd160.h and sha2.h in /usr/include/crypto, unlike
the other hash functions which get installed in /usr/include for compatibility.
2006-10-27 21:20:48 +00:00
thorpej 03e8889986 Insert a .WAIT between "depend" and "all" in the "dependall" target, so
that "make -j4 dependall" has the intended effect.
2006-10-26 05:10:55 +00:00
pooka bbceff78e8 add fs/puffs 2006-10-22 22:44:44 +00:00
pooka ce9afaf2f9 grab device number for puffs 2006-10-22 22:44:32 +00:00
martin f2df2d2b3b Sparc64 is -Wextra ready - but we are not sure where to go with __unused,
so add -Wno-unused-parameter for now.
Ok'd by christos.
2006-10-17 14:28:46 +00:00
christos 4d595fd7b1 - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
2006-10-12 01:30:41 +00:00
thorpej 31adc576d7 Add subroutines for maintaining object-specific data for arbitrary
subsystems, based on work by YAMAMOTO Takashi.  This is intended to
be used by other subsystems (such as the proc_*() or lwp_*() routines)
rather than directly by consumers.
2006-10-08 04:21:53 +00:00
christos 6565c53658 Add -Wextra -Wno-unused for i386. Portmasters, please check your ports
and make sure they compile with these flags.
2006-10-04 16:03:01 +00:00
gdamore 533076c8ff Go ahead and include files.spi. It is going to be used by my alchemy
commit and it appears to be harmless to other configs.  This is modeled
much like files.i2c.
2006-10-02 07:57:46 +00:00
manu 62e38c2a6a Restore twa as major 187, this time with the flag so that it does not get
used in kernels that do not include the driver.
2006-09-24 08:23:36 +00:00
jmcneill f135e0d607 Add "name" parameter to powerhook_establish, to aid debugging. No objections
on tech-kern@
2006-09-24 03:53:07 +00:00
manu 2a6884acfb Back out the twa device:
- if allocated in the MI range, it breaks the builds for ports that do
  not use it
- if allocated in the MD range, 3ware's tw_cli tool will break because it
  hardcodes the major
2006-09-24 03:46:30 +00:00
manu d4b92f5f7f Add a major for twa. The 3ware management tool has the major 187 hardcoded
for twa. Fortunately 187 is available.

The same tool hardcodes twe major at 146, which falls into the range
reserved to vendors...
2006-09-23 21:58:15 +00:00
matt ecaf18c847 Add AFLAGS+= ${AOPTS.${.IMPSRC:T}} 2006-09-11 03:12:48 +00:00
plunky 4f1cbddc12 update to bluetooth device attachment:
remove pseudo-device btdev(4) and inherent limitations

add bthub(4) which autoconfigures at bluetooth controllers as they
are enabled. bluetooth devices now attach here.

btdevctl(8) and its cache is updated to handle new semantics

etc/rc.d/btdevctl is updated to configure devices from a list
in /etc/bluetooth/btdevctl.conf
2006-09-10 15:45:55 +00:00
elad 5f7169ccb1 First take at security model abstraction.
- Add a few scopes to the kernel: system, network, and machdep.

- Add a few more actions/sub-actions (requests), and start using them as
  opposed to the KAUTH_GENERIC_ISSUSER place-holders.

- Introduce a basic set of listeners that implement our "traditional"
  security model, called "bsd44". This is the default (and only) model we
  have at the moment.

- Update all relevant documentation.

- Add some code and docs to help folks who want to actually use this stuff:

  * There's a sample overlay model, sitting on-top of "bsd44", for
    fast experimenting with tweaking just a subset of an existing model.

    This is pretty cool because it's *really* straightforward to do stuff
    you had to use ugly hacks for until now...

  * And of course, documentation describing how to do the above for quick
    reference, including code samples.

All of these changes were tested for regressions using a Python-based
testsuite that will be (I hope) available soon via pkgsrc. Information
about the tests, and how to write new ones, can be found on:

	http://kauth.linbsd.org/kauthwiki

NOTE FOR DEVELOPERS: *PLEASE* don't add any code that does any of the
following:

  - Uses a KAUTH_GENERIC_ISSUSER kauth(9) request,
  - Checks 'securelevel' directly,
  - Checks a uid/gid directly.

(or if you feel you have to, contact me first)

This is still work in progress; It's far from being done, but now it'll
be a lot easier.

Relevant mailing list threads:

http://mail-index.netbsd.org/tech-security/2006/01/25/0011.html
http://mail-index.netbsd.org/tech-security/2006/03/24/0001.html
http://mail-index.netbsd.org/tech-security/2006/04/18/0000.html
http://mail-index.netbsd.org/tech-security/2006/05/15/0000.html
http://mail-index.netbsd.org/tech-security/2006/08/01/0000.html
http://mail-index.netbsd.org/tech-security/2006/08/25/0000.html

Many thanks to YAMAMOTO Takashi, Matt Thomas, and Christos Zoulas for help
stablizing kauth(9).

Full credit for the regression tests, making sure these changes didn't break
anything, goes to Matt Fleming and Jaime Fournier.

Happy birthday Randi! :)
2006-09-08 20:58:56 +00:00
mrg baafcdbb23 make the bpendtsleep: label only active if KERN_SYNCH_BPENDTSLEEP_LABEL
is defined.  if this option is present in the Makefile CFLAGS and we are
using GCC4, build kern_synch.c with -fno-reorder-blocks, so that this
actually works.

XXX be nice if KERN_SYNCH_BPENDTSLEEP_LABEL was a normal 'defflag' option
XXX but for now take the easy way out and make it checkable in CFLAGS.
2006-09-07 18:41:28 +00:00
itohy cb2fb285ec Workbit NinjaATA-32 busmastering PIO IDE controller driver (njata)
This driver supports NinjaATA-32Bi and NPATA-32 chips,
which are used for CardBus ATA interface cards and
CardBus CompactFlash adapters.
2006-09-07 14:22:07 +00:00
itohy 0a30900857 Add PIOBM (busmastering transfer using ATA PIO mode) support.
The PIOBM is used by only one driver (will be added later,
stay tuned) and intruduce an attribute "ata_piobm" so that
it will be conditionally compiled in.
The "ata_dma" (busmastering transfer using ATA DMA mode) and
"ata_udma" (busmastering transfer using ATA Ultra DMA mode)
attributes are also added for consistency, but unused for now.
2006-09-07 12:34:41 +00:00
ad 44f6463cc4 Add /dev/lockstat. 2006-09-07 01:18:01 +00:00
uwe c7a7101b20 MI part of the Ricoh RS5C313 real time clock todr(9) driver.
Based on the code from landisk port.  With help from gdamore@
2006-09-07 01:12:00 +00:00
ad beafae096b Add the 'lockstat' driver, which collects basic information about lock events. 2006-09-07 00:20:28 +00:00
gdamore c583da0d13 Add MI implementation of inittodr, todr_attach, and resettodr.
This is triggered upon __HAVE_GENRIC_TODR in machine/types.h.  Conversion of
evbmips port forthcoming.
2006-09-02 20:18:00 +00:00
cube 3122ef59fe Revert my commit that made SYSTRACE depend on PTRACE, this is no longer
necessary.  Thanks, Matt.
2006-09-01 22:38:27 +00:00
dyoung 7ad81e35ff Remove an extraneous line that snuck into my previous commit. 2006-08-31 17:49:12 +00:00
dyoung 47be766fd3 Add a mode to gre(4) that sends GRE tunnel packets in UDP datagrams.
Fix MOBILE encapsulation.  Add many debugging printfs (mainly
concerning UDP mode).  Clean up the gre(4) code a bit.  Add the
capability to setup UDP tunnels to ifconfig.  Update documentation.

In UDP mode, gre(4) puts a GRE header onto transmitted packets,
and hands them to a UDP socket for transmission.  That is, the
encapsulation looks like this: IP+UDP+GRE+encapsulated packet.

There are two ways to set up a UDP tunnel.  One way is to tell the
source and destination IP+port to gre(4), and let gre(4) create
the socket.  The other way to create a UDP tunnel is for userland
to "delegate" a UDP socket to the kernel.
2006-08-31 17:46:16 +00:00
cube c7efdaf65b Make SYSTRACE depend on PTRACE because it uses process_domem(). 2006-08-30 14:07:09 +00:00
cube bd859bd3de Restore dependency on PTRACE for PROCFS.
Bump required config(1) version.
2006-08-30 13:49:27 +00:00
matt 583998d384 sys_process.c is also used by KTRACE. 2006-08-30 11:08:15 +00:00
matt 9e0ec4816e Make PTRACE and COREDUMP optional. Make the default (status quo) by putting
them in conf/std.
2006-08-29 23:34:48 +00:00
cube e7b8b95beb Require a config(1) supporting syntax version 20060604 now that we use
the "obsolete" statement.
2006-08-27 15:44:16 +00:00
simonb d4fec3837e Add -Wa,-fatal-warnings to AFLAGS. We want assembler warnings to be
fatal as well as compiler warnings.
Vague nods of agreement from Christos and Gimpy.
2006-08-27 06:49:27 +00:00
christos 9472fb0cb6 raid and ccd now use dk_lookup. 2006-08-27 04:58:06 +00:00
bjh21 2cd3c4f0e6 Move the sgimips "sbic" driver from arch/sgimips/hpc/sbic.c to
dev/ic/wd33c93.c.  This may not be the best WD33C93 driver we've
got, but it's the most recently worked on and probably the most
portable, so it seems like a good basis for further work (and in
particular an acorn26 driver for the Acorn SCSI card).  There's
no functional change in this commit, and sgimips kernels still
compile.
2006-08-26 22:06:36 +00:00
matt 6d292cb00b Remove support for netns and netccitt. For now, don't include files.netns
and files.netccitt.
2006-08-25 17:32:27 +00:00
dsl 5464d4dc61 Create a linker map file.
Very useful when trying to find out where recent 'bloat' has come from,
as well as giving exact details of what is actually in the kernel.
2006-08-24 21:23:40 +00:00
riz bbde6246b7 Back out revision 1.109 - it's NOT silly to parse the comment when
there's important information there.  Like, say, a _BETA extension.
2006-08-08 07:05:40 +00:00
pavel 8bf13164fe defflag PPPOE_SERVER and PPPOE_TERM_UNKNOWN_SESSIONS. 2006-08-05 17:20:54 +00:00
tron 4241fec1bf Bluetooth fixes by Iain Hibbert:
Change the way in which bluetooth devices attach to system. The
new way is for devices to attach directly to a btdevN device via
its own control file /dev/btdevN.
- bthub(4) is replaced by btdev(4).
- /dev/bthubctl is replaced by /dev/btdevN.
- configuration now uses proplib(3) property lists.
- btcontrol(8) updated to use new API, and now uses private
- XML config file /var/db/btdev.xml.
2006-07-26 10:30:59 +00:00
elad 9778bb7296 make veriexec.h be generated again; thanks cube@ 2006-07-25 18:04:03 +00:00
elad 5d611badde some fixes:
- adapt to NVERIEXEC in init_sysctl.c.
  - we now need "veriexec.h" for NVERIEXEC.
  - "opt_verified_exec.h" -> "opt_veriexec.h", and include it only where
    it is needed.
2006-07-24 16:37:28 +00:00
bouyer d252c65e9c Add a /dev/amr* control file for amr(4) devices, which allows sending raw
commands to the controller.
Add a amrctl(8) control tool, which for now only allows to get status
from the adapter (status of adapter, logical volumes and and individual
drives).
From FreeBSD, with some adjustements by Andrew Doran and me.
2006-07-23 12:01:25 +00:00
elad a92c1615a4 deprecate the VERIFIED_EXEC option; now we only need the pseudo-device to
enable it. while here, some config file tweaks.

tons of input from cube@ (thanks!) and okay blymn@.
2006-07-22 10:34:26 +00:00
elad b5d09ef065 okay, since there was no way to divide this to two commits, here it goes..
introduce fileassoc(9), a kernel interface for associating meta-data with
files using in-kernel memory. this is very similar to what we had in
veriexec till now, only abstracted so it can be used more easily by more
consumers.

this also prompted the redesign of the interface, making it work on vnodes
and mounts and not directly on devices and inodes. internally, we still
use file-id but that's gonna change soon... the interface will remain
consistent.

as a result, veriexec went under some heavy changes to conform to the new
interface. since we no longer use device numbers to identify file-systems,
the veriexec sysctl stuff changed too: kern.veriexec.count.dev_N is now
kern.veriexec.tableN.* where 'N' is NOT the device number but rather a
way to distinguish several mounts.

also worth noting is the plugging of unmount/delete operations
wrt/fileassoc and veriexec.

tons of input from yamt@, wrstuden@, martin@, and christos@.
2006-07-14 18:41:40 +00:00
gdamore 34537908ab Add an option COM_REGMAP to allow com(4) to use an array of register indices.
This allows us to convert aucom to just another com attachment, and cleanup
some code in the com_arbus.c.

Additionally, we use a common com_cleanup routine rather than having a
zillion copies of it in the attachment points.

This has been tested on a number architectures, and it has been shown to get
close to comparable performance when COM_REGMAP is defined, and comparable
when it is not defined.

Approved by core@.  Fixes PR port-evbmips/32362.
2006-07-13 22:56:00 +00:00
martin 9adca95023 COMPAT_SUNOS* uses COMPAT_30 getfh too 2006-07-13 17:39:47 +00:00
martin 508a062fec Make freebsd_sys_getfh use compat_30_sys_getfh 2006-07-13 16:28:38 +00:00
mlelstv 8261b32756 move and renumber bthub major to avoid conflicts with other archs 2006-07-09 18:56:35 +00:00
chap 710af63468 Ankh-Morpork, we have a MIDI driver....
Merge from chap-midi branch, after
~month for review
Comments by thorpej@ drochner@ and Alexandre Ratchov

Incorporated: points by thorpej@ drochner@; preliminary support for
a stats-collecting ioctl suggested by martin@ from comments by A.R.

PR kern/32441 kern/32442 kern/32567 kern/32588 kern/32694 kern/33590
kern/33614 and one instance of kern/32651

ok martin@
2006-06-30 13:56:25 +00:00
drochner eff818776d add some common code to support the ACPI power management timer
independly of ACPI
2006-06-26 16:13:21 +00:00
yamt bc4977819f 1. implement solaris-like vmem. (still primitive, though)
2. implement solaris-like kmem_alloc/free api, using #1.
   (note: this implementation is backed by kernel_map, thus can't be
   used from interrupt context.)
2006-06-25 08:00:01 +00:00
gdamore a5c89047c0 Initial import of bluetooth stack on behalf of Iain Hibbert. (plunky@,
NetBSD Foundation Membership still pending.)  This stack was written by
Iain under sponsorship from Itronix Inc.

The stack includes support for rfcomm networking (networking via your
bluetooth enabled cell phone), hid devices (keyboards/mice), and headsets.

Drivers for both PCMCIA and USB bluetooth controllers are included.
2006-06-19 15:44:33 +00:00
kardel de4337ab21 merge FreeBSD timecounters from branch simonb-timecounters
- struct timeval time is gone
  time.tv_sec -> time_second
- struct timeval mono_time is gone
  mono_time.tv_sec -> time_uptime
- access to time via
	{get,}{micro,nano,bin}time()
	get* versions are fast but less precise
- support NTP nanokernel implementation (NTP API 4)
- further reading:
  Timecounter Paper: http://phk.freebsd.dk/pubs/timecounter.pdf
  NTP Nanokernel: http://www.eecis.udel.edu/~mills/ntp/html/kern.html
2006-06-07 22:33:33 +00:00
rpaulo d83bbab446 Fix a comment for ral. 2006-06-07 15:24:12 +00:00
martin 77947573d1 Now that rt2661.c uses firmware_*, ral needs attribute firmload. 2006-06-07 12:51:40 +00:00
dogcow 43d83b7844 add the dev/ic/ files for ral(4). 2006-06-07 08:06:56 +00:00
mrg db19e89e04 remove support for building (with) GCC 2.95. also:
- always install <stdbool.h>
- don't generate a fake one for vax / gettext.
2006-06-02 22:16:18 +00:00
martin b59e36a073 Move definition of the 'fb' attribute to global scope and make machfb@pci
require it. On most archs this does not change anything, but on sparc{,64}
it allows linking of kernels that have machfb as the only framebuffer.
Solution suggested by Quentin.
2006-05-28 08:57:53 +00:00
yamt c24f70bcad move wait points for kva from upper layers to vm_map. PR/33185 #1.
XXX there is a concern about interaction with kva fragmentation.
see: http://mail-index.NetBSD.org/tech-kern/2006/05/11/0000.html
2006-05-25 14:27:28 +00:00
christos ce07c2d219 it is attributes no attribute 2006-05-21 05:49:54 +00:00
christos a4d71852e0 Put back -Wno-attribute for now since not all archs have been fixed. 2006-05-21 04:53:23 +00:00
christos a58b86d582 Don't use -Wno-attributes for gcc4. All the code has been fixed and it will
just hide bugs.
2006-05-20 00:47:27 +00:00
liamjfoy 4876c304b1 Integrate Common Address Redundancy Procotol (CARP) from OpenBSD
'pseudo-device	carp'

Thanks to: joerg@ christos@ riz@ and others who tested
Ok: core@
2006-05-18 09:05:49 +00:00
elad 04d63f90b5 Introduce PaX MPROTECT -- mprotect(2) restrictions used to strengthen
W^X mappings.

Disabled by default.

First proposed in:

	http://mail-index.netbsd.org/tech-security/2005/12/18/0000.html

More information in:

	http://pax.grsecurity.net/docs/mprotect.txt

Read relevant parts of options(4) and sysctl(3) before using!

Lots of thanks to the PaX author and Matt Thomas.
2006-05-16 00:08:24 +00:00
elad 874fef3711 integrate kauth. 2006-05-14 21:19:33 +00:00
rpaulo 2134afa7ad By popular demand, this should be done by config(1). 2006-05-12 20:39:39 +00:00
mrg efb8c0c93f if GCC>3:
- add -Wno-attributes -Wno-pointer-sign to CWARNFLAGS.
- add -fno-strict-aliasing to CFLAGS [*]

our kernel again needs a bunch of work for this to be enabled.
2006-05-11 17:21:38 +00:00
thorpej 621d724145 Remove the obsolete (and now unused) propdb API. 2006-05-05 18:26:19 +00:00
rpaulo de8db47547 Add support for RFC 3542 Adv. Socket API for IPv6 (which obsoletes 2292).
* RFC 3542 isn't binary compatible with RFC 2292.
* RFC 2292 support is on by default but can be disabled.
* update ping6, telnet and traceroute6 to the new API.

From the KAME project (www.kame.net).
Reviewed by core.
2006-05-05 00:03:21 +00:00
thorpej fbade90aaa Also search for headers in common/include 2006-04-28 03:40:15 +00:00