Commit Graph

390 Commits

Author SHA1 Message Date
skrll
f4ce2b2831 Fix typo that broke bt /a with curlwp 2007-12-20 20:24:47 +00:00
skrll
f63ceafc74 typo in comment. 2007-12-20 08:11:31 +00:00
perry
9b2b412c19 __FUNCTION__ -> __func__ 2007-12-15 00:39:14 +00:00
skrll
ed0dc19ecc g/c __HPPA_SIGNAL_PRIVATE 2007-12-13 21:34:18 +00:00
skrll
e151146b60 Provide a _C_LABEL 2007-12-02 15:55:09 +00:00
ad
ad40d74014 - Change lock_cas from "compare and set" to "compare and swap".
- Add aliases for atomic_cas_ulong(), etc.

Ok skrll@
2007-11-29 16:14:28 +00:00
yamt
ee7cf9f0ab pmap_create: M_VMMAP -> M_VMPMAP for pmap. 2007-11-26 08:33:11 +00:00
skrll
e2b2bdc928 Define PT_MACHDEP_STRINGS for kdump(1) 2007-11-22 11:58:48 +00:00
yamt
38d5e34116 make kmutex_t and krwlock_t smaller by killing lock id.
ok'ed by Andrew Doran.
2007-11-21 10:19:06 +00:00
skrll
caacd2c467 Typo in comment. From OpenBSD. 2007-11-18 12:18:21 +00:00
skrll
74c813c4e9 s/proc/lwp/ in comment 2007-11-16 07:36:10 +00:00
skrll
fd4abe684b No need for reg.h here. 2007-11-13 15:53:17 +00:00
skrll
1acb610fdd Don't use structure copy in __cpu_simple_lock_init. Set the array elements
to __SIMPLELOCK_RAW_UNLOCKED instead.
2007-11-13 11:37:06 +00:00
skrll
c1e4ee94be Fix kernel profiling on HPPA.
- stop gcc emitting stuff that HPUX requires
- don't use splhigh() in MCOUNT_ENTER as a call to _mcount will be
  generated at the moment. Disable interrupts in hardware instead.
- Fix _PROF_PROLOGUE to save/restore all the register args when calling
  _mcount.
- Fixup LEAF_ENTRY to dtrt (I think) in the GPROF case.
- Provide LEAF_ENTRY_NOPROFILE and sprinkle its use where i) profiling
  causes problems, e.g. trap handlers, and ii) where it just doesn't
  make sense, e.g. start.
2007-11-12 12:58:10 +00:00
ad
bd6663fc4d Don't set l_usrpri / spc_curpriority here. mi_userret() does it. 2007-11-05 20:37:48 +00:00
skrll
016efc036d Remove get_psw/set_psw - they're not needed and can cause problems. 2007-10-18 18:55:10 +00:00
garbled
d974db0ada Merge the ppcoea-renovation branch to HEAD.
This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree.  Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches.  The work
for this branch was done by a variety of people, too long to list here.

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

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
2007-10-17 19:52:51 +00:00
skrll
20d370f9df Make want_resched a member of cpu_info. 2007-10-02 13:49:45 +00:00
he
ed42b680fa Fix build problem: ensure uintptr_t is declared by including <sys/stdint.h>.
OKed by skrll.
2007-09-15 08:05:34 +00:00
skrll
9fdaf800d9 Merge nick-csl-alignment. 2007-09-10 11:34:05 +00:00
drochner
dce09ea075 clean up some definitions around rune_t which are not needed anymore 2007-09-03 20:31:56 +00:00
drochner
0e0fe2c353 Fix definitions of UCHAR_MAX/USHRT_MAX and related
types. C99 requires that these definitions promote to (signed/unsigned)
integer the same way as the types the definition is for. And since
unsigned char/short fit into an "int" on all our archs and thus promote
to signed int, the definitions must not be unsigned.
Fixes PR lib/31306 by Neil Booth.
2007-08-31 16:24:21 +00:00
ad
07b0fe01aa cpu_lwp_fork: don't rely on struct mdlwp being zeroed in advance. 2007-08-17 23:58:45 +00:00
ad
63c4506184 Changes to make ktrace LKM friendly and reduce ifdef KTRACE. Proposed
on tech-kern.
2007-08-15 12:07:23 +00:00
skrll
c2c660d00f Finish up the _lock_cas implementation by adding the RAS check.
While I'm here make sure the owner gets set for mutex_enter if we get
interrupted between obtaining the interlock and setting the owner.
2007-07-12 19:31:01 +00:00
skrll
7db093553a Like I said - don't futz with the trapframe in pmap_activate. Instead
update the trapframe space and protection register in cpu_lwp_fork and
setregs.
2007-07-12 14:15:36 +00:00
pooka
0bc323f5cd Initialize the link context in a signal frame to the receiving lwp's
link context instead of NULL.  Otherwise, if we got a signal while the
lwp had a link context set, the link context would be set to NULL upon
return from signal delivery.

