Commit Graph

8708 Commits

Author SHA1 Message Date
dyoung
24e681f5cd Implement bus_space_tag_create() and _destroy().
Factor bus_space_reserve(), bus_space_release(), et cetera out of
bus_space_alloc(), bus_space_map(), bus_space_free(), bus_space_unmap(),
et cetera.

For i386 and amd64, activate the use of <machine/bus_defs.h> and
<machine/bus_funcs.h> by #defining __HAVE_NEW_STYLE_BUS_H in
their respective types.h.  While I'm here, remove unnecessary
__HAVE_DEVICE_REGISTER #defines.
2011-07-06 18:46:04 +00:00
mrg
166e4479ba avoid an uninitialised variable warning GCC 4.5 -O3 picks up. 2011-07-05 07:08:17 +00:00
joerg
b187f964f6 Use integrated assembler with clang for Via PadLock. 2011-07-04 16:20:45 +00:00
bouyer
fd33bd72b3 Add back DIAGNOSTIC option to x86 GENERIC kernels, as discussed on tech-kern.
This will have to be commented out on release branches.
2011-07-03 10:40:16 +00:00
dyoung
59e0aa2438 #include <sys/bus.h> instead of <machine/bus.h>. 2011-07-01 18:11:24 +00:00
dyoung
f5b064ee38 #include <sys/bus.h> instead of <machine/bus.h>. 2011-07-01 17:37:26 +00:00
dyoung
59adf08e17 Per discussion at
<http://mail-index.netbsd.org/tech-kern/2010/04/02/msg007941.html>,
divide each machine's bus.h into bus_defs.h (constants & data types)
and bus_funcs.h (macro implementations of bus_space(9) routines and MD
prototypes).

Note that some bus_space(9) routines' implementation will move to .c
files from inline subroutines or macros in .h files.

I've only made the split for machine architectures where there is PCI.
All of the non-PCI-having architectures will require a similar split.

These #include files are not referenced by any (committed) Makefiles or
header files, yet.  Changes to Makefiles, to <sys/bus.h>, and to some
more machine-dependent files will dribble in before I throw the switch.
2011-07-01 17:09:58 +00:00
mrg
b7e452c793 remove HAVE_GCC == 4 conditional 2011-07-01 01:26:15 +00:00
joerg
6aa8f81f53 Fix sizeof() usage in memcpy, curtesy of the new warning in clang. 2011-06-30 23:28:03 +00:00
wiz
4cbd24b23f dependant -> dependent 2011-06-30 20:09:15 +00:00
mrg
f6f68342e6 cast a uint8_t * to a char * for a function that takes char *. 2011-06-23 12:07:00 +00:00
mrg
c111245a78 apply some -Wno-error and/or -fno-strict-aliasing.
all of this should be looked at closer, but some of them are not
very trivial.
2011-06-22 02:49:41 +00:00
jruoho
653bf25132 By default, enable wmihp(4) instead of hpqlb(4), as it has a better chance
of working with a greater number of HP laptops. Ok cegger@.
2011-06-21 05:01:17 +00:00
mrg
e685ea4b88 remove some more ancient HAVE_GCC checks. 2011-06-20 08:46:28 +00:00
mrg
8f161cd6d3 remove all the code that supported HAVE_GCC=3. mostly from chuq. 2011-06-20 06:52:36 +00:00
joerg
9708bada85 Refactor compiler-specific optimizer flags. Mark bootxx as supported
with clang.
2011-06-16 16:39:53 +00:00
joerg
c97378d081 Add an optional MD calling convention flag for use in libsa when space
optimisation is critical. Use this on i386 to switch to register passing
calling convention for the file system entry points and most assembler
call backs that have to preserve at least 3 registers.
2011-06-16 13:27:58 +00:00
joerg
9703593994 Use minimal alignment for functions in standalone code. 2011-06-16 13:16:20 +00:00
jruoho
6e72689aa7 Try to attach hpet(4) also via a specific HPET table. Fixes PR kern/43702. 2011-06-14 13:59:23 +00:00
rmind
e225b7bd09 Welcome to 5.99.53! Merge rmind-uvmplock branch:
- Reorganize locking in UVM and provide extra serialisation for pmap(9).
  New lock order: [vmpage-owner-lock] -> pmap-lock.

- Simplify locking in some pmap(9) modules by removing P->V locking.

- Use lock object on vmobjlock (and thus vnode_t::v_interlock) to share
  the locks amongst UVM objects where necessary (tmpfs, layerfs, unionfs).

- Rewrite and optimise x86 TLB shootdown code, make it simpler and cleaner.
  Add TLBSTATS option for x86 to collect statistics about TLB shootdowns.

