Commit Graph

111956 Commits

Author SHA1 Message Date
reinoud
dd08aea25e Rename err to nerrno 2011-09-04 20:49:59 +00:00
reinoud
e0a62f0bed Implement thunk_seterrno() 2011-09-04 20:46:58 +00:00
reinoud
07ff92e4ee -thunk_makecontext_trapframe2go(ucontext_t *ucp, void *func, void *trapframe)
+thunk_makecontext_1(ucontext_t *ucp, void *func, void *arg)
2011-09-04 20:15:57 +00:00
reinoud
ed71469833 Space around | (style) 2011-09-04 20:14:37 +00:00
jmcneill
e656d3b0f6 PR# kern/45021: Please support /emul/linux/proc/version
Add /proc/version for procfs with -o linux. The version reported depends
on the emulation type of the calling process:

$ cat /proc/version
NetBSD version 5.99.55 (netbsd@localhost) (gcc version 4.1.3 20080704 prerelease (NetBSD nb2 20081120)) NetBSD 5.99.55 (GENERIC) #39: Sun Sep  4 09:10:05 EDT 2011

$ /emul/linux/bin/cat /proc/version
Linux version 2.6.18 (linux@localhost) (gcc version 4.1.3 20080704 prerelease (NetBSD nb2 20081120)) #0 Wed Mar 3 03:03:03 PST 2010

$ /emul/linux32/bin/cat /proc/version
Linux version 2.6.18 (linux32@localhost) (gcc version 4.1.3 20080704 prerelease (NetBSD nb2 20081120)) #0 Wed Mar 3 03:03:03 PST 2010
2011-09-04 17:32:10 +00:00
sborrill
31a08a90c4 Don't attach GPIO framework if NGPIO = 0 2011-09-04 15:05:26 +00:00
christos
04056fb8c6 Split sigget into sigget() and siggetinfo(). When a signal comes from the
debugger (l->l_sigpendset == NULL), using siggetinfo() try to fetch the
siginfo information from l->l_sigpend and then from p->p_sigpend if it
was not found. This allows us to pass siginfo information for traps from
the debugger.
2011-09-04 13:09:12 +00:00
mbalmer
17fe830303 Disable gpio(4) which can now be built and used as modules. 2011-09-04 12:31:30 +00:00
jmcneill
c72d2332bb mem_access_handler: panic if we receive sigsegv or sigbus with SI_NOINFO,
and when "peeing outside the box" print the offending va
2011-09-04 12:17:59 +00:00
nakayama
24fe5dfcb8 Preset ih_pil. 2011-09-04 12:17:46 +00:00
nakayama
b68a419a7b ih_pil is an interrupt level, not an interrupt mask. 2011-09-04 12:17:13 +00:00
christos
a263e66646 Protect new functions with #ifndef __LIBC12_SOURCE__ so that they are not
visibile in the libc12 compat environment.
2011-09-04 10:02:33 +00:00
jmcneill
7052ba021e Now that pr45327 is fixed, remove BROKEN_SIGINFO code. 2011-09-03 20:02:34 +00:00
christos
6f879bd995 PR/45327: Jared McNeill: ptrace: siginfo doesn't work with traced processes
When saving the signal in p->p_xstat, clear it from the pending mask, but
don't remove it from the siginfo queue, so that next time the debugger
delivers it, the original information is found.
When posting a signal from the debugger l->l_sigpendset is not set, so we
use the process pending signal and add it back to the process pending set.
2011-09-03 19:33:40 +00:00
jmcneill
4810597f31 add a workaround for kern/45327 2011-09-03 19:07:32 +00:00
jmcneill
7c4e700db7 unbreak build on netbsd 2011-09-03 19:06:48 +00:00
jmcneill
4f4fa401d9 Let NetBSD/usermode build & link on a Linux host:
- Need to add options CPU_HOST=i386 or CPU_HOST=amd64 for membar & atomic_ops
 - Don't use MAP_* and PROT_* with thunk API since the kernel and host
   might not be the same; add THUNK_MAP_* and THUNK_PROT_* and translate them
 - Add thunk_posix_memalign
 - allocate mem_uvm with thunk_posix_memalign instead of thunk_malloc
 - Fix thunk_mmap callers to always pass either THUNK_MAP_PRIVATE or
   THUNK_MAP_SHARED
 - mkstemp on Linux requires exactly 6 "X" characters at the end of the
   template string, so add an X
2011-09-03 18:42:13 +00:00
mlelstv
c2041d07f2 Regenerate for Kingston DT101 G2 2011-09-03 16:21:18 +00:00
mlelstv
d22ddeb9cf Correct vendor code for Kingston DT101 G2 2011-09-03 16:19:47 +00:00
reinoud
a8da4706c3 Add SIGILL handler, doing nothing than printing out details.
Move the address check to be done later so pmap and uvm have their go first.

