Commit Graph

1164 Commits

Author SHA1 Message Date
ahoka
c0dfcdb337 Add a missing opt_multiboot.h into sys/arch/i386/i386/machdep.c.
Also do the missed rename of multiboot_ksyms_init to
multiboot_ksyms_addsyms_elf to compile with MULTIBOOT set.

This caused a minor and a more serious bug in the past:
- dmesg did not contain the information about the loader
- /dev/ksyms did not work when the kernel was booted with a
  multiboot bootloader (grub for example)

Ok by jmcneill, joerg.
2009-02-22 18:05:42 +00:00
christos
461a86f9bd merge christos-time_t 2009-01-11 02:45:45 +00:00
pooka
2c52214ded _LKM -> _MODULE 2008-12-29 19:59:09 +00:00
ad
68c33f6d28 Fix a comment. 2008-12-21 11:18:19 +00:00
ad
6ad4a3fdd5 Remove stray opt_redzone.h 2008-12-20 13:09:44 +00:00
ad
9a5c311632 Revert part of previous. 2008-12-20 13:07:36 +00:00
ad
0e83efcacb opt_noredzone.h is gone. 2008-12-20 13:06:25 +00:00
ad
5e34fbf90e - Kill NOREDZONE.
- Make the redzone conditional on DIAGNOSTIC.
- Give amd64 an additional page for the uarea. 2 is not enough.
2008-12-20 12:41:19 +00:00
pooka
29f99fff05 _VMPARAM_H_ -> _$MACHINE_VMPARAM_H_ 2008-12-13 14:07:10 +00:00
ad
92ce8c6a3d Make the emulations, exec formats, coredump, NFS, and the NFS server
into modules. By and large this commit:

- shuffles header files and ifdefs
- splits code out where necessary to be modular
- adds module glue for each of the components
- adds/replaces hooks for things that can be installed at runtime
2008-11-19 18:35:57 +00:00
ad
8537937e0b Wrap sigframe_sigcontext in _KERNEL 2008-11-14 13:05:34 +00:00
ad
c475578182 Remove some compat ifdefs that aren't really needed. 2008-11-14 12:53:18 +00:00
christos
2aa2273679 use a macro to get to d_type. 2008-10-26 17:41:11 +00:00
mrg
c0a0f4462b - use _I386_FOO_H for multi-include protection
- use <i386/foo.h> in a couple of places
2008-10-26 06:57:30 +00:00
wrstuden
fc7511b00e Merge wrstuden-revivesa into HEAD. 2008-10-15 06:51:17 +00:00
joerg
9bb39d02a6 Add "multiboot" command to boot multiboot compliant kernels like Xen.
Patch provided by Robert Swindell with fixes for the command line
parsing and addition of passing module options from me. The kernel now
always gets the full string for modules like for the command line,
everything before the first space/tab is the path name of the module.
2008-10-11 11:06:19 +00:00
gmcgarry
5aa0bc7608 Selector registers are 16-bit and binutils 2.18 insists that only 16-bit
accesses are permitted on them.  Therefore, change movl to movw.  No change to
machine code generated.
2008-07-07 13:01:16 +00:00
drochner
54745077e8 Remove "struct device" from "struct pic", where it was only real
for ioapics and faked up for others. Add it to "struct ioapic_softc"
for now, until device/softc get split.
This required all typecasts between "struct pic" and "struct ioapic_softc"
to be replaced, I hope I got them all.
functionally tested on i386, compile-tested on xen, untested on amd64
2008-07-03 14:02:24 +00:00
cegger
c82e679e68 struct device * -> device_t 2008-06-27 11:03:13 +00:00
gmcgarry
8cb6efd4df Add stdargs support for pcc. 2008-06-21 00:56:39 +00:00
ad
d1b2ddc725 pmap_remove_all() for x86. Also, always defer freeing ptps to pmap_update().
There may be a better way to do this, but for now this is simple and avoids
potential bugs.

