aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-xtensa/coprocessor.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-xtensa/coprocessor.h')
-rw-r--r--include/asm-xtensa/coprocessor.h70
1 files changed, 70 insertions, 0 deletions
diff --git a/include/asm-xtensa/coprocessor.h b/include/asm-xtensa/coprocessor.h
new file mode 100644
index 000000000000..a91b96dc0efe
--- /dev/null
+++ b/include/asm-xtensa/coprocessor.h
@@ -0,0 +1,70 @@
1/*
2 * include/asm-xtensa/cpextra.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2003 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_COPROCESSOR_H
12#define _XTENSA_COPROCESSOR_H
13
14#include <xtensa/config/core.h>
15
16#define XTOFS(last_start,last_size,align) \
17 ((last_start+last_size+align-1) & -align)
18
19#define XTENSA_CP_EXTRA_OFFSET 0
20#define XTENSA_CP_EXTRA_ALIGN XCHAL_EXTRA_SA_ALIGN
21
22#define XTENSA_CPE_CP0_OFFSET \
23 XTOFS(XTENSA_CP_EXTRA_OFFSET, XCHAL_EXTRA_SA_SIZE, XCHAL_CP0_SA_ALIGN)
24#define XTENSA_CPE_CP1_OFFSET \
25 XTOFS(XTENSA_CPE_CP0_OFFSET, XCHAL_CP0_SA_SIZE, XCHAL_CP1_SA_ALIGN)
26#define XTENSA_CPE_CP2_OFFSET \
27 XTOFS(XTENSA_CPE_CP1_OFFSET, XCHAL_CP1_SA_SIZE, XCHAL_CP2_SA_ALIGN)
28#define XTENSA_CPE_CP3_OFFSET \
29 XTOFS(XTENSA_CPE_CP2_OFFSET, XCHAL_CP2_SA_SIZE, XCHAL_CP3_SA_ALIGN)
30#define XTENSA_CPE_CP4_OFFSET \
31 XTOFS(XTENSA_CPE_CP3_OFFSET, XCHAL_CP3_SA_SIZE, XCHAL_CP4_SA_ALIGN)
32#define XTENSA_CPE_CP5_OFFSET \
33 XTOFS(XTENSA_CPE_CP4_OFFSET, XCHAL_CP4_SA_SIZE, XCHAL_CP5_SA_ALIGN)
34#define XTENSA_CPE_CP6_OFFSET \
35 XTOFS(XTENSA_CPE_CP5_OFFSET, XCHAL_CP5_SA_SIZE, XCHAL_CP6_SA_ALIGN)
36#define XTENSA_CPE_CP7_OFFSET \
37 XTOFS(XTENSA_CPE_CP6_OFFSET, XCHAL_CP6_SA_SIZE, XCHAL_CP7_SA_ALIGN)
38#define XTENSA_CP_EXTRA_SIZE \
39 XTOFS(XTENSA_CPE_CP7_OFFSET, XCHAL_CP7_SA_SIZE, 16)
40
41#if XCHAL_CP_NUM > 0
42# ifndef __ASSEMBLY__
43/*
44 * Tasks that own contents of (last user) each coprocessor.
45 * Entries are 0 for not-owned or non-existent coprocessors.
46 * Note: The size of this structure is fixed to 8 bytes in entry.S
47 */
48typedef struct {
49 struct task_struct *owner; /* owner */
50 int offset; /* offset in cpextra space. */
51} coprocessor_info_t;
52# else
53# define COPROCESSOR_INFO_OWNER 0
54# define COPROCESSOR_INFO_OFFSET 4
55# define COPROCESSOR_INFO_SIZE 8
56# endif
57#endif
58
59
60#ifndef __ASSEMBLY__
61# if XCHAL_CP_NUM > 0
62struct task_struct;
63extern void release_coprocessors (struct task_struct*);
64extern void save_coprocessor_registers(void*, int);
65# else
66# define release_coprocessors(task)
67# endif
68#endif
69
70#endif /* _XTENSA_COPROCESSOR_H */