Commit Graph

964 Commits

Author SHA1 Message Date
matt 71416f6690 In struct emul, e_nsysent is *not* initialized to *SYS_NSYSENT but
*SYS_MAXSYSCALL.  Adjust to this and simply compare 'code' to it instead
of doing the p-o-2 dance.
2002-11-01 00:02:40 +00:00
matt 1cec255a41 Move child_return back to syscall.c
Fix syscall to use emulations SYS_syscall/SYS___syscall definitions.
Use the emulation NSYSENT to limit code.
Don't define *syscall_fancy if it will never be used.
2002-10-30 18:34:15 +00:00
manu 6224b0c0ce Fixed mistakes 2002-10-30 07:39:40 +00:00
manu fddf44c0bf Add COMPAT_MACH and EXEC_MACHO support on the PowerPC 2002-10-30 06:41:45 +00:00
manu a3da524774 Prepare syscall.c for COMPAT_MACH support. linux_syscall_intern is
moved to a Linux specific file, child_return is moved to trap.c,
and we introduce a EMULNAME macro co that syscall.c can be included to
define the system call handler for another emulation.
2002-10-30 06:37:37 +00:00
manu fe4e91080d Moved binary compatibility options from arch directory to cpu directory 2002-10-30 06:26:42 +00:00
manu f9cac3b168 Changed the ifndef guard of this header file from _MACH_EXEC_H_ to
_POWERPC_AOUT_EXEC_H_. The former was conflicting with
<compat/mach/mach_exec.h>.
2002-10-28 18:00:40 +00:00
thorpej 4b68c83f09 Make these work with GCC 3.x. 2002-10-25 20:46:44 +00:00
jdolecek e0cc03a09b merge kqueue branch into -current
kqueue provides a stateful and efficient event notification framework
currently supported events include socket, file, directory, fifo,
pipe, tty and device changes, and monitoring of processes and signals

kqueue is supported by all writable filesystems in NetBSD tree
(with exception of Coda) and all device drivers supporting poll(2)

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
2002-10-23 09:10:23 +00:00
chs 4017fd1809 fix two bugs in the previous PTE-spill handling changes:
- in pmap_pte_spill(), the victim PTE could be using the secondary hash,
   in which case its pvo entry is actually in the other bucket.  use the
   correct bucket for the victim pvo when moving it to the front of its list.
 - similarly, in pmap_pvo_remove(), if the pteidx is pre-computed for us,
   it might actually point to the other bucket if the entry is using the
   secondary hash.  adjust ptegidx if this is the case.

these should fix PRs 18645 and 18736.
while I'm here, wrap line lines and do some other misc cleanup.
2002-10-22 04:34:13 +00:00
nathanw c1cc872908 Catch up some code inside #ifdef DEBUG to recent pvo_entry changes. 2002-10-18 20:02:23 +00:00
matt 69f28d5e54 Remove pmap_pte_spill calls. 2002-10-10 22:44:21 +00:00
matt 8c472e414b Move pte_spill calls from trap_subr to trap(). Count the number of
"evictions" and avoide calling pmap_pte_spill if there are no evictions
for the current pmap.  Make the ISI execption use the default exception
code.  Remove lots of dead stuff from trap_subr.

Make olink use TAILQ instead of LIST and be sorted with evicted entries
first and resident entries last.  Make use of this knowledge to make
pmap_pte_spill do a fast exit.
2002-10-10 22:37:50 +00:00
jdolecek 3aa30dca1a fix typo - driver name is 'opb', not 'obp' 2002-10-10 13:45:14 +00:00
thorpej 89bf5a8f8e Add trailing ; to CFATTACH_DECL. 2002-10-02 15:52:22 +00:00
thorpej b96bc0d7bc Use CFATTACH_DECL(). 2002-10-02 04:06:36 +00:00
thorpej d652bdcafe Use CFATTACH_DECL(). 2002-10-01 02:49:56 +00:00
thorpej f818766afe Declare all cfattach structures const. 2002-09-27 20:31:45 +00:00
provos 0f09ed48a5 remove trailing \n in panic(). approved perry. 2002-09-27 15:35:29 +00:00
thorpej 6c88de3b53 Introduce a new routine, config_match(), which invokes the
cfattach->ca_match function in behalf of the caller.  Use it
rather than invoking cfattach->ca_match directly.
2002-09-27 03:17:40 +00:00
thorpej d1ad2ac4f2 Rather than referencing the cfdriver directly in the cfdata entries,
instead use a string naming the driver.  The cfdriver is then looked
up in a list which is built at run-time.
2002-09-27 02:24:06 +00:00
matt b6b04cb00c In mftb(), make sure we say we are clobbering cr0. 2002-09-26 01:13:32 +00:00
thorpej 71404bb533 Don't include <sys/map.h>. 2002-09-25 22:21:01 +00:00
simonb 63096043b3 Use "#define\t" instead of "#define ". 2002-09-22 08:30:56 +00:00
chs c081614ea2 it really helps to get the stub right before cutting + pasting it 27 times.
alas, I did not.  doh.
2002-09-22 07:53:39 +00:00
chs 55e1f79335 add pmap_remove_all() hook (empty on most platforms so far). 2002-09-22 07:17:08 +00:00
gmcgarry dca80f08fd Add __HAVE_MD_RUNQUEUE flag for MD code to override MI run queue primitives. 2002-09-22 04:11:32 +00:00
chs 128b037bfc remove all vesitages of dk_establish(). 2002-09-18 01:46:23 +00:00
chs 5a93abd050 fix the FIRMWORKSBUGS case: ofwr_init() substitutes a wrapper OFW entry point
for the real one, so we must call it before we save off the entry point
that the higher level code will use.
2002-09-16 02:07:24 +00:00
matt 45e5f68016 Allow MAXPHYS to be overriden. Increase the default MSGBUFSIZE to 2 pages. 2002-09-06 19:26:26 +00:00
gehenna 77a6b82b27 Merge the gehenna-devsw branch into the trunk.
This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

	device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
  by using this grammer.