Proposed on tech-kern and discussed with chs@.
2008-06-05 21:09:12 +00:00
jmcneill
10f75496ad MI implementation of AcpiAcquireGlobalLock and AcpiReleaseGlobalLock. 2008-05-24 22:16:20 +00:00
jmcneill
43c510d39b Replace asm implementation of ACPI global lock functions with C equivalents. 2008-05-24 22:02:31 +00:00
ad
d9b262b49d Mark x86_curlwp() with __attribute__ ((const)), so gcc can CSE it and know
that it does not clobber global data.
2008-05-22 13:55:51 +00:00
ad
9188c0738a Wrap stuff in #ifdef _KERNEL 2008-05-11 16:57:43 +00:00
ad
f674d9678b Share cpu.h between the x86 ports. 2008-05-11 15:32:20 +00:00
ad
50d8ae9d14 Simplify x86 identcpu code, and share between i386/amd64. 2008-05-11 14:44:53 +00:00
ad
75ada79f33 Improve x86 tsc handling:
- Ditch the cross-CPU calibration stuff. It didn't work properly, and it's
  near impossible to synchronize the CPUs in a running system, because bus
  traffic will interfere with any calibration attempt, messing up the
  timings.

- Only enable the TSC on CPUs where we are sure it does not drift. If we are
  On a known good CPU, give the TSC high timecounter quality, making it the
  default.

- When booting CPUs, detect TSC skew and account for it. Most Intel MP
  systems have synchronized counters, but that need not be true if the
  system has a complicated bus structure. As far as I know, AMD systems
  do not have synchronized TSCs and so we need to handle skew.

- While an AP is waiting to be set running, try and make the TSC drift by
  entering a reduced power state. If we detect drift, ensure that the TSC
  does not get a high timecounter quality. This should not happen and is
  only for safety.

- Make cpu_counter() stuff LKM safe.
2008-05-10 16:12:32 +00:00
ad
9ab200719c Merge cpu_counter.h. 2008-05-10 14:53:54 +00:00
joerg
a790b941e6 Make cpu_idle a macro calling a function pointer on x86.
Select the Xen idle routine for Xen, mwait if supported by the CPU and
it is not AMD and halt otherwise. As reported by Christoph Egger,
AMD Barcelona keeps the CPU in C0 state with MWAIT, contrary to HLT,
which uses C1 and therefore much less power.
2008-05-09 18:11:28 +00:00
yamt
5b453874fc add macros to designate the end of asm functions. ok by Andrew Doran. 2008-05-03 05:54:52 +00:00
ad
e1df701f0d Avoid unneeded AST faults. 2008-04-30 12:44:27 +00:00
ad
104cf0ae89 Add support for kernel preeemption to the i386 and amd64 ports. Notes:
- I have seen one isolated panic in the x86 pmap, but otherwise i386
  seems stable with preemption enabled.

- amd64 is missing the FPU handling changes and it's not yet safe to
  enable it there.

- The usual level for kern.sched.kpreempt_pri will be 128 once enabled
  by default. For testing, setting it to 0 helps to shake out bugs.
2008-04-28 22:47:37 +00:00
martin
ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
ad
fff5f20c25 - Give ci_want_resched a single cache line, and align. This is for monitor/
mwait. At least one errata sheet from Intel notes that a single line
  should be used.
- Align cc_microtime.
2008-04-24 11:26:52 +00:00
cegger
20161b7289 Access Xen's vcpu info structure per-CPU.
Tested on i386 and amd64 (both dom0 and domU) by me.
Xen2 tested (both dom0 and domU) by bouyer.
OK bouyer
2008-04-21 15:15:33 +00:00
cegger
ed5b592b8e idt_* are not implemented for Xen. So don't provide the prototypes for Xen. 2008-04-19 12:10:08 +00:00
jmcneill
3bc833ec73 Revert previous. 2008-04-11 11:24:41 +00:00
jmcneill
b66550c825 Remove a nasty hack that slipped in during the ACPICA update that should
never have made it in-tree. How ACPI has ever worked since 4.99.42 is
beyond me.
2008-04-11 02:27:57 +00:00
yamt
6c336cd753 don't bother to check curlwp==NULL. 2008-02-29 12:34:23 +00:00
xtraeme
4ac581c0f9 Add back the CPU_TMLR_* definitions for binary sysctl compatibility
with NetBSD pre-2.0, and use them in the longrun driver again.

