Commit Graph

46662 Commits

Author SHA1 Message Date
ad 6f7f8905b7 Adjust ci_idepth for cpu_intr_p(). 2008-01-04 16:09:54 +00:00
yamt 35d91ae479 i386:
- make tss per-cpu.  this considerably speeds up context switch for,
	  at least, pentium4, where ltr instruction seems very slow.
i386, xen:
	- kill cpu_maxproc.
kvm86:
	- adapt to per-cpu tss.
	- cleanup and simplify.
	- move kvm86_mp_lock to more meaningful place.
	- disable preemption during a call.
2008-01-04 15:55:28 +00:00
yamt b860f867c0 use device_xname. 2008-01-04 15:44:58 +00:00
ad 75209c4d35 Fix it. 2008-01-04 14:51:17 +00:00
ad 1dd75d2865 Add a simple in-kernel linker, derived from FreeBSD's link_elf_obj.c. Needs
more work but is enough to load simple LKMs. amd64 is untested.

Locking is caller provided. This is decoupled from the LKM framework because
kernel modules need not be loaded from the file system - they could be built
into the kernel and referenced via link set.
2008-01-04 12:26:20 +00:00
martin f0fe5d20cf lk_interlock is a kmutex_t now 2008-01-04 01:11:30 +00:00
joerg 28b31e738f Timecounter and generic todr support for pmax. From Garret D'Amore. 2008-01-03 23:02:24 +00:00
joerg 26ecc8b33a Add missing include of dev/clock_subr.h. 2008-01-03 22:35:27 +00:00
jdc 829d5d12dc Print the "banner-name" property (up to the first '(' character), if
it is present, as well as the "name" property.
2008-01-03 21:34:58 +00:00
he 46a379e692 Declare sysbeepdetach(), and protect a small additional section
with #if (NPCPPI > 0).
2008-01-03 21:30:16 +00:00
joerg 02af50dd40 Add assym.h dependency. 2008-01-03 21:17:44 +00:00
joerg c087080661 Missing assym.h dependency. 2008-01-03 20:58:06 +00:00
joerg a8affe0a2c Missing assym.h dependency. 2008-01-03 20:02:22 +00:00
ad 5f56d09078 Bump NKL2_KIMG_ENTRIES to allow for 20MB of kernel.
Well past time for an in-kernel linker...
2008-01-03 19:30:10 +00:00
he 75fc209bcf Fix a cv_timedwait() usage after the vmlocking2 merge, and remove
a now-no-longer-used local variable.
2008-01-03 16:06:24 +00:00
ad 202aa39736 - Remove simple_lock calls.
- Use mutex_enter/exit where needed.
2008-01-03 13:18:55 +00:00
kiyohara bd1410f189 Remove white-space. 2008-01-03 07:21:21 +00:00
mrg 9c1261344f support FS_RAID partitions, and increase the offset by
RF_PROTECTED_SECTORS (64) if so.
2008-01-03 06:40:02 +00:00
dyoung 8d9f58ea97 Support detachment of geodegcb(4) and its children, geodecntr(4)
and geodewdog(4).  Support detachment of gscpcib0 and its child,
gpio0.
2008-01-03 04:52:54 +00:00
dyoung 69d7a3e831 Support detachment of pchb(4) and sysbeep(4). 2008-01-03 04:50:19 +00:00
joerg c8ad2035a8 Simplify delay based on x86 version. 2008-01-03 01:02:04 +00:00
joerg 62fcc14f1c ANSIfy. 2008-01-03 00:31:28 +00:00
dyoung 03f1738ff9 Use device_t, device_private(). Join some lines. 2008-01-02 21:05:51 +00:00
he 1b2f5d4f55 Remove the #endif corresponding to the #ifdef _KERNEL removed in previous. 2008-01-02 21:00:34 +00:00
jmmv 14780346b4 Remove this; objections from joerg@ and ad@, and I agree with them that
additional kernel configs are not the way to go because they are not
flexible at all.  Plus ad@ is working on a real solution (bootprop).
2008-01-02 20:40:43 +00:00
yamt 03539d901d pmap_extract_ma:
- TRUE/FALSE -> true/false
	- (P == FALSE) -> (!P)
2008-01-02 17:33:08 +00:00
joerg 9f9b7d3adb Better description, this is not GENERIC after all. 2008-01-02 12:49:30 +00:00
joerg 956f82654b Add some missing dependencies on assym.h. 2008-01-02 12:46:23 +00:00
yamt 41f847fb03 make pmap_pv_cache static. 2008-01-02 12:31:32 +00:00
yamt d450c78d16 g/c pv_page stuffs. 2008-01-02 12:30:30 +00:00
ad 4a780c9ae2 Merge vmlocking2 to head. 2008-01-02 11:48:20 +00:00
mrg a386f0e8b3 build an INSTALL kernel. it's just GENERIC with md(4) root space. 2008-01-02 11:32:15 +00:00
sborrill 37c7a4d0f3 Configuration file is boot.cfg, not boot.cnf, so fix comments 2008-01-02 10:39:39 +00:00
dogcow fad5ee1397 const char casting, to make gcc happy. (not that sun2 compiles these days
without other patches.)
2008-01-02 06:53:09 +00:00
mrg 3259c65b6e add COMPAT_40, raid and RAID_AUTOCONFIG options. 2008-01-02 02:32:25 +00:00
yamt 48a1e4c2c1 a simple performance monitor based profiler, inspired from linux oprofile. 2008-01-01 21:28:37 +00:00
yamt 13d9847b0a add swapgs. 2008-01-01 21:24:17 +00:00
yamt cfb66876d1 try to detect processor resource sharing topologies. ie. package/core/smt IDs. 2008-01-01 20:32:10 +00:00
yamt 7aa31c1c3b make the nmi handler safer.
XXX should use IST.
2008-01-01 19:49:05 +00:00
chris 736004cf1c Add property to aceride to allow the forcing of compat mode.
This allows cats to override the BIOS (aka ABLE) settings, which enable
native mode, but doesn't route the interrupts correctly.

