Commit Graph

87077 Commits

Author SHA1 Message Date
xtraeme 91829be711 There's no need to use MSR_CPU_BROADCAST_READ in clockmod_getstate(),
because clockmod_setstate() will do it for us.
2007-03-21 05:27:49 +00:00
isaki 59684b33a0 Make it compilable with DEBUG. 2007-03-21 05:15:50 +00:00
dan ce901237e7 teach bce(4) about being an rnd(4) source 2007-03-21 04:56:39 +00:00
jmcneill ad0dc10411 Try not to free NULL pointers. 2007-03-21 04:52:14 +00:00
xtraeme 00974998e3 Use the CPUID2STEPPING macro. 2007-03-21 04:17:59 +00:00
garbled cfa6e1cb25 Add a read entry point to this driver. There are two minor devices
associated with this, 0, the nvram device, and now 1, the residual
device.  The devices allow the user to directly read the contents of the
kernel copy of the nvram, and the residual data respectively.  There is
no provision for write.
2007-03-21 04:13:53 +00:00
xtraeme 5da15c6409 Do not use cpu_id and cpu_feature, they are not available for i386
(or have different types), use CPUID.
2007-03-21 04:01:59 +00:00
xtraeme feef686ef0 Fix previous, use %zd. 2007-03-21 03:22:16 +00:00
dyoung be7bb25d74 Make all debug messages use GRE_DPRINTF(). Get rid of a redundant
if_ierrors++.  Change (type *)0 to NULL.  Get rid of unnecessary
casts to void *.
2007-03-21 03:18:08 +00:00
macallan fb308a7a59 - pass a sane boundary parameter to bus_dmamem_alloc
- sprinkle aprint_error()
2007-03-21 03:10:31 +00:00
macallan ea7f3505eb we return addresses, not page numbers in *mmap() methods 2007-03-21 02:11:44 +00:00
dyoung 271d77fa58 If we do not recognize the protocol of a received packet, then
increase ifi_noproto.  If the GRE header contains routing options,
increase the input-error count, ifi_ierrors.

While I am here, make some cosmetic changes: remove unnecessary
'proto' argument from gre_input3().  Shorten some staircases.
2007-03-21 01:56:05 +00:00
garbled bbcca898c4 Add a second check to the prep-pci-intrmap test, to make sure the dictionary
actually contains entries.  It is apparently possible to get a non-null,
but empty dictionary back.  This seems to happen if you inject a ppb-card
on pci0 when you also have a prep pci1 at a later device function.  With
this, my fxp card works in any slot on my 7043-140.
2007-03-21 01:34:32 +00:00
xtraeme 545c3b7ca9 Don't build msr_ipifuncs on Xen, fixes the build with XEN2_DOM0. 2007-03-21 00:16:52 +00:00
ad e0fd341348 Changes to LWP wakeup:
- Don't bother sorting the sleep queues, since user space controls the
  order of removal.
- Change setrunnable(t) to lwp_unsleep(t). No functional change from the
  perspective of user applications.
- Minor cosmetic changes.
2007-03-20 23:25:17 +00:00
macallan bbd6f83b09 fix a bunch of #include statements to make radeondrm and mach64drm compile 2007-03-20 22:12:14 +00:00
xtraeme d59b97695d Erm, remove a local change committed accidentally in previous. 2007-03-20 21:30:27 +00:00
xtraeme 739956e2de ALL: Enable INTEL_ONDEMAND_CLOCKMOD.
GENERIC: Add INTEL_ONDEMAND_CLOCKMOD disabled by default.
2007-03-20 21:29:28 +00:00
xtraeme 28050fc1b5 Driver for Intel Thermal Monitor (feature TM) On-Demand Clock
Modulation.

This works by changing the duty cycle of the clock modulation,
and saves power and helps to not increase the temperature by
software.

Adapted from OpenBSD/FreeBSD's p4tcc.

To enable it one must use "options INTEL_ONDEMAND_CLOCKMOD".

