Commit Graph

396 Commits

Author SHA1 Message Date
mrg 5f3362148f various ia64 updates:
- add a compat vfork because of stupid
- add a weak sbrk
- add a shmat syscall
- add an empty kvm implementation that links
- add missing fp stuff
2016-06-30 09:14:30 +00:00
christos d6b67564a6 some ports need <sys/wait.h> 2016-04-04 22:14:38 +00:00
christos cacc57bfc6 catch up with p_xstat split. 2016-04-04 21:08:44 +00:00
mrg 19cbd6805c distinguish between partial and failed read, so that "read 0xffffffff bytes failed"
is not output..
2016-03-29 06:51:40 +00:00
christos c4abdb423f mips needs _KMEMUSER for label_t in pcb.h 2016-01-24 16:07:48 +00:00
dholland 65f8003146 Update synopses to match u_int/u_long/etc. changes. Do not bump date as
it's not a substantive change.
2016-01-23 00:43:42 +00:00
nakayama 13217c03e5 Use PRIxPADDR instead of type casting. 2015-10-31 02:40:44 +00:00
martin 59db503a23 Fix the -m32 compat build for sparc64 after recent sparc/include/types.h
changes. XXX I suspect this variant has not been tested in real life.
2015-10-07 11:56:41 +00:00
martin 4c8eef7861 Dummy support for ia64 2015-04-17 13:16:01 +00:00
matt 6cf6fe02a9 New files for Userland support of UCB RISC-V (both 32-bit and 64-bit) 2014-09-19 17:36:24 +00:00
matt 27620987b8 New files for OR1K support 2014-09-03 19:34:25 +00:00
matt cc87ea3a00 #if 0 some code not in use yet 2014-08-23 02:25:23 +00:00
matt 810b61bb1a MKCOMPAT fixes for when compat MACHINE_CPU != normal MACHINE_CPU 2014-08-10 23:39:08 +00:00
matt beb9c6d1b5 Preliminary files for AARCH64 (64-bit ARM) support.
Enough for a distribution build.
2014-08-10 05:47:35 +00:00
matt c1987519cf #include <m68k/m68k.h> 2014-03-04 06:38:08 +00:00
palle 4ad8530004 sun4v: Rename TLB_ defines to SUN4U_TLB_ so entries created using TSB_DATA() are properly setup for sun4u and sun4v. Relocate the cputyp variable from autoconf.c to locore.s and make it const in param.h so optimized code can be generated. Parts from OpenBSD. Optimization suggested by nakayama@. OK martin@, mrg@, nakayama@ 2014-02-21 18:00:09 +00:00
dsl 7c166415e7 Remove the #include <sys/user.h> from all of libkvm.
sys/user.h is a stub that just #includes sys/pcb.h.
There are no 'struct pcb' anywhere in here, so I'm extremely doubtful
any of the builds will fail.
OTOH it might be relying on a header that pcb.h includes.
In any case i386 and amd64 build.
2014-02-19 20:21:22 +00:00
matt 0deb66dfa6 Add missing __RCSID("$NetBSD$"); 2014-01-27 21:00:01 +00:00
martin 81d4664037 Do not fail kvm_dump_mkheader without setting an error message 2012-08-26 23:09:42 +00:00
martin f8fdd418df Measure kinfo_proc2::p_vm_vsize in pages, as it was always documented.
This value seems to never have been used anywhere.
This makes it consistent with it's cousin p_vm_msize (which is in pages as
well and has several uses).
2012-06-05 08:23:05 +00:00
matt e1a2f47f12 Use C89 function definition 2012-03-21 10:10:36 +00:00
matt 572e1c8587 These directories don't handle WARNS=5 2012-03-21 10:08:30 +00:00
chs 9f94a5cde3 fix handling of large pages. 2012-01-10 16:01:16 +00:00
christos 5305df2297 kill open_cloexec() 2011-10-15 21:08:53 +00:00
christos e375a9464f more sys/param.h additions 2011-09-14 12:37:55 +00:00
christos 80867328b8 Include <sys/param.h> for MAXPATHLEN 2011-09-13 19:11:09 +00:00
wiz 810ed21852 Sort sections. 2011-09-13 08:53:15 +00:00
wiz 267db0c546 Fix Xr. 2011-09-13 08:53:10 +00:00
christos 8171e48bf4 doc for kvm_getkernelname 2011-09-12 21:11:53 +00:00
christos b8c5a24416 add a function to report the name of the file kvm_open{,.files} is using. 2011-09-12 21:11:31 +00:00
matt 9fbae4ec6b Add -D_KMEMUSER to CPPFLAGS 2011-02-14 18:27:24 +00:00
matt 6ab334853b Teach libkvm how kernel virtual memory is laided on 64-bit MIPS kernels. 2011-01-23 06:28:52 +00:00
dholland 01cef2d63e Return error on failure instead of hiding it and always returning zero.
From Henning Petersen in PR 44152.
2010-11-26 22:01:53 +00:00
uebayasi 9a0d0defa9 Fix build. 2010-11-12 04:52:08 +00:00
stacktic 7bede9ad38 Do not return -1 on _kvm_read when all the requested data could be read (fix bin/38648) 2010-10-23 14:34:12 +00:00
jym f15c6971d1 Import PAE support for kvm(3):
- add kvm_i386pae.c (used for PAE memory translations), and update Makefile
  for libkvm build.
