Commit Graph

162 Commits

Author SHA1 Message Date
skrll
74c813c4e9 s/proc/lwp/ in comment 2007-11-16 07:36:10 +00:00
ad
88697952bb Clear the direction flag on entry to the kernel. 2007-11-14 11:09:49 +00:00
ad
1207625f42 - cpu_vendor was both an int and char[] on amd64 - fix it.
- Run the errata check/patch on all CPUs, not just the boot processor.
2007-11-12 18:44:42 +00:00
ad
e7976c8a86 Mark cpu_info::ci_tlbstate volatile to ensure that the compiler doesn't
reorder accesses to it. It's updated from the TLB IPI handlers and we don't
block those, so the order in which things are read/updated is important.
2007-10-29 01:35:36 +00:00
joerg
930e1f6e1d Match delay/DELAY on x86 with delay(9). It takes an unsigned int as
argument. Use this and replace the inline assembly (mul + div using the
64bit intermediate result) with normal 32bit multiplication and
division. The compiler can turn the division into a multiplication and
shift, making it even cheaper then the original assembly. For extreme
long delays, just use 64bit arithmetic.
2007-10-26 13:24:39 +00:00
yamt
24a1632cb3 merge yamt-x86pmap branch.
- reduce differences between amd64 and i386.  notably, share pmap.c
  between them.  it makes several i386 pmap improvements available to
  amd64, including tlb shootdown reduction and bug fixes from Stephan Uphoff.
- implement deferred pmap switching for amd64.
- remove LARGEPAGES option.  always use large pages if available.
  also, make it work on amd64.
2007-10-18 15:28:31 +00:00
garbled
d974db0ada Merge the ppcoea-renovation branch to HEAD.
This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree.  Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches.  The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
2007-10-17 19:52:51 +00:00
joerg
19459bd736 Bump default size of the message buffer from 16 KB to 32 KB.
This is large enough that boot -v on most systems fits into the
message buffer, which makes it easier for debugging.
2007-10-13 14:46:54 +00:00
ad
8338d4a584 Fix the ifdefs to match i386. 2007-10-03 20:19:47 +00:00
ad
5939a3f4b8 Make the atomics inline unless !__GNUC__. 2007-10-03 12:24:48 +00:00
ad
a06455d0e5 Now that the bootblocks are the same, share loadfile_machdep.h between
amd64 and i386.
2007-10-01 20:31:41 +00:00
ad
bd63f75ddf Sync with i386. 2007-09-27 01:50:01 +00:00
ad
0c800520db Only include machine/cpufunc.h if _KERNEL. 2007-09-27 01:10:11 +00:00
xtraeme
66ed18bcf1 Fix profiling kernels:
read_psl -> x86_read_psl
write_psl -> x86_write_psl
disable_intr -> x86_disable_intr
2007-09-26 20:27:26 +00:00
ad
9c412e0cbf x86 changes for pcc and LKMs.
- Replace most inline assembly with proper functions. As a side effect
  this reduces the size of amd64 GENERIC by about 120kB, and i386 by a
  smaller amount. Nearly all of the inlines did something slow, or something
  that does not need to be fast.
- Make curcpu() and curlwp functions proper, unless __GNUC__ && _KERNEL.
  In that case make them inlines. Makes curlwp LKM and preemption safe.
- Make bus_space and bus_dma more LKM friendly.
- Share a few more files between the ports.
- Other minor changes.
2007-09-26 19:48:34 +00:00
mrg
ceb63bd6ed in VALID_USER_DSEL3() only check the low 16 bits.
this fixes 32bit gmake from occasionally reporting "Error 255" after
a command has successfully run.

lots of help from ad@ and joerg@.
2007-09-26 02:33:46 +00:00
ad
b684adf6ed ci_astpending is no more. 2007-09-25 17:08:08 +00:00
dsl
06b0a1bdab Define netbsd32_uint64 for 64bit integers with the alignment requirement
of the corresponding 32bit architecture.
Use it for the 64bit items in netbsd32_statvfs so that the structure
doesn't collect 8byte alignment (and 4 bytes of trailing padding).
This replaces the 'packed' attribute which wasn't architecture specific
and would cause massive overheads accessing every member of sparc64.
Should allow the MIPS64 port do DTRT.
2007-09-16 22:35:01 +00:00
drochner
dce09ea075 clean up some definitions around rune_t which are not needed anymore 2007-09-03 20:31:56 +00:00
drochner
0e0fe2c353 Fix definitions of UCHAR_MAX/USHRT_MAX and related
types. C99 requires that these definitions promote to (signed/unsigned)
integer the same way as the types the definition is for. And since
unsigned char/short fit into an "int" on all our archs and thus promote
to signed int, the definitions must not be unsigned.
Fixes PR lib/31306 by Neil Booth.
2007-08-31 16:24:21 +00:00
ad
fbb58ada61 Merge most x86 changes from the vmlocking branch, except the threaded soft
interrupt stuff. This is mostly comprised of changes to the pmap modules to
work on multiprocessor systems without kernel_lock, and changes to speed up
tlb shootdowns.
2007-08-29 23:38:01 +00:00
ad
63811f5275 Generic soft interrupts are mandatory. 2007-07-14 21:48:17 +00:00
tsutsui
69dbd2e45e Move x86 common cpu_counter functions into <x86/cpu_counter.h>. 2007-07-07 17:38:26 +00:00
njoly
abfea2f7ae Remove duplicated AMD K8 MSR definitions, already in x86 specialreg.h
file.