Tested by me in UP and SMP, ok'ed by Matthew R. Green.
2007-03-20 21:22:03 +00:00
xtraeme 4b852b5e23 Use the new MSR IPI handlers to make it work properly with SMP. 2007-03-20 21:13:06 +00:00
xtraeme b803090b66 Use the new MSR IPI handlers to make it work properly with SMP.
Tested by Daniel Carosone and Michael Van Elst.
2007-03-20 21:12:22 +00:00
xtraeme 32b7185652 MSR read and write IPI handlers for x86. A MSR will be read or written
in all CPUs available in the system. This adds another member
to struct cpu_info, ci_msr_rvalue; it will contain the value of the MSR
in a previous operation.

Tested with clockmod in UP and SMP by me, tested with est in SMP
by Daniel Carosone and Michael Van Elst.

Ok'ed by Andrew Doran and Matthew R. Green.
2007-03-20 21:07:38 +00:00
plunky ac2ed142c1 discard inbound packets if the channel is not open 2007-03-20 20:25:24 +00:00
pooka 2bddbed0e0 export puffs version of namei ISLASTCN macro to userspace 2007-03-20 18:28:49 +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
garbled f8ef9d1431 Add the slide device, and the special PCIIDE_SLIDE_SETIRQA option to set
the irq up properly for a RAVEN.  (So far, the only prep machines that
seem to have these chips are RAVEN's, so we should be ok here)
2007-03-20 17:20:59 +00:00
garbled 8e09750d58 The motorola RAVEN is both a pchb and an MPIC. Block out the pci
configuration of it's mem area to keep the PIC available.
2007-03-20 17:16:33 +00:00
drochner a6fee167b2 allocate chracter dev major #180 for drm 2007-03-20 16:37:12 +00:00
tsutsui 251bb51bf0 Fix shadowed declaration warning. 2007-03-20 11:39:34 +00:00
tsutsui c55df5782d Pass an ipl argument to pool_init/POOL_INIT to be used when initializing
the pool's lock.
2007-03-20 11:27:48 +00:00
njoly 226b6c843f Add ktrace I/O support to netbsd32_ioctl() syscall.
Reviewed by cube.
2007-03-20 11:02:18 +00:00
pooka 8d9c021816 * rework the page cache interaction a bit: cache metadata in the
kernel and flush it out all at once instead of continuous updating
* add support for delivering notifications to the file server about
  when a page was written to (but disabled by default for now).  the
  file server can use this to request flushing or invalidating the
  kernel page cache
2007-03-20 10:21:58 +00:00
tsutsui d60cbb92f9 Prepare sc_rtl8201l flag in softc and use it in rlphy_status() so that
we don't have to check device names of device_parent(). From FreeBSD.
2007-03-20 10:17:18 +00:00
dyoung 8db8860cb3 Add an example kernel configuration for the RouterBOARD 153.
XXX This is a fairly specialized configuration that I use for a
XXX wireless router.
2007-03-20 09:22:01 +00:00
cube e80df1a6aa Typo. Reported by martin. 2007-03-20 09:11:04 +00:00
dyoung 5451083ef2 Comment out admflash, I have not supplied a source file for that,
yet.
2007-03-20 08:55:43 +00:00
dyoung 320845dda2 Add a port to the Infineon ADM5120.
Basics: the ADM5120 is a 175 MHz MIPS32 4Kc processor featuring a
6-port ethernet 10/100 switch with Auto MDI/X, a PCI controller,
USB 1.1 controller, UART, watchdog timer, eight GPIO pins, and a
multiport memory controller with both NOR and NAND flash support.
This code supports most of the devices on the ADM5120, including
the 6-port switch (each port attaches as an ethernet, admsw0 through
admsw5), the PCI controller, USB controller, GPIO, watchdog, and
UART.

Remaining work: the port includes no NOR/NAND flash drivers.  No
bootloader is included.  I have only tested the PCI bus driver with
the use of one PCI slot on the RouterBOARD 153.  It is not possible
to exploit the capabilities of the ethernet switch using bridge(4).
I have only netbooted the ADM5120 on the RB153.  Booting other
boards, and booting from flash memory, remains to be done.

Hardware availability: many low-cost routers, including the
RouterBOARD 100 series at RouterBOARD.com, use the Infineon ADM5120
processor.

Credits: Ruslan Ermilov and Vsevolod Lobko ported to the ADM5120,
and they wrote device drivers for the UART, USB controller, and
10/100 switch.  Matt Isaacs brought the port up-to-date with
NetBSD-current, made it compile, and ran it first on the RB153.
I added drivers for the PCI controller, GPIO, and watchdog timer.
I produced the bus attachment for the CompactFlash slot with advice
from Mikrotik technical support and from Matt Thomas.
2007-03-20 08:52:00 +00:00
cube e8beebe1e2 More SCARG_P32 fallout. 2007-03-20 08:25:37 +00:00
cube 35a0a309fb Fix typo. Reported by martin. 2007-03-20 08:12:42 +00:00
garbled a23808d635 Special case the MTX604 and other RAVEN based machines to not attach
wdc@pnpbus.
2007-03-20 05:58:40 +00:00
garbled 6f633e2b65 Put a small hack in slide.c disabled by default. PCIIDE_SLIDE_SETIRQA. This
sets IDE_IRQA in the IDE Control/Status Register.  This is needed on prep
machines with Motorola RAVEN host bridges, as they wire up the ide device
oddly.
2007-03-20 05:50:35 +00:00
kent 5deb14ad9d readable mixer item names for AD1981HD 2007-03-19 16:27:00 +00:00
drochner 4d1d1f005b fix variable in DEBUG code, from Lubomir Kundrak per PR kern/36036 2007-03-19 14:02:56 +00:00
tsutsui af7a0c1731 Prepare rlphy_reset() and set BMCR_AUTOEN in it.
This makes autonegotiation on rlphy(4) at re(4)
on landisk (8139C+) select 100baseTX full-duplex
at boot time (before first ifconfig) properly,
and there is no bad side effect on rlphy(4) at nfe(4).

This may also fix PR kern/34109.
2007-03-19 12:23:30 +00:00
njoly f408971232 Fix TIOCGPTN ioctl.
Do not use sysioctl() directly, but netbsd32_ioctl() instead.
2007-03-19 10:16:46 +00:00
dillo 0fb2977031 args.path is in UIO_USERSPACE too.
Fixes statvfs on macppc and PR kern/36012.
Thanks to Magnus Henoch for testing.
2007-03-19 09:16:22 +00:00
xtraeme 0d40da510d typo. 2007-03-18 22:36:11 +00:00
dsl d364d308c7 Change all the NETBSD32PTR64(SCARG(uap, xxx))) to SCARG_P32(uap, xxx). 2007-03-18 21:38:32 +00:00
dyoung cafee584b5 KNF: compare pointers with NULL instead of 0, and do not "test
truth" of either integers or pointers, so that it's clear
     what's going on.  Remove superfluous () from return statements.
     bcmp -> memcmp, bcopy -> memcpy.