christos@tech-kern: "I think you are right."
2007-07-08 10:19:21 +00:00
tsutsui
6a8a584d1a Remove leftover netns stuff. 2007-07-07 05:13:14 +00:00
skrll
f27ffb061f Fix up the frame sanity checking to not bitch when taking interrupts in
the sti ROM code.

Fixes PR/34715.

Thanks to David H. Gutteridge.
2007-05-27 09:41:25 +00:00
skrll
a56f764868 Minor KNF and make some output a bit easier to read. 2007-05-18 13:32:18 +00:00
skrll
0aab2380d9 Use the CALL macro. No functional change. 2007-05-18 13:29:37 +00:00
skrll
843d692d5a pmap_activate shouldn't play with the trap frame - especially not now it's
called by the MI code.

Implement a way of tracking the vmspace allocated to a process and its
LWPs so that if it changes underneath us we can correct the space id in
the trapframe in pmap_activate for now.

An example of when this happens is vfork/exec.

An exec hook is probably the way to go.
2007-05-18 09:10:50 +00:00
yamt
f03010953f merge yamt-idlelwp branch. asked by core@. some ports still needs work.
from doc/BRANCHES:

	idle lwp, and some changes depending on it.

	1. separate context switching and thread scheduling.
	   (cf. gmcgarry_ctxsw)
	2. implement idle lwp.
	3. clean up related MD/MI interfaces.
	4. make scheduler(s) modular.
2007-05-17 14:51:11 +00:00
skrll
ad81397a3c Pull across #include file fix from yamt-idlelwp. 2007-05-15 18:00:34 +00:00
skrll
7b06b6fc23 Remove useless comment. 2007-05-08 07:06:45 +00:00
skrll
bd22722e77 Use sr1 to jump to syscall as we just loaded it with the right value. 2007-05-08 07:01:17 +00:00
skrll
8ac9999f27 Whitespace. 2007-04-18 13:41:37 +00:00
skrll
974981b1d9 Bump the initial stack size limit to bring in line with other ports.
newfs_lfs doesn't core by default now.
2007-04-18 13:39:37 +00:00
skrll
ee87345f90 Remove unused label. 2007-04-12 10:07:36 +00:00
skrll
5790e46e8b Correct a comment. 2007-04-07 09:02:50 +00:00
skrll
406c4f0d55 de-__P()
s/lwp/l/ for argument name in pmap_deactivate.
2007-04-07 09:02:07 +00:00
skrll
693a79edd7 Add ldcw as a store instruction. From OpenBSD. 2007-04-07 08:38:28 +00:00
skrll
6e5bbbab10 de-__P() 2007-04-07 08:37:49 +00:00
skrll
d8db1d193c de-__P() and whitespace. 2007-04-07 08:36:49 +00:00
skrll
fe255bdc71 Whitespace. 2007-04-07 08:35:52 +00:00
skrll
101cbda361 Typo. From OpenBSD. 2007-04-07 08:35:13 +00:00
skrll
3581d4c55c Improve EXIT and add a BSS macro. From OpenBSD.
Implement WARN_REFERENCES.
2007-04-07 08:34:17 +00:00
skrll
108c9e1aa3 Move a comment and correct a typo. 2007-03-16 08:02:49 +00:00
he
820deae228 Change a cast from void* to char* due to the need to do pointer arithmetic. 2007-03-07 09:23:32 +00:00
christos
53524e44ef Kill caddr_t; there will be some MI fallout, but it will be fixed shortly. 2007-03-04 05:59:00 +00:00
skrll
bb026cb226 Remove hppa_{round,trunc}_page. 2007-03-03 14:37:54 +00:00
skrll
830baead4e Actually remove spinlock.h 2007-03-03 10:52:45 +00:00
skrll
6fe0d31d3a Update for change in db_stack_trace_print prototype 2007-02-22 22:17:02 +00:00
thorpej
f5d6b882ad TRUE -> true, FALSE -> false 2007-02-22 05:46:28 +00:00
thorpej
dd962f8680 Pick up some additional files that were missed before due to conflicts
with newlock2 merge:

Replace the Mach-derived boolean_t type with the C99 bool type.  A
future commit will replace use of TRUE and FALSE with true and false.
2007-02-21 23:48:10 +00:00
thorpej
712239e366 Replace the Mach-derived boolean_t type with the C99 bool type. A
future commit will replace use of TRUE and FALSE with true and false.
2007-02-21 22:59:35 +00:00
skrll
85f62f2ac1 - Add /a modifier to trace that allows a specific LWP to be selected.
- When doing trace/t, always note which pid/lid combination is being traced

XXX This probably shouldn't be in this file.
2007-02-21 00:23:59 +00:00
skrll
9a649e55a4 Check the right register for the mtx_waiters value. 2007-02-20 00:28:53 +00:00
skrll
bb27762b37 Call mutex_wakeup if there are waiters instead of mutex_vector_exit. 2007-02-19 18:09:55 +00:00
skrll
9d95242f6c Remove some redundant '.import's 2007-02-19 17:06:32 +00:00
skrll
197cd56e11 Remove the requirement for $trap_tmp_save to be 2048 aligned. It's not
it for the sake of 4 instructions.
2007-02-19 13:23:11 +00:00
skrll
654d0ffbd9 Whitespace. 2007-02-19 13:19:20 +00:00
skrll
bf42c1ff86 s/SPACE_CURPROC/SPACE_CURLWP/ to reflect what it actually does. 2007-02-19 12:26:39 +00:00
ad
def3fb26c7 Add MUTEX_CLEAR_WAITERS(). 2007-02-15 22:52:42 +00:00
skrll
1472d08a88 Fix a label. 2007-02-10 13:21:52 +00:00
skrll
de10cef758 Destroy a mutex correctly. That is, overright the owner and don't set
mtx_waiters.
2007-02-10 12:15:24 +00:00
ad
b07ec3fc38 Merge newlock2 to head. 2007-02-09 21:55:00 +00:00
skrll
a815b70d5c G/C hp{pa,700}/spinlock.h 2007-02-06 21:59:24 +00:00
christos
5058960df7 make this gdtoa friendly. 2007-02-04 00:39:19 +00:00
skrll
03c2b891e6 Update uvm_grow to support stacks that grow upwards.
Use on hppa and fix a bug in the hppa trap handler.
2006-12-18 09:39:14 +00:00
skrll
6cff9cd2f4 Initialise the result rather than returning garbage. 2006-11-27 07:22:07 +00:00
wiz
6919c6578c s/independant/independent/, from Zafer. 2006-11-24 22:04:21 +00:00
skrll
140ca90ce5 pmap_kenter_pa the kernel and it's data structures including the kernel
stack.

