Commit Graph

1015 Commits

Author SHA1 Message Date
he 1aa0117a81 Fix the 060 variants to not have conflicting definitions for the
cache ops common to 060 and 040.  Also remove the now-redundant
definitions for the 060 variant which simply pointed to the 040
variants.
This fixes the build of the mvme68k VME172 kernel.
2007-06-13 07:00:33 +00:00
mhitch d2eac2f631 Pass a frame pointer to trap() rather than the 'entire frame' trick. Gcc4
was optimizing away modifications to the frame contents (it's not nice to
trick gcc).  Pass the pointer as the first argument to reduce the number
of places that would be changed otherwise.  Fixes the getcwd regression
test on most m68k ports.
2007-06-12 03:34:28 +00:00
tsutsui c2ff4f910e Fix pasto in previous. 2007-06-09 14:40:19 +00:00
tsutsui 7df023a2e5 Unroll cache flush/purge ops per 8 cachelines (128bytes).
Improve MI Sonic xfer speed ~2%.
2007-06-08 16:07:49 +00:00
tsutsui f04ca69e5f Use pointers for variables assigned to %a0 by __asm("%a0") so that
gcc may generate silightly better inlined code on optimization.
2007-06-08 15:57:16 +00:00
tsutsui dadbb85281 DCFA(), DCPA(), ICPL(), ICPP(), DCPL(), DCPP, DCFL(), and DCFP()
cache ops are identical between M68040 and M68060 and they are not
available on M68020 and M68030, so no need to check cputype even on
multi CPU kernels and they can always be inlined.

This improves MI Sonic xfer speed ~5%.
http://mail-index.netbsd.org/port-mac68k/2007/06/07/0003.html
2007-06-08 15:44:34 +00:00
tsutsui 36f4b2e43f Enable _pmap_set_page_cacheable(), _pmap_set_page_cacheinhibit() and
_pmap_page_is_cacheable() on all pmap_motorola.c ports and add
BUS_DMA_COHERENT support (from mvme68k) to common m68k bus_dma.c.

Tested with (not-yet-integrated) MI Sonic Ethernet driver on mac68k
http://mail-index.netbsd.org/port-mac68k/2007/06/07/0000.html
and ok'ed by thorpej.
2007-06-07 15:54:08 +00:00
mhitch bbb24892dd Page table sizes depend on pagesize - fix M68K_MAX_PTSIZE to account for
pagesize.  M68K_MAX_KPTSIZE also dependent on pagesize, and was 1/4 the
maximum size of a user pagetable.
2007-06-05 04:52:07 +00:00
tsutsui 04776a47dd Remove another #ifdef PCB_CMAP2 portion. 2007-06-02 23:51:37 +00:00
tsutsui 5044d1542d Fix bus_dmamap_sync(9) to do more proper cache flush operations.
Mostly taken from mvme68k.

Tested on (not yet integrated) mac68k SONIC Ethernet with MI dp83932.c.

XXX: should we also enable _pmap_set_page_cache{able,inhibit}()
XXX: functions in m68k/pmap_motorola.c for BUS_DMA_COHERENT support?
2007-06-02 11:13:45 +00:00
tsutsui 9955baccd9 Add #define __NO_STRICT_ALIGNMENT. 2007-06-02 06:34:21 +00:00
skrll fb901b95c7 __HAVE_MD_RUNQUEUE is no longer relevant. 2007-06-01 07:18:31 +00:00
tsutsui 2c07c8ddd5 Use consistent cast. 2007-05-26 00:08:32 +00:00
tsutsui ba1003bc61 Remove an obsolete file after yamt-idlelwp merge. 2007-05-26 00:02:28 +00:00
mhitch 786f6950fd Get rid of pcb_cmap2 - it hasn't been used for a long, long time. 2007-05-22 20:29:31 +00:00
tsutsui 835288d097 Remove unused m68k/bcopy.s.
(src/common/lib/libc/arch/m68k/string/bcopy.S in libkern is enough)
2007-05-21 16:54:00 +00:00
tsutsui f8eda28885 Remove netns stuff. 2007-05-21 16:51:13 +00:00
tsutsui 069bd07685 Remove a local declaration of lwp_trampoline(). 2007-05-21 16:39:52 +00:00
tsutsui 32b0b73c06 Move declarations of m68k common functions
from <machine/cpu.h> to <m68k/m68k.h>.
While here, remove some obsolete function decls.
2007-05-21 16:37:03 +00:00
tsutsui 055d952d40 - update and add some comments for readability
- fix prototype of cpu_switchto(9) in comment
- use %sp@(8) style index rather than 8(%sp)
2007-05-21 14:01:56 +00:00
mhitch 9385473585 Add missing call to lwp_startup() in lwp_trampoline() (which was renamed
from proc_trampoline to match the other ports).