Discussed last year on tech-kern and port-cats.
2008-01-01 14:57:05 +00:00
chris c93dd30159 Add support for kcore headers to arm32 kernel core dumps.
The kcore code is based on i386's kcore header handling.

Having an asm stub for dumpsys, to dump the registers onto the stack, and
then call the C code to do the memory dump is based on amd64's core dump
code.

This allows a successful core dump on cats.

Part of fixing PR cats/18026.
2008-01-01 14:06:42 +00:00
yamt e01ad62b66 always consider T_NMI as !T_USER regardless of trapframe. 2008-01-01 13:40:20 +00:00
jmmv e92603e152 Revert previous by removing the apm entry. Even though the driver seems
to work, we do not build any userland support for it; see 1.183's commit
message.  Per jmcneill@'s request.
2008-01-01 13:35:36 +00:00
yamt e550a539ee add x86_cpuid2, which can specify ecx register. 2008-01-01 12:51:08 +00:00
yamt aa3e923c59 add some dependencies on assym.h. 2008-01-01 11:35:33 +00:00
jmmv b35cc6641f Add a trimmed-down configuration file for the VMware Fusion virtual machine
suitable for the subset of hardware devices it provides.
2008-01-01 11:20:42 +00:00
jmmv 4d71e761d0 Add the ACPI apm emulation device. 2008-01-01 11:05:27 +00:00
jmmv 14b3c39f2a Add and enable piixpm. Confirmed working under VMware Fusion. 2008-01-01 10:48:36 +00:00
he aa5a643b16 Follow up the change to soackaddr_dl by using CLLADDR() and propagating
const to camentry().
2008-01-01 01:04:20 +00:00
garbled 4ae431e265 On the 745x cpu, you have to invalidate cache slightly differently than
you do on the other cpus.  Add an if statement that takes this into account.
2007-12-31 18:54:34 +00:00
garbled 1c93f00dd2 Add a bunch of PVR values for a variety of processors. Taken from
various manuals, and linux.
2007-12-31 18:44:47 +00:00
ad 2ecdf58c2c Remove systrace. Ok core@. 2007-12-31 15:31:24 +00:00
martin 4bf6db2543 Fix unusued variable warning (depending on options). Noticed by
Adrian Portelli on port-sparc64.
2007-12-31 14:10:15 +00:00
ad 9f6b8c4d04 Remove COMPAT_HPUX. 2007-12-31 13:38:47 +00:00
dyoung f72e4b15e1 Fix 'tags' target. 2007-12-31 10:45:22 +00:00
macallan 3e23f460d5 'never try to fix more than one thing at once, especially if one is a crash'
backout bogus G4 CPU revision 'fix'
2007-12-31 01:37:13 +00:00
macallan 3987217f14 Remove a superfluous /* FALLTHROUGH */
Also switch back to waiting for L2CR_L2IP in cpu_enable_l2cr() - now my 2nd
G4 spins up again.
2007-12-30 23:21:21 +00:00
macallan eddfeaff1f Fix a logic botch when setting up L3 cache - don't attempt to do so on CPUs
that can't have L3 cache. While there also fix revision reporting for MPC7400
so what we report matches MacOS X.
2007-12-30 22:39:15 +00:00
joerg 47708a0e13 Missing assym.h dependency. 2007-12-30 16:07:02 +00:00
yamt 33871803b1 pull CMOVxx from the amd64 version. 2007-12-30 13:28:20 +00:00
joerg 8d9503a349 Enable wedge autodiscovery and wedge support for GPT. Both MBR and BSD
disklabel support is *not* enabled, but documented.
2007-12-30 13:15:21 +00:00
jdc c4b53cee4f Make extent mapping error more meaningful. OK martin@. 2007-12-30 12:54:23 +00:00
joerg 85f3dbd137 i386func.S needs assym.h. 2007-12-30 12:34:12 +00:00
skrll 53e9e3b501 G/C all the cpu options it doesn't work and it's not the supported way.
Don't add options to COPTS - it loses the default optimisation level.

Kernels are now compiled with -O2.
2007-12-30 08:56:59 +00:00
skrll 250bd03568 Initilise sysctllog to NULL so sysctl_createv, et al don't look at garbage
on the stack.
2007-12-30 08:32:14 +00:00
dyoung 13e9109580 De-__P(). 2007-12-29 23:12:38 +00:00
reinoud fc7694435a Add GENERIC32 configuration file for 32 bit architectures. This
configuration includes GENERIC but disables EXEC_ELF64.
2007-12-29 20:22:25 +00:00
reinoud 0202db78c9 define opt constants away for i386 2007-12-29 20:21:01 +00:00
reinoud 39e4fad4c1 *** empty log message *** 2007-12-29 20:19:37 +00:00
reinoud ebc09eacd8 To make NetBSD/userland to boot on i386 choose some defaults in vmparam.h
since for i386 they are defined in page size constants wich NetBSD/userland
doesn't know yet. Also undefine ptrace's __HAVE_PTRACE_MACHDEP since i386
has that but NetBSD/userland not.
2007-12-29 20:07:22 +00:00
reinoud 540893b8f7 Fix enough to get i386 more-or-less compiling. The i386 needs u_long to be
an unsigned long too or uvm will complain.
2007-12-29 18:30:17 +00:00
tsutsui 7bfee5be48 Fix typo in comments. Mostly from OpenBSD. 2007-12-29 17:53:23 +00:00
jmcneill 402a3d3535 -Dfree=kernfree, to match -Dmalloc=kernmalloc 2007-12-29 17:48:23 +00:00
tsutsui 8021ef3f6c Remove __P(). 2007-12-29 16:48:03 +00:00
jmcneill aed987feb1 Add -z to usage strings. 2007-12-29 16:28:40 +00:00
jmcneill a724fac145 Define init_main's main away to kernmain, and provide our own MD main entry
point. We do this since we don't have a proper bootloader, so we can
instead parse boot arguments here.

  $ ./netbsd -h
  -h: unknown flag
  usage: ./netbsd [-acdqsvx]
	 (ex. "./netbsd -s")
