Commit Graph

2378 Commits

Author SHA1 Message Date
xtraeme
6897610c87 Disable monitoring in the Integer sensors, they are just informative
and shouldn't need it anyway.
2007-07-16 17:57:41 +00:00
ad
88ab7da936 Merge some of the less invasive changes from the vmlocking branch:
- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
2007-07-09 20:51:58 +00:00
pooka
0bc323f5cd Initialize the link context in a signal frame to the receiving lwp's
link context instead of NULL.  Otherwise, if we got a signal while the
lwp had a link context set, the link context would be set to NULL upon
return from signal delivery.

christos@tech-kern: "I think you are right."
2007-07-08 10:19:21 +00:00
tsutsui
6a8a584d1a Remove leftover netns stuff. 2007-07-07 05:13:14 +00:00
martin
a698ff2d49 A few nits for 32bit SMP kernels, noticed by mrg.
While there, simplify the fpstate IPIs a bit.
2007-07-06 07:36:46 +00:00
martin
43ebaf27df sparc64_ipi_save_fpstate is not a leaf function - create a full grown
stack frame.
2007-07-05 20:21:11 +00:00
xtraeme
19b01fa46a Use PSWITCH_EVENT_{PRESSED,RELEASED} for consistency with other drivers
using the sysmon_power framework.
2007-07-01 20:01:44 +00:00
xtraeme
da3f163bd2 Imported envsys 2, a brief description of the new features:
(Part 2: drivers)

* Support for detachable sensors.
* Cleaned up the API for simplicity and efficiency.
* Ability to send capacity/critical/warning events to powerd(8).
* Adapted all the code to the new locking order.
* Compatibility with the old envsys API: the ENVSYS_GTREINFO
  and ENVSYS_GTREDATA ioctl(2)s are supported.
* Added support for a 'dictionary based communication channel' between
  sysmon_power(9) and powerd(8), that means there is no 32 bytes event
  size restriction anymore.
* Binary compatibility with old envstat(8) and powerd(8) via COMPAT_40.
* All drivers with the n^2 gtredata bug were fixed, PR kern/36226.

Tested by:

blymn: smsc(4).
bouyer: ipmi(4), mfi(4).
kefren: ug(4).
njoly: viaenv(4), adt7463.c.
riz: owtemp(4).
xtraeme: acpiacad(4), acpibat(4), acpitz(4), aiboost(4), it(4), lm(4).
2007-07-01 07:37:12 +00:00
dyoung
1ee8f4a418 Extract common code from i386, xen, and sparc64, creating
config_handle_wedges() and read_disk_sectors().  On x86, handle_wedges()
is a thin wrapper for config_handle_wedges().  Share opendisk()
across architectures.

Add kernel code in support of specifying a root partition by wedge
name.  E.g., root specifications "wedge:wd0a", "wedge:David's Root
Volume" are possible.  (Patches for config(1) coming soon.)

In support of moving disks between architectures (esp. i386 <->
evbmips), I've written a routine convertdisklabel() that ensures
that the raw partition is at RAW_DISK by following these steps:

        0 If we have read a disklabel that has a RAW_PART with
          p_offset == 0 and p_size != 0, then use that raw partition.

        1 If we have read a disklabel that has both partitions 'c'
          and 'd', and RAW_PART has p_offset != 0 or p_size == 0,
          but the other partition is suitable for a raw partition
          (p_offset == 0, p_size != 0), then swap the two partitions
          and use the new raw partition.

        2 If the architecture's raw partition is 'd', and if there
          is no partition 'd', but there is a partition 'c' that
          is suitable for a raw partition, then copy partition 'c'
          to partition 'd'.

        3 Determine the drive's last sector, using either the
          d_secperunit the drive reported, or by guessing (0x1fffffff).
          If we cannot read the drive's last sector, then fail.

        4 If we have read a disklabel that has no partition slot
          RAW_PART, then create a partition RAW_PART.  Make it span
          the whole drive.

        5 If there are fewer than MAXPARTITIONS partitions,
          then "slide" the unsuitable raw partition RAW_PART, and
          subsequent partitions, into partition slots RAW_PART+1
          and subsequent slots.  Create a raw partition at RAW_PART.
          Make it span the whole drive.

The convertdisklabel() procedure can probably stand to be simplified,
but it ought to deal with all but an extraordinarily broken disklabel,
now.

