Commit Graph

428 Commits

Author SHA1 Message Date
benno
9e81110a6e Remove some diagnostic code that snuck in. 2002-07-10 09:48:43 +00:00
benno
d842b432e7 Remove some dead code. 2002-07-10 09:46:49 +00:00
benno
b053cc9efe Remove some unused includes. 2002-07-10 09:46:24 +00:00
benno
51d0233947 Bring this in line with what I'm using. 2002-07-09 13:46:27 +00:00
benno
1262ef823d Add an implementation for pmap_zero_page_area. 2002-07-09 13:44:24 +00:00
benno
00db70e21a Add the OF_getetheraddr function required by if_gem. 2002-07-09 13:43:06 +00:00
benno
dca19fc035 Tidy up trap vector and external interrupt setup. 2002-07-09 13:40:37 +00:00
benno
73aaaf9a29 Driver for the Apple UniNorth Host-PCI bridge.
This is in a PowerMac-specific subdirectory as it is hoped that we will support
more than just the PowerMac platform.
2002-07-09 13:34:09 +00:00
benno
3e835e4704 OpenFirmware PCI support code.
This and the sparc64 equivalent should probably be merged at some point.
2002-07-09 13:27:58 +00:00
benno
3b1e5e1a74 Changes for KSE3.
Submitted by:	Peter Grehan <peterg@ptree32.com.au>
2002-07-09 12:57:23 +00:00
benno
e53166ffd0 Add this file, which I forgot in a previous commit.
This relates to the trap/interrupt cleanup.

Submitted by:	Peter Grehan <peterg@ptree32.com.au>
2002-07-09 12:50:58 +00:00
benno
eacece7da3 1) Add busdma machdep code.
2) Add bus_pio.h and bus_memio.h (which do nothing).

Submitted by:	Peter Grehan <peterg@ptree32.com.au> (1)
2002-07-09 12:47:14 +00:00
benno
69112364bc Driver for OpenPIC compatible interrupt controllers.
It's fairly PowerMac specific at the moment, but that should be fixable.
2002-07-09 11:26:10 +00:00
benno
4898dffa90 - Add the "compatible" property to the list that we keep in ivars.
- Add interrupt alloc/setup/teardown/dealloc support, via whichever PIC
  OpenFirmware gives us.
2002-07-09 11:13:33 +00:00
benno
95feadb0a5 Add interrupt handling support code.
I've tried to make this fairly platform-independant as some PowerPC platforms
may not have openpic-style interrupt controllers.  This may not have the best
performance but it works for now.
2002-07-09 11:12:20 +00:00
mike
ebfda4c0dd Move __offsetof() macro from <machine/ansi.h> to <sys/cdefs.h>. It's
hardly MD, since all our platforms share the same macro.  It's not
really compiler dependent either, but this helps in reducing
<machine/ansi.h> to only type definitions.
2002-07-08 16:43:35 +00:00
peter
62e40d1277 Add a special page zero entry point intended to be called via the single
threaded VM pagezero kthread outside of Giant.  For some platforms, this
is really easy since it can just use the direct mapped region.  For others,
IPI sending is involved or there are other issues, so grab Giant when
needed.

We still have preemption issues to deal with, but Alan Cox has an
interesting suggestion on how to minimize the problem on x86.

Use Luigi's hack for preserving the (lack of) priority.

Turn the idle zeroing back on since it can now actually do something useful
outside of Giant in many cases.
2002-07-08 04:24:26 +00:00
peter
b73c441dad Collect all the (now equivalent) pmap_new_proc/pmap_dispose_proc/
pmap_swapin_proc/pmap_swapout_proc functions from the MD pmap code
and use a single equivalent MI version.  There are other cleanups
needed still.