2007-12-29 16:13:46 +00:00
jmcneill dab73a34c7 Mention -x in command_help 2007-12-29 16:02:46 +00:00
jmcneill 372f1f5260 #ifdef _X86_foo_H -> _ARCH_USERMODE_INCLUDE_foo_H, to match the rest of
the sources.
2007-12-29 15:44:31 +00:00
jmcneill 38365ca359 Import work-in-progress NetBSD/usermode port. 2007-12-29 14:38:30 +00:00
xtraeme 507639572d Update itesio(4) comments. 2007-12-29 06:09:04 +00:00
martin aa1b67be38 Make the copy of the syscall return value to register A0 independend of
options COMPAT_AOUT_M68K. Works around PR port-m68k/37631.
XXX we will phase out the copy to A0 completely and handle it in userland
XXX in the future.
2007-12-29 00:02:52 +00:00
joerg 08acf5f65c Prepare for timecounter support on amiga. 2007-12-28 20:49:49 +00:00
joerg 02d07b4e9d Remove delaytab and just compute the reminder directly. This requires
two muls and a shift, which needs at most 2ms on a 25MHz i386 and should
end up as fast as delay(1) was before due to using a reminder of 2.
Discussed with ad@.
2007-12-28 14:05:22 +00:00
dogcow 0a9401426e XEN only gets defined in opt_xen.h; move the ifndef check after the include. 2007-12-28 07:04:54 +00:00
garbled 0abe9cf449 Add one more convenience function to rtas, rtas_has_func, and add a
global int machine_has_rtas that can be used to decide if a machine has
rtas functionality or not.  Take a crack at power off support for the
pegasos, which doesn't work right, probably due to a firmware bug.
2007-12-28 05:12:41 +00:00
garbled f217f96524 Take advantage of the new rtas_call function and get rid of the uneeded
rtas_reboot() function.  Still reboots even.
2007-12-28 04:47:37 +00:00
garbled ae7424d959 Rewrite the rtas_call command, to allow ports to call rtas directly from
outside rtas.c, by simply issuing the right token.  This makes using the
rtas functionality much simpler.
2007-12-28 04:45:57 +00:00
joerg 53c1ce668c opt_physmem.h only exists for !Xen. 2007-12-27 21:31:35 +00:00
garbled 47b06f10ce change some printf's to aprint_normal. 2007-12-27 17:49:36 +00:00
garbled 28d432f9cc Add an infinate loop after the reboot call so we don't somehow drop past
it if it fails.
2007-12-27 17:25:02 +00:00
garbled 86909579bf Make the reboot function work when in single/multi user mode. I have no
idea why this makes it work, but apparently it needs to return status,
and if it doesn't, it won't reboot.  (unless you call it at the askroot
prompt, then it worked fine).  *boggle*.
2007-12-27 17:23:54 +00:00
joerg df7753af9c Fix typo. 2007-12-27 16:50:43 +00:00
rjs fa579d4ec4 Change to new softint API. 2007-12-27 12:29:16 +00:00
garbled cbd61cd9a6 Enable l2 cache on the pegasos 2007-12-27 05:41:51 +00:00
garbled 07cb4134b6 Lots and lots of fixes to the cpu identification code, and dealing with
L2 and L3 cache initialization.  Mostly to get the L2 enabled on the
pegasos, but since I had the manual, I fixed a few other things I saw
while I was there.
2007-12-27 05:40:49 +00:00
elad b1111e85d4 Compile in by default (disabled) PaX ASLR for amd64 and i386. 2007-12-26 23:00:50 +00:00
christos 6a838fb09a Add missing PAX defines 2007-12-26 22:32:44 +00:00
joerg 0edb50f1a2 Remove #if 0'ed microtime from the simulator days. 2007-12-26 16:39:27 +00:00
joerg 2b35d82f32 Add PHYSMEM_MAX_ADDR and PHYSMEM_MAX_SIZE options. This limit physical
memory based on overall size (useful for debugging to keep core dumps
small) or maximum address (when using devices with bus dma limits).
Contrary to REALBASEMEM and REALEXTMEM, they still use the BIOS memory
map and can therefore deal with fragmented memory.
2007-12-26 16:28:15 +00:00
ad ea3f10f7e0 Merge more changes from vmlocking2, mainly:
- Locking improvements.
- Use pool_cache for more items.
2007-12-26 16:01:34 +00:00
yamt 2cbcb46f49 - share idt entry allocation code among x86.
- introduce a function to reserve an idt entry and use it instead of
  manipulating idt_allocmap directly.