Fixes the "booting from disk memory corruption bug" which was a result
of pmap_extract silently failing against a scsipi_xfer data area allocat-
ed on kernel stack in _bus_dmamap_load_buffer
2006-10-30 16:04:10 +00:00
skrll
4663c12d85 Add some debug code. 2006-10-30 08:41:27 +00:00
skrll
c6dcde599c Whitespace fixes. 2006-10-30 08:39:04 +00:00
skrll
92df06c2d1 G/C pages_per_vm_page 2006-10-30 08:30:01 +00:00
skrll
2ec9405f64 Fix the code to deal with new gcc propagating const-ness from structs to
members. All fixups of the mcontext are done in the trapframe.
2006-10-25 11:06:02 +00:00
skrll
21f8bf16fc KNF and comment update. 2006-10-23 14:15:09 +00:00
he
e1fda29be8 Convert to using hexadecimal literals for the type limits.
Also, add a trailing 'U' to the unsigned limits.
2006-10-19 20:20:43 +00:00
skrll
23faec7f85 Reformat a comment and fix a typo. 2006-10-14 09:09:34 +00:00
skrll
d39c8c0379 Typo in comment. 2006-10-14 09:07:01 +00:00
skrll
8e824ab13e Make this compile without KTRACE.
From Sergey Svishchev in a private email.
2006-10-09 21:32:29 +00:00
tnozaki
44eb8f042e fix gcc -Werror -Wmissing-braces problem
mbstate_t(this is opaque object)'s initializer should be ``{ 0 }'',
so changed 1st field of union from character array to integer.
2006-10-04 13:51:59 +00:00
skrll
c6b33d9f1f Create real lock primatives using as little asm as possible.
It's not used anywhere, but it's better committed than on any of my HDs.
2006-09-22 08:31:34 +00:00
skrll
f576f19cbb Fix comment. %t1 is the syscall # not curlwp. 2006-09-15 06:09:36 +00:00
skrll
679c7b5e46 Don't lose a page at the end of the 3 segments we uvm_page_physload.
(end/avail_end are excluive page numbers - as dicussed on tech-kern)
2006-09-03 13:40:08 +00:00
yamt
e527ebac6f - remove unused bdbtofsb.
- move the following macros from MD headers to sys/param.h.
	ctod
	dtoc
	ctob
	btoc
	dbtob
	btodb
2006-08-28 13:43:35 +00:00
skrll
29c50502a7 Pull across OpenBSD cpufunc.h:1.27 (ignore the typo)
revision 1.27
date: 2005/04/07 00:19:28;  author: mickey;  state: Exp;  lines: +3 -3
put a memmory barrier onto the sync_caches()
2006-08-27 08:42:50 +00:00
skrll
edb23da2a3 Pull across the stack trace stuff from OpenBSD. 2006-08-26 06:27:40 +00:00
skrll
5a545933ba Correct assembler syntax to load the correct (left) bits of a constant.
Inspired by OpenBSD.
2006-08-26 06:00:07 +00:00
skrll
4f9577ff1d Fix a spello in a debug message. 2006-08-25 07:21:07 +00:00
skrll
544f900acb Fix PR 33702.
Modernise the linker script and make sure we have a symbol after the
link_sets.

Make sure that pmap_bootstrap doesn't tell uvm that some of the kernel
phys pages are free. Previously uvm would very likely allocate the phys
pages used for the link_sets to a MALLOC and they'd get overwritten.

Thanks to David H. Gutteridge for testing various things.
2006-08-25 06:49:15 +00:00
skrll
f2ed48bd00 KNF a comment 2006-08-25 06:23:54 +00:00
skrll
9f892c7bca Use PMAP_PRINTF(PDB_INIT, ...) instead of various #ifdefs and add some
more debug code.
2006-08-24 07:00:46 +00:00
skrll
afd79cc70e KNF a comment. 2006-08-24 06:54:11 +00:00
skrll
cd2d8ca31f Fix PMAPDEBUG compile by sorting the printf format problems. 2006-08-24 06:50:48 +00:00
drochner
84f50d1b92 don't install <machine/db_machdep.h>, this is kernel only 2006-07-26 19:54:56 +00:00
ad
2b79369c7e - Hold a reference to the process credentials in each struct lwp.
- Update the reference on syscall and user trap if p_cred has changed.
- Collect accounting flags in the LWP, and collate on LWP exit.
2006-07-19 21:11:37 +00:00
skrll
e5bd1e1629 Disable DDB_DEBUG by default 2006-07-07 09:40:54 +00:00
skrll
0fd55006fe Fix use of user_backtrace. It takes a lwp pointer now. 2006-07-07 09:38:47 +00:00
skrll
4b14ca6f7c Actually drop into ddb for unknown traps (with the right conditions) 2006-07-03 19:48:30 +00:00
skrll
6206b7dc5f P_PROFIL is held in p_flag of struct proc so test for it there. 2006-05-12 04:26:40 +00:00
cherry
d600e81a73 closes: PR kern/32359
modifies machine/db_machdep.h: BKPT_SET(inst) to BKPT_SET(inst, addr) for all archs ie; passess the
breakpoint address as well.