Misc. cosmetic: join some lines, remove a few empty lines, remove
spaces from type casts.  Don't open-code IFNET_FOREACH().  Shorten
some staircases.
2007-03-18 20:59:38 +00:00
uwe f54c2e5ccf Don't do curupte checks if the miss address is in user space. 2007-03-18 20:18:36 +00:00
dyoung 912b6eb53e The departure of IPv6 interfaces does not agree with pf. The pfil
hooks that signal the interface's departure run before IPv6 sends
messages to indicate that it is leaving its multicast groups; when
pf filters the departure messages, it does not recognize the output
interface, so it complains at the departure of gre65, for example:

pf_test6: kif == NULL, if_xname gre65

I have changed if_detach() so that it calls pr_usrreq(PRU_PURGEIF)
before pfil_run_hooks(PFIL_IFNET_DETACH), instead of the other way
around.  That quiets the pf_test6: messages.
2007-03-18 20:05:52 +00:00
jdc d77557d8c3 Add USB support (for the Javastation Espresso). 2007-03-18 17:29:56 +00:00
xtraeme 5dbf7fbdf5 Forgot to initialize cstate, make it global and static. Fixes
build problem with the LKM.
2007-03-18 14:30:54 +00:00
kent 3e124ca34a don't make a mixer item for a power widget 2007-03-18 14:16:00 +00:00
kent 371c325530 correct the DAC group definition for AD1988.
reported by wiz
2007-03-18 11:49:21 +00:00
xtraeme 0959735d30 Fix previous, sync prototypes and missing curcpu(). 2007-03-18 07:56:01 +00:00
xtraeme 90872da93f Don't write same code when there's an error, just use the goto
statement.
2007-03-18 07:40:29 +00:00
xtraeme 4c6e4fcf9b Sync with est.c, est_init does not take any argument now. Just use
curcpu().
2007-03-18 07:28:37 +00:00
xtraeme 3599c78870 Fix mem leak in k8_powernow_destroy, when it's called multiple times.
Found by mrg@.