- rename idt to xen_idt for amd64 xen.  add missing #ifdef XEN.
2007-12-26 11:51:10 +00:00
dogcow 453afff1c4 ding dong, the witch is __dead. Not sure why it was even bothered with here. 2007-12-26 10:19:41 +00:00
mrg bc98ae9212 move
extern struct powerpc_bus_dma_tag pci_bus_dma_tag;
where everyone can see it.  fixes ofppc builds.
2007-12-26 00:58:05 +00:00
he 81018e0a2e Bump SYMTAB_SPACE so the symbol table fits again. 2007-12-25 22:47:03 +00:00
perry b6a2ef7569 Convert many of the uses of __attribute__ to equivalent
__packed, __unused and __dead macros from cdefs.h
2007-12-25 18:33:32 +00:00
macallan 7eb34fdf1c get rid of macppc's private pci_bus_dma_tag 2007-12-25 17:55:10 +00:00
joerg 9a98cd19ff Add initial version of calling VGA POST from vga_resume. This is the
equivalent to "vbetool post" using x86emu in the kernel.
2007-12-25 14:22:25 +00:00
ad f4c9b5b65a Make SMP the default on i386. For the time being the noacpi kernel does
not have it enabled.
2007-12-25 01:03:31 +00:00
garbled a42bf0b72b Fix a segv if you forget to set the -m option. 2007-12-24 19:34:41 +00:00
hamajima 0e3cc22bed Add compat_13_netbsd32_sigreturn() for 32bits programs with COMPAT_13+EXEC_AOUT. 2007-12-24 17:35:00 +00:00
perry 970ad9314d Remove __attribute__((__noreturn__)) from things already marked __dead
Found by the department of redundancy department.
2007-12-24 15:46:45 +00:00
ad aeb73b56d5 b_un.b_addr -> b_data 2007-12-24 15:06:38 +00:00
phx 66e67a4f6b Make USB, IEEE1394 and viaaudio attach to the Pegasos2.
USB works fine. IEEE1394 is untested. Audio doesn't work (playing white noise).
Need to set IO/MEM-enable for IEEE1394 and audio, as the firmware (Smart
Firmware 1.2) doesn't do it.
Patch approved by Tim Rightnour.
2007-12-24 13:54:58 +00:00
kiyohara 51311b8619 Remove white-spaces. 2007-12-24 07:54:26 +00:00
macallan 7500033ffa check for __HAVE_PRIVATE_PCI_BUS_DMA_TAG instead of macppc when (not)
declaring pci_bus_dma_tag
while there move #include <machine/isa_machdep.h> to the ISA block so archs
without ISA won't see it. Now macppc builds again.
2007-12-24 01:31:08 +00:00
macallan ddf0036d4b #define __HAVE_PRIVATE_PCI_BUS_DMA_TAG 2007-12-24 01:27:34 +00:00
jmcneill 087888e1dd Add sony* at acpi? 2007-12-23 17:33:57 +00:00
jmcneill 9f7f6d9be0 Move Sony Notebook Controller (sony(4)) driver from MD to MI directory,
as it can be used on amd64 as well.
2007-12-23 17:29:26 +00:00
jmcneill 8f31e2d8cd Remove wskbd attachment, it never worked right anyway. Instead, deliver
hotkey events to powerd.
2007-12-23 17:25:45 +00:00
rjs 4cec9c5ce2 Fix prototype. 2007-12-23 10:28:39 +00:00
tsutsui 0cbdb8cc76 Use __arraycount(). 2007-12-23 03:04:57 +00:00
dsl a1e817b5ba Define 'struct intrframe' in terms of 'struct trapframe' since the two are
assumed to match by a lot of code (including that which saves the regs).
This only slightly reduces the number of places the trapframe register
layout is defined.
2007-12-22 18:35:00 +00:00
tsutsui 9e4e6d48cb In icu_intr_establish(), don't panic if the specified irq
is already in use and just return NULL instead.

