Commit Graph

1394 Commits

Author SHA1 Message Date
chs
bfbf7ea9b1 implement pmap_wired_count(). fix some places we would forget to splx().
move the parts of pte.h that were used into pmap.c (since they were really
pmap-internal details) and delete ibm4xx/pte.h.  other misc cleanup.
2005-01-16 21:35:58 +00:00
shige
49c3c14437 Add externs:
- md_device_register (func ptr)
	- ibm4xx_device_register (func)
2005-01-13 17:16:33 +00:00
shige
2e87452aa9 Remove device_register, cpu_rootconf functions.
These functions are moved to ibm4xx/autoconf.c.
2005-01-13 17:14:36 +00:00
shige
79354dbad0 Add device_register function for all ibm4xx machine. 2005-01-13 17:12:28 +00:00
shige
786539f27b Add device_register machine-independent-glue. 2005-01-13 17:11:14 +00:00
chs
67402a485f enable powersave mode on 7450 and family.
also, the HID0_DOZE bit in this context doesn't mean "doze",
it's actually "enable extra BATs".  add an alias for this bit
and use it as appropriate.
2005-01-11 02:09:54 +00:00
matt
b046d5ecf9 Now that countless UVM bugs have been fixed, enable "topdown" memory
allocation by default.
2005-01-10 05:42:09 +00:00
briggs
4137e66929 Allow MSR[POW] off for power saving on 604-era CPUs. From Tim Kelly.
XXX -- needs benchmarking
2005-01-07 21:31:04 +00:00
briggs
35a39caef5 Don't attempt to probe the cache with l2cr on 604ev. From Tim Kelly. 2005-01-07 20:41:35 +00:00
chs
ddc6ab738a drop the big lock in upcallret() like all the other platforms do. 2005-01-03 00:03:25 +00:00
shige
d2306c8cf3 Add functions:
- com_opb_cnattach
	- com_opb_device_register
2004-12-24 14:55:50 +00:00
shige
eb555844f1 Substitute PPC405_ with PPC_IBM405_. 2004-12-17 16:23:57 +00:00
matt
eb30eca3e3 Add -Wa,-maltivec so that AltiVec instuctions will be recognized. 2004-12-09 22:57:12 +00:00
matt
42e9e00c87 Make MSIZE and MCLSHIFT overrideable in <machine/param.h> 2004-12-09 00:37:54 +00:00
briggs
710cfd7aef Add MPC7400 to the list of CPUs for which we try to measure the speed.
Noticed missing by Tim Kelly.
2004-12-08 03:07:03 +00:00
briggs
52af8374ec Minor (old) patch from me to correct CPU ID of 604e vs. 604ev.
Tested by Tim Kelly.
Also patched from Tim to
 - Delay longer for second CPU spinup.
 - Only attempt to print CPU speed and cache configuration on certain
   CPU types.
2004-12-06 04:15:03 +00:00
matt
080d581a20 Make sure to enable interrupts before lower IPL so we don't block any
interrupts (IPI) we shouldn't.
2004-12-04 05:56:28 +00:00
shige
4b61add729 Add header file for IBM405XX(AMCC405XX) Device Control Registers. 2004-12-01 17:55:33 +00:00
thorpej
7a60e77293 bus_dmamap_load_mbuf(): Skip zero-length mbufs.
kern/24811
2004-11-28 17:34:45 +00:00
matt
e27c3887b6 If setfault() returns nonzero (ie, we trapped), make sure to unsetusr. 2004-11-18 22:56:32 +00:00
matt
589ef8f06a Make sure to do setenv/unsetenv in pairs. This prevents panics in
DIAGNOSTIC kernel when crossing segment boundaries.
2004-11-18 21:09:37 +00:00
thorpej
e9818f5b5e When adding/deleting multicast addresses, only whack the address
filter if the interface is marked RUNNING.

Fixes kern/27678.
2004-10-30 18:08:34 +00:00
thorpej
dc2f2fbe74 Centralize the declaration of booted_device and booted_partition. 2004-10-23 17:07:37 +00:00
yamt
d2fe4b34bb move some per-cpu data definitions to MI place so that they can be modified
without touching all ports.  discussed on tech-kern@.
2004-09-22 11:32:02 +00:00
scw
ac3ac35ecb MPC8xx DC_CST is SPR 0x238, not 0x230.
Reported by Jared Momose in private email.
2004-09-20 11:29:19 +00:00
skrll
f7155e40f6 There's no need to pass a proc value when using UIO_SYSSPACE with
vn_rdwr(9) and uiomove(9).