- Added the new naming convention.
  The name of the device switch must be <prefix>_[bc]devsw for auto-generation
  of device switch tables.

- The backward compatibility of loading block/character device
  switch by LKM framework is broken. This is necessary to convert
  from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
  We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
  the LKM framework will refer it to assign device major number dynamically.
2002-09-06 13:18:43 +00:00
matt 05980fc1da Move bufpages to top of kernel vm space. allocate dead zone after buf
pages so that it go larger than > 256MB.
2002-08-28 06:27:20 +00:00
scw 5cff5c076e Don't need <machine/walnut.h> here. 2002-08-27 12:23:06 +00:00
thorpej 139cdc3125 Make nbuf, nswbuf, and bufpages unsigned. Make all operations on these
variables unsigned, and update places where their values are printed.
2002-08-25 20:21:33 +00:00
matt ffdea2c266 Only do the dssall if cpu_altivec is set. 2002-08-23 16:08:10 +00:00
scw 5b79fdfaf7 Add "ecc at plb" device.
Add an "irq" locator to the plb device.
This gets rid of the original hack where ecc support was wedged into
the cpu driver.
2002-08-23 15:01:07 +00:00
simonb 3502025a54 Show the IRQ we attach the ECC handler to. 2002-08-23 13:43:18 +00:00
scw 9ba60b4297 Install the ECC error interrupt handler at the level specified by
a "4xx-ecc-irq" property.
If the property isn't defined, assume the hardware has no ECC support.
This should, ideally, be a config file option.
2002-08-23 12:46:49 +00:00
scw c4fdfebd38 Allow port-specific Makefiles to override the name and location
of locore.[So].
This is in preparation for arch/evbppc.
2002-08-23 12:01:58 +00:00
scw a0d58bf2f5 Remove an extra trailing bracket in a DEBUG printf. 2002-08-23 11:59:40 +00:00
scw f384fe8ba7 Don't assume all com ports run at "COM_FREQ", or a multiple thereof.
Use a board-specific property instead.
2002-08-23 11:42:13 +00:00
scw 19c988633d Don't frob cpu-specific DCR registers in common code. 2002-08-23 11:40:07 +00:00
scw 4968573654 Split off common 4xx locore code so it can be re-used by other 4xx ports. 2002-08-23 11:37:53 +00:00
matt 510b31be28 Add missing PMAPCOUNT2 macro for the non-PMAPCOUNTERS case 2002-08-22 15:43:08 +00:00
matt 9e33535006 Add more evcnt entries for monitoring the page table entries. 2002-08-21 18:36:55 +00:00
matt c7a899fa13 Use "b" constraint for base registers (indexed addressing mode). 2002-08-20 06:04:38 +00:00
matt 8a75cdd09b Add evcnt's for common pmap activities when PMAPCOUNTERS is defined
in the config file.
2002-08-18 19:18:33 +00:00
matt 5ba45ecc9c defflag PMAPDEBUG, PMAPCHECK, and PMAPCOUNTERS into opt_pmap.h 2002-08-18 17:17:59 +00:00
matt d2965f3ad3 Prepare for PPC64. Use register_t for mtmsr/mfmsr since the msr on PPC64
is 64bits wide.  Define proper types for PPC64 if _LP64 is defined.
2002-08-14 15:41:57 +00:00
matt 571dd402e2 Add a bunch of mpc8xx SPR definitions. 2002-08-14 15:38:40 +00:00
matt 7f8f67eaed Re-enable PTE_EXEC. PTE_EXEC is now also cleared in pmap_zero_page,
pmap_copy_page, and pmap_clear_modify (pmap_clear_bit).  Remove #ifdef
MULTIPROCESSOR since the cache instructions operate on all caches on
all processors.
2002-08-14 14:25:15 +00:00
simonb bff11b16da Remove the "comfound < 2" bogosity. 2002-08-14 12:31:38 +00:00
simonb 2eded71179 Remove an unused global variable (that was marked with an XXX!). 2002-08-14 12:29:50 +00:00
simonb 2f766ff3c2 Use the base space tag from the attach args, don't recreate it all the
time.
Clean up some include files.
2002-08-13 06:15:15 +00:00
simonb f0302072f1 Use "ibm4xx" instead of "galaxy"; galaxy was an early code name for the
405GP.
2002-08-13 05:43:24 +00:00
simonb 42dede3769 Move 4xx devices to their own config include file so they can be used
elsewhere.
2002-08-13 05:29:25 +00:00
simonb 9e00d2d7f9 Fix include file location botch in previous. 2002-08-13 05:25:39 +00:00
simonb 497d6762cf Split out device register definitions to their own files as the are
common across many of the 4xx parts.  Leaves ibm405gp.h with device
address information specific to the 405GP CPU.  Now allows opb.c to
support multiple 4xx CPU types.
2002-08-13 04:57:48 +00:00
matt c75c0aa911 Print DAR and DSISR on user ALIgnment traps (e.g. treat them as being
similar to DSI tracks).
2002-08-12 22:44:03 +00:00
simonb b16f7fe1fc Add a pvr field to 'struct opb_dev', to allow the opb_devs array to
contain info about on-chip devices for more than one CPU type.
2002-08-12 07:55:08 +00:00
simonb 6bf1aaf8eb Reorganise the IBM 4xx bus layout, using terminology from the IBM
documentation:
 - Remove "mainbus" altogether.
 - The new root is "plb" - the Processor Local Bus.
 - Attached to this is the "opb" - the On-chip Peripheral Bus, to which
   all the on-chip devices are attached (except the cpu and pci host
   bridge).
 - Port-specific code can pass an array of 'struct plb_dev' to
   config_rootfound() to attach extra devices to the plb.  The walnut
   port attaches a "pbus" (Peripheral Bus) in here for the RTC and
   pc keyboard controller to attach to.
