Skip to content

Commit b53e906

Browse files
author
Ley Foon Tan
committed
nios2: Signal handling support
This patch adds support for signal handling. Signed-off-by: Ley Foon Tan <lftan@altera.com>
1 parent 1000197 commit b53e906

5 files changed

Lines changed: 428 additions & 0 deletions

File tree

‎arch/nios2/include/asm/signal.h‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Copyright Altera Corporation (C) 2013. All rights reserved
3+
*
4+
* This program is free software; you can redistribute it and/or modify it
5+
* under the terms and conditions of the GNU General Public License,
6+
* version 2, as published by the Free Software Foundation.
7+
*
8+
* This program is distributed in the hope it will be useful, but WITHOUT
9+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11+
* more details.
12+
*
13+
* You should have received a copy of the GNU General Public License along with
14+
* this program. If not, see <http://www.gnu.org/licenses/>.
15+
*
16+
*/
17+
#ifndef _NIOS2_SIGNAL_H
18+
#define _NIOS2_SIGNAL_H
19+
20+
#include <uapi/asm/signal.h>
21+
22+
#endif /* _NIOS2_SIGNAL_H */

‎arch/nios2/include/asm/ucontext.h‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
* Copyright (C) 2010 Tobias Klauser <tklauser@distanz.ch>
3+
* Copyright (C) 2004 Microtronix Datacom Ltd
4+
*
5+
* This file is subject to the terms and conditions of the GNU General Public
6+
* License. See the file "COPYING" in the main directory of this archive
7+
* for more details.
8+
*/
9+
10+
#ifndef _ASM_NIOS2_UCONTEXT_H
11+
#define _ASM_NIOS2_UCONTEXT_H
12+
13+
typedef int greg_t;
14+
#define NGREG 32
15+
typedef greg_t gregset_t[NGREG];
16+
17+
struct mcontext {
18+
int version;
19+
gregset_t gregs;
20+
};
21+
22+
#define MCONTEXT_VERSION 2
23+
24+
struct ucontext {
25+
unsigned long uc_flags;
26+
struct ucontext *uc_link;
27+
stack_t uc_stack;
28+
struct mcontext uc_mcontext;
29+
sigset_t uc_sigmask; /* mask last for extensibility */
30+
};
31+
32+
#endif
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* Copyright (C) 2004, Microtronix Datacom Ltd.
3+
*
4+
* All rights reserved.
5+
*
6+
* This program is free software; you can redistribute it and/or modify
7+
* it under the terms of the GNU General Public License as published by
8+
* the Free Software Foundation; either version 2 of the License, or
9+
* (at your option) any later version.
10+
*
11+
* This program is distributed in the hope that it will be useful, but
12+
* WITHOUT ANY WARRANTY; without even the implied warranty of
13+
* MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
14+
* NON INFRINGEMENT. See the GNU General Public License for more
15+
* details.
16+
*/
17+
18+
#ifndef _ASM_NIOS2_SIGCONTEXT_H
19+
#define _ASM_NIOS2_SIGCONTEXT_H
20+
21+
#include <asm/ptrace.h>
22+
23+
struct sigcontext {
24+
struct pt_regs regs;
25+
unsigned long sc_mask; /* old sigmask */
26+
};
27+
28+
#endif
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*
2+
* Copyright Altera Corporation (C) 2013. All rights reserved
3+
*
4+
* This program is free software; you can redistribute it and/or modify it
5+
* under the terms and conditions of the GNU General Public License,
6+
* version 2, as published by the Free Software Foundation.
7+
*
8+
* This program is distributed in the hope it will be useful, but WITHOUT
9+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11+
* more details.
12+
*
13+
* You should have received a copy of the GNU General Public License along with
14+
* this program. If not, see <http://www.gnu.org/licenses/>.
15+
*
16+
*/
17+
#ifndef _ASM_NIOS2_SIGNAL_H
18+
#define _ASM_NIOS2_SIGNAL_H
19+
20+
#define SA_RESTORER 0x04000000
21+
#include <asm-generic/signal.h>
22+
23+
#endif /* _ASM_NIOS2_SIGNAL_H */

0 commit comments

Comments
 (0)