Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/usermode/usermode Initialise the alternative signal...
details: https://anonhg.NetBSD.org/src/rev/5f7b010dec82
branches: trunk
changeset: 769269:5f7b010dec82
user: reinoud <reinoud%NetBSD.org@localhost>
date: Mon Sep 05 11:56:52 2011 +0000
description:
Initialise the alternative signal stack before referring to it
diffstat:
sys/arch/usermode/usermode/trap.c | 20 ++++++++++----------
1 files changed, 10 insertions(+), 10 deletions(-)
diffs (48 lines):
diff -r cbb327b32acd -r 5f7b010dec82 sys/arch/usermode/usermode/trap.c
--- a/sys/arch/usermode/usermode/trap.c Mon Sep 05 11:25:29 2011 +0000
+++ b/sys/arch/usermode/usermode/trap.c Mon Sep 05 11:56:52 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: trap.c,v 1.24 2011/09/05 11:10:36 reinoud Exp $ */
+/* $NetBSD: trap.c,v 1.25 2011/09/05 11:56:52 reinoud Exp $ */
/*-
* Copyright (c) 2011 Reinoud Zandijk <reinoud%netbsd.org@localhost>
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.24 2011/09/05 11:10:36 reinoud Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.25 2011/09/05 11:56:52 reinoud Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -70,6 +70,14 @@
{
static struct sigaction sa;
+ if ((sigstk.ss_sp = thunk_malloc(SIGSTKSZ)) == NULL)
+ panic("can't allocate signal stack space\n");
+ sigstk.ss_size = SIGSTKSZ;
+ sigstk.ss_flags = 0;
+ if (thunk_sigaltstack(&sigstk, 0) < 0)
+ panic("can't set alternate stacksize : %d",
+ thunk_geterrno());
+
sigemptyset(&sa.sa_mask);
sa.sa_flags = SA_RESTART | SA_SIGINFO | SA_ONSTACK;
sa.sa_sigaction = mem_access_handler;
@@ -87,14 +95,6 @@
if (thunk_sigaction(SIGILL, &sa, NULL) == -1)
panic("couldn't register SIGILL handler : %d", thunk_geterrno());
- if ((sigstk.ss_sp = thunk_malloc(SIGSTKSZ)) == NULL)
- panic("can't allocate signal stack space\n");
- sigstk.ss_size = SIGSTKSZ;
- sigstk.ss_flags = 0;
- if (thunk_sigaltstack(&sigstk, 0) < 0)
- panic("can't set alternate stacksize : %d",
- thunk_geterrno());
-
// debug_fh = thunk_open("/usr/sources/debug", O_RDWR | O_TRUNC | O_CREAT, 0666);
}
Home |
Main Index |
Thread Index |
Old Index