Also, make sure they have data before trying to free them.
2007-03-18 07:23:53 +00:00
xtraeme efd5228a6f There's no need to run est_init or k8_powernow_init on each CPU.
Just run it once (in the first cpu probed) with the RUN_ONCE(9)
framework.

Change the argument of est_init and k8_powernow_init to void, we don't
need cpu_info * anymore.

Suggested by tls@ and mrg@.
2007-03-18 07:21:40 +00:00
xtraeme 5ec1f7a202 Change k8_powernow_init to accept a struct cpu_info * as argument,
so that in the informative messages it prints the correct cpu
and not curcpu().

This fixes the first part of PR kern/35676.
2007-03-18 04:41:03 +00:00
uwe 911335e303 Shave off few instructions when doing ldtlb. 2007-03-17 17:23:31 +00:00
tsutsui 3f372aff43 Fix compile errors in the previous:
- include <sys/filedesc.h> for do_sys_stat()
- include <sys/namei.h> for FOLLOW and NOFOLLOW
- add missing semicolons
- fix typos
2007-03-17 17:02:44 +00:00
uwe 62f5ccf3c2 Cosmetic - fix local label name to match the name of the var it refers. 2007-03-17 14:23:07 +00:00
uwe 2e7cdeb33d Don't hijack COPTS to specify cpu type, we have CPUTYPE for that.
Provide a commented out example of a useful COPTS setting.
2007-03-17 14:19:39 +00:00
msaitoh 548cdc0050 s/intialized/initialized/ 2007-03-17 13:51:46 +00:00
tsutsui 40b782670f Use char * where pointer arithmetics are required. 2007-03-17 11:45:21 +00:00
dyoung 2ee6d07aca Regen. 2007-03-17 06:44:31 +00:00
dyoung 67e99bd532 Add Infineon ADM5120 PCI host bridge. 2007-03-17 06:43:52 +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
dyoung 72d41408ef bcopy -> memcpy, bcmp -> memcmp.
Don't open-code LIST_FOREACH().
2007-03-17 06:36:05 +00:00
tsutsui 752b5779eb Use (char *) on pointer arithmetic. (I forgot to commit this one) 2007-03-17 06:34:25 +00:00
dyoung 95b277379f In nd6_rtrequest(), when we lookup/create a route whose destination
is equal to one of the host's IPv6 addresses, do not stop at setting
the route's interface to lo0, but also clear the route's RTF_CLONED
flag, if it is present, so that ip6_input() will accept packets
sent to that destination.  This is necessary because ip6_input()
will not accept a packet if it looks up the packet's destination
and finds a route with RTF_CLONED set.

I believe this will help IPv6 networking survive '/etc/rc.d/network
restart'.  See the problem report, kern/33279.
2007-03-17 06:32:46 +00:00
uwe cfeed1498f sh3_switch_setup: make md_upte[] map uarea pages in reverse order so
that mapping for the bottom of the stack (practically the only page we
ever touch) is found on earlier iterations through md_upte[] in the
tlb miss handler.
2007-03-17 00:56:46 +00:00
matt 125090f30f Remove errant debug line. 2007-03-17 00:11:03 +00:00
dsl 803fec88b2 Use NETBSD32PTR64() and NETBSD32PTR32() throughout. 2007-03-16 22:23:30 +00:00
dsl a065e51621 remove all the double (and triple) casts used to convert 32bit userspace
pointers to and from 64bit kernel pointers.  Instead use the defines
NETBSD32PTR64(p32) to read a 32bit pointer and (the new) NETBSD32PTR32(p32,p64)
to write a 32bit pointer throughout.
The 32bit pointer is now a struct to enforce the above.
amd64 (with linux emul) and sparc64 will both compile (when the arch stuff
goes in soon), and amd64 still runs some i386 binaries.
2007-03-16 22:21:40 +00:00
xtraeme 868ef0036d struct cpu_info: add a ci_feature2_flags member.
identcpu: print extended cpuid features with ci_feature2_flags.