OK'd by Jason Thorpe
2004-09-17 14:11:20 +00:00
scw
17d7b87515 It helps to call fpu_sqrt() when dealing with the frsqrte instruction. 2004-09-15 07:04:21 +00:00
scw
db255697d0 Apply suggested changes from PR port-powerpc/24830 arch/powerpc/ibm4xx:
Bad register constraints in copyin(), copyout(), copyinstr(), copyoutstr(),
and delay().
2004-09-02 08:22:58 +00:00
simonb
ac20296fee Remove the unused MKTTE macro. 2004-08-31 01:06:12 +00:00
drochner
46289e1fef Phase out the use of a string as first "attach args" member to control
which bustype should be attached with a specific call to config_found()
(from a "mainbus" or a bus bridge).
Do it for isa/eisa/mca and pci/agp for now. These buses all attach to
an mi interface attribute "isabus", "eisabus" etc., and the autoconf
framework now allows to specify an interface attribute on config_found()
and config_search(), which limits the search of matching config data
to these which attach to that specific attribute.
So we basically have to call config_found_ia(..., "foobus", ...) where
such a bus is attached.
As a consequence, where a "mainbus" or alike also attaches other
devices (eg CPUs) which do not attach to a specific attribute yet,
we need at least pass an attribute name (different from "foobus") so
that the foo bus is not found at these places. This made some minor
changes necessary which are not obviously related to the mentioned buses.
2004-08-30 15:05:15 +00:00
thorpej
6c08646cb8 Garbage-collect pagemove(); nothing use it anymore (YAY!!!) 2004-08-28 22:12:40 +00:00
matt
e4726fc65d Add pmap counters for reclaimed pvos and for the times a pvo could not be
obtained.
Switch to EVCNT_ATTACH_STATIC*
In DEBUG/DIAGNOSTIC, decrement/increment pmap_pvo_enter_depth around pool
calls since they could possibly cause a recursion back into pmap_pvo_enter.
2004-08-24 21:31:49 +00:00
nathanw
05e0a219ae Don't prohibit DDB and KGDB together. 2004-08-23 20:55:03 +00:00
chs
80c0e76172 implement pmap_pvo_reclaim(), which steals an existing non-wired pvo entry
for reuse, and use this in pmap_pvo_enter() when we can't allocate a new one.
2004-08-19 15:31:57 +00:00
scw
ad271535d4 In _bus_dmamap_load_buffer(), honour the maximum segment size specified
when the DMA map was created.