A DIAGNOSTIC kernel will now boot and run.  LOCKDEBUG still doesn't work yet.
Also, my amiga no longer loses time.
2007-05-20 04:29:47 +00:00
mhitch 881ae5b63c Spelling error, I should be old enough to know better. 2007-05-19 21:00:22 +00:00
mhitch 36e70d8e10 Common m68k changes for idlelwp. 2007-05-18 01:46:39 +00:00
mhitch 2aacb7ab4a Changes to enable support of 8K pagesize. 2007-05-12 17:43:53 +00:00
dsl 844e5f00de Allow for other info in opt_fpsp.h when trying to find out whether FPSP
is enabled.
Surely there are proper mechanisms that can be used to conditionally include
this file?
2007-05-09 20:43:53 +00:00
msaitoh 8ce1f4fff2 fix typos 2007-04-29 20:23:34 +00:00
tnn b19e17d66f protectoin -> protection 2007-04-05 13:17:11 +00:00
thorpej ea6be967fd LOCK_CAS_CHECK(): make sure we're in kernel mode. 2007-03-13 17:17:28 +00:00
ad 59d979c5f1 Pass an ipl argument to pool_init/POOL_INIT to be used when initializing
the pool's lock.
2007-03-12 18:18:22 +00:00
thorpej 8f326e8290 - Define LOCK_CAS_CHECK() in m68k/frame.h (there because it operates on
a clockframe).
- Call LOCK_CAS_CHECK() in clock_intr() (noted by Izumi Tsutsui).
2007-03-12 02:51:03 +00:00
thorpej 62509c00e0 Actually store the new value in the RAS _lock_cas(). Noticed by Izumi Tsutsui. 2007-03-11 16:46:52 +00:00
thorpej 32a8b62d33 - Shrink ipl_cookie_t from 32-bits to 16-bits (large enough to hold
an SR value or an IPL_* constant).
- Take advange of the smaller ipl_cookie_t to shrink kmutex_t from
  16 bytes to 8 bytes by overlapping storage where possible.
- Implement a RAS-based _lock_cas() for mc68010 systems (Sun2).  See
  sun68k/sun68k/isr.c.

Tested on various m68k platforms, but NOT Sun2.  In any case, at least
Sun2 compiles now.
2007-03-11 05:22:24 +00:00
tsutsui 2a92ad0d7f Don't disable EA_DIRECT in fpu_load_ea(), which seems disabled
accidentally in rev 1.11 about six years ago, otherwise
fmovel %dN,%fpN instructions cause unexpected memory access.
2007-03-09 16:33:27 +00:00
tsutsui 369fa66d6e Make these compile with options DEBUG_FPE. 2007-03-09 16:23:01 +00:00
dogcow f18ef70a25 semimechanically convert 'void foo' -> 'void *foo', as part of the continuing
caddr_t fallout.
2007-03-05 21:05:00 +00:00
he f1f47464be Cast to char* before doing pointer arithmetic. 2007-03-05 20:38:19 +00:00
tsutsui 90b5f236a9 Use (char *) on pointer arith. 2007-03-05 14:31:08 +00:00
tsutsui d5a5c6095d Allocate msgbufaddr in pmap_bootstrap.c where it's initilized,
and move its declaration into <m68k/pmap_motorola.h>.
2007-03-05 12:50:15 +00:00
tsutsui 8cb08f311c Use (char *) on pointer arith.
XXX: these "params" variables seem unused.
2007-03-04 11:59:16 +00:00
tsutsui e5f9539882 Use (char *) where pointer arith is required. 2007-03-04 11:18:25 +00:00
tsutsui f6f3edac05 Move declarations of CADDR1 and CADDR2 from m68k/pmap_motorola.c
to <m68k/pmap_motorola.h>.
2007-03-04 11:09:39 +00:00
tsutsui 8c7e65a3e1 Replace (void *) with (char *) where pointer arith is required. 2007-03-04 10:56:21 +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
tsutsui 1b20cebad5 Hide #include <m68k/softintr.h> inside #ifdef _KERNEL in <machine/intr.h>
to avoid exporting unnecessary files to userland.
Should fix build.sh failure, which was pointed out by isaki@.