Patch from cherry@mahiti.org
2006-04-01 15:44:58 +00:00
drochner
47fbb9d86b adapt to uvm_fault() interface cleanup: kill the useless 3rd argument 2006-03-15 18:12:02 +00:00
thorpej
61dd49d3bc Syscall debug tracing is handled by trace_enter() / trace_exit(). Change
trace_is_enabled() to return TRUE if SYSCALL_DEBUG is defined, and g/c
all of the SYSCALL_DEBUG handling from individual system call dispatch
routines.
2006-03-07 07:21:50 +00:00
thorpej
be8b235384 Clean up fallout proc_is_traced_p() change:
- proc_is_traced_p() -> trace_is_enabled(), to match trace_enter() and
  trace_exit().
- trace_is_enabled() becomes a real function.
- Remove unnecessary include files from various files that used to care
  about KTRACE and SYSTRACE, but do no more.
2006-03-07 03:32:04 +00:00
wiz
1ad8067cb3 Fix typos, reported by Alexey Dobriyan ("Gathered from Linux"),
forwarded by jmc@openbsd.
2006-02-25 00:58:34 +00:00
perry
fbae48b901 Change "inline" back to "__inline" in .h files -- C99 is still too
new, and some apps compile things in C89 mode. C89 keywords stay.

As per core@.
2006-02-16 20:17:12 +00:00
dsl
8d7fb15302 Add .MAKE to targets that run ${MAKE} so that parallel makes work properly. 2006-02-04 11:23:45 +00:00
dsl
801edd9a37 Use uint32_t and uint16_t not in_addr_t and in_port_t 2006-02-03 22:05:21 +00:00
dsl
67d47e0290 Change sys/arch/xxx/include/bswap.h to #include machine/byte_swap.h then
sys/bswap.h in order to pick up the MD inline routines and the constant
folding definitions in the right order.
Code can include either sys/bswap.h or machine/bswap.h with the same effect.
2006-01-31 07:49:18 +00:00
dsl
c88ae1f9ee Move all the stuff that detects bswapxx(constant) into the MI sys/bswap.h
Put the minimum to define the required inline assembler or C into the MD files.
NB: there may be some fallout from this!
2006-01-30 22:46:35 +00:00
christos
3ffa241fcd Add a STRONG_ALIAS macro 2006-01-20 22:02:40 +00:00
perry
2d542ba1f8 inline -> __inline 2005-12-28 19:09:29 +00:00
perry
e7b322a5f7 inline -> __inline 2005-12-28 18:40:13 +00:00
perry
50a256a3a0 __asm__ -> __asm
__const__ -> const
__inline__ -> inline
__volatile__ -> volatile
2005-12-24 23:23:59 +00:00
perry
2d65de2479 bare asm -> __asm 2005-12-24 22:45:33 +00:00
perry
5f1c88d70d Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete. 2005-12-24 20:06:46 +00:00
christos
95e1ffb156 merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
he
7a4c4764d9 Remove "bad" label no longer in use. 2005-07-03 22:21:10 +00:00
christos
6d30dcee75 PR/29607: Christian Biere systrace doesn't handle interrupted syscalls properly
Instead of jumping to the default "bad" case, jump to the error handling
switch, so that we can deal with ERESTART/EJUSTRETURN properly.
2005-07-01 18:01:44 +00:00
he
0f76827b9a Remove the declaration of a now-unused local variable. 2005-06-10 22:34:05 +00:00
matt
e1245a3c46 Rework the coredump code to have no explicit knownledge of how coredump
i/o is done.  Instead, pass an opaque cookie which is then passed to a
new routine, coredump_write, which does the actual i/o.  This allows the
method of doing i/o to change without affecting any future MD code.
Also, make netbsd32_core.c [re]use core_netbsd.c (in a similar manner that
core_elf64.c uses core_elf32.c) and eliminate that code duplication.
cpu_coredump{,32} is now called twice, first with a NULL iocookie to fill
the core structure and a second to actually write md parts of the coredump.
All i/o is nolonger random access and is suitable for shipping over a stream.
2005-06-10 05:10:12 +00:00
chs
47a4c9b6ff adapt to const changes. 2005-06-03 15:21:35 +00:00
scw
8f4aee207b Declare the second arg of process_write_{fp,}regs() to be const.
This permits sh5 to continue to re-use those functions in cpu_setmcontext()
with the recent change to Makefile.kern.inc (revision 1.62).
2005-06-01 13:01:35 +00:00
chs
90fe0e8ced avoid a shadow. 2005-05-31 16:10:47 +00:00
chs
0400611d8a adapt to const changes. 2005-05-30 16:02:09 +00:00
chs
94622623d8 in pmap_enter(), preset the mod/ref bits based on the flags argument.
fixes 25640.
2005-05-29 15:56:59 +00:00
kleink
4a6a03b162 Include <sys/cdefs.h> for __signed; related to lib/30072. 2005-05-25 20:58:00 +00:00
chs
b25ecfbe53 only lvalues can be incremented. found by gcc4. 2005-05-20 15:09:45 +00:00
chs
9a563a9ab1 in pmap_protect(), remove the assertion that any entries modified must be
managed.  after the yamt-km changes, the sti driver needs to add execute
permission to the (now unmanaged) mapping for its copy of the card firmware,
and this appears to work fine already.
2005-05-07 15:54:46 +00:00
chs
9159c32c9e add additional args to frame_sanity_check() so we can log which
context it was called from and the trap type (if called from trap()).
2005-05-07 15:06:51 +00:00
chs
e92ef73e64 in the trap handler for T_EMULATION traps, also check if the opcode is 0xe.
if it is, then the instruction is an FPU instruction and we must not check
bits 23-25 since they are not a UID field in this format.