Such situation could happen with devices which have
unconfigured PCI interrupt pins (because firmware
doesn't configure multiple function devices) and
each driver could handle the return value properly.
2007-12-22 14:42:21 +00:00
skrll 6698b79073 Minor change to comment. 2007-12-22 14:14:31 +00:00
skrll c54df2db09 Add some more trap types and HPPA_BREAK_SS. From OpenBSD. 2007-12-22 14:11:10 +00:00
skrll 4fef0969e0 Align the stack when delivering signals and don't waste a HPPA_FRAME_SIZE. 2007-12-22 14:09:03 +00:00
skrll 0361d1fef2 Cast the argument to HPPA_FRAME_ROUND to uintptr_t 2007-12-22 14:06:47 +00:00
dsl 35e44a2658 Fix the remaining sys_sysarch() stub function. 2007-12-22 08:59:02 +00:00
tsutsui b3b089f419 Use (char *) on pointer arithmetic. 2007-12-22 08:29:40 +00:00
tsutsui f35eb8772f Put a workaround for gcc ICE on ddb/db_command.c. 2007-12-22 08:17:57 +00:00
ad 8044d72190 Make compile (hi moof). 2007-12-22 01:21:41 +00:00
yamt 949e16d902 use binuptime for l_stime/l_rtime. 2007-12-22 01:14:53 +00:00
xtraeme 4bb97c0a3e After comments from joerg@, backout previous and use 'cpuN'. 2007-12-21 21:36:22 +00:00
dsl 89a3551a18 Create the trap/syscall frame space for all the registers in one go.
Use the tramp-frame offsets (TF_foo) for all references to the registers.
Sort the saving of the GP registers into the same order as the trap frame
because consequetive memory accesses are liekly to be faster.
2007-12-21 20:43:45 +00:00
dsl 9b0b44bbdc Change the xen CLI() and STI() defines to only use one scratch register.
As well as saving an instruction, in one place it saves a push/pop pair.
2007-12-21 19:18:13 +00:00
dsl 88aa2c71d3 Enable LINUX and LINUX32 emulation. 2007-12-21 18:31:12 +00:00
joerg e9bc92e889 lock_stubs.S needs assym.h. 2007-12-21 16:23:05 +00:00
jmcneill ebdccda407 Add thinkpad at acpi 2007-12-21 15:18:28 +00:00
drochner 200f66ee6b define the SSSE3 feature flag bit and print out all known bits 2007-12-21 14:57:22 +00:00
skrll 2b4f402919 Improve ddb backtraces by:
- Starting with the right set of fp, pc, and rp in all cases.
	- Dropping the argument printing stuff as it could never work.
	- Backtrace through traps and decode syscalls properly by
	  making sure the trapframe is at a known offset from the stack
	  pointer in both cases. Also, ensure that the frame pointer
	  is zero so that we can detect traps.
2007-12-21 13:05:26 +00:00
dyoung 041c1b3f89 Get rid of sc_suspended, it is redundant because the device_t
contains the same state.
2007-12-21 07:31:44 +00:00
matt 39a278be7e Make this compile again. 2007-12-21 02:27:57 +00:00
xtraeme 6f9427240c Change the description to 'coreN' rather than 'cpuN', which seems to
be more correct.
2007-12-21 01:10:54 +00:00
ad e16a661bf3 - Make __cpu_simple_lock and similar real functions and patch at runtime.
- Remove old x86 atomic ops.
- Drop text alignment back to 16 on i386 (really, this time).
- Minor cleanup.
2007-12-20 23:46:10 +00:00
ad f28895c808 Remove GENERIC.MP config and enable SMP by default on amd64. 2007-12-20 23:32:24 +00:00
xtraeme b59ab94c46 - Use intel_family_new_probe() for CPUCLASS_686/family 6, so that we can
show 'features3' in the Core 2 Duo CPUs.
- Use __arraycount() in two lines.

Ok by ad@ (the new x86 portmaster).
2007-12-20 23:28:08 +00:00
dsl 7e2790cf6f Convert all the system call entry points from:
int foo(struct lwp *l, void *v, register_t *retval)
to:
    int foo(struct lwp *l, const struct foo_args *uap, register_t *retval)
Fixup compat code to not write into 'uap' and (in some cases) to actually
pass a correctly formatted 'uap' structure with the right name to the
next routine.
A few 'compat' routines that just call standard ones have been deleted.
All the 'compat' code compiles (along with the kernels required to test
build it).
98% done by automated scripts.
2007-12-20 23:02:38 +00:00
garbled e7da798e38 Add bebox mkbootimage stuff to the unified mkbootimage. It should work
in theory, assuming:

a) I didn't mess up
b) The original code in bebox/stand actually works
2007-12-20 22:59:59 +00:00
phx d2a9b2ff83 VT8231 IDE workaround for native mode with "compatibility" interrupts 14/15.
This time done right by calling pciide_machdep_compat_intr_establish() to
get a MD interrupt handler.
Verified that it compiles for XEN again.
2007-12-20 22:24:40 +00:00
dsl 0acba075bd Kill syscall fancy.
Optimise matching native code.
2007-12-20 22:16:50 +00:00
dyoung 396e67c2e6 Add definitions for several more registers on the AMD Elan SC520
System Controller.
2007-12-20 20:44:58 +00:00
skrll f4ce2b2831 Fix typo that broke bt /a with curlwp 2007-12-20 20:24:47 +00:00
ad 4f4f294aa3 Decode cmpxchg8b correctly. 2007-12-20 19:53:47 +00:00
garbled 39fda4680b add verbose flag to usage statement. 2007-12-20 18:00:18 +00:00
garbled 690f8887fc Port over the code from rs6000/stand/mkbootimage. Now the unified
mkbootimage can build both prep and rs6000 images.
2007-12-20 17:58:49 +00:00
skrll f63ceafc74 typo in comment. 2007-12-20 08:11:31 +00:00
ad 163e94a67e 64-bit atomic ops for i386. 2007-12-20 01:27:24 +00:00
garbled f97bd8894f bring over bootrec.h from rs6000/stand/mkbootimage 2007-12-19 19:50:14 +00:00
garbled a3af60a95e s/prep_magic.h/magic.h/ 2007-12-19 19:47:08 +00:00
garbled 4fcef35aac Add rs6000 stuff in here now. 2007-12-19 19:46:31 +00:00
garbled ec9be1a886 Changed my mind on naming this prep_magic.h. Change it back to magic.h.
Sorry for the churn.
2007-12-19 19:45:32 +00:00
garbled 2f6e46a275 Change the prep bootloader to reach over into the
powerpc/stand/mkbootimage directory for the magic.h file.
2007-12-19 18:28:50 +00:00
garbled 4849f95d59 First crack at a new unified mkbootimage for powerpc. Still some work
left to do here, so the build isn't enabled yet.
2007-12-18 18:26:36 +00:00
garbled 67049908f4 Copy prep/stand/mkbootimage over to powerpc/stand/mkbootimage. The
makefile still needs work, and I still need to do some additional
fiddling here, but this is to be the unified rs6000/prep/bebox
mkbootimage eventually.
2007-12-18 18:19:07 +00:00
joerg 870cffb0ab Add new IPI for saving CPU state explicitly, share high-level part of
ACPI wakeup code and teach it how to start the APs again. As a side
effect the CPU_START interface allows choosing between different
bootstrap codes more easily now.
2007-12-18 07:17:08 +00:00
garbled d8e4680b19 Fix a mistake in boot.c Forgot to remove reference to residual.h and add
reference to iplcb.h
2007-12-17 19:54:32 +00:00
christos 6d8587f061 from jmcneill: suspend and resume handlers for spic. 2007-12-17 19:51:09 +00:00
garbled d1d2109e89 Add some files that got missed in the initial import of port-rs6000. 2007-12-17 19:11:58 +00:00
garbled 68fe5b6f0a Import the rs6000 port into the tree.
This port of NetBSD is intended to run on MCA-based IBM RS/6000
machines.  The port so far has only been tested on a 7006-41T, which is a
601-based RS/6000.  The port also contains a limited set of code for the
7012-3XX machines, but support for those is a long way off still.