XXX: which userland program would require contents of <machine/intr.h>?
2007-03-04 05:28:38 +00:00
tsutsui b23f121559 Add common soft interrupt routines for m68k ports which use
hp300 derived simulated software interrupt with VAX REI emulation.
Just taken from hp300/hp300/softintr.c and sys/arch/hp300/include/intr.h.
2007-03-04 01:54:04 +00:00
dyoung 58d89d0317 Make the mac68k 'tags' target work. 2007-02-25 05:47:55 +00:00
mhitch 04f1eeb439 Extract extended precision fraction correctly. Now gdtoa works properly
on m68k for extended precision numbers.
2007-02-22 17:11:15 +00:00
thorpej 132af634d7 TRUE -> true, FALSE -> false 2007-02-22 17:09:44 +00:00
mhitch 48a4473f0b Whitespace 2007-02-22 17:09:40 +00:00
tsutsui 37c7309453 Fix lossage on bool changes. 2007-02-22 13:50:36 +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
mrg 4410329b87 add a pair of new bus_dma(9) functions:
int _bus_dmatag_subregion(bus_dma_tag_t tag,
				  bus_addr_t min_addr,
				  bus_addr_t max_addr,
				  bus_dma_tag_t *newtag,
				  int flags)
	void _bus_dmatag_destroy(bus_dma_tag_t tag)

that allow a (normally broken/limited) device to restrict the bus address
range it can talk to.  this is used by bce(4) to limit DMA addresses to
1GB range, the maximum the chip can address.

all this is from Yorick Hardy <yhardy@uj.ac.za> with input from several
people on tech-kern.

XXX: bus_dma(9) needs an update still.
2007-02-21 20:41:23 +00:00
ad d43ea32af9 - 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.
2007-02-20 01:02:02 +00:00
pavel 934634a18c Change the process/lwp flags seen by userland via sysctl back to the
P_*/L_* naming convention, and rename the in-kernel flags to avoid
conflict. (P_ -> PK_, L_ -> LW_ ). Add back the (now unused) LSDEAD
constant.

Restores source compatibility with pre-newlock2 tools like ps or top.

Reviewed by Andrew Doran.
2007-02-17 22:31:36 +00:00
mhitch d417d9f5d4 From Christos: gdtoa fixes for m68k. M68k ports should build now, but
printing extended precision is a little off.
2007-02-17 17:50:52 +00:00
mhitch e7d5ff9134 Kernel threads were running at splhigh on m68k systems because the status
register was inherited from proc0.  Set the new process's status register
to PSL_LOWIPL.  Raidframe reconstruction no longer causes my Amiga to lose
time.
2007-02-15 02:55:39 +00:00
mhitch 5271afeb9d Add lock stubs for m68k. Amiga builds and runs now. 2007-02-15 02:48:48 +00:00
tsutsui eeca26831e Update for newlock2 merge. 2007-02-10 02:34:42 +00:00
ad b07ec3fc38 Merge newlock2 to head. 2007-02-09 21:55:00 +00:00
elad 1e70d64818 Consistent usage of KAUTH_GENERIC_ISSUSER. 2007-01-04 16:55:29 +00:00
martin 6288976a60 Allow pmap_enter_ptpage to fail, sometimes. Pass WAIT/NOWAIT flags and
fix some obvious locking problems. This allows us to run a LOCKDEBUG
kernel now.
No objection from mhitch and chs.
2006-12-30 01:28:57 +00:00
wiz fa34b615d2 Correct spelling of "immediate(ly)". From Zafer. 2006-11-24 21:23:07 +00:00
christos 168cd830d2 __unused removal on arguments; approved by core. 2006-11-16 01:32:37 +00:00
he 8d51656fd4 Const-ness is now (by the new gcc) propagated from structs to
members, so constify so as to not lose qualification.
2006-10-23 18:58:24 +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
mhitch 55fb5385d7 Common m68k pmap has same problem with 68060 after 17 month old uvm changes.
Tested and verified on my Amiga (yes, I'm hoping to switch amiga to using
the common pmp_motorola.c).