Requested by cube@.
2008-02-27 20:18:56 +00:00
xtraeme
f402cadf9a Remove CTL_MACHDEP_NAMES, it's not used anywhere.
Ok by martin@.
2008-02-27 18:26:15 +00:00
xtraeme
e4a52ebb2b - Fixup the machdep.tm_longrun_* sysctl nodes creation.
- The CTL_TMLR_ static definitions for CTL_MACHDEP are not needed anymore.
2008-02-27 17:39:37 +00:00
xtraeme
c524510b66 Split off the Transmeta Crusoe Longrun code into its own file, that
way identcpu.c and machdep.c are not cluttered with foreign code.

The driver is built by default as before, but the sysctl subtree will
only be created if longrun is detected and not always as the old code
did. This matches what the FreeBSD code does.

Ok by christos@.
2008-02-26 18:24:28 +00:00
ad
bc9a63754d #define __HAVE_ATOMIC_AS_MEMBAR, indicating that:
- atomic_cas_ni() does an implicit membar_exit()
- all other atomic operations do an implicit membar_sync()

While this might seem kind of arbitrary it's the basis for some important
optimizations.
2008-02-21 16:31:13 +00:00
ad
7210c1fef8 Align cc_microtime and struct cpu_info to 64b. 2008-02-10 14:37:41 +00:00
bouyer
98a8e8b486 Merge the bouyer-xeni386 branch. This brings in PAE support to NetBSD xeni386
(domU only). PAE support is enabled by 'options PAE', see the new XEN3PAE_DOMU
and INSTALL_XEN3PAE_DOMU kernel config files.

See the comments in arch/i386/include/{pte.h,pmap.h} to see how it works.
In short, we still handle it as a 2-level MMU, with the second level page
directory being 4 pages in size. pmap switching is done by switching the
L2 pages in the L3 entries, instead of loading %cr3. This is almost required
by Xen, which handle the last L2 page (the one mapping 0xc0000000 - 0xffffffff)
in a very special way. But this approach should also work for native PAE
support if ever supported (in fact, the pmap should almost suport native
PAE, what's missing is bootstrap code in locore.S).
2008-01-23 19:46:43 +00:00
bouyer
3d0b4af882 Make first argument of Xen's pmap_pte_cas() volatile, fix a warning
building pmap.c.
2008-01-20 18:41:47 +00:00
joerg
3615cf7715 Now that __HAVE_TIMECOUNTER and __HAVE_GENERIC_TODR are invariants,
remove the conditionals and the code associated with the undef case.
2008-01-20 18:09:03 +00:00
yamt
ecf338e548 - rewrite P->V tracking.
- use a hash rather than SPLAY trees.
	  SPLAY tree is a wrong algorithm to use here.
	  will be revisited if it slows down anything other than
	  micro-benchmarks.
	- optimize the single mapping case (it's a common case) by
	  embedding an entry into mdpage.
	- don't keep a pmap pointer as it can be obtained from ptp.
	  (discussed on port-i386 some years ago.)
	  ideally, a single paddr_t should be enough to describe a pte.
	  but it needs some more thoughts as it can increase computational
	  costs.
- pmap_enter: simplify and fix races with pmap_sync_pv.
- don't bother to lock pm_obj[i] where i > 0, unless DIAGNOSTIC.
- kill mp_link to save space.
- add many KASSERTs.
2008-01-20 13:43:37 +00:00