There is still much 405GP specific code; the next round of changes will
generalise this to enable easier support for other 4xx CPUs.
2002-08-12 02:06:18 +00:00
simonb 95319edf4a Add some IBM 4xx CPU PVR values; sort PVRs numerically.
White space nits.
2002-08-11 13:33:00 +00:00
simonb ef1df3654e Define the 4xx PVR values in one place only. 2002-08-11 13:32:20 +00:00
matt dcab4f46e8 Switch back to kenter_pa/kremove 2002-08-11 02:17:30 +00:00
matt 549ac19770 Add IBM Power3 CPUID. 2002-08-10 21:38:06 +00:00
matt 67f40b1907 More refinement, only map B_READ buf with VM_PROT_WRITE (all pages always
have VM_PROT_READ).  Also, pass PMAP_WIRED to pmap_enter (for non-mpc6xx
pmaps).  This will give pmap clues about flushing any "icache ok state".
2002-08-10 18:49:56 +00:00
matt 246ee3ef1d Switch vmap*buf back to using pmap_enter/pmap_remove. This is so that
accesses to the buffer will cause the reference and modified bits for
the pages to be udpated appropriately.
2002-08-10 16:28:49 +00:00
simonb 5b415a20e5 Fix for when EMAC_EVENT_COUNTERS isn't defined. Problem reported by
Allen Briggs.
2002-08-09 14:10:30 +00:00
simonb acce3a5e36 Add a driver the for IBM 405gp (and possibly other IBM 4xx cpus) ethernet
MAC (emac).  Much thanks to Jason Thorpe for debugging help writing this
driver.  Tested on the walnut, and an earlier version of this driver works
on the OpenBlockSS.
2002-08-09 04:17:26 +00:00
matt 0fb9cba190 Add SPR_ASR from OEA-64. Change mfspr to use register_t. 2002-08-08 22:49:09 +00:00
chs 0a97a311e2 it's PPC_HAVE_FPU, not PPC_HAS_FPU.
also, include the headers that turn on FPU and AltiVec features
in case no one else does.
2002-08-08 01:27:35 +00:00
matt e66a17771e Disable PTE_EXEC optimization until I figure out why it fails on 750 but
not 74xx.
2002-08-07 19:04:05 +00:00
tsubai e373d8b520 Re-correct previous. It's intentional. 2002-08-07 08:01:57 +00:00
briggs 0b956d0b8b Implement pmc(9) -- An interface to hardware performance monitoring
counters.  These counters do not exist on all CPUs, but where they
do exist, can be used for counting events such as dcache misses that
would otherwise be difficult or impossible to instrument by code
inspection or hardware simulation.

pmc(9) is meant to be a general interface.  Initially, the Intel XScale
counters are the only ones supported.
2002-08-07 05:14:47 +00:00
matt a2e9fe106d Correct __va_list typedef for GCC 3.* to match the GCC 3.* definition. 2002-08-07 00:11:59 +00:00
chs f7fb853264 be sure to re-enable interrupts before calling trap() a second time
due to an AST.  the rule is that we must always have interrupts
enabled when acquiring kernel_lock, so that we can process blocking IPIs
from another CPU which is already holding kernel_lock.
reduce differences between the MP and non-MP versions of this file.
2002-08-06 06:21:58 +00:00
chs f73abf90fb on MP systems, if the firmware didn't configure the L2 cache
on the non-boot CPUs, copy the L2CR configuration from the boot CPU.
also, fix the code that configures the L2 cache so that it works at all.
while I'm here, use mfspr() and mtspr() instead of inline asms.
2002-08-06 06:20:08 +00:00
chs 2928d8ba05 actually we shouldn't hold kernel_lock while calling postsig(). 2002-08-06 06:18:24 +00:00
chs 0924752f24 add the MSSCR0 register and some more L2CR fields. 2002-08-06 06:17:50 +00:00
chs 461184c6b6 fix the calculation of the address of the IPI dispatch register. 2002-08-06 06:16:42 +00:00
chs 301f1ebf31 move more inlines to cpu.h: mftb(), mftbl() and mfpvr().
(the mftb() in pmap.c only wanted the lower 32 bits, so that's now mftbl()).
2002-08-06 06:14:33 +00:00
enami a55bfb4d51 A cosmetic change. 2002-08-05 02:56:58 +00:00
enami 1aaddc3669 - Care about carry bit when adding short value to force 4 byte boundary.
It may contain any 32 bit value there.
- Use correct instruction to clear carry bit.
- Don't use series of load with update instruction.  It's slower.
2002-08-05 02:55:39 +00:00
simonb 7cfa7d3ce0 Sprinkle a small amount of KNF. 2002-08-03 13:12:44 +00:00
chs 810cde53cc use a completely separate trap handler for syscall traps.
this reduces syscall overhead by 10% to 20% depending on cpu type.
2002-08-02 03:46:42 +00:00
simonb d16ca1844f Add driver for 405gp (and other 4xx?) watchdog timer. 2002-08-01 23:15:37 +00:00
matt 3e158de7c1 Don't define register references if not KERNEL or STANDALONE. 2002-07-30 06:09:10 +00:00
itojun f8e5e9c295 be friendly with gcc-3.1.1 -O2, which takes advantage of ANSI C
pointer aliasing rule (gcc optimization/7427).  from tsubai, sync w/kame
2002-07-29 09:14:36 +00:00
chs 03315186b6 install atomic.h. 2002-07-28 07:11:25 +00:00
chs a7171ee431 add some atomic operations. 2002-07-28 07:09:28 +00:00
chs fccc379b30 restructure the FPU and AltiVEC code so that it works for MP. 2002-07-28 07:07:44 +00:00
chs 64094057a1 resync the MP and non-MP trap_subr's. 2002-07-28 07:06:27 +00:00
chs a7763f6e2c create a syscall_plain() like on other platforms
and avoid getting the kernel lock for MPSAFE syscalls.
2002-07-28 07:05:53 +00:00
chs 0e5816fca3 remove a local copy of mfmsr(). 2002-07-28 07:05:19 +00:00
chs 7f81a49168 propagate the MP idle-loop fix to ppc from the other ports:
Move call to sched_unlock_idle to later in the context switch to
  eliminate a race where another processor could grab the outgoing
  process before we were done saving our state into it, with predictable
  results.

  Bug spotted by Frank van der Linden <fvdl@wasabisystems.com>

also, don't re-enable interrupts temporarily in the middle of
switching to a new process, just wait until we're completely switched.
this didn't work on MP and it's not worth the effort.
2002-07-28 07:05:06 +00:00
chs badae2dc11 disable the PTE_EXEC optimization for MP for now.
PTE_EXEC needs to become a per-CPU flag eventually.
2002-07-28 07:03:47 +00:00
chs 9b01e8d8ce split off the part of cpu_attach_common() that pokes at special CPU registers
into a separate function so that we can run it on each CPU we configure
rather than always on the boot CPU.
2002-07-28 07:03:15 +00:00
chs 84b41b2adb rearrange the PCB structure a bit so it's easier to look at in ddb. 2002-07-28 07:02:54 +00:00
chs 4b5a2a3f79 define CPU_INFO iterators so that the CPU-states sysctl works for MP. 2002-07-28 07:02:29 +00:00
matt f9be6bb495 Cleanup AltiVec data stream issues with context switching. Don't stop
data streams on execptions/interrupts since the processor will suspend
them for us.  Only stop them on 1) process exit, 2) another process gets
its address space loaded, and 3) (for completeness only) we save a process's
AltiVec context.
2002-07-25 23:46:47 +00:00
matt a660a9325f Set normal memory PTEs with PTE_M (memory coherent). Change how we
remember the "exec"ness of a page.  If a managed page is pmap_enter'ed
with VM_PROT_EXECUTE, remember that it's an "exec"page.  Such that when
additional mapping are performed, no synch'ing of the I-cache is needed.
Revoke "exec"ness when the page is mapped into the kernel with VM_PROT_WRITE
or the pmap_page_protect is called with VM_PROT_NONE.
2002-07-25 23:33:04 +00:00
chs 4e9f286b98 for MP builds, save and restore sprg0 (which contains the curcpu pointer)
around restoring OFW's sprg registers while calling into OFW.
2002-07-24 06:04:43 +00:00
chs 185a5bbcf0 rename the intr_depth field of struct intrframe to avoid a name conflict
in MULTIPROCESSOR builds.
2002-07-24 05:44:37 +00:00
chs 804e68d33a reimplement copy{in,out}str() similarly to copy{in,out}()
(instead of the old way of calling [fs]ubyte() in a loop).
2002-07-24 04:59:32 +00:00
matt cde20d8743 Make sure that pmap_zero_page and pmap_copy_page don't make calls or
reference while relocation is disabled since the stack will be inaccessible.
Add support for using AltiVec in pmap_zero_page and pmap_copy_page on
AltiVec capable processors.
2002-07-18 22:51:57 +00:00
matt 436f257283 Add a common file to do pmap_zero_page/pmap_copy_page/pmap_pageidlezero and
pmap_syncicache.  This file uses a ppc feature in a sick and twisted way
to avoid mapping the physical pages used by those routines.  It performs
the operations with the MMU disabled but PPC exception save and retstore
the machine state and are invoked with the MMU disabled, this doesn't have
an adverse effect on the system.