ok by xtraeme.
2007-06-06 20:40:11 +00:00
skrll
c7c42ec961 Correct comment - it's cpu_switchto now. 2007-05-21 08:17:41 +00:00
fvdl
816da6f7fe Revert fs/gs changes until I figure out issues with them. 2007-05-21 08:10:38 +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
fvdl
3f7e9a7e0d Don't save/restore %fs and %gs in trapframe. The kernel won't touch them.
Instead, save/restore them on context switch. For 32bit processes, save/restore
the selector values only, for 64bit processes, save/restore the appropriate
MSRs. Iff the defaults have been changed.
2007-05-11 14:01:46 +00:00
ad
8aefa8aa0c Share the sysarch stuff between the x86 ports. PR kern/36046. 2007-04-16 19:12:17 +00:00
njoly
052dae8c13 Add PT_MACHDEP_STRINGS, for kdump output. 2007-04-16 12:22:26 +00:00
xtraeme
6ae05af027 - Remove ci_msr_rvalue, it's not useful anymore as yamt@ pointed out.
- Remove completely debug from msr_ipifuncs, now it's known to work.
2007-03-21 18:20:59 +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
dsl
803fec88b2 Use NETBSD32PTR64() and NETBSD32PTR32() throughout. 2007-03-16 22:23:30 +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
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
ad
2f3dd41194 Include sys/simplelock.h, not sys/lock.h. 2007-03-12 16:43:11 +00:00
drochner
d880082522 clean up how cpus and ioapics are attached at the mainbus:
Seperate "cpubus" and "ioapicbus" -- while they share a common "address
space" (the apic id), the kernel doesn't use this fact. There are different
data passed to cpus and apics, which caused some ugly polymorphism. This
also saves the special "submatch" functions needed to distingush cpus
and ioapics for autoconf. (And it makes that "apid" locators wired
in the kernel configuration are honored now; this allows one to dumb down
an mp box to singleprocessor by userconfig.)
Print "apid" locators in the buses "print" function "as everyone does",
so the per-port cpu drivers don't need to do it.
Being here, constify "struct cpu_functions" and g/c the unused MP_PICMODE
flag.
2007-03-05 16:50:59 +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
thorpej
712239e366 Replace the Mach-derived boolean_t type with the C99 bool type. A
future commit will replace use of TRUE and FALSE with true and false.
2007-02-21 22:59:35 +00:00
pavel
11f19508fd Accept the old ABI versions of signal trampolines for 32-bit
compatibility. Unbreaks the i386 cvsup binary on amd64.

Problem reported by Blair Sadewitz and Viktor Holmlund, fix tested by
Viktor Holmlund.
2007-02-18 01:45:37 +00:00
ad
3363855a4a Remove spllowersoftclock() and CLKF_BASEPRI(), and always dispatch callouts
via a soft interrupt. In the near future, softclock will be run from process
context.
2007-02-16 02:53:43 +00:00
ad
b07ec3fc38 Merge newlock2 to head. 2007-02-09 21:55:00 +00:00
ad
466538383c .. but only if _KERNEL is defined. 2007-01-14 14:08:55 +00:00
ad
d0a255a895 On second thought, implement x86_pause() as a regular function. The small
delay from the call is useful for spinlock backoff.
2007-01-14 14:03:00 +00:00
ad
151f7e0198 x86_pause(): do issue the 'pause' instruction, for EMT64 CPUs. 2007-01-12 20:22:04 +00:00
ad
fb7fd24980 Report on and where possible, try to work around some of the known errata
for Athlon 64 and Opteron processors. Tested briefly by cube@ and elad@.
2007-01-01 20:56:58 +00:00
tnozaki
44eb8f042e fix gcc -Werror -Wmissing-braces problem
mbstate_t(this is opaque object)'s initializer should be ``{ 0 }'',
so changed 1st field of union from character array to integer.
2006-10-04 13:51:59 +00:00
cube
4a5ad09e72 This is again that time of the millenium where we have to crank up a few
static limits to meet modern bloat requirements.

VM_PHYSSEG_MAX needs it to run on Intel's D946GZIS motherboard, as reported
by rix on #NetBSD-code on freenode.  This has a consequence on the initial
number of possible extent allocations for iomem_ex, so increase that value
too.

While there, clarify the action to be taken when VM_PHYSSEG_MAX is maxed
out.

Do that on both amd64 and i386 because the causes, the effects and the code
are mostly the same.
2006-09-27 17:10:34 +00:00
ad
38566f3287 Add an SPLLOWER() macro. 2006-09-05 19:00:42 +00:00
perry
e1c0963dfd temporarily turn on "__HAVE_GENERIC_TODR" 2006-09-03 20:42:14 +00:00