Uvm changes over 17 months ago resulted in the 68040/060 segment table
page being entered with pmap_kenter(), which does not record the mapping
in the pv table.  Attempting to inhibit caching of that page as required
by the 68060 hardware no longer changes the PTE and caused varying degrees
of multiple faulting, sometimes resulting in an unusable system.  Apparently
very few people attempted to run a 68060 based system since that change.
Fix to to change the caching bits directly rather than using pmap_changebit().
2006-09-16 17:31:13 +00:00
ad 6c8685b2d2 Use p_find(addr, PFIND_LOCKED) in case the proclist_lock is held. 2006-09-06 23:58:20 +00:00
matt d2fa9e5329 Make cpu_coredump dependent on COREDUMP 2006-08-31 16:49:21 +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
tsutsui cab7ee65e0 Remove __P(). 2006-08-07 23:24:55 +00:00
mhitch 977da07ffe gcc4 checks for and warns of matching constraints that don't specify
a register operand.  Remove the matching constraint and change the output
operand constraint from "=m" (write-only) to "+m" (read-write).
2006-08-03 20:32:07 +00:00
drochner 84f50d1b92 don't install <machine/db_machdep.h>, this is kernel only 2006-07-26 19:54:56 +00:00
ad f474dceb13 Use the LWP cached credentials where sane. 2006-07-23 22:06:03 +00:00
tsutsui 83d364980f TAB/space cleanup. 2006-07-22 06:58:17 +00:00
tsutsui ecc22258ee - remove parentheses from return
- remove trailing spaces
2006-07-22 06:42:41 +00:00
tsutsui 999dc402f0 KNF, remove register decls 2006-07-22 06:40:44 +00:00
tsutsui 9b4ab881f1 - include <m68k/m68k.h> for fputype decl
- some KNF
2006-07-22 06:40:20 +00:00
tsutsui 2bf43cdfa1 remove __P(), ANSIfy, KNF, use pmap_t rather than struct pmap * 2006-07-22 06:37:27 +00:00
tsutsui 2895c250c2 KNF, ANSIfy, remove register decls 2006-07-22 06:36:06 +00:00
tsutsui 4d891ed888 KNF and misc cosmetics 2006-07-22 06:34:41 +00:00
tsutsui f430313b2d - remove unused decls.
- remove parentheses from return arg
2006-07-22 06:32:17 +00:00
tsutsui c15c158ffc KNF, ANSIfy, de-__P(), bzero() -> memset() 2006-07-22 06:27:00 +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
tsutsui c4a04b7ba4 Backout previous since there is an objection and I'm not a toolchain guy. 2006-06-27 09:22:30 +00:00
tsutsui 45e77c51c9 XXX: Appease gcc4 -Wuninitialized warnings. 2006-06-25 14:19:56 +00:00
tsutsui da091c39ed Fix "warning: matching constraint does not allow a register" on gcc4.
(I guess constraints "0-9" are valid only for register operands, right?)
2006-06-25 14:17:40 +00:00
tsutsui 648df6ea96 Pass sed command path to asm2gas via environment
rather than arg. ok'ed by gdamore.
2006-06-24 03:28:42 +00:00
gdamore 5b4951cdf4 Use TOOL_SED for asm2gas, which makes it possible to cross-compile this
on Solaris 10.  (Solaris 10's sed doesn't like the comment lines, and
also complains about too many commands in the input.)
2006-06-18 05:21:21 +00:00
elad 8ccb6c9341 integrate kauth. 2006-05-14 21:55:09 +00:00
skrll 214053461e Fix some more comments. 2006-05-13 08:56:08 +00:00
oster 79a8ee2f0f Populate /usr/include/m68k with both pmap_motorola.h and pte_motorola.h.
/usr/include/m68k/pmap.h expects to find pmap_motorola.h, and
/usr/include/machine/pte.h wants pte_motorola.h.
2006-04-13 19:51:09 +00:00
mrg 0db1500b43 retire HAVE_GCC3/HAVE_GCC4 and introduce HAVE_GCC that is set to 2, 3 or 4. 2006-04-07 19:38:58 +00:00
oster 6b45384deb We don't need (or want!) to include cpuframe.h or have sigstate
visible to userland on m68k.  Fixes numerous pkgsrc build issues where
"struct frame" as defined in cpuframe.h pollutes the local namespace.