The port builds and generates a working kernel, however, it still lacks
bus_dma code for the MCA bus, so at present, only the com ports work,
though any other device (such as the printer/keyboard) located on the
ioplanar could probably be made to work.  Work will continue on this port
as I iron out the DMA code.

This port was made possible by a generous gonation of hardware by Kevin
Bowling, who also provided much of the documentation for the port.
2007-12-17 19:09:01 +00:00
riz 344b2782f7 Add drvctl(4) 2007-12-17 16:45:12 +00:00
joerg 599a3a8e85 Revert, fixed differently. 2007-12-17 14:11:53 +00:00
joerg 1dfe814354 Don't call acpi_md_sleep_init on Xen, it doesn't support ACPI sleep
anyway.
2007-12-17 14:11:12 +00:00
joerg dffe4b9c05 Use GENERIC for installation as well, just add the ramdisk hooks. 2007-12-17 13:48:18 +00:00
dyoung d475558145 Cosmetic: wrap some lines. Join some lines. struct device * ->
device_t.  Use device_t accessor functions.
2007-12-17 05:05:03 +00:00
riz 1d7c0bc27f Add drvctl(4) 2007-12-17 04:36:16 +00:00
dyoung 15bdc66954 Miscellaneous changes designed to improve elansc suspend/detachment:
1 Synchronize access to the softc and hardware with a mutex.
2 Add the sc_suspended flag, and observe it in the watchdog routines.
3 Re-order operations in elansc_attach() and elansc_detach() to
  protect against access while the device is not fully configured.
4 Cancel detachment if sysmon_wdog_unregister() is cancelled by a
  signal.
5 Add an empty childdetached method so that I can detach gpio0 at
  elansc0.  (XXX cannot individually re-attach gpio0.)
2007-12-16 21:14:22 +00:00
dyoung 471ee9702c Add a childdetached handler. This lets us detach devices from
mainbus0. E.g.,

# drvctl -d pci0
elansc0 detached
cardbus0 detached
pcmcia0 detached
cardslot0 detached
cbb0 detached
rtw0 detached
cardbus1 detached
pcmcia1 detached
cardslot1 detached
cbb1 detached
nsphyter0 detached
sip0 detached
nsphyter1 detached
sip1 detached
pci0 detached
#

Alas, we cannot re-attach devices to mainbus, yet.
2007-12-16 20:57:21 +00:00
phx c6d327a8be At least under certain (mis)configurations (e.g. on the "Pegasos" board)
the VT8231-IDE's native mode only works with irq 14/15, and cannot be
programmed to use a single native PCI irq alone. So we install an interrupt
handler for each channel, as in compatibility mode.
This behaviour has to be activated by the "use-compat-native-irq" property,
otherwise the driver works as before.
2007-12-16 16:41:01 +00:00
mrg cd5f1957b6 move the arm32 cpu_intr_p() function into arm32_machdep.c
from arm_machdep.c.  this lets acorn26 link again.
2007-12-16 07:31:47 +00:00
mrg f38a1578dc catch up with LOCKDEBUG changes. 2007-12-16 02:23:55 +00:00
dyoung 7ab662e649 Add a detach routine. 2007-12-16 00:00:08 +00:00
jmcneill 381f4068ae Provide a stub acpi_md_sleep_init on xen, pointed out by Paul Goyette
on current-users.
2007-12-15 19:24:17 +00:00
phx 5dda38d449 wsmux was missing.
Switched to a smaller default font.
2007-12-15 16:09:08 +00:00
tsutsui 61126beefc Rename a device property name: "override_ultra" -> "aic7xxx-override-ultra" 2007-12-15 14:23:14 +00:00
tsutsui fc91c35517 - enable both ffsv1 and ffsv2
- use __arraycount()
2007-12-15 14:21:40 +00:00
joerg 9ba317469f Move mapping of the real mode location for the ACPI wakeup code into a
separate function called from acpi_md_callback.
2007-12-15 11:26:40 +00:00
joerg bcf2c96639 For now, remove the attempts to shutdown other CPUs and bring them back
online. It runs into issues in the pmap code and will handled
differently. This allows sysctl -w machdep.sleep_state=3 to at least
recover into a working system again.
2007-12-15 09:18:59 +00:00
joerg 261292569c Steal some rope from innocent users and disallow ACPI suspend if more
than one CPU was found.
2007-12-15 09:15:37 +00:00
dyoung 6091ef39bb Add a suspend/resume handler. Do not suspend if the watchdog timer
is active.  Reinitialize the watchdog timer on resume.  If the
device is not powered, neither tickle the watchdog nor set the
watchdog's mode, but return EBUSY, instead.
2007-12-15 05:37:03 +00:00
perry 9b2b412c19 __FUNCTION__ -> __func__ 2007-12-15 00:39:14 +00:00
pavel 474470307d Update URLs after website reorganization. patch by OKANO Takayoshi, from
PR 37070.
2007-12-14 21:15:52 +00:00
chris 86e1b8a4aa Fix for PR cats/18026.
cats was never able to dump a kernel core dump because reading from
VGA addresses (0xb8000) was causing the system to hang.