The previous behaviour honoured the maximum segment size only when
coalescing adjacent segments.
2004-08-17 08:35:43 +00:00
aymeric
990d2462b0 add a missing break in the EXC_MCHK|EXC_USER case in trap() 2004-08-16 10:16:16 +00:00
aymeric
e2de6e57a9 fix typo in comment 2004-08-16 10:12:40 +00:00
tacha
08adc832cf remove obsolete "pci_enumerate_bus" definition. 2004-08-02 18:07:40 +00:00
uebayasi
33d0780d08 Fix an apparent syntax error. 2004-08-02 13:30:08 +00:00
simonb
ed2e469e3d Remove some debug printf()s.
Reorder an evcnt_attach_static().
2004-07-31 13:28:53 +00:00
manu
66fc5fb621 Empty shell for Darwin audit API 2004-07-28 22:24:06 +00:00
manu
57ae178c88 Added a simple bigcopy, from Srinivasa Kanduru 2004-07-25 09:21:48 +00:00
manu
f6a07159af typo 2004-07-15 20:21:55 +00:00
manu
1e147c565c Remove an outdated comment. 2004-07-15 11:51:56 +00:00
manu
51267dac7d Correctly set MSR static user bits on thread creation, as the calling
process might not have done it. This fixes crashes on thread creation.
2004-07-14 19:58:51 +00:00
matt
635306e7ba Clear PSL_SE on a scheduler activation upcall. 2004-07-09 22:59:17 +00:00
matt
4f6490d718 Add some comments, clean things up so routines can be called from the
idle loop.
2004-07-09 22:00:46 +00:00
manu
99b82f59fb Fix semantic problems with commpage functions, by Wolfgang Solfrank 2004-07-08 13:24:39 +00:00
manu
0d64053852 I copy/pasted the copyright notice from another file but I forgot to
change the name of the contributor: Wasabi Systems did not contribute
that file.
2004-07-08 07:36:25 +00:00
christos
f68663bc91 kill duplicate code. 2004-07-07 22:02:12 +00:00
manu
9ff70d0082 Assembly versions of commpage functions for Powerpc, by Peter Grehan.
bigcopy is still missing
gettimeofday is implemented as a system call, whereas on Darwin, it reads
the data from the commpage (the kernel updates it).
2004-07-06 14:11:49 +00:00
pk
a7c40722d8 Call inittodr() from main(). Let file system code set the recorded `last
update' time (if any) through the new function setrootfstime().
2004-07-05 07:28:45 +00:00
manu
67cf1bc043 MacOS X.3 introduces a new sigreturn for PowerPC, with a usercontext
versionning argument. For now we only implement the X.2 flavor.
2004-07-04 21:03:55 +00:00
manu
7fef082024 Move all the MD bits of commpage to a new file.
Map the comm page as RW in kernel (we want to modify it but not to execute it),
and RX in userland (no need to modify it but we want to execute it
2004-07-03 22:17:18 +00:00
manu
26200ee754 In MacOS X.3, the kernel maps tw opages of memory in every user process.
This areas is called the comm pages. It is used to provide fast access to
several data and functions.

The comm pages are mapped starting at 0xffff800 (address chosed so that
absolute branch can be used, so it can be accessed even when dynamic linking
is not ready). NetBSD has the user stack here, so we need to provide a
Darwin-specific stack setup routine which sets the top of the stack at
0xbfff0000.

This implementation is not complete but it does enough to get MacOS X.3
starting again (static binaries run, dynamic binaries still have an issue).
in the comm pages functions, we only implement bcopy, pthread_self and
memcpy.

TODO:
- clean up the powerpc specific code from MD parts
- for now we map only one page to avoid a crash, we want two pages.
- write all the comm functions.
2004-07-03 00:14:30 +00:00
kleink
0fea7f39a2 On OEA, turn PSL_USER* into runtime values appropriate for the CPU model
we're executing on; besides dealing with the bits not implemented in the
601's MSR it also removes the silent failure behaviour when passing
PSL_VEC set on a CPU not implementing it.

Also, fix those masks for the 4xx again.
2004-06-26 21:48:30 +00:00
kleink
5b37ad104f Repair a sentence. 2004-06-26 16:04:55 +00:00
kleink
0edffeb867 On MPC601s, rewrite any (unimplemented) tlbsync instruction as a sync. 2004-06-23 22:04:44 +00:00
kleink
8a98994beb Get rid of the silly CPU601 hooks and move BAT register restoration and
obliteration to RESTORE_{KERN,USER}_SRS, respectively; have oea_init()
patch these sequences to be skipped on non-MPC601s.  The code sequence
matching heuristic isn't as pretty as the one for VRSAVE and MQ but works
well enough with the current structure of the trap code, and can be easily
updated when necessary.
2004-06-09 23:24:51 +00:00
kleink
15764c5ab2 pmap_extract(): consider the MPC601's different battable layout, and its
use of I/O segments.
2004-06-09 19:30:57 +00:00
kleink
00fcabcfc9 Print SPR 0x100 as VRSAVE on non-4xx. 2004-06-09 19:19:05 +00:00
kleink
b7ca652249 Add MPC601 support. 2004-06-08 19:29:53 +00:00
kleink
1e669a49c6 Repair a comment misplaced in rev. 1.43. 2004-06-08 19:07:00 +00:00
kleink
d92e6963e4 Add some BAT-style predicate macros. 2004-06-06 21:23:53 +00:00
kleink
7498ed2ff7 Mark cr0 as clobbered in mfrtc(). 2004-06-06 10:45:06 +00:00
thorpej
e33c2bb5d5 Add the %MAKEOPTIONSAPPEND token at the end of the file, after the
common Makefile.kern.inc has been included.
2004-06-04 04:45:49 +00:00
matt
3c0ef6aa5f Fix softnet intr handling (to be like the generic ppc softintr). 2004-06-01 00:49:41 +00:00
kleink
7b3b647647 Factor out W{CHAR,INT}_{MAX,MIN} into their own header file. 2004-05-08 21:51:47 +00:00
matt
886b18bf35 Add PT_MACHDEP_STRINGS so that kdump(1) can print out the PowerPC-specific
ptrace requests.
2004-05-06 22:53:02 +00:00
kleink
0e5d242328 Update for new pci_devinfo(9) signature. 2004-04-24 15:49:00 +00:00
matt
e3aa635a37 Fix tpyo. 2004-04-18 23:32:46 +00:00
matt
0f0d66d66e Add entry for netns/ns_cksum.c 2004-04-18 23:31:45 +00:00
matt
8cd24529dc Add a SAVE/DISCARD flag to save_{fpu,vec}_lwp. Use it appropriately.
Nuke struct fpu and use struct fpreg instead (except for the names, they
were identical).  On MP machines, this will avoid an unneeded IPI to save
the register contents that are about to discarded.
2004-04-16 23:58:08 +00:00
hannken
3dc578de5e Make it compile when PPC_HAVE_FPU is not defined. 2004-04-16 08:52:41 +00:00
matt
ee00feaab9 Revamp how user MSR/SRR1 are dealt with.
Add a PSL_USEROK_P(psl) macro which valids the bits (replaces the use of
PSL_USERSTATIC).
Add a PSL_USERSRR1 mask which is used to mask out status bits in the upper
half of SRR1.
Make sure PSL_VEC is set appropriately in userret().  PSL_VEC is in the same
region as SSR1 status bits so it's not preserved on exceptions.  Thus we
need to make to set it.
When returning a MSR/SRR1 to userland, always clear the status bits.
Add emulation of the mfpvr, mtmsr, and mfmsr instructions.
2004-04-15 21:07:06 +00:00
matt
949694f7d9 When seeing if the FP or VEC unit has been stolen by another process, check
PSL_{FP|VEC} instead of PCB_{FP|VEC}.  The former will only be set if the
process owned the {FP,VEC} unit when it trapped into the kernel.  The latter
would be set if the lwp ever used the {FP,VEC} unit.
2004-04-06 02:25:22 +00:00
simonb
3ce5632009 Fix tyop. 2004-04-05 04:53:01 +00:00
matt
15fc41dbb0 When trying to figure out which code to return, use the exception enable
bits to mask out the undesired exceptions.  (Thanks to Todd Whitesel for
the idea).
2004-04-04 22:20:44 +00:00
matt
e7c76e51e6 Add SIGFPE handling code. Report the proper SIGINFO ksi_code when a SIGFPE
happens.  When a SIGFPE occurs, disable the exception enables in the FPSCR.
2004-04-04 19:21:36 +00:00
matt
bc8d283982 Reformat the __asm a bit. 2004-04-04 17:35:15 +00:00
matt
5bf797c2e1 Add int get_fpu_fault_code(void). 2004-04-04 17:26:58 +00:00
matt
481d181cd4 In cpu_getmcontext, make sure the returned MSR has the FP exception mode
(PSL_FE0|PSL_FE1) saved in the PSL.  In cpu_setmcontext, copy the FP
exception bits to the PCB where they live.
2004-04-04 17:26:10 +00:00
matt
847bed9428 Fix the way cpu_setmcontext was restoring FPSCR. Make the opposite of the
way that cpu_getmcontext was saving it.  (FPSCR was being saved incorrectly
before and thus obliterated when a signal happened).
2004-04-04 17:20:15 +00:00
matt
7681ce429d Make sure that the SRR1 we pass to userland reflects PSL_FE0|PSL_FE1 even
if the lwp doesn't currently own the FPU.  When returning, copy those bits
back to the PCB.  (In case the user decided to the FP exception mode in the
signal handler).
2004-04-04 17:10:32 +00:00
matt
4dc0aa3dee Don't add PSL_FE_FDLT to srr1, but put in pcb_flags. It will be added to
the SRR1 only when the lwp owns the FPU.
2004-04-04 17:05:31 +00:00
matt
44003b5fca The FP exception mode bits from the MSR will be stored in pcb_flags. From
there, they will copied to MSR as needed (when FP is enabled).  They will be
cleared from the MSR when the lwp loses the FPU.  Hence they need to be stored
someplace else.
2004-04-04 17:01:44 +00:00
matt
aed3d18029 On FPU'ed systems, initialize the default FP exception mode. 2004-04-04 16:57:00 +00:00
matt
c0dce2fdd9 Be a lot more explicit about the MSR bits a user process can change. 2004-04-04 16:49:12 +00:00
matt
0d6bda4d21 When returning back to user mode, if the lwp has lost the FPU, not only
clear PSL_FP bit (to force a FPU Unavailable exception) but clear
PSL_FE0 and PSL_FE1 so that the FP execption mode is changes to ignore.
This will prevent spurious FP exceptions being made when the running lwp
doesn't own the FPU.
2004-04-04 16:47:02 +00:00
matt
ef47d758dd Remove softintr__init call. 2004-04-01 16:58:06 +00:00
simonb
f05568af64 Make the "cond" variable an unsigned variable. Stops sign extension
problems when we shift it left and right while creating the new value
for the condition register.

Fixes problems reported by Juergen Hannken-Illjes in toolchain/24938.
2004-03-30 00:04:37 +00:00
simonb
06f98319d7 Fix the LINTSTUB entries- the second arg to these functions is a
bus_space_handle_t, not a bus_addr_t.
2004-03-29 01:15:14 +00:00
simonb
d4c87e3c2e Use "%#x" instead of "%x" so it's obvious the printed number is in hex. 2004-03-29 01:12:01 +00:00
drochner
c83eb997b8 nothing cares about __HAVE_SIGINFO anymore, so nuke it 2004-03-26 21:39:57 +00:00
drochner
d19f706361 all ports define __HAVE_SIGINFO now, so remove the CPP conditionals 2004-03-26 17:34:18 +00:00
matt
06bf53b3d7 Add diagnostic to skip calling uvm_fault when the lwp's USERSR is unset. 2004-03-25 18:50:50 +00:00
matt
040b0bc071 Move data structures to softintr.c. Remove an unneeded if. Fix a typo. 2004-03-25 18:46:27 +00:00
matt
a266f24eb9 Add latent generic soft interrupt initialization. 2004-03-24 23:50:18 +00:00
matt
7f65c1cc37 Generic soft interrupt support for PowerPC ports. 2004-03-24 23:39:39 +00:00
atatat
19af35fd0d Tango on sysctl_createv() and flags. The flags have all been renamed,
and sysctl_createv() now uses more arguments.
2004-03-24 15:34:46 +00:00
simonb
45cc2456c0 Add promiscuous and multicast support.
From KIYOHARA Takashi in PR port-powerpc/23892.
2004-03-24 07:45:23 +00:00
aymeric
0c43568c58 pmap_pinit(): improve the hash function in the case of collisions, the
previous version would easily make the low order bits oscillate between 0
and some other value.

Together with the previous change, this should make those
pmap_pinit: out of segments
panics even less likely.

We should really attempt a systematic search before panic()ing at the end.
2004-03-21 10:34:56 +00:00
aymeric
560cb79c0e . don't call VSID_TO_HASH() on a pmap.pm_vsid. It already holds the hash value.
This should fix PR #24754, as well as many of the hangs and process
  aborts reported on port-macppc@ in the last weeks.
  This error would cause the pmap's vsid never to be freed, and would
  occasionnally free a valid vsid used by another pmap, sometimes the kernel's.
. add a related KASSERT() to avoid regression
2004-03-21 10:25:59 +00:00
aymeric
3ddd2de94c defparam PMAP_MEMLIMIT 2004-03-17 14:14:02 +00:00
cl
ea5ec0212d add kernel part of concurrency support for SA on MP systems
- move per VP data into struct sadata_vp referenced from l->l_savp
  * VP id
  * lock on VP data
  * LWP on VP
  * recently blocked LWP on VP
  * queue of LWPs woken which ran on this VP before sleep
  * faultaddr
  * LWP cache for upcalls
  * upcall queue
- add current concurrency and requested concurrency variables
- make process exit run LWP on all VPs
- make signal delivery consider all VPs
- make timer events consider all VPs
- add sa_newsavp to allocate new sadata_vp structure
- add sa_increaseconcurrency to prepare new VP
- make sys_sa_setconcurrency request new VP or wakeup idle VP
- make sa_yield lower current concurrency
- set sa_cpu = VP id in upcalls
- maintain cached LWPs per VP
2004-03-14 01:08:47 +00:00
christos
fcc8e3a5b0 PR/24741: Aymeric Vincent: Variable sme_flags isn't initialized to zero 2004-03-11 15:40:13 +00:00
kleink
9ff09d5dff Pull in SPRs via <powerpc/spr.h> in this single instance, and dispose of
<machine/spr.h> again.
2004-03-02 00:35:54 +00:00
drochner
6f1a2b7cbf deliver SIGSEGV/SEGV_ACCERR if code execution on stack is attempted,
tested by Juergen Hannken-Illjes
(there are more uninitialized ksi.ksi_code arguments)
2004-02-24 18:31:46 +00:00
drochner
45fc887212 deliver SIGSEGV/SEGV_ACCERR if code execution on stack is attempted,
tested by Chuck Silvers
2004-02-24 18:25:27 +00:00
matt
77effcd27e Don't waste space on likely unused sysmon structure.
Instead malloc them as needed.
2004-02-17 22:03:52 +00:00
wiz
d20841bb64 Uppercase CPU, plural is CPUs. 2004-02-13 11:36:08 +00:00
uebayasi
189c5218f4 Typo typo. 2004-01-31 14:12:33 +00:00
nonaka
bf6adc04cc implement bus_space_set_region_[124], bus_space_copy_region_[124]. 2004-01-08 15:29:20 +00:00
briggs
ad7a849c27 Change CPPFLAGS to -D${MACHINE}=${MACHINE} instead of just -D${MACHINE}
This makes it possible to define header files on the command line that
might include ${MACHINE} somewhere in the path.  This might be used in
evbppc, for example, when defining PPC_PCI_MACHDEP_IMPL as, for example:

PPC_PCI_MACHDEP_IMPL="<arch/evbppc/sandpoint/pci_machdep.h>"

which will be included as

#include PPC_PCI_MACHDEP_IMPL

Prior to this change, the compile would fail trying to include
<arch/evbppc/1/pci_machdep.h>
2004-01-06 18:44:57 +00:00
jdolecek
089abdad44 Rearrange process exit path to avoid need to free resources from different
process context ('reaper').

From within the exiting process context:
* deactivate pmap and free vmspace while we can still block
* introduce MD cpu_lwp_free() - this cleans all MD-specific context (such
  as FPU state), and is the last potentially blocking operation;
  all of cpu_wait(), and most of cpu_exit(), is now folded into cpu_lwp_free()
* process is now immediatelly marked as zombie and made available for pickup
  by parent; the remaining last lwp continues the exit as fully detached
* MI (rather than MD) code bumps uvmexp.swtch, cpu_exit() is now same
  for both 'process' and 'lwp' exit

uvm_lwp_exit() is modified to never block; the u-area memory is now
always just linked to the list of available u-areas. Introduce (blocking)
uvm_uarea_drain(), which is called to release the excessive u-area memory;
this is called by parent within wait4(), or by pagedaemon on memory shortage.
uvm_uarea_free() is now private function within uvm_glue.c.

MD process/lwp exit code now always calls lwp_exit2() immediatelly after
switching away from the exiting lwp.

g/c now unneeded routines and variables, including the reaper kernel thread
2004-01-04 11:33:29 +00:00
aymeric
f45c23b807 fix an obvious typo which prevented the machdep.cacheinfo table from being
published.
This generated the following warning message at boot time:
sysctl_createv: sysctl_create(cacheinfo) returned 17
2004-01-03 00:09:15 +00:00
pk
70f20a1217 Replace the traditional buffer memory management -- based on fixed per buffer
virtual memory reservation and a private pool of memory pages -- by a scheme
based on memory pools.

This allows better utilization of memory because buffers can now be allocated
with a granularity finer than the system's native page size (useful for
filesystems with e.g. 1k or 2k fragment sizes).  It also avoids fragmentation
of virtual to physical memory mappings (due to the former fixed virtual
address reservation) resulting in better utilization of MMU resources on some
platforms.  Finally, the scheme is more flexible by allowing run-time decisions
on the amount of memory to be used for buffers.

On the other hand, the effectiveness of the LRU queue for buffer recycling
may be somewhat reduced compared to the traditional method since, due to the
nature of the pool based memory allocation, the actual least recently used
buffer may release its memory to a pool different from the one needed by a
newly allocated buffer. However, this effect will kick in only if the
system is under memory pressure.
2003-12-30 12:33:13 +00:00
manu
fe7a5ddf22 Fix PowerPC ports build with KGDB. 2003-12-30 11:23:20 +00:00
mjl
df0cb86d0d Add some casts to printf() args to make it compile w/ DEBUG set. 2003-12-27 13:35:52 +00:00
pk
5218af0651 Use uvm_km_zalloc(...) instead of uvm_km_alloc1(...,1). 2003-12-18 14:15:55 +00:00
simonb
4805123b12 Nuke register prefix for local variables, clean up indentation a little. 2003-12-17 04:04:40 +00:00
manu
d2b4a2c0fa Enable SA_SIGINFO for COMPAT_DARWIN 2003-12-16 13:38:25 +00:00
manu
c3eb252046 GPR5 does not hold code, it holds the signal number (this is the first
argument to the signal handler). It's an extraordinary luck that test
programs worked so far.
2003-12-16 13:36:18 +00:00
scw
6222bc14b8 Fix a typo in bswr2rb() which resulted in an 8-bit load instead 16-bit.
Pointed out by Derek Godfrey.
2003-12-11 23:52:25 +00:00
matt
0ecc4c35b5 Copy ksi->ksi_info, not all of ksi, to user stack. 2003-12-11 18:33:52 +00:00
simonb
8b18b565b8 Make some comments line up. 2003-12-09 09:49:01 +00:00
hannken
8e29a1a664 Make it compile without PPC_OEA. 2003-12-05 11:00:57 +00:00
atatat
13f8d2ce5f Dynamic sysctl.
Gone are the old kern_sysctl(), cpu_sysctl(), hw_sysctl(),
vfs_sysctl(), etc, routines, along with sysctl_int() et al.  Now all
nodes are registered with the tree, and nodes can be added (or
removed) easily, and I/O to and from the tree is handled generically.

Since the nodes are registered with the tree, the mapping from name to
number (and back again) can now be discovered, instead of having to be
hard coded.  Adding new nodes to the tree is likewise much simpler --
the new infrastructure handles almost all the work for simple types,
and just about anything else can be done with a small helper function.

All existing nodes are where they were before (numerically speaking),
so all existing consumers of sysctl information should notice no
difference.

PS - I'm sorry, but there's a distinct lack of documentation at the
moment.  I'm working on sysctl(3/8/9) right now, and I promise to
watch out for buses.
2003-12-04 19:38:21 +00:00
manu
057381d1b4 Move machine dependent definitions to machine dependent headers. 2003-12-03 18:25:44 +00:00
simonb
9c334e285d Remove unused ddbsave define. 2003-11-30 07:41:54 +00:00
manu
097771219f Implement vm_read, vm_write, and a framework for vm_machine_attribute.
THe machine dependent bit nees to be written.
2003-11-29 23:56:08 +00:00
simonb
2350e98506 Fix some white space nits. 2003-11-26 03:56:38 +00:00
simonb
19a9d14f26 Remove the prototype for the non-existent intr_md_register() function. 2003-11-26 03:55:38 +00:00
simonb
da33cec9b3 Need offset of ci_curpm in struct cpu_info on 4xx as well. 2003-11-26 03:51:39 +00:00
matt
99f7a6b7db More PPC64 changes. (latent for now). 2003-11-21 22:57:14 +00:00
matt
d765841d3e Restore ci_curpm since it re-enables 603 to working state. 2003-11-21 18:07:29 +00:00
matt
13e522ee98 Add PowerPC64 definitions 2003-11-21 17:40:48 +00:00
scw
1ba37196a9 Include arch/powerpc/ibm4xx/intr.c only if a particular board actually
uses the generic 4xx interrupt implementation.
There are some 4xx boards with entirely different interrupt controllers.
2003-11-19 14:27:24 +00:00
manu
b6b7d129a1 Added mach_thread_set_state 2003-11-11 18:12:40 +00:00
manu
a2bed85761 Implement mach_thread_get_state.
While we are here, try to tag machine dependent functions in header files.
also transformed darwin_ppc_*_state into mach_ppc_*_state, as this is
what they really are (COMPAT_DARWIN is on the top of COMPAT_MACH, not the
other way around)
2003-11-11 17:31:59 +00:00
he
1995f8d682 Replace an overlooked instance of p->p_nras with LIST_EMPTY(&p->p_raslist). 2003-11-06 08:49:13 +00:00
dsl
2ffbd2ab99 Remove p_nras from struct proc - use LIST_EMPTY(&p->p_raslist) instead.
Remove p_raslock and rename p_lwplock p_lock (one lock is enough).
Simplify window test when adding a ras and correct test on VM_MAXUSER_ADDRESS.
Avoid unpredictable branch in i386 locore.S
(pad fields left in struct proc to avoid kernel bump)
2003-11-04 10:33:15 +00:00
cl
ef56cc40ab Reduce code duplication by adding mi_userret() in sys/userret.h
containing signal posting, kernel-exit handling and sa_upcall processing.

XXX the pc532, sparc, sparc64 and vax ports should have their
XXX userret() code rearranged to use this.
2003-10-31 16:44:34 +00:00
simonb
6d85c5e0d5 Don't pass the (unused) return value args to the
trace_enter()/systrace_enter() functions.
2003-10-31 03:28:12 +00:00
chs
6ef2bc9b82 make this compile again. 2003-10-28 15:28:24 +00:00
kleink
39dd1b6e20 pmap_print_mmuregs(): move initialization of addr before its first use;
reported by David Young.
2003-10-27 23:35:41 +00:00
dyoung
9dbaa63583 Stop false uninitialized variable warning. 2003-10-27 23:08:12 +00:00
dyoung
9a73ec4e1e Stop false uninitialized variable warning. 2003-10-27 22:48:20 +00:00
simonb
499ef1c1bb Remove (the now non-compiling) support for 128bit FP emulation, which
isn't needed for PowerPC anyway.
2003-10-27 04:32:02 +00:00
simonb
354075932d Fix a bogus uninitialised warning. 2003-10-27 04:30:32 +00:00
simonb
1baeb1502a Keep bogus gcc -Wuninitialised warnings happy. 2003-10-27 03:58:17 +00:00
kleink
a3fabb9e7f Use <sys/ieee754.h> where applicable. 2003-10-26 20:55:30 +00:00
chs
cac49e5cf0 clear pcb_onfault before calling uvm_fault() and restore it afterward.
if the fault handler generates a pagefault, we'd like to panic rather
than invoking the onfault handler.
2003-10-25 16:31:39 +00:00
matt
425743428c Fix some indentation problems. Turn off PSL_EE when calling OFW. 2003-10-24 05:10:02 +00:00
matt
7e1d1cca33 s/SSR/SRR 2003-10-22 17:29:18 +00:00
matt
3f37cf2db7 Rework ddblow so that if PSL_PR == 1, it dispatches directly to the
trap handler and bypasses the ddbtrap code.
2003-10-22 17:27:58 +00:00
simonb
d4b0d4911f Remove some numeric asm labels that aren't used. 2003-10-20 05:52:55 +00:00
simonb
066683efa3 Need Data Relocate in the MSR for the dcbf in pmap_procwr().
From Matt Thomas.
2003-10-20 05:47:52 +00:00
matt
421dd6cc28 Reorganize the way powerpc port install machine specific headers.
Use <powerpc/oea/bat.h> exclusively and remove <machine/bat.h> and
<powerpc/bat.h>.  Remove unneeded <machine/cpufunc.h>.  To insure
1:1 correspondence of <powerpc/FOO.h> to <machine/FOO.h> include
"../../powerpc/include/Makefile" in "arch/FOO/include/Makefile".
Incororpate <byte_swap.h> into <bswap.h> and then byte_swap.h
2003-10-20 00:12:09 +00:00
matt
ba34947f80 Add powerpc-specific isa and isadma machdep code. (Merge common code from
prep and sandpoint and ...)
2003-10-19 03:19:32 +00:00
matt
3575370e0a Remove worthless load.
Save curcpu before doing uniprocessor dispatch.
2003-10-17 22:21:38 +00:00
matt
12ecf72b47 Don't zero curlwp/curpcb in cpu_switchto.
Use correct register in the store conditional.
Add DIAGNOSTIC check for null curpcb on cpu_switch exit.
2003-10-17 21:08:57 +00:00
matt
67ab911529 Add a KASSERT() to verify the pcb is not NULL. 2003-10-17 19:56:18 +00:00
simonb
ef41f16231 Correct a test for setting IFF_OACTIVE on the interface. 2003-10-15 02:10:00 +00:00
matt
4b22ee736b Add support for MPC74[45]7 2003-10-09 20:49:06 +00:00
matt
acf4563b13 Add code to drop into DDB if you get a DSI fault on the current stack page. 2003-10-09 07:12:24 +00:00
thorpej
901da40cf9 Add some accessor macros for the ucontext:
* _UC_MACHINE_PC() - access the program counter
* _UC_MACHINE_INTRV() - access the integer return value register
* _UC_MACHINE_SET_PC() - set the program counter (this requires
  special handling on some platforms).
2003-10-08 22:43:01 +00:00
thorpej
9ed3b44b84 Use ksi_signo and ksi_code accessor macros. 2003-10-08 00:40:54 +00:00
thorpej
68723a995b * Shuffle some data structures so, and add a flags word to ksiginfo_t.
Right now the only flag is used to indicate if a ksiginfo_t is a
  result of a trap.  Add a predicate macro to test for this flag.
* Add initialization macros for ksiginfo_t's.
* Add accssor macro for ksi_trap.  Expands to 0 if the ksiginfo_t was
  not the result of a trap.  This matches the sigcontext trapcode semantics.
* In kpsendsig(), use KSI_TRAP_P() to select the lwp that gets the signal.
  Inspired by Matthias Drochner's fix to kpsendsig(), but correctly handles
  the case of non-trap-generated signals that have a > 0 si_code.

This patch fixes a signal delivery problem with threaded programs noted by
Matthias Drochner on tech-kern.

As discussed on tech-kern.  Reviewed and OK's by Christos.
2003-10-08 00:28:40 +00:00
scw
4eea84b735 Gah. Pick up the MI i2c headers from the right place.
Pointed out by Shigeyuki Fukushima on port-powerpc@.
2003-10-06 18:19:24 +00:00
shige
0af4acb526 Add Real time clock support code. 2003-10-06 18:15:08 +00:00
scw
2ba7642346 MD i2c glue for the 405GP's onboard IIC controller.
Bit-bang only for now.
2003-10-06 16:15:46 +00:00
manu
2522a3f784 Build PowerPC again with _HAS_SIGINFO. Remove the ifdef on _HAS_SIGINFO
in the header file since all platforms supported by COMPAT_DARWIN now have it.
2003-09-30 21:04:54 +00:00
simonb
953b5b465b Add a dependancy on assym.h; helps "make -j N" kernel builds. 2003-09-29 05:14:23 +00:00
matt
a8a3bf5bed ANSIfy. 2003-09-27 04:44:42 +00:00
matt
827263a8bc Use ksi_signo instead of _signo. 2003-09-27 03:51:54 +00:00
matt
60ff688f72 Define SIGTRAMP_VALID properly. 2003-09-27 00:58:32 +00:00
nathanw
4d59420344 Move __cpu_simple_lock_t and __SIMPLELOCK_{UN,}LOCKED to machine/types.h
so that they can be used in a namespace-friendly way.
2003-09-26 22:45:41 +00:00
matt
6986092cfe Add a machine-dependent SIGTRAMP_VALID macro which is used to test whether
a trampoline version is valid or not.
2003-09-26 22:14:19 +00:00
matt
fb54d529b8 Copy out the entire ksiginfo_t, not just the first word. 2003-09-26 18:00:47 +00:00
eeh
a6192488f7 Define ksi. 2003-09-26 00:00:17 +00:00
matt
2deb8b2e7b Deal with the constification of ksiginfo_t and sigset_t in signalling. 2003-09-25 22:22:36 +00:00
christos
ecfb034cb3 constify siginfo/trapsignal 2003-09-25 22:04:17 +00:00
matt
9a305fca59 Use direct entry for siginfo trampoline. Deal with missing
legacy trampolines in a cleaner manner.
2003-09-25 21:59:55 +00:00
matt
83003b0798 Fill in ksi_code. 2003-09-25 21:58:46 +00:00
matt
85a5f3065d Add siginfo support for PowerPC. 2003-09-25 18:42:18 +00:00
matt
49317aa149 Remove db_onpanic check. 2003-09-25 17:36:33 +00:00
shige
95fa35eb8e Delete this file because filename includes uppercase letters. 2003-09-24 11:51:19 +00:00
shige
0a36d23137 Copy IBM4xxGPx specific autoconf code from evbppc/walnut/autoconf.c. 2003-09-24 11:47:02 +00:00
matt
9c8a5009b3 Define va_list as __builtin_va_list for GCC 3.x. Change stdarg macros
appropriately.  (this is committed from a system run a kernel and userland
built with these changes).
2003-09-24 02:39:56 +00:00
shige
dc98452dce Copy PCI codes for IBM405GPx from evbppc/walnut/pci/{pchb.c,pci_machdep.c}. 2003-09-23 15:30:22 +00:00
shige
03467d74b5 Add devices info for IBM405GPR. 2003-09-23 15:26:46 +00:00
shige
91be153592 Add global cpu_model variable. 2003-09-23 15:25:26 +00:00
shige
e20e959b37 Copy IBM4xxGPx specific autoconf code from evbppc/walnut/autoconf.c. 2003-09-23 15:24:15 +00:00
shige
a8dd07e005 Copy IBM4XX OpenBIOS locore.S from evbppc/walnut. 2003-09-23 15:21:58 +00:00
shige
fc29eb23bf Add some PCI definitions listed in evbppc/include/walnut.h. 2003-09-23 15:19:05 +00:00
shige
2977d5a89a Add IBM40x specific machdep functions. 2003-09-23 15:14:02 +00:00
shige
87f629a7b8 Add IBM405GPr PVR. 2003-09-23 15:10:05 +00:00
shige
94959351e8 Add IBM405GPx specific kernel configuration file. 2003-09-23 15:06:40 +00:00
shige
ee990c494d Move todclock driver from evbppc/walnut/dev. 2003-09-23 15:01:50 +00:00