- Unify /dev/mem et al in MI code and provide required locking (removes
  kernel-lock on some ports).  Also, avoid cache-aliasing issues.

Thanks to Andrew Doran and Joerg Sonnenberger, as their initial patches
formed the core changes of this branch.
2011-06-12 03:35:36 +00:00
joerg
bff766af54 Add a few more cases that need GNU as. One of the padlock instructions
is missing in LLVM. spl.S and lock_stubs.S break with patchfunc
otherwise.
2011-06-10 03:19:25 +00:00
rmind
c652f42cfd Convert simple_lock to mutex. 2011-06-08 22:43:10 +00:00
joerg
bc843b5e55 Use prototypes from libi386.h. 2011-06-08 16:04:40 +00:00
joerg
db603d4492 G/C wbinvd 2011-06-08 16:03:42 +00:00
joerg
b7a1edf1d5 Catch up with addition of putstr32.S. 2011-06-07 20:05:46 +00:00
bouyer
44635a6831 Don't call psignal() without holding proc_lock. This is the cause of
the reboot of PR port-xen/45028
Now that Xen2 is gone, handle FPU context switches the same way as
amd64. This makes all tests in /usr/tests/lib/libc/ieeefp pass.
2011-06-07 14:53:03 +00:00
msaitoh
4ad86a183a Rename to use PCI_PRODUCT_INTEL_82801DBM_LPC 2011-06-06 14:33:31 +00:00
dsl
53bfd680f2 Add C stubs to allow prints early in the boot code. 2011-06-02 18:53:00 +00:00
dsl
27a83e750f Put all the 'CFLAGS+= -Dxxx' together. 2011-06-02 18:48:55 +00:00
dsl
ba7daa4cde Replace the trapframe fields for segment registers with two uint16_t
fields - one of which is an explicit pad.
2011-06-02 18:46:51 +00:00
tsutsui
ff2f721f5c Split device_t/softc of all ad1848 variants properly. Compile test only.
Please check all attribute users in all files.* on device_t/softc split.

XXX: not sure if gus(4) needs device_t in ad1848_isa_softc
2011-06-02 14:12:24 +00:00
joerg
f6ced94e3b Disable -Werror for ah_regdomain.c if building with clang as workaround
for http://llvm.org/bugs/show_bug.cgi?id=10030.
2011-05-30 15:06:32 +00:00
ryo
a584933737 many whitespace cleanup.
confirmed "cvs diff -b" are identical.
2011-05-28 13:01:49 +00:00
joerg
a2bf8e5d19 Introduce DDB_EXPR_FMT and replace the logic around DB_EXPR_T_IS_QUAD. 2011-05-26 15:34:12 +00:00
joerg
a216da57a6 Default to -Wno-sign-compare -Wno-pointer-sign for clang.
Push -Wno-array-bounds down to the cases that depend on it.
Selectively disable warnings for 3rd party software or non-trivial
issues to be reviewed later to get clang -Werror to build most of the
tree.
2011-05-26 12:56:24 +00:00
uebayasi
dcf649145a Support userconf(4) command in boot(8)/boot.cfg(5) on i386/amd64.
From jmmv@, no objections seen in the proposed thread:

	http://mail-index.netbsd.org/tech-kern/2009/01/22/msg004081.html
2011-05-26 04:25:26 +00:00
joerg
ef5d0bd3b7 Disable integrated assembler for files that use .code16 or .code32 for
now. Disable Clang completely for bootxx and netboot for now until the
size issue has been sorted out.
2011-05-20 22:29:55 +00:00
joerg
3cf929db2b mbr.S and gpt.S want to reassign ., so don't use the integrated
assembler for now.
2011-05-20 15:05:02 +00:00
joerg
78fa586054 Use -x assembler-with-cpp from sys.mk. 2011-05-20 13:22:53 +00:00
joerg
97c3f9abba LLVM's assembler parser doesn't support .code16 yet, so disable it as
needed.
2011-05-20 13:22:30 +00:00
joerg
ac7187524d The %dx argument for in/out is not a memory reference, so don't use the
"feature" of GNU as to hide it as such.
2011-05-20 13:17:12 +00:00
dyoung
a6b2b8396b PCI_FLAGS_IO_ENABLED and PCI_FLAGS_MEM_ENABLED changed their functional
role in NetBSD (drivers are no longer supposed to write these to
pa_flags) without changing name.  Correct that.

Rename PCI_FLAGS_IO_ENABLED to PCI_FLAGS_IO_OKAY and
PCI_FLAGS_MEM_ENABLED to PCI_FLAGS_MEM_OKAY, thus making their names
consistent with the other PCI flags and poisoning 3rd-party driver
sources that use the flags in the old bad way.