Compile-tested full builds for hp300, mac68k, amiga, sun3, and next68k.

OK'ed by matt@.
2006-04-01 18:03:55 +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
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
he 53c5776a46 syscall_fancy is only defined if either KTRACE or SYSTRACE is set,
so enclose its use in the same set of conditionals.
2006-03-06 08:05:06 +00:00
rjs 15f20d6c5b Always define syscall_fancy. 2006-03-05 22:34:34 +00:00
aymeric d065f526ab pass -traditional to ${CPP} so that the test for FPSP indeed works 2006-03-05 22:03:30 +00:00
christos beea4fc3fa Add a proc_is_traced_p() macro and use it, instead of copying the same code
in many places. Idea from thorpej.
2006-03-05 19:08:38 +00:00
christos a4495f4cec implement PT_SYSCALL 2006-03-05 07:21:37 +00:00
yamt ec5a93183a merge yamt-uio_vmspace branch.
- use vmspace rather than proc or lwp where appropriate.
  the latter is more natural to specify an address space.
  (and less likely to be abused for random purposes.)
- fix a swdmover race.
2006-03-01 12:38:10 +00:00
wiz 5d1e8b2745 Fix some typos. 2006-02-25 02:28:55 +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 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
yamt bc21da4cfb bus_dmamem_map: honour BUS_DMA_NOWAIT. noted by Manuel Bouyer.
bus_space_map: always do NOWAIT allocation as it used to be before yamt-km.

we have too many copies!
2005-11-24 13:08:32 +00:00
chs 8b17730eac put mcount.c in the normal object list, so that "make depend" works.
use a gcc attribute to prevent it from being instrumented.
2005-10-02 15:34:17 +00:00
he 6f5b98e680 Another file needing <compat/sys/signal.h> and <compat/sys/signalvar.h>
for native_sigset_to_sigset13().
2005-09-14 19:30:45 +00:00
he e1e0525260 Another set of files needing <compat/sys/signal.h> and
<compat/sys/signalvar.h> for native_sigset13_to_sigset().
2005-09-14 19:27:48 +00:00
drochner 8311fb86aa namespace sanity: don't expose compatibility sigcontext stuff
unnecessarily
2005-09-07 19:42:51 +00:00
kleink e2cef34883 signed -> __signed 2005-09-06 19:18:23 +00:00
he f35ed2ac89 Include <sys/time.h> before <sys/signalvar.h> so that copyinout_t is
defined before it is used in the second of these.

