Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-7]: src/external/cddl/osnet Pull up following revision(s) (reques...
details: https://anonhg.NetBSD.org/src/rev/3114d66c70cc
branches: netbsd-7
changeset: 799936:3114d66c70cc
user: martin <martin%NetBSD.org@localhost>
date: Sun Jul 10 10:00:20 2016 +0000
description:
Pull up following revision(s) (requested by pgoyette in ticket #1189):
external/cddl/osnet/sys/kern/string.c: revision 1.3
external/cddl/osnet/dev/dtrace/dtrace_hacks.c: revision 1.5
external/cddl/osnet/dist/uts/common/dtrace/dtrace.c: revision 1.32
external/cddl/osnet/dev/dtrace/amd64/dtrace_asm.S: revision 1.6
Import fix from FreeBSD - see [1], [2] references below...
Fix DTrace's panic() action.
It would previously call into some unfinished Solaris compatibility code
and return without actually calling panic(9). The compatibility code is
unneeded, however, so just remove it and have dtrace_panic() call
vpanic(9)
directly.
Fixes immediate problem in PR-51265. However, this now reveals another
redefined symbol 'strpbrk' in the required module "solaris".
[1] https://svnweb.freebsd.org/changeset/base/281916
[2] http://lists.freebsd.org/pipermail/svn-src-head/2015-April/071019.html
On NetBSD we already have strpbrk() in libkern, so we don't need to
provide another copy in the module. Removes another 'redefined symbol'
error when loading the module.
Related to PR kern/51265
One more removal of a redefined symbol while loading dtrace module.
Should finish the issues with PR kern/51265
diffstat:
external/cddl/osnet/dev/dtrace/amd64/dtrace_asm.S | 210 +-------------------
external/cddl/osnet/dev/dtrace/dtrace_hacks.c | 4 +-
external/cddl/osnet/dist/uts/common/dtrace/dtrace.c | 4 +
external/cddl/osnet/sys/kern/string.c | 4 +-
4 files changed, 9 insertions(+), 213 deletions(-)
diffs (279 lines):
diff -r 18fa1f40aa0d -r 3114d66c70cc external/cddl/osnet/dev/dtrace/amd64/dtrace_asm.S
--- a/external/cddl/osnet/dev/dtrace/amd64/dtrace_asm.S Sun Jul 10 09:49:41 2016 +0000
+++ b/external/cddl/osnet/dev/dtrace/amd64/dtrace_asm.S Sun Jul 10 10:00:20 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dtrace_asm.S,v 1.4 2012/06/11 15:18:05 chs Exp $ */
+/* $NetBSD: dtrace_asm.S,v 1.4.10.1 2016/07/10 10:00:20 martin Exp $ */
/*
* CDDL HEADER START
@@ -365,211 +365,3 @@
popfq
ret
END(dtrace_interrupt_enable)
-
-/*
- * The panic() and cmn_err() functions invoke vpanic() as a common entry point
- * into the panic code implemented in panicsys(). vpanic() is responsible
- * for passing through the format string and arguments, and constructing a
- * regs structure on the stack into which it saves the current register
- * values. If we are not dying due to a fatal trap, these registers will
- * then be preserved in panicbuf as the current processor state. Before
- * invoking panicsys(), vpanic() activates the first panic trigger (see
- * common/os/panic.c) and switches to the panic_stack if successful. Note that
- * DTrace takes a slightly different panic path if it must panic from probe
- * context. Instead of calling panic, it calls into dtrace_vpanic(), which
- * sets up the initial stack as vpanic does, calls dtrace_panic_trigger(), and
- * branches back into vpanic().
- */
-
-/*
-void
-vpanic(const char *format, va_list alist)
-*/
- ENTRY(vpanic) /* Initial stack layout: */
-
- pushq %rbp /* | %rip | 0x60 */
- movq %rsp, %rbp /* | %rbp | 0x58 */
- pushfq /* | rfl | 0x50 */
- pushq %r11 /* | %r11 | 0x48 */
- pushq %r10 /* | %r10 | 0x40 */
- pushq %rbx /* | %rbx | 0x38 */
- pushq %rax /* | %rax | 0x30 */
- pushq %r9 /* | %r9 | 0x28 */
- pushq %r8 /* | %r8 | 0x20 */
- pushq %rcx /* | %rcx | 0x18 */
- pushq %rdx /* | %rdx | 0x10 */
- pushq %rsi /* | %rsi | 0x8 alist */
- pushq %rdi /* | %rdi | 0x0 format */
-
- movq %rsp, %rbx /* %rbx = current %rsp */
-
- leaq panic_quiesce(%rip), %rdi /* %rdi = &panic_quiesce */
- call panic_trigger /* %eax = panic_trigger() */
-
-vpanic_common:
- /*
- * The panic_trigger result is in %eax from the call above, and
- * dtrace_panic places it in %eax before branching here.
- * The rdmsr instructions that follow below will clobber %eax so
- * we stash the panic_trigger result in %r11d.
- */
- movl %eax, %r11d
- cmpl $0, %r11d
- je 0f
-
- /*
- * If panic_trigger() was successful, we are the first to initiate a
- * panic: we now switch to the reserved panic_stack before continuing.
- */
- leaq panic_stack(%rip), %rsp
- addq $PANICSTKSIZE, %rsp
-0: subq $REGSIZE, %rsp
- /*
- * Now that we've got everything set up, store the register values as
- * they were when we entered vpanic() to the designated location in
- * the regs structure we allocated on the stack.
- */
-#ifdef notyet
- movq 0x0(%rbx), %rcx
- movq %rcx, REGOFF_RDI(%rsp)
- movq 0x8(%rbx), %rcx
- movq %rcx, REGOFF_RSI(%rsp)
- movq 0x10(%rbx), %rcx
- movq %rcx, REGOFF_RDX(%rsp)
- movq 0x18(%rbx), %rcx
- movq %rcx, REGOFF_RCX(%rsp)
- movq 0x20(%rbx), %rcx
-
- movq %rcx, REGOFF_R8(%rsp)
- movq 0x28(%rbx), %rcx
- movq %rcx, REGOFF_R9(%rsp)
- movq 0x30(%rbx), %rcx
- movq %rcx, REGOFF_RAX(%rsp)
- movq 0x38(%rbx), %rcx
- movq %rcx, REGOFF_RBX(%rsp)
- movq 0x58(%rbx), %rcx
-
- movq %rcx, REGOFF_RBP(%rsp)
- movq 0x40(%rbx), %rcx
- movq %rcx, REGOFF_R10(%rsp)
- movq 0x48(%rbx), %rcx
- movq %rcx, REGOFF_R11(%rsp)
- movq %r12, REGOFF_R12(%rsp)
-
- movq %r13, REGOFF_R13(%rsp)
- movq %r14, REGOFF_R14(%rsp)
- movq %r15, REGOFF_R15(%rsp)
-
- xorl %ecx, %ecx
- movw %ds, %cx
- movq %rcx, REGOFF_DS(%rsp)
- movw %es, %cx
- movq %rcx, REGOFF_ES(%rsp)
- movw %fs, %cx
- movq %rcx, REGOFF_FS(%rsp)
- movw %gs, %cx
- movq %rcx, REGOFF_GS(%rsp)
-
- movq $0, REGOFF_TRAPNO(%rsp)
-
- movq $0, REGOFF_ERR(%rsp)
- leaq vpanic(%rip), %rcx
- movq %rcx, REGOFF_RIP(%rsp)
- movw %cs, %cx
- movzwq %cx, %rcx
- movq %rcx, REGOFF_CS(%rsp)
- movq 0x50(%rbx), %rcx
- movq %rcx, REGOFF_RFL(%rsp)
- movq %rbx, %rcx
- addq $0x60, %rcx
- movq %rcx, REGOFF_RSP(%rsp)
- movw %ss, %cx
- movzwq %cx, %rcx
- movq %rcx, REGOFF_SS(%rsp)
-
- /*
- * panicsys(format, alist, rp, on_panic_stack)
- */
- movq REGOFF_RDI(%rsp), %rdi /* format */
- movq REGOFF_RSI(%rsp), %rsi /* alist */
- movq %rsp, %rdx /* struct regs */
- movl %r11d, %ecx /* on_panic_stack */
- call panicsys
- addq $REGSIZE, %rsp
-#endif
- popq %rdi
- popq %rsi
- popq %rdx
- popq %rcx
- popq %r8
- popq %r9
- popq %rax
- popq %rbx
- popq %r10
- popq %r11
- popfq
- leave
- ret
- END(vpanic)
-
-/*
-void
-dtrace_vpanic(const char *format, va_list alist)
-*/
- ENTRY(dtrace_vpanic) /* Initial stack layout: */
-
- pushq %rbp /* | %rip | 0x60 */
- movq %rsp, %rbp /* | %rbp | 0x58 */
- pushfq /* | rfl | 0x50 */
- pushq %r11 /* | %r11 | 0x48 */
- pushq %r10 /* | %r10 | 0x40 */
- pushq %rbx /* | %rbx | 0x38 */
- pushq %rax /* | %rax | 0x30 */
- pushq %r9 /* | %r9 | 0x28 */
- pushq %r8 /* | %r8 | 0x20 */
- pushq %rcx /* | %rcx | 0x18 */
- pushq %rdx /* | %rdx | 0x10 */
- pushq %rsi /* | %rsi | 0x8 alist */
- pushq %rdi /* | %rdi | 0x0 format */
-
- movq %rsp, %rbx /* %rbx = current %rsp */
-
- leaq panic_quiesce(%rip), %rdi /* %rdi = &panic_quiesce */
- call dtrace_panic_trigger /* %eax = dtrace_panic_trigger() */
- jmp vpanic_common
-
- END(dtrace_vpanic)
-
-/*
-int
-panic_trigger(int *tp)
-*/
- ENTRY(panic_trigger)
- xorl %eax, %eax
- movl $0xdefacedd, %edx
- lock
- xchgl %edx, (%rdi)
- cmpl $0, %edx
- je 0f
- movl $0, %eax
- ret
-0: movl $1, %eax
- ret
- END(panic_trigger)
-
-/*
-int
-dtrace_panic_trigger(int *tp)
-*/
- ENTRY(dtrace_panic_trigger)
- xorl %eax, %eax
- movl $0xdefacedd, %edx
- lock
- xchgl %edx, (%rdi)
- cmpl $0, %edx
- je 0f
- movl $0, %eax
- ret
-0: movl $1, %eax
- ret
- END(dtrace_panic_trigger)
diff -r 18fa1f40aa0d -r 3114d66c70cc external/cddl/osnet/dev/dtrace/dtrace_hacks.c
--- a/external/cddl/osnet/dev/dtrace/dtrace_hacks.c Sun Jul 10 09:49:41 2016 +0000
+++ b/external/cddl/osnet/dev/dtrace/dtrace_hacks.c Sun Jul 10 10:00:20 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dtrace_hacks.c,v 1.3 2010/02/28 07:01:43 darran Exp $ */
+/* $NetBSD: dtrace_hacks.c,v 1.3.24.1 2016/07/10 10:00:20 martin Exp $ */
/* $FreeBSD: src/sys/cddl/dev/dtrace/dtrace_hacks.c,v 1.1.4.1 2009/08/03 08:13:06 kensmith Exp $ */
/* XXX Hacks.... */
@@ -8,8 +8,6 @@
int panic_quiesce;
char panic_stack[PANICSTKSIZE];
-cpu_core_t cpu_core[MAXCPUS];
-
boolean_t
priv_policy_only(const cred_t *a, int b, boolean_t c)
{
diff -r 18fa1f40aa0d -r 3114d66c70cc external/cddl/osnet/dist/uts/common/dtrace/dtrace.c
--- a/external/cddl/osnet/dist/uts/common/dtrace/dtrace.c Sun Jul 10 09:49:41 2016 +0000
+++ b/external/cddl/osnet/dist/uts/common/dtrace/dtrace.c Sun Jul 10 10:00:20 2016 +0000
@@ -631,7 +631,11 @@
va_list alist;
va_start(alist, format);
+#ifdef __NetBSD__
+ vpanic(format, alist);
+#else
dtrace_vpanic(format, alist);
+#endif
va_end(alist);
}
diff -r 18fa1f40aa0d -r 3114d66c70cc external/cddl/osnet/sys/kern/string.c
--- a/external/cddl/osnet/sys/kern/string.c Sun Jul 10 09:49:41 2016 +0000
+++ b/external/cddl/osnet/sys/kern/string.c Sun Jul 10 10:00:20 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: string.c,v 1.2 2010/12/14 01:01:40 haad Exp $ */
+/* $NetBSD: string.c,v 1.2.24.1 2016/07/10 10:00:20 martin Exp $ */
/*
* CDDL HEADER START
@@ -33,6 +33,7 @@
#define IS_ALPHA(c) \
(((c) >= 'a' && (c) <= 'z') || ((c) >= 'A' && (c) <= 'Z'))
+#ifndef __NetBSD__
char *
strpbrk(const char *s, const char *b)
{
@@ -47,6 +48,7 @@
return (NULL);
}
+#endif
/*
* Convert a string into a valid C identifier by replacing invalid
Home |
Main Index |
Thread Index |
Old Index