To workaround this reprogram the footbridge to map the memory to appear on
the PCI bus at 0x20000000, rather than at 0x0.  Also configure the pci bus
to have a DMA range so that data is mapped correctly.

Note that -current kernels seem to hang when unmounting the fs.  This
is a seperate issue, and appears to be because interrupts need to be
enabled to unmount filesystems.

So using reboot 0x104 does work, as it does a sync without unmounting the
filesystems.

Also arm savecore doesn't do anything with the memroy dump, as on arm we
currently just dump the raw memory, there's no header block to indicate
memory sizes or other useful information.
2007-12-14 11:08:03 +00:00
jmmv 0aa628334a Enable puffs in this kernel. I find it very useful in virtual machines to
access the host's (Mac OS X) file system, instead of having to set up NFS.
No objections from pooka@.
2007-12-14 10:57:48 +00:00
uwe 4a77686dd9 Use dedicated interrupt stack. Tested on hpcsh and landisk. This has
been sitting in my tree for quite a while.  While here s/top/bottom/
in a few places related to stacks to confirm to conventional
terminology.
2007-12-14 00:58:37 +00:00
bouyer ca0831b58a Remove obsolete code and comment. 2007-12-13 21:42:06 +00:00
skrll ed0dc19ecc g/c __HPPA_SIGNAL_PRIVATE 2007-12-13 21:34:18 +00:00
bouyer a4bffcd44a Reorder some operations for better handling of failures in
xpq_update_foreign(). Note that this also affects native operations, but it
shoulnd't cause problems even for SMP system. Proposed on port-amd64@ and
port-i386@

Don't invalidate the recursive PTE entry in user pmap when switching from
kernel to userland on Xen/amd64. This effectively means that a userland
process can read its own page tables (no write, of course) on Xen/amd64, but
it shouldn't cause security issue (discussed on tech-kern@ some time ago).
This makes NetBSD Xen/amd64 more than 10x faster
building pkgsrc/pkgtools/digest
2007-12-13 21:22:15 +00:00
joerg 151d068190 Add glue for x86emu and build it as part of i386/ALL. 2007-12-13 17:25:19 +00:00
sborrill df6e82e8f8 Check whether we are loading from ustarfs and if so, do not attempt to
read boot.cfg.

Fixes PR install/37521. Heavily based on patch by Izumi Tsutsui.
2007-12-13 11:52:17 +00:00
jmcneill 645fe8c342 Try not to pass garbage to pci_make_tag; workaround for odd ACPI DSDTs.
Fixes kern/37527.
2007-12-12 23:33:22 +00:00
bouyer e2b280eabb cleanup the debug event handler to not use the IPL system at all. Fix
debug event storm on XEN2.
2007-12-12 22:16:32 +00:00
bouyer 200e86ecad Initialize ci_idepth in cpu_info_primary, makes LOCKDEBUG kernels boot. 2007-12-12 19:25:38 +00:00
macallan 7f37ac3821 fix sensor attachment 2007-12-12 18:19:20 +00:00
xtraeme eb3500dc11 Fix previous with suggestion by cube: rather than checking for cpu_model[0]
check that cpu_vendor is CPUVENDOR_AMD.
2007-12-12 15:01:42 +00:00
yamt c180823658 specify sections. 2007-12-12 14:58:58 +00:00
yamt 5576993097 restore section after RCSID. 2007-12-12 14:58:20 +00:00
xtraeme a6ab4730a4 Check for the first 'D' letter in the cpu_model string for POWERNOW_K8,
so that it works in Dual Core Opterons (and maybe others).

Patch from Akihiko Taniguchi in PR port-amd64/37526.
2007-12-12 14:36:21 +00:00
nisimura 27f7bc42d9 remove EUMBBAR register debugging stuff. It should be ok when the
control reachs here.
2007-12-12 04:24:57 +00:00
nisimura 9cd3f872dc have a compile time option, START_DDB_SESSION, to invoke immediate
DDB session in mid initppc().
2007-12-12 04:17:49 +00:00
lukem 6ec6d598ac use __KERNEL_RCSID() 2007-12-11 23:31:07 +00:00
david 587cc41918 Wrong copyright template used on import. Referenced Regents, but
Berkeley wasn't in on this one.

closes port-macppc/37520, filed by Ted Unangst.
2007-12-11 23:23:02 +00:00
jmcneill c44d13d630 No longer required after jmcneill-pm merge. 2007-12-11 23:07:30 +00:00
lukem a4914dc7f9 Use __KERNEL_RCSID(). For these .S files, the following style was
adopted, a la .C files and <sys/cdefs.h>:
  *  move <machine/asm.h> to the top
  *  use __KERNEL_RCSID() immediately after it