Fixes a build problem for several of our m68k ports.  I've been
waiting for a better fix, but now my "proper fix timeout" triggered.
2005-08-13 05:38:45 +00:00
christos 3e061b04ef new file 2005-07-11 13:05:33 +00:00
christos f1461c7e8a No point in declaring syscall_intern and syscall in a zillion places. 2005-07-10 00:45:52 +00:00
he 34cf717530 Delete now unused "bad" label. 2005-07-02 23:08:21 +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
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
scw e3896510e9 Fix const fallout when DEBUG is defined. 2005-06-03 08:55:33 +00:00
tsutsui e29ae5bc6f Fix one more shadow warning in #ifdef DIAGNOSTIC. 2005-06-02 16:47:42 +00:00
tsutsui a4c79ce346 Fix a shadow warning. 2005-06-02 14:56:58 +00:00
tsutsui 4b933e86cb Adapt to ddb constification. 2005-06-02 14:51:32 +00:00
tsutsui 096dae56ce Fix hexstr() for -Wwritable-strings. 2005-06-02 14:29:02 +00:00
tsutsui e240af5cd6 Add consts and fix a shadow warning. 2005-06-02 14:24:26 +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
he 57ef378309 Adapt to recent constification of db_interface.h and db_sym.h. 2005-05-30 21:15:28 +00:00
christos 362a4a0bd5 Yes, it was a cool trick >20 years ago to use "0123456789abcdef"[a] to
implement, xtoa(), but I think defining the samestring 50 times is a bit
too much. Defined HEXDIGITS and hexdigits in subr_prf.c and use it...
2005-05-17 04:14:57 +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
matt 1b5520b3d6 For GCC3 and beyond, use the __builtin_va_* types and functions to
deal with variable argument lists.
2005-04-14 20:06:15 +00:00
scw 54e140a9bb In m68k_make_fpu_idle_frame(), replace fmove.x with fmove.d as the former
is not supported natively by the 060's FPU.

Fixes a problem on MVME177 reported by Matt Thomas on port-mvme68k@
2005-04-14 12:35:42 +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
matt a6db24a485 Add a dm_maxsegsz public member to bus_dmamap_t. This allows a user of the API
to select the maximum segment size for each bus_dmamap_load (up to the maxsegsz
supplied to bus_dmamap_create).  dm_maxsegsz is reset to the value supplied to
bus_dmamap_create when the dmamap is unloaded.
2005-03-09 19:04:43 +00:00
chs 589a29e548 fix an off-by-on in pmap_check_wiring(): we increment the PTP refcount
before calling this, so it's ok to see the max value here.
2005-02-14 02:15:43 +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
yamt 95c82bfee4 introduce vm_map_kernel, a subclass of vm_map, and
move some kernel-only members of vm_map to it.
2005-01-01 21:02:12 +00:00
chs 6bd8ed04bb add cases for '040 and '060 FPUs. from Radek Kujawa. 2005-01-01 17:11:39 +00:00
thorpej 7a60e77293 bus_dmamap_load_mbuf(): Skip zero-length mbufs.
kern/24811
2004-11-28 17:34:45 +00:00
christos 527610e2db moved from x86k/x68k 2004-11-16 01:21:45 +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
rumble b1a9752c01 Correct a few comment typos that have propagated through the
tree.
2004-09-16 03:57:10 +00:00
thorpej 6c08646cb8 Garbage-collect pagemove(); nothing use it anymore (YAY!!!) 2004-08-28 22:12:40 +00:00
thorpej 605050704a Use ANSI function decls and static. 2004-08-28 22:06:28 +00:00
thorpej cfc755477e Minor style nit. 2004-08-28 21:56:00 +00:00
thorpej 606336a153 De-__P 2004-08-28 21:31:07 +00:00
thorpej 63a3547c69 - De-__P.
- Also define DB_ELF_SYMBOLS and DB_ELFSIZE.
2004-08-28 21:24:20 +00:00
skrll adf5c92842 Include <sys/cdefs.h> once. 2004-08-10 07:35:53 +00:00
is fae5cbad97 Revert last change. It breaks the build due to interactions with
frame.h.
2004-07-29 12:54:46 +00:00
is 3f5c400809 For a while, we exported symbols in the user namespace (which should only
be interesting for the kernel), thus breaking (e.g.) vim. (PR 26048)
2004-07-28 11:39:37 +00:00
wiz 1249084227 "panicking" needs a k. 2004-05-16 15:44:10 +00:00
drochner 19f047f8d0 SIGTRAMP_VALID() should not pollute the user namespace 2004-05-10 21:51:49 +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 c83eb997b8 nothing cares about __HAVE_SIGINFO anymore, so nuke it 2004-03-26 21:39:57 +00:00
wiz f0d2889eb5 Move
(c) TNF
line from 4-clause UCB to 3-clause UCB license; in other words,
remove UCB's ad clause from the license TNF grants.
There is no point in TNF demanding that UCB's ad clause be followed
when even UCB doesn't demand it any longer.