this fixes the spurious SIGILLs sometimes triggered by xmpyu instructions.
2005-05-07 15:03:00 +00:00
chs
750baa7b66 in sendsig(), set tf->tf_iisq_* as well, since a thread might take a signal
while it's executing in the gateway page.
2005-05-07 14:27:14 +00:00
chs
521e1394ad remove the sigcontext signal stuff, we've never used it. 2005-05-01 19:19:25 +00:00
chs
058afa680c flush the FPU before accessing the PCB copy. 2005-05-01 19:18:39 +00:00
chs
e47a91f6f0 paranoia: move the dcache flush to the end. 2005-05-01 19:18:12 +00:00
chs
613d022e34 check pcb_onfault for kernel T_DATALIGN traps (for ddb). 2005-05-01 19:17:52 +00:00
chs
e7346e3b2b in cpu_lwp_free(), use hppa_fpu_flush() instead of a broken inline version.
in vmapbuf() and vunmapbuf(), adapt to yamt-km API changes.
2005-05-01 15:23:18 +00:00
kleink
b2cb7fcd8a Push back the descriptions of NaN formats, and descriptions of the
distinction between signalling NaNs and quiet NaNs back into the
machine-dependent headers; treat the implementation of __nanf in the
same spirit.

IEEE 754 leaves the distinction between signalling NaNs and quiet NANs
to the implementation, and unlike our headers used to suggest they're
not identical in the interpretation of the fraction's MSb; in due
course, make those of hppa, mips, sh3, and sh5 reflect reality.
2005-04-15 22:39:10 +00:00
yamt
6b2d8b66a4 merge yamt-km branch.
- don't use managed mappings/backing objects for wired memory allocations.
  save some resources like pv_entry.  also fix (most of) PR/27030.
- simplify kernel memory management API.
- simplify pmap bootstrap of some ports.
- some related cleanups.
2005-04-01 11:59:21 +00:00
tsutsui
061b204c56 user_backtrace() is used if DEBUG or USERTRACE is defined, but not DIAGNOSTIC. 2005-02-17 14:19:49 +00:00
skrll
015f297666 Modernise these to use GCC __builtin_* functions and types.
Also provide a (protected) va_copy.
2005-02-04 12:15:22 +00:00
jmc
3fed402d23 Provide lint wrappers around the va_* defs like other ports do so this can
make it through lint (was dying in libpam)
2005-02-03 23:45:37 +00:00
jkunz
e4bed1ee79 Implement powerd(8) interface via sysmon(9) for power switch, controllable by sysctl(8). 2005-01-31 18:17:35 +00:00
jkunz
48f11129db Import mfcpu() from OpenBSD, needed by power switch code. 2005-01-31 17:32:15 +00:00
atatat
a076957818 Convert the PMAP_PREFER() macro from two arguments (offset and hint)
to four (adding size and direction).

