Commit Graph

21 Commits

Author SHA1 Message Date
Peter Grehan
04975fbba5 Copy SPRG0-3 registers at boot-time and restore when calling into
OpenFirmware. FreeBSD/ppc uses SPRG0 as the per-cpu data area pointer,
and SPRG1-3 as temporary registers during exception handling. There
have been a few instances where OpenFirmware does require these to
be part of it's context, such as cd-booting an eMac.

reported by:	many
MFC after:	3 days
2005-10-30 21:29:59 +00:00
Warner Losh
60727d8b86 /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
Marius Strobl
39513fa664 Instead of "OpenFirmware", "openfirmware", etc. use the official spelling
"Open Firmware" from IEEE 1275 and OpenFirmware.org (no pun intended).

Ok'ed by:	tmm
2004-08-16 15:45:27 +00:00
Peter Grehan
a76b77653c Bring KDB stack size into line with thread stack size (4 pages). 2004-07-23 05:31:14 +00:00
Peter Grehan
def828503c No need for ddb option. Never a need for ipkdb option. 2004-07-12 22:22:53 +00:00
Peter Grehan
49f397d0c3 Interrupt statistics, vmstat -i now works.
Submitted by:  Suleiman Souhlal <refugee@segfaulted.com>
Slightly modified by: grehan
Derived from:  i386
2004-02-11 13:18:31 +00:00
Peter Grehan
867069044e - Add definition for GET_CPUINFO, required by new trap_subr code
- garbage-collect unused defs
2004-02-04 12:57:41 +00:00
Peter Grehan
cb87db740e Remove BAT invalidation. This is done later in the boot sequence,
so isn't required here, and seems to cause problems when booting
from disk.

Approved by:  benno
2003-01-22 01:47:05 +00:00
Peter Grehan
3f3331903d - moved intrcnt/intrnames to locore.s to fix sysctl -a panic
Approved by: benno
2002-09-19 04:29:59 +00:00
Benno Rice
c3e9df1087 - Make sure we don't trample our metadata pointer in our initial bootstrap.
- Load metadata parameters.
2002-07-10 12:16:48 +00:00
Benno Rice
637dd1a0b3 - Use tmpstk exclusively in the init path.
- Remove redundant code.

Submitted by:	Peter Grehan <peterg@ptree32.com.au>
2002-06-29 09:31:27 +00:00
Benno Rice
6c2a062580 Many fixes to low-level trap and interrupt handling:
- Tidy up clock code.  Don't repeatedly call hardclock().
- Remove intrnames, decrnest and intrcnt from locore.s
- Coalesce all trap handling into a single stub that then calls a dispatch
  function.

Submitted by:	Peter Grehan <peterg@ptree32.com.au>
2002-06-29 09:28:21 +00:00
Benno Rice
b57e802a85 Commit of stuff that's been sitting in my tree for a while.
Highlights include:
- New low-level trap code from NetBSD.  The high level code still needs a lot
  of work.
- Fixes for some pmap handling in thread switching.
- The kernel will now get to attempting to jump into init in user mode.  There
  are some pmap/trap issues which prevent it from actually getting there though.

Obtained from:	NetBSD (parts)
2002-04-29 12:14:31 +00:00
Benno Rice
b8160b5af4 - Prevent the decrementer interrupt handler from nesting.
- Catch some more cases of PSL_EE and PSL_RI getting out of sync.
2002-02-28 11:57:47 +00:00
Benno Rice
4eed0cf1be Make fork work, at least for kthreads. Switching still has some issues. 2002-02-28 03:24:07 +00:00
Benno Rice
5244eac968 Complete rework of the PowerPC pmap and a number of other bits in the early
boot sequence.

The new pmap.c is based on NetBSD's newer pmap.c (for the mpc6xx processors)
which is 70% faster than the older code that the original pmap.c was based
on.  It has also been based on the framework established by jake's initial
sparc64 pmap.c.

There is no change to how far the kernel gets (it makes it to the mountroot
prompt in psim) but the new pmap code is a lot cleaner.

Obtained from:	NetBSD (pmap code)
2002-02-14 01:39:11 +00:00
John Baldwin
0bbc882680 Overhaul the per-CPU support a bit:
- The MI portions of struct globaldata have been consolidated into a MI
  struct pcpu.  The MD per-CPU data are specified via a macro defined in
  machine/pcpu.h.  A macro was chosen over a struct mdpcpu so that the
  interface would be cleaner (PCPU_GET(my_md_field) vs.
  PCPU_GET(md.md_my_md_field)).
- All references to globaldata are changed to pcpu instead.  In a UP kernel,
  this data was stored as global variables which is where the original name
  came from.  In an SMP world this data is per-CPU and ideally private to each
  CPU outside of the context of debuggers.  This also included combining
  machine/globaldata.h and machine/globals.h into machine/pcpu.h.
- The pointer to the thread using the FPU on i386 was renamed from
  npxthread to fpcurthread to be identical with other architectures.
- Make the show pcpu ddb command MI with a MD callout to display MD
  fields.
- The globaldata_register() function was renamed to pcpu_init() and now
  init's MI fields of a struct pcpu in addition to registering it with
  the internal array and list.
- A pcpu_destroy() function was added to remove a struct pcpu from the
  internal array and list.

Tested on:	alpha, i386
Reviewed by:	peter, jake
2001-12-11 23:33:44 +00:00
Mark Peek
0308a57783 Clean up the trap handling code and make it consistent with the other platforms.
Submitted by:	jhb
2001-11-05 00:49:03 +00:00
Mark Peek
5fd2c51edb Update PowerPC MD code to compile and do initial bootstrap based on
recent changes (KSE and VM requiring physmem to be setup).

Reviewed by:	benno, jhb, julian
2001-09-20 00:47:17 +00:00
Benno Rice
111c77dcef Fix comment breakage. 2001-06-27 12:20:48 +00:00
Benno Rice
f9bac91b18 Bring in NetBSD code used in the PowerPC port.
Reviewed by:	obrien, dfr
Obtained from:	NetBSD
2001-06-10 02:39:37 +00:00