While here, use the UMA zone hooks to keep a cache of preinitialized
proc structures handy, just like the thread system does.  This eliminates
one dependency on 'struct proc' being persistent even after being freed.
There are some comments about things that can be factored out into
ctor/dtor functions if it is worth it.  For now they are mostly just
doing statistics to get a feel of how it is working.
2002-07-07 23:05:27 +00:00
peter
9ed546fad0 Update for post-kse3 pmap kthread allocation changes 2002-07-07 22:56:31 +00:00
mike
beba9fcf0e Since printf(3) now supports the `j' conversion specifier, use that
when printing intmax_t and uintmax_t.

Forgotten by:	mike
Noticed by:	bde
2002-06-30 05:48:03 +00:00
benno
bb87c74c1b Add an inline to call eieio.
("Enforce In-order Execution of I/O".  I am not making this up.)
2002-06-29 10:00:07 +00:00
benno
a55c84e369 We don't need to clear RI in the MSR when entering a critical section. 2002-06-29 09:55:57 +00:00
benno
bed0f0d856 in_cksum et al.
Submitted by:	Peter Grehan <peterg@ptree32.com.au>
2002-06-29 09:49:26 +00:00
benno
4eaae0ef21 Implement vtophys() 2002-06-29 09:47:06 +00:00
benno
d8edf207d8 Add pmap_mapdev and pmap_unmapdev. 2002-06-29 09:45:59 +00:00
benno
668238a99c - Initialise battable to cover I/O spaces.
- Statically size the bpvo entries to avoid conflicts between bpvo allocation
  and the vm allocator.
- Shift pmap_init2 code into pmap_init.
- Add UMA_ZONE_VM flag to uma_zcreate.

Submitted by:	Peter Grehan <peterg@ptree32.com.au>
2002-06-29 09:43:59 +00:00
benno
202c3a8b7c To quote Peter:
The case in cpu_switch() where there isn't a higher priority thread
(choosethread() == curthread) uses r4 as the PCB context pointer. However, the
use of r4 after the label L2 is incorrect, since it was probably trashed by
the call to choosethread, and in any case was set up to curthread at the start
of the routine.

This condition will occur when an interrupt thread schedules a netisr, which
is a lower priority thread.

Another (probably unnecessary) difference is that I was paranoid about
register trashing, so I decided to save r2 and r13 as well.

Submitted by:	Peter Grehan <peterg@ptree32.com.au>
2002-06-29 09:39:44 +00:00
benno
588d2f5396 mempcy/bcopy handles overlapping copies so make ovbcopy call it. 2002-06-29 09:34:54 +00:00
benno
a3a56ebeb3 Add BOOTP_NFSROOT support code. 2002-06-29 09:33:18 +00:00
benno
b3dcfcf0d7 - 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
6c2607ad88 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
d7065a7a3b Convert this from mostly inline assembler to mostly C.
Submitted by:	Peter Grehan <peterg@ptree32.com.au>
2002-06-29 09:16:30 +00:00
jake
e102a9b6dd Add an MD callout like cpu_exit, but which is called after sched_lock is
obtained, when all other scheduling activity is suspended.  This is needed
on sparc64 to deactivate the vmspace of the exiting process on all cpus.
Otherwise if another unrelated process gets the exact same vmspace structure
allocated to it (same address), its address space will not be activated
properly.  This seems to fix some spontaneous signal 11 problems with smp
on sparc64.
2002-06-24 15:48:02 +00:00
mini
ef6f2f567d Remove unused diagnostic function cread_free_thread().
Approved by:	alfred
2002-06-24 06:22:00 +00:00
iedowse
37d2aea25a Make vm_pindex_t 64-bit on all platforms. This is necessary to avoid
overflows with the large file sizes that UFS2 permits.

Reviewed by:	dillon, alc, tegge
2002-06-23 21:57:19 +00:00
peter
df4ec1a7b3 Deorbit suibyte(). It was only used for split address space systems
for supporting UIO_USERISPACE (ie: it wasn't used).
2002-06-20 07:13:35 +00:00
peter
4830c34648 Move the "- 1" into the RQB_FFS(mask) macro itself so that
implementations can provide a base zero ffs function if they wish.
This changes
  #define RQB_FFS(mask) (ffs64(mask))
  foo = RQB_FFS(mask) - 1;
to
  #define RQB_FFS(mask) (ffs64(mask) - 1)
  foo = RQB_FFS(mask);
On some platforms we can get the "- 1" for free, eg: those that use the
C code for ffs64().

Reviewed by:	jake (in principle)
2002-06-20 06:21:20 +00:00
jhb
2aa855d8b1 - Fixup / remove obsolete comments.
- ktrace no longer requires Giant so do ktrace syscall events before and
  after acquiring and releasing Giant, respectively.
- For i386, ia32 syscalls on ia64, powerpc, and sparc64, get rid of the
  goto bad hack and instead use the model on ia64 and alpha were we
  skip the actual syscall invocation if error != 0.  This fixes a bug
  where if we the copyin() of the arguments failed for a syscall that
  was not marked MP safe, we would try to release Giant when we had
  not acquired it.
2002-06-07 05:47:35 +00:00
dfr
a3b8e6c9c7 Move the definition of ElfN_Hashelt to common headers. The only platform
which has a different definition for this is alpha.
2002-05-30 08:32:18 +00:00
benno
b3ff7bedf7 The stack is not at the top of the user struct. 2002-05-28 12:31:34 +00:00
benno
ae97f0c60a Remove an assertion as to whether the current thread already had the FPU or
not.  It may be desirable to put something similar back, but it's getting in
the way in it's current form.
2002-05-28 12:28:22 +00:00
benno
4fc9c21665 - Move macros that represent where syscall args are kept in a trapframe from
trap.c to frame.h
- Use the macros in vm_machdep.c:cpu_fork() to set up the trap frame of the
  new thread.
2002-05-28 12:24:29 +00:00
benno
ef9686f87e Remove the old prototype for kcopy. It's in cpu.h now. 2002-05-28 09:38:02 +00:00
benno
ebe993f5ea Implement pmap_copy and pmap_copy_page. 2002-05-28 07:38:55 +00:00
benno
56b6a77a90 Move the kcopy() function from trap.c to machdep.c. Add a prototype. 2002-05-28 07:36:36 +00:00
benno
556157d84a Print srr1 in printtrap()
Submitted by:	Peter Grehan <peterg@ptree32.com.au>
2002-05-27 11:20:19 +00:00
benno
d7323955b4 Get the correct memory regions from OpenFirmware. We were getting the
"available" ranges, not the "physical" ranges.  Clean up some of the
bootstrap code in the process.

Submitted by:	Peter Grehan <peterg@ptree32.com.au>
2002-05-27 11:18:12 +00:00
benno
496e86d41b Use correct types in [sf]uword32. 2002-05-27 10:50:47 +00:00
dfr
e8d149b2f7 Add declarations of suword32 and suword64. Add implementations of one or
the other (or both) to all the platforms. Similar for fuword32 and
fuword64.
2002-05-26 16:03:13 +00:00
jake
88bdee3b2f Make the run queue parameters machine dependent. Optimize 64 bit
architectures by using a 64 bit word for the bit array which keeps
track of non-empty queues.

Reviewed by:	peter
2002-05-25 01:12:23 +00:00