In order for topdown uvm to be an option on ports using PMAP_PREFER,
they will need to "prefer" lower addresses if topdown is being used.
Additionally, at least one port also needs to know the size.
2005-01-17 04:37:20 +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
thorpej
6c08646cb8 Garbage-collect pagemove(); nothing use it anymore (YAY!!!) 2004-08-28 22:12:40 +00:00
jkunz
1035c6af08 Import STI wscons(4) driver from OpenBSD and add new driver for PS/2
keyboard / mouse pots of LASI.
2004-08-26 16:48:06 +00:00
chs
7732d6db9d handle T_CONDITION traps (by sending SIGFPE).
fix T_EXCEPTION code to handle the other FP major opcodes.
2004-08-07 21:47:05 +00:00
chs
43d9a77774 remove the alignment attribute from the typedef of __cpu_simple_lock_t
since it doesn't have any affect and lint chokes on it.
2004-08-07 21:42:10 +00:00
chs
1974de97c5 stub out the ldcw stuff for now, since gcc -O2 chokes on it. 2004-08-07 21:41:44 +00:00
chs
2e5e9111d9 clean up some register naming. 2004-08-07 21:41:18 +00:00
chs
f05f720ae1 real siginfo support. 2004-07-24 19:04:53 +00:00
chs
d2943099a2 FPU fixes and improvements, adapted from openbsd:
- handle exceptions correctly
 - emulation of unimplemented instructions (eg. on PA-7300LC)
2004-07-24 18:59:05 +00:00
chs
7a0d577e38 put RAS_DECL() back to declaring a function by default (since SH5
requires that).  instead, allow <machine/types.h> to override the
default definition and do so on hppa.
2004-07-19 03:12:31 +00:00
chs
0d86a5cd52 add hppa support for RAS, context stuff, siginfo and scheduler activations:
- add a RAS hook in cpu_switch().
 - fill in the definition of struct mcontext.
 - implement cpu_upcall(), cpu_getmcontext(), cpu_getmcontext() and
   cpu_switchto().
 - for now, force the right priviledge bits and space regs in setcontext().
 - use correct values for __SIMPLELOCK_*.
 - move the user stack to start at a multiple of the pthread stack size
   so that libpthread can use the sp-masking trick.