2007-12-11 23:06:11 +00:00
macallan 965a184e93 switch to majors.powerpc 2007-12-11 22:30:39 +00:00
macallan 1e6d2e66e6 make this compile again 2007-12-11 21:00:22 +00:00
garbled 76a99a952a Fix the endless stream of 7's problem on i8259-like interrupt controllers
once and for all.  The i8259 does not like to be read in a loop, when an
interrupt comes in, it will return a valid value, however, if you keep
reading it until there are no outstanding interrupts, it will return 7
(which is the lpt interrupt).  Change the pic handler to give an argument
to the get_irq functions of mode, which indicates if this is the first
time we are asking, or if we are just rechecking in a loop.  Non-i8259
handlers can safely ignore this argument.

Tested to fix the stream of 7's problem on prep and ofppc.  Got rid of
the nasty hack in ofppc with this too, and the prep machine seems to take
less interrupts now, which is a good thing.
2007-12-11 18:04:18 +00:00
ad 19e49bf314 And you, be ye fruitful, and multiply; bring forth abundantly in the earth,
and multiply therein. (Genesis 9:6-8)
2007-12-11 17:12:26 +00:00
ad 65d64ddefe Make it compile. 2007-12-11 17:03:35 +00:00
ad a3576cd2c3 Add cpu_intr_p(). 2007-12-11 17:02:32 +00:00
ad 2505fdfd77 Get landisk compiling again. 2007-12-11 16:51:13 +00:00
ad 730c8a98ab +landisk 2007-12-11 16:33:57 +00:00
lukem 5f235cda5e MAKEVERBOSE support 2007-12-11 13:56:50 +00:00
lukem ceed9c722c use __KERNEL_RCSID() 2007-12-11 11:52:26 +00:00
dogcow 1098fc279b add #include for missing typedefs 2007-12-11 09:26:11 +00:00
martin 57f85d1876 Make sure the compiler does not reorder stores accross spl...() calls
[or, for completeness, calls changing the processor state]. The mutex
code has small race windows otherwise.
2007-12-11 08:59:57 +00:00
dsl a5766b890b Include mach_syscallargs.h to (hopefully) get MACH_SYS_MAXSYSARGS. 2007-12-11 08:06:16 +00:00
nisimura 0edee75daa - have machine/cpu.h and sys/device.h references here. 2007-12-11 05:32:12 +00:00
nisimura d1ce7e7621 - switch to use majors.powerpc. 2007-12-11 05:01:21 +00:00
jmcneill 9313b4bcb3 Disable apm@acpi on amd64, since we don't create /dev/apmctl, build apmd,
or provide machine/apmvar.h. Ok ad@
2007-12-11 04:22:46 +00:00
dsl 380984af81 Use MACH_SYS_MAXSYSARGS for the syscall args array, don't hardcode 8. 2007-12-10 22:28:45 +00:00
ad d0e415a936 GENERIC is good enough. 2007-12-10 22:27:46 +00:00
ad 8218ef4d43 Real hardware has been available for a long time now! 2007-12-10 21:48:20 +00:00
garbled 05fd0d9547 Switch ofppc to the unified powerpc majors file. This should make single
user mode work.
2007-12-10 18:19:45 +00:00
wiz 30df2bb21e Add acpiecdt and add a comment explaining it (from i386/GENERIC). 2007-12-10 17:44:33 +00:00
garbled 5c179ff52d Add a new majors.powerpc. This was cobbled together from the majors
files of all the different powerpc ports (except amigappc).  It should be
compatible with sandpoint and macppc.  It is compatible with evbppc minus
one device (gtmpsc).

To convert a port to use this file rather than a local one, delete your
majors file, and edit your files.port to point to this instead.  (I will
follow up with a MAKEDEV fix to support this)
2007-12-10 17:43:52 +00:00
bouyer 9ef60ea019 Make Xen kernels build again. 2007-12-10 13:39:06 +00:00
jmcneill e099142b51 Revert previous, thanks wiz! 2007-12-10 12:35:27 +00:00
dogcow 646b6c65c5 sometimes we don't have MTRR. (thanks, taca!) 2007-12-10 03:12:46 +00:00
martin 8ddc5309ba Add support for "dumppcb" - Nick says it makes ddb a lot more happy. 2007-12-09 22:04:32 +00:00
smb 55755eddc3 Change pnp_get_platform to pmf_get_platform 2007-12-09 21:52:05 +00:00
xtraeme 273ccc1066 Remove useless returns at the end of void functions. 2007-12-09 21:14:26 +00:00
jmcneill 6dc665045d How did these get lost? 2007-12-09 20:32:17 +00:00
jmcneill 4c1d81b2b5 Merge jmcneill-pm branch. 2007-12-09 20:27:42 +00:00
martin 3947df41d1 Provide cpu_intr_p(), at least for non-MULTIPROCESSOR kernels.
Based on suggestions by Andrew Doran.
2007-12-09 20:12:54 +00:00
ad be36918dcb Use sys/atomic instead of __asm(). 2007-12-09 15:35:15 +00:00
ad f7576cd670 Use the new memory barriers. 2007-12-09 15:33:13 +00:00
ad 36fb43dbdb Use atomic_cas_ulong(). 2007-12-09 15:32:27 +00:00
ad 56c1b0074f Minor correction to previous. 2007-12-09 15:31:03 +00:00
ad dd24075295 - pmap_reactivate: save an atomic op if possible.
- pmap_tlb_shootdown: use atomic ops instead of _lock_cas().
2007-12-09 15:29:53 +00:00
nisimura da81a6921f - make sure to advertise flowcontrol and 1000T FDX/HDX capablity for
GbE NICs.
- stop and reactive MII auto polling for every MII read/write access
in vge.c and nvt.c.
2007-12-09 09:55:58 +00:00