i386: compiled and tested, sparc64: compiled, evbmips: compiled.
2007-06-24 01:43:34 +00:00
kiyohara
1b20b9d6d5 zyd was known to not work on big endian systems. 2007-06-11 13:39:22 +00:00
kiyohara
8f6cd34a62 Add zyd(4). 2007-06-09 11:34:01 +00:00
dyoung
d44c1c6985 Remove redundant TAGS rule and variable assignments. 2007-06-09 01:34:05 +00:00
dyoung
6683efbb1f Make the 'tags' target work. 2007-06-08 22:59:51 +00:00
martin
c2534a819b Add pseudo-device agr to all GENERIC kernels where it might make sense
(commented out in some).
2007-06-04 08:55:18 +00:00
chs
243f294f4f instead of specifying the start of the data section in the makefile,
just round it up to the next 4MB boundary in the ldscript.
this prevents parts of the kernel-image range from being left unmapped.
fixes PR 36388.
2007-06-04 04:53:44 +00:00
mrg
b4ff11c2dd fix some NOTDEF_DEBUG code. 2007-05-28 21:52:49 +00:00
mrg
8f8cea5c68 clean up cpu_switchto() a little - no need to flushw or membar
excessively.  optimise an rdpr.  tested by tnn.
2007-05-28 20:09:50 +00:00
martin
95f43235b7 remove some debugging printfs for the MULTIPROCESSOR case 2007-05-25 12:42:07 +00:00
martin
dad9937fa5 In pmap_kenter_pa honour VM_PROT_EXECUTE - otherwise LKMs are not mapped
executable.
Fixes PR port-sparc64/36376.
2007-05-23 09:36:22 +00:00
martin
48290fcae6 Fix a stupid bug in the save_fpstate ipi, which caused overwriting of
struct lwp of the lwp owning the fpu. Fix clearing the fplwp - %o0 will
not survive the call to savefpstate - duh!
2007-05-23 08:16:43 +00:00
martin
6b07dc2e73 In cpu_hatch() set curlwp to the idlelwp.
While here, remove a few debug printfs we no longer need.
2007-05-22 15:44:06 +00:00
martin
12a2d1610a Simplify tf_tstate setting when leaving for userland initially - I seem
to have confused the if with the else case of the previous C code.
Funny that it worked at all.
2007-05-20 21:51:01 +00:00
martin
b09a59d4a8 cpu_switchto() has to return it's first arg, always. This differs from
my reading of the documentation, but helps in the real world and seems
to be what other ports do.
2007-05-20 20:28:02 +00:00
martin
b52e09dc19 Remove special case handling for userland lwps from cpu_lwp_fork, instead
do it in lwp_trampoline when we first return to userland.
2007-05-20 19:18:15 +00:00
martin
9a8848720e cpu_idle is a leaf function, so we better "return from leaf".
Use return value from cpu_switchto for previous lwp in lwp_trampoline.
Also shamelessly steal a comment from uwe written for sparc that explains
all this.
Thanks to tnn, mrg, and uwe for helping to debug this.
2007-05-19 23:27:42 +00:00
martin
ca7f1b27f4 No need to pass "old lwp" to lwp_trampoline - we'll get it as return
value from cpu_swithchto() once the lwp gets scheduled for the first
time.
2007-05-19 23:25:54 +00:00
martin
745a13751c page_idle_zero is now checked in MI code 2007-05-19 22:10:39 +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
tnn
a1ab0c29a3 Define microvoltage scale factor which was previously a magic constant. 2007-05-02 11:40:44 +00:00
tnn
88ed5f6036 We can't support them in a clean way, but still note the bus addresses
of the disk failure LEDs.
2007-04-18 14:49:44 +00:00
tnn
368b74aabf Correct envsys ranges. From njoly@ 2007-04-15 12:38:09 +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
macallan
43b2c2b989 include files.wsfb 2007-04-10 02:50:32 +00:00
tnn
02ade499f6 pci_find_ino(): Use interrupt pin from pci_attach_args when mapping interrupts.
Use *ihp as a pure output. Fix case where interrupt pin #D was incorrectly
mapped. Some cosmetic changes while here. Ok'd by martin.
2007-04-04 11:04:33 +00:00
hannken
3b5501efa7 Cleanup last by using a "n"umeric address space identifier.
Ok: Martin Husemann <martin@netbsd.org>
2007-03-31 13:04:21 +00:00
martin
a63279589c When invalidating a context, make sure to flush user windows upfront.
Do not set the DMMU secondary context to 0 (that would be kernel), and
add a few required membars after switching the secondary dmmu context.

This avoids SIRs caused by double kernel_data_faults, caused by spills
of obsolete user windows after the context for that user pmap is gone.
2007-03-30 21:14:13 +00:00
jnemeth
45ed5307a6 fix a couple of syntax issues in sparc code from Tobias Nygren 2007-03-27 10:17:48 +00:00
jnemeth
618e615736 move definition of FTC_FLIP to auxioreg.h to mirror sparc 2007-03-27 10:13:12 +00:00
jnemeth
0b59ea5a73 Fixed formatting. Problem was that we were trying to get the result
of a data transfer operation immediately after the data transfer
was finished, instead of waiting for the chip to interrupt us and
tell us that it was finished and had the result for us.  This worked
okay for read and write since the operation would be finished very
shortly after the data transfer completed.  However, with formatting,
the chip still had most of the rest of the track to do, so we ended
up timing out before the operation was finished.
2007-03-25 09:29:11 +00:00
dsl
803fec88b2 Use NETBSD32PTR64() and NETBSD32PTR32() throughout. 2007-03-16 22:23:30 +00:00
drochner
ab07e481e4 It doesn't make sense to specify "configuration" and "interface"
locators for uhub because a hub can't have sub-devices.
This might be sanity-checked eventually.
Same for ubt now after the change to device attachment.
2007-03-14 12:27:20 +00:00
ad
59d979c5f1 Pass an ipl argument to pool_init/POOL_INIT to be used when initializing
the pool's lock.
2007-03-12 18:18:22 +00:00
jnemeth
5b888d73db Correct gap2 length from ISA driver.
XXX  The machine no longer becomes unusable when formatting, but it still
doesn't format properly.
2007-03-09 21:02:30 +00:00
he
5f0dedf664 Cast to char* and not void* when doing pointer arithmetic. 2007-03-08 22:35:53 +00:00
dogcow
b9b4ca0bf0 more caddr_t fallout. 2007-03-06 02:30:16 +00:00
christos
fffc9c66c9 fix fallout from caddr_t changes. 2007-03-04 07:54:07 +00:00
christos
53524e44ef Kill caddr_t; there will be some MI fallout, but it will be fixed shortly. 2007-03-04 05:59:00 +00:00
jnemeth
d62719e541 Deallocate resources where possible when we fail to attach.
XXX  Somebody needs to write bus_intr_disestablish().
2007-03-02 22:26:14 +00:00
jnemeth
3d61218161 add support for drvctl properties 2007-03-02 09:17:00 +00:00
jnemeth
d34b8a7014 merge remaining differences from sparc driver in 2007-03-02 07:17:19 +00:00