This patch produces no binary changes in this set of PCI kernels when
they are compiled w/o 'options DIAGNOSTIC' and w/ -V MKREPRO=yes:

algor P4032 P5064 P6032
alpha GENERIC
amd64 GENERIC XEN3_DOM0
arc GENERIC
atari HADES MILAN-PCIIDE
bebox GENERIC
cats GENERIC
cobalt GENERIC
evbarm-el ADI_BRH ARMADILLO9 CP3100 GEMINI GEMINI_MASTER GEMINI_SLAVE
evbarm-el GUMSTIX HDL_G IMX31LITE INTEGRATOR IQ31244 IQ80310 IQ80321
evbarm-el IXDP425 IXM1200 KUROBOX_PRO
evbarm-el LUBBOCK MARVELL_NAS NAPPI NSLU2 SHEEVAPLUG SMDK2800 TEAMASA_NPWR
evbarm-el TEAMASA_NPWR_FC TS7200 TWINTAIL ZAO425
evbmips-el AP30 DBAU1500 DBAU1550 MALTA MERAKI MTX-1 OMSAL400 RB153 WGT624V3
evbmips64-el XLSATX
evbppc EV64260 MPC8536DS MPC8548CDS OPENBLOCKS200 OPENBLOCKS266
evbppc OPENBLOCKS266_OPT P2020RDB PMPPC RB800 WALNUT
hp700 GENERIC
i386 ALL XEN3_DOM0 XEN3_DOMU
ibmnws GENERIC
iyonix GENERIC
landisk GENERIC
macppc GENERIC
mvmeppc GENERIC
netwinder GENERIC
ofppc GENERIC
prep GENERIC
sandpoint GENERIC
sbmips-el GENERIC
sgimips GENERIC32_IP2x GENERIC32_IP3x
sparc GENERIC_SUN4U KRUPS
sparc64 GENERIC
2011-05-17 17:34:47 +00:00
dyoung
25441706c1 Add to tags some assembly files in common/. 2011-05-10 23:58:25 +00:00
jym
27b7b84b30 Enable balloon(4) for Xen kernels.
ok bouyer@; shortly discussed on port-xen@.
2011-04-29 01:51:52 +00:00
joerg
787e55aa29 Remove PECOFF/Win32 emulation. 2011-04-26 16:57:38 +00:00
joerg
e958063324 Remove IRIX emulation 2011-04-26 16:36:40 +00:00
joerg
5aca2679d7 Remove Darwin, MACH and Mach-O support. 2011-04-26 15:51:22 +00:00
jym
6b3956d6d5 Large rewrite of the balloon driver. This one:
- turns balloon into a driver that attaches to xenbus(4). This allows to
disable the functionality either at compile time or boot time via
userconf(4). Driver can implement detach or pmf(9) hooks if deemed
necessary.

- keeps Cherry's locking model, but simplify it a bit. There is now
only one target value serialized inside balloon, we do not feedback
alternative value to Xenstore (clients are not expected to see its value
evolve behind their back, and can't do much about that either)

- implements min threshold; this is an admin-settable value that tells
driver to "not balloon below this threshold." This can be used by domain
to keep memory reservations, useful if activity is expected in the near
future.

- in addition to min threshold, the driver implements internally a
safeguard value (uvmexp.freemin + 1MiB), so that admin cannot
inadvertently set min to a very low value forcing domain into heavy
memory pressure and swapping.

- create the sysctl(8) kern.xen.balloon tree. 4 nodes are actually present
(values are in KiB):
   - min: (rw) an admin-settable value that prevents ballooning below this
          mark
   - max: (ro) the maximum size for reservation, as set by xm(1) mem-max.
   - current: (ro) the current reservation for domain.
   - target:  (rw) the targetted reservation for domain.

- fix a few limitations here and there, most notably the max_reservation
hypercall, and KiB vs pages representations at interfaces.

The driver is still turned off by default. Enabling it would need more
approval, especially from bouyer@, cherry@ and cegger@.

FWIW: tested it two days long, from amd64 dom0 (with dom0 ballooning
enabled for xend), and bunch of domUs. Did not notice anything suspicious.

XXX it still has one big limitation: it cannot hotplug memory pages in
uvm(9) if they were not present beforehand. Example: ballooning above
physmem will give more pages to domain but it won't use it to serve
allocations, unless we teach uvm(9) how to handle the extra pages.
2011-04-18 01:36:24 +00:00
yamt
ce08932414 fix backtrace of interrupt 2011-04-14 16:05:59 +00:00
yamt
58024e6af5 comments 2011-04-14 16:04:12 +00:00