- in pdppaddr: pass a flag to indicate PAE mode. Use a bit ignored
  by the MMU. Mask address with PG_FRAME to avoid side effects.

Tested with vmstat(1)/netstat(1) to debug core files of PAE and !PAE
kernels. Older kernel dumps will default to native i386 (!PAE) mode.

XXX Currently, savecore(8) will fail to dump a PAE kernel in a !PAE
    environment (and reciprocally). So you need to sync and reboot
    with a kernel of the same mode as the one that crashed. Once the dump
    is successful, this does not matter anymore.
2010-10-05 23:48:16 +00:00
jym 8bb0c87c7e Define KREAD() inside kvm_private.h, for reusability. 2010-09-26 22:28:05 +00:00
jym 962a341df6 Change kvm_pa2off() and kvm_kvatop() prototypes (private to kvm(3)):
-int     _kvm_kvatop(kvm_t *, u_long, u_long *);
-off_t   _kvm_pa2off(kvm_t *, u_long);
+int     _kvm_kvatop(kvm_t *, vaddr_t, paddr_t *);
+off_t   _kvm_pa2off(kvm_t *, paddr_t);

Basically, use vaddr_t for VA and paddr_t for PA. In addition, for variables
representing addresses, use paddr_t or vaddr_t, depending on the context.

For most arches, vaddr_t and paddr_t are equivalent to unsigned long. However,
the change was needed for exotic situations, like i386 PAE, were unsigned long
is not suitable for PA which are 64 bits long. As this required a complete
change of the function prototypes, all arches had to be adapted accordingly.

Core files from before this commit should still work with the new code; I did
not see any direct dependency between core's structure and kvatop/pa2off.

The change was compile tested for all arches, as it impacts all of them.

See also:

http://mail-index.netbsd.org/current-users/2010/09/07/msg014249.html
2010-09-20 23:23:16 +00:00
jym f0583e593c KNF 2010-09-19 11:37:40 +00:00
jym 6dc46b923b Ansify and KNF all functions within kvm(3). No objection on current-users@.
Used as ground for u_long => vaddr_t/paddr_t replacements in kvm(3)
private functions.

Compile tested for all arches. See also:

http://mail-index.netbsd.org/current-users/2010/09/07/msg014249.html
2010-09-19 02:07:00 +00:00
skrll c6d6c8c225 More KNF 2010-06-24 20:46:11 +00:00
skrll d481569999 ANSIfy / KNF. 2010-06-24 20:42:24 +00:00
joerg 3c70878e9a Use .In instead of .Ar Pa for headers. 2010-03-22 21:55:06 +00:00
matt 7b012669b8 Adapt to <powerpc/spr.h> breakup. 2010-02-25 23:34:54 +00:00
rmind 40cf6f3659 Remove uarea swap-out functionality:
- Addresses the issue described in PR/38828.
- Some simplification in threading and sleepq subsystems.
- Eliminates pmap_collect() and, as a side note, allows pmap optimisations.
- Eliminates XS_CTL_DATA_ONSTACK in scsipi code.
- Avoids few scans on LWP list and thus potentially long holds of proc_lock.
- Cuts ~1.5k lines of code.  Reduces amd64 kernel size by ~4k.
- Removes __SWAP_BROKEN cases.

Tested on x86, mips, acorn32 (thanks <mpumford>) and partly tested on
acorn26 (thanks to <bjh21>).

Discussed on <tech-kern>, reviewed by <ad>.
2009-10-21 21:11:57 +00:00
snj 4988388746 Remove 3rd and 4th clause on Leo Weppelman's license. OK leo@. 2009-10-20 19:10:09 +00:00
apb 50a2fd2471 Make the documentation match reality. If no explicit kernel name is
provided, kvm_open() and kvm_openfiles() will try _PATH_KSYMS first,
then either the path from sysctl machdep.booted_kernel (if that's
available) or _PATH_UNIX (if the sysctl is not available).
2009-09-14 19:34:12 +00:00
apb 8a61809cf3 Move the code that tries to open _PATH_KSYMS first into a common path,
so that it is used both for the /dev/mem case and the core dump case.

Output from savecore(8) before:
    savecore - - - (null): kvm_openfiles: /netbsd: No such file or directory
and after:
    savecore - - - no core dump
2009-09-14 19:29:20 +00:00
he f9dd8b23a6 Anoter instance of <sys/exec_aout.h> -> <sys/exec.h>. 2009-08-20 11:18:55 +00:00
yamt edde2bdd71 kvm_getprocs actually works with KVM_NO_FILES. 2009-05-16 11:56:47 +00:00