"Looks good" by christos and njoly.
2007-03-16 18:52:03 +00:00
tsutsui ecde337fba Bump MAXBSIZE to 0x4000 because 16KB could be used by default
on newfs(8) in these days and we'll get "buf mem pool index 5" panic
in sys/kern/vfs_bio.c.
2007-03-16 18:39:21 +00:00
uwe a4c73117e3 Cosmetic changes in {sh3,sh4}_switch_setup to make them easier to read.
Same object code is generated.
2007-03-16 18:31:36 +00:00
tsutsui 2f7615dcc1 Fix compile with options DIAGNOSTIC.
(Hmm, no one has tried it since nathanw_sa merge..)
2007-03-16 18:29:35 +00:00
uwe 66f80b8d65 There's no sense in duplicating function prototype in preceding comments.
While here, make ANSI'fy idle() definition.
2007-03-16 18:20:40 +00:00
tsutsui ba9ffe28c4 Pass proper args to ksyms_init(). 2007-03-16 12:12:14 +00:00
skrll 108c9e1aa3 Move a comment and correct a typo. 2007-03-16 08:02:49 +00:00
xtraeme 83cb0f0a96 Remove __P(), remove k8_powernow_init proto... it was moved to
x86/include/powernow.h long time ago.
2007-03-16 06:20:36 +00:00
ober 9a950d3d87 Updating GENERIC to include bpfilter to allow dhclient to work.
Also enable LFS which appears to work well so far.
2007-03-16 04:44:12 +00:00
uwe ee31aeeb82 Use dt to loop over md_upte in sh3_vector_tlbmiss. Saves a few instructions. 2007-03-16 04:22:22 +00:00
uwe 7233c378a1 Comment proc_trampoline properly. 2007-03-16 02:27:16 +00:00
uwe c67ce65c70 L_MD_PCB and L_MD_UPTE are small enough to be used as immediate values. 2007-03-16 01:30:56 +00:00
dyoung ab751193cc Don't open-code TAILQ_FOREACH(). KNF: Fix K&R prototypes and
parameter-type declarations.
2007-03-15 23:39:51 +00:00
dyoung 833cc39940 In nd6_lookup, shorten a staircase. KNF: change return (expr); to
return expr; throughout.  Fix K&R prototypes and parameter type
declarations.
2007-03-15 23:35:25 +00:00
dyoung f1c68f17f4 Bark if we cannot assign a link-local address. While I am here,
fix the grammar in a comment.
2007-03-15 23:26:04 +00:00
dyoung e75050de27 KNF: compare pointer w/ NULL, don't "check truth". Fix K&R parameter
types declaration.
2007-03-15 23:22:30 +00:00
uwe 1edd00232c Comment sh3_vector_tlbmiss. Same object code is generated. 2007-03-15 23:13:59 +00:00
skrll 335ac44f76 Restore previous semantics of PT_LWPINFO and make sure to lwp_addref the
LWP.

OK'ed by ad.
2007-03-15 20:55:15 +00:00
plunky 298d20388c remove C++ style comments 2007-03-15 19:47:50 +00:00
dogcow 0bb5e8a5a4 Comment out VGA_RASTEROPS; even the fine manpage says that it's deprecated
in favor of wscons(4).
2007-03-15 17:06:17 +00:00
dogcow d515e7b784 Some delicious copypasta from sys/dev/ic/vga.c, so that unichromefb will
compile (and possibly work) when option VGA_RASTERCONSOLE is present.
2007-03-15 16:58:36 +00:00
ad 1b83cbc3d6 sodopendfreel: Getting a bit over ambitious.. Go to splvm() before calling
pool_cache_put().
2007-03-15 16:28:31 +00:00
drochner 82d96e1fac Keep track of the per-port status change notifications coming in
through the interrupt pipe; during exploration check only the ports
where we got such a notification. This speeds up things.
(I believe we should go a step further and use a thread per hub
instead of per bus. If power management gets implemented, we should
be able to react quickly on a resume event.)
Try to simplify the logics in the explore function a bit. (The reattach
thing was hacked in badly, not sure whether I broke it. Only used
by if_atu.)
Clean up some dead code.
2007-03-15 15:29:09 +00:00