Also some minor cosmetic fixes
2011-09-03 15:33:56 +00:00
jmcneill
2882839936 Get this compiling (but not quite linking yet) on Linux 2011-09-03 15:00:27 +00:00
jmcneill
24f1db749c Instead of doing #include </usr/include/machine/..>, use the headers
that ship with the kernel sources as #include "../../$host/include/$hdr",
and auto-generate these ugly headers with a script.
2011-09-03 14:23:49 +00:00
christos
349878874a Make sure that we initialize all accounting bytes. 2011-09-03 14:09:03 +00:00
jmcneill
66713f4d80 if emulating the syscall, toggle insyscall as the child won't get stopped a
second time
2011-09-03 12:48:22 +00:00
jmcneill
18816ee03c move call of urkelvisor_init to main instead of pmap_bootstrap 2011-09-03 12:33:02 +00:00
jmcneill
67559f643e Add usermode kernel supervisor, can be disabled with 'no options URKELVISOR' 2011-09-03 12:28:45 +00:00
reinoud
aae37cebb5 Oops forgot to commit this one 2011-09-03 12:25:31 +00:00
christos
a315582ad2 We need to process SA_STOP signals immediately, and not deliver them to
the process. Instead of re-structuring the code to do that, call issignal()
like before in that case. (tail -F /file^Zfg should not get interrupted).
2011-09-03 10:28:33 +00:00
asau
69257e1644 Add quirks for Kingston DT 101 to stop them giving HBA errors. 2011-09-03 01:56:44 +00:00
asau
cc3f43f54e Regenerate for Kingston Data Travel 101. 2011-09-03 01:53:01 +00:00
asau
9017cee0d4 Add two Kingston Data Travel 101 models. 2011-09-03 01:51:20 +00:00
macallan
2627ab06e7 add stvii driver for gdium's onboard microcontroller
while there add comments on new(ly added) drivers
2011-09-02 22:42:27 +00:00
dyoung
78b0e18345 Report vmem(9) errors out-of-band so that we can use vmem(9) to manage
ranges that include the least and the greatest vmem_addr_t.  Update
vmem(9) uses throughout the kernel.  Slightly expand on the tests in
subr_vmem.c, which still pass.  I've been running a kernel with this
patch without any trouble.
2011-09-02 22:25:08 +00:00
macallan
effe3b0975 add new voyager driver, follow related changes from LOONGSON
now this builds again
thanks he for noticing
2011-09-02 22:19:35 +00:00
dyoung
8fc5e34825 Add a target, subr_vmem, for building the vmem(9) test program. 2011-09-02 22:15:16 +00:00
dyoung
2a6ff6d60a In the tags target, move x86 sources above xen includes, for more
helpful tags.
2011-09-02 22:12:48 +00:00
christos
72a34c792c Add support for PTRACE_FORK.
- add a field in struct proc to save the forker/forkee pid, and a flag.
- add 3 new ptrace calls: PT_GET_PROCESS_STATE, PT_GET_EVENT_MASK,
  PT_SET_EVENT_MASK
Add a PT_STRINGS constant so that we don't hard-code the list of ptrace
subcalls in other programs (kdump).
2011-09-02 20:10:19 +00:00
christos
179ba60291 add support for PRACE_FORK. 2011-09-02 20:07:41 +00:00
christos
b4ab627dec Add support for PTRACE_FORK. NB: This does not (yet) work for vfork(), because:
1. When we vfork() PL_PPWAIT is set, and that makes us do regular disposition
   of the TRAP signal, and not indirect through the debugger.
2. The parent needs to keep running, so that the debugger can release it.
   Unfortunately, with vfork() we cannot release the parent because it will
   eventually core-dump since the parent and the child cannot run on the
   same address space.
2011-09-02 20:06:29 +00:00
christos
bac4b71fcb If the process is traced, resulting from a PTRACE_FORK inherited setting,
stop it right now.

XXX[1]: Cannot make this MI, because I cannot wrap child_return because there
is MD code that checks fun == child_return. I think it is better to have an
mi child_return() and add a cpu_child_return()?
XXX[2]: Why do we need to stop so early? Perhaps stopping just after exec
is better?
2011-09-02 20:01:20 +00:00
reinoud
be0dfa85ba Revert 2011-09-02 16:09:01 +00:00
reinoud
8cbecef186 Update trapframe and add system call switchframe 2011-09-02 14:56:48 +00:00
reinoud
5eb75d88b2 -thunk_makecontext_trapframe2go(ucontext_t *ucp, void *func, void *trapframe)
+thunk_makecontext_1(ucontext_t *ucp, void (*func)(void), void *arg)

Create a more general prototype for makecontext() with one variable.
2011-09-02 14:55:22 +00:00
reinoud
66b43637c5 Add note on how to posibly create a signal and send it to a userland program 2011-09-02 14:54:41 +00:00
he
5f00afcf47 Bump SYMTAB_SPACE so that it fits again. 2011-09-02 11:50:29 +00:00
christos
f05fc604ec trylockowner is not needed anymore. 2011-09-02 10:18:38 +00:00
reinoud
9e716faec6 Disable the debug_fh code for now 2011-09-02 10:11:43 +00:00
mbalmer
44d0145a0a Make sure error is not used unitialized when sc->sc_attach_busy is 0. 2011-09-02 06:50:20 +00:00
msaitoh
c67bb3dce4 Add support for some fxp devices from FreeBSD and OpenBSD.
{Free,Open}BSD say that we have to do some work to make fxp
stable.
2011-09-02 03:16:18 +00:00
msaitoh
0488e3f6ff regen. 2011-09-02 03:10:37 +00:00