2004-07-18 23:21:35 +00:00
chs
611ac30047 use mi_userret(). 2004-07-18 20:57:34 +00:00
chs
807ed3c6d2 store the kernel stack pointer for a sleeping LWP in its PCB instead of
in its trapframe.  this is needed for scheduler activations, so that we can
change the user stack pointer via the trapframe.  from openbsd.
2004-07-18 20:27:11 +00:00
chs
8f2322ff01 remove an extra instruction I added with an overzealous cut+paste. 2004-07-14 07:23:10 +00:00
chs
9c209c4b37 clear pcb_onfault before calling uvm_fault() and restore it after.
remove some debug code that actually makes debugging harder.
2004-06-15 16:29:32 +00:00
chs
b7bd18170e flush the dcache after accessing pcb_fpregs.
we access it with the DTLB both on and off,
so we need to avoid bad cache aliases.
2004-06-15 16:29:01 +00:00
skrll
31fb35bd8d Fix MAKEOBJDIRPREFIX builds and remove a line continuation that is not
needed.
2004-06-15 07:41:36 +00:00
chs
5579fe0ffc change sigdebug default to not print anything. 2004-06-11 14:01:02 +00:00
chs
5183104959 redo rev. 1.13, handle curlwp being NULL correctly. 2004-06-09 16:06:56 +00:00
chs
6e6e8ad7fe convert pmap_deactivate() from a macro to an inline function
so that the kernel builds again.
2004-05-18 15:33:11 +00:00
chs
df674b2ca1 for instruction TLB miss traps, process the fault with VM_PROT_EXECUTE
instead of VM_PROT_READ (to support non-executable mappings).
2004-05-16 17:07:29 +00:00
chs
f6d0516ba0 in pmap_protect(), don't just return if the desired permissions include write.
we could be removing execute permission.
2004-05-16 17:07:07 +00:00
kleink
7b3b647647 Factor out W{CHAR,INT}_{MAX,MIN} into their own header file. 2004-05-08 21:51:47 +00:00
drochner
80bded6289 To the rest of the kernel, pretend that hppa supports SIGINFO.
There are still only "sigcontext" stackframes passed to the user,
but at least we can clean up the MI sources now.
2004-03-26 14:11:01 +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
wiz
d20841bb64 Uppercase CPU, plural is CPUs. 2004-02-13 11:36:08 +00:00
chs
7e6508e29e add a PMAP_NC flag for pmap_kenter_pa() to specific a non-cached mapping.
use this in mbus_dmamem_map() to fix corruption of DMA memory.
note that this TLB bit is ignored on some CPUs (PA7100 and probably
others of that era), so this doesn't fix the problem in general,
but it does work on newer models and will make things easier later.
2004-01-05 02:25:32 +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
chs
d740b5e191 de-__P, remove register, ansify. 2003-11-28 19:02:25 +00:00
chs
da3e14c277 fix address computation in vmapbuf(). use uvm_km_valloc_prefer_wait().
call pmap_remove() explicitly in vunmapbuf(), this has been required
for several years now.  fixes PR 20933.
2003-11-18 11:37:39 +00:00
tsutsui
3dc4924359 In trap(), curlwp could be NULL so don't refer it implicitly. 2003-11-08 12:08:12 +00:00
matt
1dc67abbb1 Compile at -O2. Fix various GCC3-isms
XXX mem.c still fails to assemble.
2003-11-01 18:23:37 +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
kleink
617742615c It turns out the hppa ABI we're using does not support an extended-
precision type, so drop the library support for now but leave in place
(#ifdef _LP64) the header definitions.
2003-10-30 22:46:17 +00:00
kleink
91af1eaa96 #define __HAVE_LONG_DOUBLE on platforms which implement a distinct
`long double' type.
2003-10-28 00:55:28 +00:00
kleink
964d6747b5 Err, rename some members added in previous to make them reflect their
semantics better.
2003-10-27 01:11:46 +00:00
kleink
b37192f049 For convenient use in libc, add unions of the C floating types and their
corresponding structure definitions.
2003-10-26 21:46:46 +00:00
kleink
a3fabb9e7f Use <sys/ieee754.h> where applicable. 2003-10-26 20:55:30 +00:00
kleink
d7efc4af9e Rip out E80 format definitions which are neither "notyet", nor going to
happen.
2003-10-26 00:36:43 +00:00
jdolecek
690bfc89f6 g/c #if 0'ed (and empty) cpu_wait() 2003-10-25 17:49:57 +00:00
chs
0e9360f160 NULL -> 0 2003-10-25 16:15:07 +00:00
kleink
422697679e * Move the definitions for types other than single-precision and double-
precision back to machine-dependent headers.  C99 has no strict
  requirement which, if any, extended-precision type `long double' must
  match, and even between 80-bit formats there are differences in
  implementation (m68k vs. x86).
* On arm, consider __VFP_FP__.
2003-10-23 23:26:06 +00:00
kleink
eef6265460 G/c the local declaration of __nanf; handling of this (conditional on
__HAVE_NANF) was moved to <math.h> some time ago.
2003-10-22 21:04:40 +00:00
fvdl
a08babb013 NULL -> 0 for preempt() argument. 2003-10-21 00:49:34 +00:00
cl
1f11f69f25 add MD part of SA/pthread pagefault handling on hppa 2003-10-13 21:12:12 +00:00
chs
06332c88ef update for new gas syntax. from Jochen Kunz. 2003-10-10 15:07:43 +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
matt
0c7bac0672 Change headers to comply with the new toolchain changes. 2003-10-06 05:27:19 +00:00
simonb
550b4bef88 Fix "constify sendsig/trapsignal" fallout for non-siginfo'd archs. Test
compiled on most architectures.
2003-09-26 12:02:55 +00:00
matt
200ff49b87 Use #ifdef _KERNEL_OPT around #include "opt_XXX.h" 2003-09-20 22:28:19 +00:00
matt
70060b7c61 Add multiple inclusion protection. 2003-09-20 22:26:16 +00:00
matt
e104d5f8a7 Install <hppa/mcontext.h> 2003-09-20 22:25:40 +00:00
chs
e46cb5bfce add some placeholders so we can at least build. 2003-08-31 01:28:58 +00:00