Currently only enable for MPC6xx and !OLDPMAP.
2002-07-17 03:11:07 +00:00
matt ece8b74130 Add machdep.powerpc sysctl. Change the default value of powersave to -1
(< 0 mean no powersave available).  Enable powersave by default for
750/7400/7410 but leave if off for 7450/7455.
2002-07-16 23:04:20 +00:00
matt 3dc1994d70 Don't install extintr handler if not supplied.
Make panic message more informative.
2002-07-16 16:39:12 +00:00
matt b35e786de2 Add a linux_syscall_intern entry (appropriately ifdef'ed COMPAT_LINUX).
When/if PPC ever supports LKMs, this should be moved to a separate file.
2002-07-11 19:32:43 +00:00
simonb 873edaed34 Clean up some white space niggles. 2002-07-11 01:38:48 +00:00
matt 6e81c6293f Bump VM kernel buffer space from 128MB to 192MB now that we have 512MB of
KVA space.
2002-07-10 05:25:12 +00:00
matt 7c3dbdc01d When allocate VA for the msgbuf, don't allocate pages too since we have
already done that in pmap_bootstrap.  (fixes a small page leak at startup).
2002-07-09 19:05:00 +00:00
matt e64bc5acc1 Allow USER_SR to be overriden on a per-port basis 2002-07-07 19:29:18 +00:00
matt 140a273f7a Use lvewx/stvewx for VSCR and save ourselves 12 bytes we don't need to load. 2002-07-07 00:46:20 +00:00
dbj 397ff5c82a protect Debugger() call with ifdef DDB 2002-07-07 00:43:11 +00:00
matt 263c3cd253 Merge macppc/ofppc locore OFW code and move it here. 2002-07-06 18:01:23 +00:00
matt 51f2834470 Bump max user address to 0xfffff000 (XXX maybe it should be -NBPG?). 2002-07-06 17:15:57 +00:00
matt 685778b53b Peform a rototill over the powerpc-based ports.
Move the trap/vector initialization for MPC6xx ports to mpc6xx_machdep.c
Also move softnet, install_extintr, mapiodev, kvtop.  Add common BAT
initialization code.

Add user Altivec support.

Fix calls to OF_call_method in macppc/macppc/machdep.c.

Use ci_fpuproc in cpu_info instead of separate fpuproc.

Add separate syscall.c and defined __HAVE_SYSCALL_INTERN.
2002-07-05 18:45:15 +00:00
thorpej 011d4d5f44 Add kernel support for having userland provide the signal trampoline:
* struct sigacts gets a new sigact_sigdesc structure, which has the
  sigaction and the trampoline/version.  Version 0 means "legacy kernel
  provided trampoline".  Other versions are coordinated with machine-
  dependent code in libc.
* sigaction1() grows two more arguments -- the trampoline pointer and
  the trampoline version.
* A new __sigaction_sigtramp() system call is provided to register a
  trampoline along with a signal handler.
* The handler is no longer passed to sensig() functions.  Instead,
  sendsig() looks up the handler by peeking in the sigacts for the
  process getting the signal (since it has to look in there for the
  trampoline anyway).
* Native sendsig() functions now select the appropriate trampoline and
  its arguments based on the trampoline version in the sigacts.

Changes to libc to use the new facility will be checked in later.  Kernel
version not bumped; we will ride the 1.6C bump made recently.
2002-07-04 23:32:02 +00:00
thorpej 00e59f25b7 Eliminate two unused sigframe members. 2002-07-04 21:33:43 +00:00
thorpej 625abcf84b Eliminate two unused sigframe members. 2002-07-04 20:22:50 +00:00
matt 25036f6b2d Properly compensate for rounding the start of a mem_region up. 2002-07-03 20:41:20 +00:00
matt af8dc59949 Add AltiVec routines for save_vec/enable_vec/init_vec. 2002-07-02 15:22:47 +00:00
matt 708f4c7b9b Add VRSAVE. 2002-07-01 20:11:05 +00:00
matt 3043c05326 Add common routines to do BAT initialization, trap vector setup,
interrupt vector installation, VM initialization, core-dumps (stubbed),
and network soft interrupts.  Also kvtop and mapiodev.
2002-06-28 02:32:16 +00:00
matt f7a6553147 Add common syscall dispatcher. Also put child_return in here. 2002-06-28 02:30:06 +00:00
matt 511223b674 If ALTIVEC is not defined, treat EXC_VEC|EXC_USER exceptions as PGM
exceptions.  [Note that we still can't trap these due to issues in
trap_subr.S which are (yet) fixed]
2002-06-27 21:15:35 +00:00
matt cd85109523 Make traps even smaller by noticing the checking of privilege mode and
use of curpcb/USPACE is common and move that into the common trap processing.
2002-06-26 20:00:17 +00:00
matt 1a5c0cf685 When not using the OLD pmap, bump kernel KVA space to 512MB (OLD pmap stays
at 256MB).
2002-06-26 01:16:22 +00:00
matt 7a12a9737c Revamp how SR(s) are loaded on the user/kernel boundary. We now load all
16 SR registers when transitioning between kernel and user.  Also, don't
reload the kernel SR(s) on every trap but only on traps from user space.
Instead of loading magic SRs for the kernel, load the kernel SRs from the
kernel_pmap_.  This makes trap_subr.S completely ignorant of SR uses and
so they can change with having to change trap_subr.S.  Also note that
since the user and kernel get complete SR sets, user VA space can now be
increased to 4GB if desired.
2002-06-26 01:14:45 +00:00
matt 7c77963b01 Set SR_PRKEY for user pmaps. For the kernel SR(s) set SR_SUKEY|SR_PRKEY.
Note that we never use a PTE PP of 0 or 1 (supervisor protection) so the
"key" is basically unused.  However, use SR_PRKEY for user space is
conceptionally the right thing to do.  Currently the kernel_pmap SR(s) are
ignored but that is going to be fixed shortly.
2002-06-26 01:10:20 +00:00
thorpej aaf6e7902d Add ENTRY_NOPROFILE(). 2002-06-23 17:26:58 +00:00
briggs 31d3b62eff Pick up support for a few more things for the IBM750FX: l2cache
configuration and temperature sensor support, for example.
2002-06-21 01:38:57 +00:00
matt 6fcbf3b943 Don't load the SR registers on a context switch. They get switched from
the user's SR registers to the kernel's SR registers on an exception or
interrupt from user level and restored with the user's SR register when the
exception or interrupt returns back to user level.
2002-06-21 00:46:18 +00:00
matt 365f1d6150 Add support for IBM750FX (used in latest iBooks). 2002-06-21 00:01:53 +00:00
matt da483421e8 Add IBM750FX (0x7000) 2002-06-20 23:51:22 +00:00
briggs 029a7e8e9a - The 8240 and 8245 have a 603 core -- add them to the 603 lists...
- Use atop(dcache_size / assoc) for uvm_page_recolor(ing) instead
  of  atop(dcache_line_size / assoc).
2002-06-19 17:43:30 +00:00
briggs d6cfd2cc8c Include the Processor ID for the MPC8245. 2002-06-19 17:39:26 +00:00
wrstuden 2eb3dc82d8 Fix recent bugs seen on Performa 4400 macppc's by
Makoto Fujiwara <makoto@ki.nu> and Manuel Bouyer <bouyer@netbsd.org>.
Help from Allen Briggs, Jason Thorpe, and Matt Thomas.

We need to call cpu_cache_probe() early in boot (machdep.c).
Add 603 info for completeness, and use NBPG not PAGESIZE, as the
latter relies on uvm being setup (cpu_subr.c).
Let uvm_page_recolor() be called before uvm has been set up; just
note the page coloring value (uvm_page.c).
2002-06-19 17:01:18 +00:00
matt c937154e18 Add a missing return; after print the 745x cache size(s). 2002-06-17 21:28:48 +00:00
christos 281c8c638b apply the fix from the powerpc port. this is almost a copy of powerpc/trap.c
and needs to be refactored.
2002-06-17 21:08:56 +00:00
christos eb5c1061a2 try to make this compile. 2002-06-17 21:07:40 +00:00
christos 3b50728cf4 MD systrace gluons. 2002-06-17 16:32:57 +00:00
kleink dd6cccb3f2 Add a case label for the 603ev cache (identical to 603e). 2002-06-11 22:24:35 +00:00
scw 9f2155138c Fix a botched pmap_vsid_bitmap[] index.
I'm surprised this worked as long as it did.
2002-06-05 15:55:51 +00:00
drochner d2b9876081 move initialization of the "struct pglist" returned by uvm_pglistalloc()
from the calling code into uvm_pglistalloc() itself for consistency
and easier error handling
2002-06-02 14:44:35 +00:00
lukem 06de426449 SIMPLEQ rototill:
- implement SIMPLEQ_REMOVE(head, elm, type, field).  whilst it's O(n),
  this mirrors the functionality of SLIST_REMOVE() (the other
  singly-linked list type) and FreeBSD's STAILQ_REMOVE()
- remove the unnecessary elm arg from SIMPLEQ_REMOVE_HEAD().
  this mirrors the functionality of SLIST_REMOVE_HEAD() (the other
  singly-linked list type) and FreeBSD's STAILQ_REMOVE_HEAD()
- remove notes about SIMPLEQ not supporting arbitrary element removal
- use SIMPLEQ_FOREACH() instead of home-grown for loops
- use SIMPLEQ_EMPTY() appropriately
- use SIMPLEQ_*() instead of accessing sqh_first,sqh_last,sqe_next directly
- reorder manual page; be consistent about how the types are listed
- other minor cleanups
2002-06-01 23:50:52 +00:00
tsubai 5fcd112b3a Add gcc 3.x version. 2002-06-01 09:22:44 +00:00
kleink 0bf753ef67 Cosmetics: there are exceptions to the PVR major/minor rule. 2002-05-31 20:10:45 +00:00
kleink 46b946bc5f Fill in real cache size/organization information and recolor; currently
doesn't make a difference except for the 604e.

XXX Does not consider L2 caches yet.
2002-05-31 15:04:14 +00:00
augustss e916f073c3 Add bus_space_vaddr(). 2002-05-31 11:31:30 +00:00
augustss cea3466ea6 Add NEED_BINARY, similar to NEED_SREC. 2002-05-19 18:57:33 +00:00
augustss 7202dc2f30 Add CPU_CI symbol so that bzero.S actually compiles on ports other than walnut. 2002-05-19 18:56:54 +00:00
jdolecek 2fc860bc0d make usable in LKM context (use #if defined(_KERNEL_OPT)) 2002-05-19 16:55:43 +00:00
augustss aaf6178285 Handle the "aligment" fault generated by DCBZ when the cache is off.
That way you can run the processor with caches off.
2002-05-19 06:35:45 +00:00
matt 0a6d35b7ed Nuke local extern label_t *db_recover; it's now in <ddb/db_extern.h> 2002-05-13 20:30:07 +00:00
matt f62dc5c664 Remove redundant declarations. 2002-05-13 07:04:24 +00:00
matt d210f0530b Eliminate commons. 2002-05-13 06:05:32 +00:00
kleink ba482b3950 * On the 601, obliterate all BAT entries when returning from kernel to
userlevel; this is necessary due to the 601, unlike other 6xx, having
  no concept of separated Valid_user vs. Valid_supervisor for BATs.
* When crossing the kernel/userlevel boundary, have platform-provided
  hooks set up the two fixed BAT entries, and possibly additional
  segment registers to redeem the 601's BAT limitations.

Both of the above are only built if the $MACHINE provides these hooks,
sparing others the pain.
2002-05-02 16:47:49 +00:00
kleink 3626919f4c Oops, swapped mtsrin operands in previous. 2002-04-23 17:14:45 +00:00
kleink 3a03930d13 Add a third argument to pmap_bootstrap() which platform-specific
initialization can use to specify additional segment registers to be set
up in the kernel pmap.
2002-04-23 12:41:04 +00:00
kleink 0b463cc8f9 Express tempsave and disisave addresses using the symbolic names of the
exception handlers which they are `borrowed' from.
2002-04-22 23:20:08 +00:00
kleink 0b82377f11 Fix a swapped register pasto(?) introduced in rev. 1.17. 2002-04-22 18:31:11 +00:00
kleink 884898e332 Convert the spill stack frame to use symbolic offset names; inspired by
a conversation with Matt Thomas.
2002-04-21 22:05:45 +00:00
kleink a641861ab8 Rig pmap_print_mmuregs() for the 601. 2002-04-19 20:56:56 +00:00
kleink 99d4b7c71f Unused; already implemented in libkern. 2002-04-18 21:42:36 +00:00
matt 66c475ca19 Use a common genassym.cf for all the PPC_MPC6XX ports. Add a makeoptions to
std.foo to indicate the directory to get genassym.cf from.  Add an intrframe
to <powerpc/frame.h> and make trap_subr.S use symbolic offsets into it.
2002-04-18 20:08:05 +00:00
kleink eb225418ed Don't do random replacement in isitrap601; just like isitrap. 2002-04-18 12:33:26 +00:00
matt 54d0dedd0c Cleanup the debug prints in pmap_enter. 2002-04-13 15:58:30 +00:00
briggs 4fb4a95b7e Install cpu.h. Noted in PR port-powerpc/16285 from smi@sm.sony.co.jp. 2002-04-10 15:36:42 +00:00
matt f8b9dbe468 Add some MPC745x L3CR cache definitions. 2002-04-03 00:12:41 +00:00
matt 830666e31e Clean the icache for pages when they are entered as executable and before
they were either not mapped at all or mapped as non-executable.  Round
memory regions in pmap_bootstrap.
2002-04-03 00:12:07 +00:00
matt 7e121bd39d Properly print out 745x cache information. 2002-04-03 00:09:52 +00:00
eeh 67c9b24c04 Follow the post-UBC semantics of resetting ref/mod collection inside of
pmap_clear_{reference,modify}().
2002-03-28 18:07:31 +00:00
kleink 1b6af7fb37 Add separate 601 versions of DSI/ISI trap entries, considering the
different battable entry format and the combined BAT implementation.
2002-03-27 15:40:46 +00:00
kleink 032762e1e9 On the 601, construct the CPU counter value from the RTC[UL] registers. 2002-03-26 21:50:39 +00:00
matt 12810ed37d Use size_t in prototype (so this will be LP64 clean for PPC64 someday).
Calculate len separately for icache & dcache in case each has different
cacheline widths.  Make the code for both loops the same except for the
dcbst/icbi.  Deal with sizes >=2GB properly (like that'll happen but ...)
2002-03-26 21:20:24 +00:00
kleink 7e9d845469 * Add MPC601 versions of BAT_VA_MATCH_P() and BAT_VALID_P().
* Make the extern declaration of the battable array incomplete;
  a given port might want to use a differently-sized definition to
  support the 601 BAT implementation, where blocks map up to 8M only.
2002-03-25 21:35:45 +00:00
briggs a2e0bd5a5d Use p->p_psstr instead of PS_STRINGS.
Tested on boot to multi-user on sandpoint.
2002-03-18 04:50:32 +00:00
eeh 0754ce0386 Use properties instead of board_info. 2002-03-15 21:12:07 +00:00
eeh 75343f2177 Use new non-PCI mainbus. 2002-03-15 21:10:46 +00:00
eeh 5468c6fb37 Fixup distinguishing between user and kernel addresses for IBM 4xx CPUs. 2002-03-15 21:01:28 +00:00
eeh de5252061e Use properties to pass around board-specific information rather than a
structure.
2002-03-15 20:59:23 +00:00
eeh 7c79cb049f Some files have been moved into powerpc/ibm4xx. 2002-03-14 17:27:59 +00:00
eeh a3833eb1c6 Add this file. 2002-03-13 23:59:58 +00:00
eeh d26d3b351c This should be pretty standard. 2002-03-13 23:12:11 +00:00
eeh 2277f9518e Delete this file. It's only relevent to 405gp. 2002-03-13 23:09:52 +00:00
eeh 2b55b12b59 405gp-specific DCRs. 2002-03-13 23:09:11 +00:00
eeh 266bd056b2 Adapt to the new, separate mainbus. 2002-03-13 19:13:10 +00:00
eeh 8e235a382a Add a vector for machine check traps. 2002-03-13 19:11:53 +00:00
eeh d94ffa460b Generic mainbus driver. 2002-03-13 01:04:16 +00:00
eeh ba8ac60043 pmap improvements:
Remove the cache flush routines that have been moved to cpu.c

Make sure we clear out the unused PA bits in the TTE which causes breakage
on some MMU models.
2002-03-13 00:47:58 +00:00
eeh 9129e6fe1d Generalized IBM UIC driver. 2002-03-13 00:40:50 +00:00
eeh 4b971968ac Add cache_info to cpu_info which provides details about D$ and I$
sizes and line sizes.  This is needed for cache flusing, clearing
memory, and several other operations.  This information is accessible
from userland through a new CPU_CACHEINFO sysctl.
2002-03-13 00:38:13 +00:00
chs bd2a5f591d switch all mpc6xx powerpc ports to NEWPMAP by default.
the old pmap is still available with the OLDPMAP option.
2002-03-09 23:35:56 +00:00
thorpej a180cee23b Pool deals fairly well with physical memory shortage, but it doesn't
deal with shortages of the VM maps where the backing pages are mapped
(usually kmem_map).  Try to deal with this:

* Group all information about the backend allocator for a pool in a
  separate structure.  The pool references this structure, rather than
  the individual fields.
* Change the pool_init() API accordingly, and adjust all callers.
* Link all pools using the same backend allocator on a list.
* The backend allocator is responsible for waiting for physical memory
  to become available, but will still fail if it cannot callocate KVA
  space for the pages.  If this happens, carefully drain all pools using
  the same backend allocator, so that some KVA space can be freed.
* Change pool_reclaim() to indicate if it actually succeeded in freeing
  some pages, and use that information to make draining easier and more
  efficient.
* Get rid of PR_URGENT.  There was only one use of it, and it could be
  dealt with by the caller.

From art@openbsd.org.
2002-03-08 20:48:27 +00:00
simonb abf4139889 Include libkern.h for strcmp() prototype. 2002-03-08 01:36:34 +00:00
tsutsui 3c8b0446fe Change type of dumpmag to u_int32_t since it is actually
a 32bit unsigned magic number.
As per discussion on tech-kern, and fixes port-sparc64/11949.
2002-03-06 13:10:18 +00:00
nathanw 3be9fbe42e Move #include <dev/sysmon/sysmonvar.h> inside #ifdef _KERNEL. 2002-03-06 06:37:17 +00:00
kleink 8a79f029ad VRSAVE is SPR 256, not 238. 2002-03-04 13:37:42 +00:00
dbj b5fde890d0 add cnpollc() calls around cngetc for TRAP_PANICWAIT 2002-03-04 04:07:35 +00:00
kleink 995081f947 Make this link again in the absence of envsys/sysmon. 2002-03-04 00:55:04 +00:00
nathanw b50fb54af2 Calculate and print the speed of G3 and G4 processors.
Add code to read the on-chip temperature sensor on the G3 and hook it in
to the envsys/sysmon subsystem. "envstat" now prints the CPU temperature.
2002-03-03 07:31:33 +00:00
nathanw 1eeb28024d Add sysmon data structures to struct cpu_info. 2002-03-03 07:09:09 +00:00
matt d26c78e764 All Moto PPC revisions should be printed as maj.min (0x0200 -> 2.0). 2002-03-03 07:09:01 +00:00
matt e0ba5cf38d Add initial MPC7455 support. 2002-03-03 06:56:09 +00:00
matt 997374a8dd Add MPC7455 2002-03-03 06:47:25 +00:00
nathanw 5d5aeaa547 Add bit definitions for the MMCR's, and event numbers for the events
that are common to the G3 and G4.
2002-03-03 06:38:31 +00:00
nathanw 7a92615001 Correct the SPR numbers of PMC3 and PMC4.
SIA wasn't retconned, but the SPR number was wrong. Re-add it, and add
USIA.
2002-03-03 05:32:37 +00:00
nathanw c2b8ec655a Delete the retconned SIAR SPR. 2002-03-03 05:17:48 +00:00
nathanw ee2cbbfe4a Add MPC7xx/7xxx performance monitor control registers (MMCR0-2, UMMCR0-2). 2002-03-03 05:15:44 +00:00
nathanw 28b2a20fb9 Add bit definitions for the MPC750 thermal management registers. 2002-03-03 04:31:53 +00:00
kleink 4a513728e8 Add end-of-comment missing in previous. 2002-03-02 21:36:27 +00:00
kleink a34187bca3 Also reset segment register 0 on kernel entry: there may not always be
a fixed BAT entry covering segment 0, or not completely covering it,
and we do restore it on return to user level already.
2002-03-02 15:19:56 +00:00
kleink dc0a08feaa Note that Guarded bit is not implemented on the 601. 2002-03-02 15:07:35 +00:00
matt 4b948be2fc Disable BTIC on rev 2.0 or earlier MPC7450s as Motorola Errata #31 for the
MPC7450.
2002-03-02 02:18:38 +00:00
simonb 4324f37586 Use "#define<tab>". 2002-02-28 03:17:23 +00:00
kleink 39a685458d Fix pastos & typoe. 2002-02-27 04:13:10 +00:00
matt 178af24f65 Add a comment to where we increment intr_depth to show that intstk+INTSTK
== intr_depth. (gag)
2002-02-27 03:27:14 +00:00
christos e8116a8f5b - Use DEV_ constants, instead of documenting the numbers!
- Delete cdev_decl(mm); where appropriate, and other hand-crufting [hi powerpc!]
2002-02-27 01:20:51 +00:00
kleink f7a55f56d3 PIR is the same on 601. 2002-02-26 00:48:58 +00:00
kleink 67678b7c54 Handle the 601's Run Mode/Trace Exception. 2002-02-22 18:50:45 +00:00
kleink 543f1e7a2d Handle the 601's Run Mode/Trace Exception as well. 2002-02-22 13:51:40 +00:00
simonb 2d8577fb83 Clean up some rampant code duplication wrt ieee number handling:
- Add alignment-safe double and float unions.
 - Use the above for the __infinity and __nan constants on all
   architectures that use the standard ieee754 representation of
   those constants.
 - Add a single copy of various ieee754 math functions (frexp, isinf,
   isnan, ldexp and modf) that had numerous duplicates among the
   arch-specific directories.
 - Use the above functions on all architectures where the generic C
   versions where used.  Architectures that had local assembly
   routines are untouched (for those functions only).
2002-02-19 13:08:12 +00:00
chs b744097a5f allow writing to write-only mappings. fixes PR 3493. 2002-02-14 07:08:02 +00:00
kleink 11402be7a5 Header for the 601's I/O Controller Interface Address Translation
segment register format.
2002-02-09 17:44:40 +00:00
briggs 9827f27b9f Update from thorpej:
* Define type and size of _mcount stub to make PIC code happy.
* Rename mcount to __mcount to get it out of the user namespace.
2002-02-07 05:13:35 +00:00
kleink 3b7a9506f7 Printf the 601's HID0. 2002-02-06 20:00:48 +00:00
kleink 69e30815cf Add a printf bitmask for HID0. 2002-02-06 19:59:30 +00:00
kleink cd6a8bc27c Add MPC601 MQ and RTCU/RTCL SPRs. 2002-02-05 19:49:17 +00:00
dbj ecf4398451 increment uvmexp.traps on entry to trap() 2002-02-02 22:02:00 +00:00
dbj 0ac4681659 add support for kgdb over zs 2002-01-06 00:35:10 +00:00
jhawk d77edb248a Print negative SIMM operands correctly; previously, negative numbers
were bogus.
2002-01-05 22:07:26 +00:00
jhawk a0dca6bb1d Remove gratuitous ", " after the last opcode for SIMM and UIMM opcodes. 2002-01-05 20:22:52 +00:00
jhawk c7996c4a47 Print addresses symbolicly using the new ddb helper function, db_symstr().
This disassembler still needs a fair chunk of work.
2002-01-05 20:21:37 +00:00
dbj 86e773e9fd change apparent typo of MS_SFILES to MD_SFILES
This fixes some dependency problems with locore.S
2002-01-05 17:58:48 +00:00
jhawk ac054a2787 Support
t/t	PID
on the powerpc. (remember to use 0tPID if pid is in decimal...)
2002-01-03 22:15:06 +00:00
chs 9451559ef4 pmap_page_protect(VM_PROT_NONE) must remove all mappings in the PV list,
even if they are wired.  we need to be able to remove all mappings to
pages that are being freed due to (eg.) file truncation.
2002-01-02 00:51:33 +00:00
dbj 98cbceb382 handle have_address=TRUE 2001-12-31 18:29:07 +00:00
dbj f03e8813e0 allow ddb access to lr, ctr, cr and xer registers when not on PPC_IBM4XX 2001-12-30 20:53:04 +00:00
dbj 98d1a18067 remove unused variable in kgdb_acc 2001-12-30 20:50:53 +00:00
dbj 1b65d8fd30 fix single stepping and continuing from breakpoints in ddb 2001-12-27 10:32:23 +00:00
dbj 2bea447d60 sync the instruction cache even when only writing 2 or 4 bytes 2001-12-27 10:25:41 +00:00
dbj d91a86f994 revert revision 1.13
this turns single stepping back off since it doesn't correctly work
note that without single stepping, several things do not work as
expected, including continuing from interrupts
2001-12-24 16:57:40 +00:00
dbj ce516e4e69 add declaration of ipkdb_trap_glue 2001-12-23 08:25:27 +00:00
dbj 3ff5d761b8 restore msr on return from ddb, this allows single stepping 2001-12-23 08:19:44 +00:00
tv 8e6f7afb5b MKfoo=no -> NOfoo 2001-12-12 01:48:43 +00:00
briggs 25e9f1f519 Provide basic bus_space_mmap(). Noted by self and in PR port-powerpc/14873.
This at least allows the compile to complete.  There are still Issues with
vga_pci.c's assumptions about a PC-ish environment.
2001-12-10 20:30:21 +00:00
thorpej 51535d4bf5 Add support for dumping ELF-cormat core files. 2001-12-09 23:05:56 +00:00
atatat b45c51b1fc Roll the rest of the ports over to the new MI kernel build machinery.
Any problems reported by testers have been fixed, and massive
cross-compiling of kernels has shown that any problems that remain
with actually building kernels are not related to this.
2001-12-09 05:00:40 +00:00