Ok'd by board@ and agc@.
2004-03-24 15:38:41 +00:00
nathanw 797c90374e Centralize identical copies of proc_trampoline code.
(lots more opportunites here for the bored hacker, such as rei and trap0...)
2004-03-04 19:53:44 +00:00
wiz dc4cc98b15 becuase -> because. From Peter Postma. 2004-02-24 15:05:53 +00:00
wiz d20841bb64 Uppercase CPU, plural is CPUs. 2004-02-13 11:36:08 +00:00
martin da4e67accc Do not export __HAVE_RAS to userland. Applications are supposed to try
rasctl() and detect failure with EOPNOTSUPP.
2004-01-18 18:23:19 +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
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
keihan 29c72c57f0 netbsd.org -> NetBSD.org
All "netbsd.org" is now gone from src/sys/arch.
2003-12-04 13:05:15 +00:00
christos a21fdf3b43 bye, bye _MCONTEXT_TO_SIGCONTEXT and vice versa. 2003-11-25 23:11:52 +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
he d800494086 Based on the historic hp300 pmap, initialize firstpage to TRUE, and
negate that after processing the first page.
2003-11-01 17:16:30 +00:00
he 22c1eedd0c Initialize needcflush to FALSE in pmap_do_remove(). 2003-11-01 15:32:47 +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 6d25a1e180 Don't define __HAVE_LONG_DOUBLE for __mc68010__. 2003-10-30 13:18:24 +00:00
mycroft c948a7f77b Allow a port to override MAXPHYS. 2003-10-30 06:13:19 +00:00
mycroft 1a2ab14519 In the 68010 code, we were reading sched_whichqs wrong... 2003-10-30 05:12:28 +00:00
kleink dbecd8cc2e Similar to sparc, make available the extended-precision definitions for
_KERNEL; the FPE package will require it once it's used on sun2.
2003-10-28 21:23:47 +00:00
mycroft dd65577904 Remove bogus initializer. 2003-10-28 20:39:54 +00:00
mrg 93b8296886 m68k_make_fpu_idle_frame() is not needed/wanted if defined(M68010) 2003-10-28 06:55:45 +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
cl 7585316531 initialize uninitialized 2003-10-27 02:03:10 +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
cl 16d49327a2 appease lint's ``warning: nonportable bit-field type'' in MD header 2003-10-27 01:05:08 +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 95971b8759 Correct the position of the QUIETNAN bit. 2003-10-26 20:59:51 +00:00
kleink a3fabb9e7f Use <sys/ieee754.h> where applicable. 2003-10-26 20:55:30 +00:00
kleink 7bc235809e Hide the extended-precision definitions from __mc68010__. 2003-10-26 10:08:02 +00:00
lukem f85d2d1c14 Use ${HOST_SH} instead of `sh'.
If necessary, pull in <bsd.sys.mk> to get the definition of HOST_SH;
Makefiles that pull in one of (most of) <bsd.*.mk> will get this anyway.
2003-10-26 07:25:33 +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 e015c8ea64 Account separately for the explicit integer bit in extended-precision
format, due to its role in denormal representation; inspired by communication
with Charles Hannum.
2003-10-23 16:57:20 +00:00
kleink c51a4365e2 While I'm here, retire the FPE code's own copy of ieee.h. 2003-10-23 15:07:30 +00:00
kleink d216ee1de2 Make struct ieee_ext actually match the layout of m68k extended-precision. 2003-10-23 15:04:00 +00:00
briggs 093821886e Define SIGTRAMP_VALID(v). 2003-10-18 17:57:06 +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 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
cl 3f16119f55 Cast through (void *) to appease gcc3. 2003-09-27 20:01:58 +00:00
mhitch 28527002f8 Cast through (void *) to appease gcc3. 2003-09-27 19:34:17 +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
christos ecfb034cb3 constify siginfo/trapsignal 2003-09-25 22:04:17 +00:00
cl 3337c2e727 move #defines back to frame.h 2003-09-23 11:33:50 +00:00